forked from rough-stuff/rough-notation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodel.ts
More file actions
34 lines (28 loc) · 823 Bytes
/
model.ts
File metadata and controls
34 lines (28 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export const SVG_NS = 'http://www.w3.org/2000/svg';
export const DEFAULT_ANIMATION_DURATION = 800;
export interface Rect {
x: number;
y: number;
w: number;
h: number;
}
export type RoughAnnotationType = 'underline' | 'box' | 'circle' | 'highlight' | 'strike-through' | 'crossed-off';
export interface RoughAnnotationConfig {
type: RoughAnnotationType;
animate?: boolean; // defaults to true
animationDuration?: number; // defaulst to 1000ms
animationDelay?: number; // default = 0
color?: string; // defaults to currentColor
strokeWidth?: number; // default based on type
padding?: number; // defaults to 5px
}
export interface RoughAnnotation {
isShowing(): boolean;
show(): void;
hide(): void;
remove(): void;
}
export interface RoughAnnotationGroup {
show(): void;
hide(): void;
}