@plait/common 0.90.1 → 0.92.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.d.ts +605 -3
- package/package.json +1 -1
- package/algorithms/a-star.d.ts +0 -10
- package/algorithms/data-structures/graph.d.ts +0 -14
- package/algorithms/data-structures/index.d.ts +0 -2
- package/algorithms/data-structures/priority-queue.d.ts +0 -16
- package/algorithms/index.d.ts +0 -2
- package/constants/default.d.ts +0 -10
- package/constants/index.d.ts +0 -4
- package/constants/media.d.ts +0 -6
- package/constants/property.d.ts +0 -5
- package/constants/resize.d.ts +0 -10
- package/core/element-flavour.d.ts +0 -5
- package/core/element-ref.d.ts +0 -13
- package/core/group.component.d.ts +0 -12
- package/core/index.d.ts +0 -4
- package/core/render-component.d.ts +0 -4
- package/generators/active.generator.d.ts +0 -22
- package/generators/generator.d.ts +0 -27
- package/generators/group.generator.d.ts +0 -7
- package/generators/index.d.ts +0 -3
- package/image/image-base.component.d.ts +0 -9
- package/image/image.generator.d.ts +0 -26
- package/image/index.d.ts +0 -3
- package/image/with-image.d.ts +0 -15
- package/plugins/index.d.ts +0 -2
- package/plugins/with-group.d.ts +0 -2
- package/plugins/with-resize.d.ts +0 -4
- package/public-api.d.ts +0 -12
- package/shapes/common.d.ts +0 -2
- package/shapes/index.d.ts +0 -1
- package/text/index.d.ts +0 -4
- package/text/text-manage.d.ts +0 -42
- package/text/text-measure.d.ts +0 -15
- package/text/types.d.ts +0 -28
- package/text/with-text.d.ts +0 -25
- package/transforms/align.d.ts +0 -20
- package/transforms/index.d.ts +0 -2
- package/transforms/property.d.ts +0 -14
- package/types/index.d.ts +0 -2
- package/types/resize.d.ts +0 -34
- package/types/rotate.d.ts +0 -6
- package/utils/animate.d.ts +0 -7
- package/utils/clipboard.d.ts +0 -10
- package/utils/creation-mode.d.ts +0 -9
- package/utils/default-orthogonal-routing.d.ts +0 -2
- package/utils/direction.d.ts +0 -25
- package/utils/drawing/index.d.ts +0 -2
- package/utils/drawing/resize-handle.d.ts +0 -4
- package/utils/drawing/rotate-handle.d.ts +0 -2
- package/utils/elbow-line-route.d.ts +0 -48
- package/utils/elements.d.ts +0 -4
- package/utils/hot-key.d.ts +0 -6
- package/utils/image.d.ts +0 -11
- package/utils/index.d.ts +0 -19
- package/utils/line-path.d.ts +0 -7
- package/utils/math.d.ts +0 -3
- package/utils/memorize.d.ts +0 -3
- package/utils/point-placement.d.ts +0 -5
- package/utils/resize.d.ts +0 -28
- package/utils/rotate.d.ts +0 -6
- package/utils/stroke.d.ts +0 -2
- package/utils/text.d.ts +0 -33
- package/utils/vector.d.ts +0 -6
package/index.d.ts
CHANGED
|
@@ -1,5 +1,607 @@
|
|
|
1
|
+
import * as _plait_core from '@plait/core';
|
|
2
|
+
import { PlaitElement, PlaitBoard, RectangleClient, Point, ResizeCursorClass, Path, Direction, PointOfRectangle, Vector, DirectionFactor, WithPluginOptions, PlaitElementRef, ElementFlavour, PlaitGroup, OnContextChanged, PlaitPluginElementContext } from '@plait/core';
|
|
3
|
+
import * as slate from 'slate';
|
|
4
|
+
import { Element as Element$1, Editor, Operation, BaseElement } from 'slate';
|
|
5
|
+
|
|
6
|
+
declare const BASE = 4;
|
|
7
|
+
declare const PRIMARY_COLOR = "#6698FF";
|
|
8
|
+
declare const RESIZE_HANDLE_DIAMETER = 9;
|
|
9
|
+
declare const WithTextPluginKey = "plait-text-plugin-key";
|
|
10
|
+
declare const DEFAULT_ROUTE_MARGIN = 30;
|
|
11
|
+
declare const TRANSPARENT = "transparent";
|
|
12
|
+
declare const ROTATE_HANDLE_DISTANCE_TO_ELEMENT = 4;
|
|
13
|
+
declare const ROTATE_HANDLE_SIZE = 18;
|
|
14
|
+
declare const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft Yahei', 'Hiragino Sans GB', Arial, sans-serif";
|
|
15
|
+
declare const DEFAULT_FILL = "none";
|
|
16
|
+
|
|
17
|
+
declare enum MediaKeys {
|
|
18
|
+
image = "image"
|
|
19
|
+
}
|
|
20
|
+
declare const PICTURE_ACCEPTED_UPLOAD_SIZE = 20;
|
|
21
|
+
declare const acceptImageTypes: string[];
|
|
22
|
+
declare const WithCommonPluginKey = "plait-common-plugin-key";
|
|
23
|
+
|
|
24
|
+
declare enum ResizeHandle {
|
|
25
|
+
nw = "0",
|
|
26
|
+
n = "4",
|
|
27
|
+
ne = "1",
|
|
28
|
+
e = "5",
|
|
29
|
+
se = "2",
|
|
30
|
+
s = "6",
|
|
31
|
+
sw = "3",
|
|
32
|
+
w = "7"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
declare enum StrokeStyle {
|
|
36
|
+
solid = "solid",
|
|
37
|
+
dashed = "dashed",
|
|
38
|
+
dotted = "dotted"
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
interface GeneratorExtraData {
|
|
42
|
+
}
|
|
43
|
+
interface GeneratorOptions {
|
|
44
|
+
prepend?: boolean;
|
|
45
|
+
active?: boolean;
|
|
46
|
+
}
|
|
47
|
+
declare abstract class Generator<T extends PlaitElement = PlaitElement, K extends GeneratorExtraData = GeneratorExtraData, V extends GeneratorOptions = GeneratorOptions, P extends PlaitBoard = PlaitBoard> {
|
|
48
|
+
protected board: P;
|
|
49
|
+
g?: SVGGElement;
|
|
50
|
+
protected options?: V;
|
|
51
|
+
constructor(board: P, options?: V);
|
|
52
|
+
processDrawing(element: T, parentG: SVGGElement, data?: K): void;
|
|
53
|
+
/**
|
|
54
|
+
* abstract function
|
|
55
|
+
*/
|
|
56
|
+
protected abstract canDraw(element: T, data?: K): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* abstract function
|
|
59
|
+
*/
|
|
60
|
+
protected abstract draw(element: T, data?: K): SVGGElement | undefined;
|
|
61
|
+
destroy(): void;
|
|
62
|
+
}
|
|
63
|
+
interface AfterDraw<T extends PlaitElement = PlaitElement> {
|
|
64
|
+
afterDraw(element: T): void;
|
|
65
|
+
}
|
|
66
|
+
declare function hasAfterDraw(value: any): value is AfterDraw;
|
|
67
|
+
|
|
68
|
+
interface ActiveGeneratorExtraData {
|
|
69
|
+
selected: boolean;
|
|
70
|
+
}
|
|
71
|
+
interface ActiveGeneratorOptions<T> extends GeneratorOptions {
|
|
72
|
+
getRectangle: (element: T) => RectangleClient;
|
|
73
|
+
getStrokeWidth: () => number;
|
|
74
|
+
getStrokeOpacity: () => number;
|
|
75
|
+
hasResizeHandle: () => boolean;
|
|
76
|
+
active: true;
|
|
77
|
+
}
|
|
78
|
+
declare const createActiveGenerator: <T extends PlaitElement = PlaitElement>(board: PlaitBoard, options: Omit<ActiveGeneratorOptions<T>, "active">) => ActiveGenerator<T>;
|
|
79
|
+
declare class ActiveGenerator<T extends PlaitElement = PlaitElement> extends Generator<T, ActiveGeneratorExtraData, ActiveGeneratorOptions<T>> {
|
|
80
|
+
board: PlaitBoard;
|
|
81
|
+
options: ActiveGeneratorOptions<T>;
|
|
82
|
+
static key: string;
|
|
83
|
+
hasResizeHandle: boolean;
|
|
84
|
+
constructor(board: PlaitBoard, options: ActiveGeneratorOptions<T>);
|
|
85
|
+
canDraw(element: T, data: ActiveGeneratorExtraData): boolean;
|
|
86
|
+
draw(element: T, data: ActiveGeneratorExtraData): SVGGElement;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
type PlaitElementOrArray = PlaitElement | PlaitElement[];
|
|
90
|
+
interface ResizeOptions {
|
|
91
|
+
}
|
|
92
|
+
interface WithResizeOptions<T extends PlaitElementOrArray = PlaitElementOrArray, K = ResizeHandle, P = ResizeOptions> {
|
|
93
|
+
key: string;
|
|
94
|
+
canResize: () => boolean;
|
|
95
|
+
hitTest: (point: Point) => ResizeHitTestRef<T, K, P> | null;
|
|
96
|
+
onResize: (resizeRef: ResizeRef<T, K, P>, resizeState: ResizeState) => void;
|
|
97
|
+
afterResize?: (resizeRef: ResizeRef<T, K, P>) => void;
|
|
98
|
+
beforeResize?: (resizeRef: ResizeRef<T, K, P>) => void;
|
|
99
|
+
}
|
|
100
|
+
interface ResizeHitTestRef<T extends PlaitElementOrArray = PlaitElementOrArray, K = ResizeHandle, P = ResizeOptions> {
|
|
101
|
+
element: T;
|
|
102
|
+
rectangle?: RectangleClient;
|
|
103
|
+
handle: K;
|
|
104
|
+
handleIndex?: number;
|
|
105
|
+
cursorClass?: ResizeCursorClass;
|
|
106
|
+
options?: P;
|
|
107
|
+
}
|
|
108
|
+
interface ResizeState {
|
|
109
|
+
startPoint: Point;
|
|
110
|
+
endPoint: Point;
|
|
111
|
+
isShift: boolean;
|
|
112
|
+
}
|
|
113
|
+
interface ResizeRef<T extends PlaitElementOrArray = PlaitElementOrArray, K = ResizeHandle, P = ResizeOptions> {
|
|
114
|
+
element: T;
|
|
115
|
+
rectangle?: RectangleClient;
|
|
116
|
+
path: Path | Path[];
|
|
117
|
+
handle: K;
|
|
118
|
+
handleIndex?: number;
|
|
119
|
+
options?: P;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
declare const getResizeHandleByIndex: (index: number) => ResizeHandle;
|
|
123
|
+
declare const getIndexByResizeHandle: (resizeHandle: ResizeHandle) => number;
|
|
124
|
+
declare const getSymmetricHandleIndex: (board: PlaitBoard, index: number) => number;
|
|
125
|
+
declare const getRotatedResizeCursorClassByAngle: (cursor: ResizeCursorClass, angle: number) => ResizeCursorClass;
|
|
126
|
+
declare const getRectangleResizeHandleRefs: (rectangle: RectangleClient, diameter: number) => {
|
|
127
|
+
rectangle: {
|
|
128
|
+
x: number;
|
|
129
|
+
y: number;
|
|
130
|
+
width: number;
|
|
131
|
+
height: number;
|
|
132
|
+
};
|
|
133
|
+
handle: ResizeHandle;
|
|
134
|
+
cursorClass: ResizeCursorClass;
|
|
135
|
+
}[];
|
|
136
|
+
declare const getResizeHandlePointByIndex: (rectangle: RectangleClient, index: number) => Point;
|
|
137
|
+
declare const IS_RESIZING: WeakMap<PlaitBoard, ResizeRef<any, any, any>>;
|
|
138
|
+
declare const isResizing: (board: PlaitBoard) => boolean;
|
|
139
|
+
declare const isResizingByCondition: <T extends PlaitElementOrArray, K>(board: PlaitBoard, match: (resizeRef: ResizeRef<T, K>) => boolean) => boolean;
|
|
140
|
+
declare const addResizing: <T extends PlaitElementOrArray, K, P>(board: PlaitBoard, resizeRef: ResizeRef<T, K, P>, key: string) => void;
|
|
141
|
+
declare const removeResizing: (board: PlaitBoard, key: string) => void;
|
|
142
|
+
declare const isEdgeHandle: (board: PlaitBoard, handle: ResizeHandle) => boolean;
|
|
143
|
+
declare const isCornerHandle: (board: PlaitBoard, handle: ResizeHandle) => boolean;
|
|
144
|
+
declare const resetPointsAfterResize: (originRectangle: RectangleClient, currentRectangle: RectangleClient, originSelectionCenterPoint: Point, currentSelectionCenterPoint: Point, angle: number) => [Point, Point];
|
|
145
|
+
declare const hasMoreThanOnePoint: (element: PlaitElement) => boolean;
|
|
146
|
+
declare const hasResizeHandle: (board: PlaitBoard, element: PlaitElement) => boolean;
|
|
147
|
+
|
|
148
|
+
declare function getPointOnPolyline(points: Point[], ratio: number): number[];
|
|
149
|
+
declare function calculatePolylineLength(points: Point[]): number;
|
|
150
|
+
declare function getRatioByPoint(points: Point[], point: Point): number;
|
|
151
|
+
declare const removeDuplicatePoints: (points: Point[]) => Point[];
|
|
152
|
+
declare function simplifyOrthogonalPoints(points: Point[]): Point[];
|
|
153
|
+
declare const getExtendPoint: (source: Point, target: Point, extendDistance: number) => Point;
|
|
154
|
+
|
|
155
|
+
declare const getPoints: (source: Point, sourcePosition: Direction, target: Point, targetPosition: Direction, offset: number) => Point[];
|
|
156
|
+
|
|
157
|
+
declare function isVirtualKey(e: KeyboardEvent): boolean;
|
|
158
|
+
declare const isExpandHotkey: (event: KeyboardEvent) => boolean;
|
|
159
|
+
declare const isTabHotkey: (event: KeyboardEvent) => boolean;
|
|
160
|
+
declare const isEnterHotkey: (event: KeyboardEvent) => boolean;
|
|
161
|
+
declare const isSpaceHotkey: (event: KeyboardEvent) => boolean;
|
|
162
|
+
declare const isDelete: (event: KeyboardEvent) => boolean;
|
|
163
|
+
|
|
164
|
+
declare enum BoardCreationMode {
|
|
165
|
+
'dnd' = "dnd",
|
|
166
|
+
'drawing' = "drawing"
|
|
167
|
+
}
|
|
168
|
+
declare const getCreationMode: (board: PlaitBoard) => BoardCreationMode | undefined;
|
|
169
|
+
declare const setCreationMode: (board: PlaitBoard, mode: BoardCreationMode) => void;
|
|
170
|
+
declare const isDndMode: (board: PlaitBoard) => boolean;
|
|
171
|
+
declare const isDrawingMode: (board: PlaitBoard) => boolean;
|
|
172
|
+
|
|
173
|
+
declare function getOppositeDirection(direction: Direction): Direction;
|
|
174
|
+
declare function getDirectionByPointOfRectangle(point: PointOfRectangle): Direction | undefined;
|
|
1
175
|
/**
|
|
2
|
-
*
|
|
176
|
+
* this function accepts vector parameter, the vector parameter vector is based on the screen coordinate system
|
|
177
|
+
* vector[0] and vector[1] are the x and y components of the vector respectively.
|
|
178
|
+
* if the vector has only one direction, the function returns a string in that direction, such as 'right', 'top', 'bottom' or 'left'.
|
|
179
|
+
* if the vector has two directions, the function will return the string in which direction it is closer.
|
|
3
180
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
181
|
+
declare function getDirectionByVector(vector: Vector): Direction | null;
|
|
182
|
+
declare function getDirectionBetweenPointAndPoint(source: Point, target: Point): Direction;
|
|
183
|
+
declare function getDirectionFactor(direction: Direction): {
|
|
184
|
+
x: number;
|
|
185
|
+
y: number;
|
|
186
|
+
} | {
|
|
187
|
+
x: number;
|
|
188
|
+
y: number;
|
|
189
|
+
} | {
|
|
190
|
+
x: number;
|
|
191
|
+
y: number;
|
|
192
|
+
} | {
|
|
193
|
+
x: number;
|
|
194
|
+
y: number;
|
|
195
|
+
};
|
|
196
|
+
declare function getDirectionFactorByDirectionComponent(directionComponent: number): DirectionFactor;
|
|
197
|
+
|
|
198
|
+
interface RenderComponentRef<T> {
|
|
199
|
+
destroy: () => void;
|
|
200
|
+
update: (props: Partial<T>) => void;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
interface PlaitTextBoard {
|
|
204
|
+
renderText: (container: Element | DocumentFragment, props: TextProps) => TextComponentRef;
|
|
205
|
+
}
|
|
206
|
+
declare const withText: <T extends PlaitBoard = PlaitBoard>(board: T) => T & PlaitTextBoard;
|
|
207
|
+
type TextComponentRef = RenderComponentRef<TextProps>;
|
|
208
|
+
interface TextProps {
|
|
209
|
+
board: PlaitBoard;
|
|
210
|
+
text: Element$1;
|
|
211
|
+
textPlugins?: TextPlugin[];
|
|
212
|
+
readonly?: boolean;
|
|
213
|
+
onChange?: (data: TextChangeData) => void;
|
|
214
|
+
afterInit?: (data: Editor) => void;
|
|
215
|
+
onComposition?: (data: CompositionEvent) => void;
|
|
216
|
+
}
|
|
217
|
+
type TextChangeData = {
|
|
218
|
+
newText: Element$1;
|
|
219
|
+
operations: Operation[];
|
|
220
|
+
};
|
|
221
|
+
interface WithTextPluginOptions extends WithPluginOptions {
|
|
222
|
+
textPlugins?: TextPlugin[];
|
|
223
|
+
}
|
|
224
|
+
type TextPlugin = (editor: Editor) => Editor;
|
|
225
|
+
|
|
226
|
+
interface TextManageChangeData {
|
|
227
|
+
newText?: Element$1;
|
|
228
|
+
operations?: Operation[];
|
|
229
|
+
width: number;
|
|
230
|
+
height: number;
|
|
231
|
+
}
|
|
232
|
+
declare class TextManage {
|
|
233
|
+
private board;
|
|
234
|
+
private options;
|
|
235
|
+
isEditing: boolean;
|
|
236
|
+
editor: Editor;
|
|
237
|
+
g: SVGGElement;
|
|
238
|
+
foreignObject: SVGForeignObjectElement;
|
|
239
|
+
textComponentRef: TextComponentRef;
|
|
240
|
+
exitCallback?: () => void;
|
|
241
|
+
constructor(board: PlaitBoard, options: {
|
|
242
|
+
getRectangle: () => RectangleClient;
|
|
243
|
+
onChange?: (data: TextManageChangeData) => void;
|
|
244
|
+
getRenderRectangle?: () => RectangleClient;
|
|
245
|
+
getMaxWidth?: () => number;
|
|
246
|
+
textPlugins?: TextPlugin[];
|
|
247
|
+
});
|
|
248
|
+
draw(text: Element$1): void;
|
|
249
|
+
updateRectangleWidth(width: number): void;
|
|
250
|
+
updateAngle(centerPoint: Point, angle?: number): void;
|
|
251
|
+
updateRectangle(rectangle?: RectangleClient): void;
|
|
252
|
+
updateText(newText: Element$1): void;
|
|
253
|
+
edit(callback?: () => void, exitEdit?: (event: Event) => boolean): () => void;
|
|
254
|
+
getSize: (element?: Element$1, maxWidth?: number) => {
|
|
255
|
+
width: number;
|
|
256
|
+
height: number;
|
|
257
|
+
};
|
|
258
|
+
getText: () => slate.Descendant;
|
|
259
|
+
destroy(): void;
|
|
260
|
+
}
|
|
261
|
+
declare const buildCompositionData: (editor: Editor, data: string) => {
|
|
262
|
+
children: any[];
|
|
263
|
+
} | null;
|
|
264
|
+
|
|
265
|
+
type ElementSize = {
|
|
266
|
+
width: number;
|
|
267
|
+
height: number;
|
|
268
|
+
};
|
|
269
|
+
declare enum Alignment {
|
|
270
|
+
left = "left",
|
|
271
|
+
center = "center",
|
|
272
|
+
right = "right"
|
|
273
|
+
}
|
|
274
|
+
type CustomText = {
|
|
275
|
+
bold?: boolean;
|
|
276
|
+
italic?: boolean;
|
|
277
|
+
strike?: boolean;
|
|
278
|
+
code?: boolean;
|
|
279
|
+
text: string;
|
|
280
|
+
underlined?: boolean;
|
|
281
|
+
color?: string;
|
|
282
|
+
[`font-size`]?: string;
|
|
283
|
+
};
|
|
284
|
+
interface LinkElement extends BaseElement {
|
|
285
|
+
type: 'link';
|
|
286
|
+
url: string;
|
|
287
|
+
}
|
|
288
|
+
interface ParagraphElement extends BaseElement {
|
|
289
|
+
align?: Alignment;
|
|
290
|
+
}
|
|
291
|
+
type CustomElement = ParagraphElement | LinkElement;
|
|
292
|
+
|
|
293
|
+
interface TextInterface {
|
|
294
|
+
getTextEditors: (board: PlaitBoard, elements?: PlaitElement[]) => Editor[] | undefined;
|
|
295
|
+
findFirstTextEditor: (board: PlaitBoard) => null;
|
|
296
|
+
getFirstTextEditor: (element: PlaitElement) => Editor;
|
|
297
|
+
getTextEditorsByElement: (element: PlaitElement) => Editor[];
|
|
298
|
+
getEditingTextEditor: (board: PlaitBoard, elements?: PlaitElement[]) => Editor | undefined;
|
|
299
|
+
}
|
|
300
|
+
declare const getTextManages: (element: PlaitElement) => TextManage[];
|
|
301
|
+
declare const getFirstTextManage: (element: PlaitElement) => TextManage;
|
|
302
|
+
declare const getTextEditorsByElement: TextInterface['getTextEditorsByElement'];
|
|
303
|
+
declare const getFirstTextEditor: TextInterface['getFirstTextEditor'];
|
|
304
|
+
declare const findFirstTextEditor: TextInterface['findFirstTextEditor'];
|
|
305
|
+
declare const getElementsText: (elements: PlaitElement[]) => string;
|
|
306
|
+
declare const getTextEditors: TextInterface['getTextEditors'];
|
|
307
|
+
declare const getEditingTextEditor: TextInterface['getEditingTextEditor'];
|
|
308
|
+
declare const buildText: (text: string | Element$1, align?: Alignment, properties?: Partial<CustomText>) => slate.BaseElement | {
|
|
309
|
+
children: {
|
|
310
|
+
bold?: boolean | undefined;
|
|
311
|
+
italic?: boolean | undefined;
|
|
312
|
+
strike?: boolean | undefined;
|
|
313
|
+
code?: boolean | undefined;
|
|
314
|
+
text: string;
|
|
315
|
+
underlined?: boolean | undefined;
|
|
316
|
+
color?: string | undefined;
|
|
317
|
+
"font-size"?: string | undefined;
|
|
318
|
+
}[];
|
|
319
|
+
type: string;
|
|
320
|
+
};
|
|
321
|
+
declare const getLineHeightByFontSize: (fontSize: number) => number;
|
|
322
|
+
|
|
323
|
+
interface CommonImageItem {
|
|
324
|
+
url: string;
|
|
325
|
+
width: number;
|
|
326
|
+
height: number;
|
|
327
|
+
}
|
|
328
|
+
declare const selectImage: (board: PlaitBoard, defaultImageWidth: number, handle: (commonImage: CommonImageItem) => void, acceptImageTypes?: string[]) => void;
|
|
329
|
+
declare const buildImage: (board: PlaitBoard, imageFile: File, defaultImageWidth: number, handle: (commonImage: CommonImageItem) => void) => Promise<void>;
|
|
330
|
+
declare const getElementOfFocusedImage: (board: PlaitBoard) => PlaitElement | undefined;
|
|
331
|
+
declare const addElementOfFocusedImage: (board: PlaitBoard, element: PlaitElement) => void;
|
|
332
|
+
declare const removeElementOfFocusedImage: (board: PlaitBoard) => void;
|
|
333
|
+
|
|
334
|
+
declare class PointNode {
|
|
335
|
+
data: Point;
|
|
336
|
+
distance: number;
|
|
337
|
+
adjacentNodes: PointNode[];
|
|
338
|
+
constructor(data: Point);
|
|
339
|
+
}
|
|
340
|
+
declare class PointGraph {
|
|
341
|
+
private index;
|
|
342
|
+
add(p: Point): void;
|
|
343
|
+
connect(a: Point, b: Point): void;
|
|
344
|
+
has(p: Point): boolean;
|
|
345
|
+
get(p: Point): PointNode | null;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
declare class AStar {
|
|
349
|
+
private graph;
|
|
350
|
+
cameFrom: Map<PointNode, PointNode>;
|
|
351
|
+
constructor(graph: PointGraph);
|
|
352
|
+
heuristic(a: Point, b: Point): number;
|
|
353
|
+
search(start: Point, end: Point, previousStart: Point): void;
|
|
354
|
+
getRoute(start: Point, end: Point): Point[];
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
declare class PriorityQueue {
|
|
358
|
+
list: {
|
|
359
|
+
node: PointNode;
|
|
360
|
+
priority: number;
|
|
361
|
+
}[];
|
|
362
|
+
constructor();
|
|
363
|
+
enqueue(item: {
|
|
364
|
+
node: PointNode;
|
|
365
|
+
priority: number;
|
|
366
|
+
}): void;
|
|
367
|
+
dequeue(): {
|
|
368
|
+
node: PointNode;
|
|
369
|
+
priority: number;
|
|
370
|
+
} | undefined;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
interface ElbowLineRouteOptions {
|
|
374
|
+
sourcePoint: Point;
|
|
375
|
+
nextSourcePoint: Point;
|
|
376
|
+
sourceRectangle: RectangleClient;
|
|
377
|
+
sourceOuterRectangle: RectangleClient;
|
|
378
|
+
targetPoint: Point;
|
|
379
|
+
nextTargetPoint: Point;
|
|
380
|
+
targetOuterRectangle: RectangleClient;
|
|
381
|
+
targetRectangle: RectangleClient;
|
|
382
|
+
}
|
|
383
|
+
interface RouteAdjustOptions {
|
|
384
|
+
centerX?: number;
|
|
385
|
+
centerY?: number;
|
|
386
|
+
sourceRectangle: RectangleClient;
|
|
387
|
+
targetRectangle: RectangleClient;
|
|
388
|
+
}
|
|
389
|
+
interface AdjustOptions {
|
|
390
|
+
parallelPaths: [Point, Point][];
|
|
391
|
+
pointOfHit: Point;
|
|
392
|
+
sourceRectangle: RectangleClient;
|
|
393
|
+
targetRectangle: RectangleClient;
|
|
394
|
+
}
|
|
395
|
+
declare const generateElbowLineRoute: (options: ElbowLineRouteOptions, board?: PlaitBoard) => Point[];
|
|
396
|
+
declare const routeAdjust: (path: Point[], options: RouteAdjustOptions, board?: PlaitBoard) => Point[];
|
|
397
|
+
declare const getGraphPoints: (options: ElbowLineRouteOptions) => Point[];
|
|
398
|
+
declare const createGraph: (points: Point[]) => PointGraph;
|
|
399
|
+
declare const reduceRouteMargin: (sourceRectangle: RectangleClient, targetRectangle: RectangleClient) => {
|
|
400
|
+
sourceOffset: number[];
|
|
401
|
+
targetOffset: number[];
|
|
402
|
+
};
|
|
403
|
+
declare const getNextPoint: (point: Point, outerRectangle: RectangleClient, direction: Direction) => Point;
|
|
404
|
+
declare const getSourceAndTargetOuterRectangle: (sourceRectangle: RectangleClient, targetRectangle: RectangleClient) => {
|
|
405
|
+
sourceOuterRectangle: {
|
|
406
|
+
x: number;
|
|
407
|
+
y: number;
|
|
408
|
+
width: number;
|
|
409
|
+
height: number;
|
|
410
|
+
};
|
|
411
|
+
targetOuterRectangle: {
|
|
412
|
+
x: number;
|
|
413
|
+
y: number;
|
|
414
|
+
width: number;
|
|
415
|
+
height: number;
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
declare const isSourceAndTargetIntersect: (options: ElbowLineRouteOptions) => boolean;
|
|
419
|
+
|
|
420
|
+
declare const memorizeLatest: <T extends PlaitElement = PlaitElement>(memorizedKey: string, propertyKey: keyof T, propertyValue: T[keyof T]) => void;
|
|
421
|
+
declare const getMemorizedLatest: <T extends PlaitElement = PlaitElement>(memorizedKey: string) => T;
|
|
422
|
+
|
|
423
|
+
declare function getUnitVectorByPointAndPoint(point1: Point, point2: Point): Point;
|
|
424
|
+
declare function getPointByVectorComponent(point: Point, vector: Vector, component: number): Point;
|
|
425
|
+
declare function getPointByVectorDirectionComponent(point: Point, unitVector: Vector, directionComponent: number, isHorizontal: boolean): Point;
|
|
426
|
+
declare function rotateVectorAnti90(vector: Vector): Vector;
|
|
427
|
+
declare function rotateVector(vector: Vector, angle: number): Vector;
|
|
428
|
+
|
|
429
|
+
declare function isPointOnSegment(point: Point, startPoint: Point, endPoint: Point): boolean;
|
|
430
|
+
declare const getCrossingPointsBetweenPointAndSegment: (point: Point, startPoint: Point, endPoint: Point) => Point[];
|
|
431
|
+
|
|
432
|
+
declare const drawHandle: (board: PlaitBoard, centerPoint: Point) => SVGGElement;
|
|
433
|
+
declare function drawFillPrimaryHandle(board: PlaitBoard, point: Point): SVGGElement;
|
|
434
|
+
declare function drawPrimaryHandle(board: PlaitBoard, point: Point): SVGGElement;
|
|
435
|
+
|
|
436
|
+
declare const drawRotateHandle: (board: PlaitBoard, rectangle: RectangleClient) => SVGGElement;
|
|
437
|
+
|
|
438
|
+
interface RotateRef<T extends PlaitElement = PlaitElement> {
|
|
439
|
+
elements: T[];
|
|
440
|
+
startPoint: Point;
|
|
441
|
+
angle?: number;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
declare const IS_ROTATING: WeakMap<PlaitBoard, RotateRef<_plait_core.PlaitElement>>;
|
|
445
|
+
declare const isRotating: (board: PlaitBoard) => boolean;
|
|
446
|
+
declare const addRotating: (board: PlaitBoard, rotateRef: RotateRef) => void;
|
|
447
|
+
declare const removeRotating: (board: PlaitBoard) => void;
|
|
448
|
+
|
|
449
|
+
declare const getElementArea: (board: PlaitBoard, element: PlaitElement) => number;
|
|
450
|
+
declare const sortElementsByArea: (board: PlaitBoard, elements: PlaitElement[], direction?: "desc" | "asc") => PlaitElement[];
|
|
451
|
+
declare const isFilled: (fill: string) => boolean | "";
|
|
452
|
+
|
|
453
|
+
type AnimateOption = {
|
|
454
|
+
stop: () => void;
|
|
455
|
+
start: () => void;
|
|
456
|
+
};
|
|
457
|
+
declare function animate(tween: (t: number) => void, duration: number, ease: Function, callback: Function): AnimateOption;
|
|
458
|
+
declare function getTimestamp(): number;
|
|
459
|
+
declare function linear(t: number): number;
|
|
460
|
+
|
|
461
|
+
declare const getStrokeLineDash: (strokeStyle: StrokeStyle, strokeWidth: number) => number[] | undefined;
|
|
462
|
+
|
|
463
|
+
declare const buildClipboardData: (board: PlaitBoard, elements: PlaitElement[], startPoint: Point, elementBuilder?: (element: PlaitElement) => PlaitElement | undefined) => (PlaitElement | {
|
|
464
|
+
points: number[][];
|
|
465
|
+
id: string;
|
|
466
|
+
children?: PlaitElement[];
|
|
467
|
+
type?: string;
|
|
468
|
+
groupId?: string;
|
|
469
|
+
angle?: number;
|
|
470
|
+
})[];
|
|
471
|
+
declare const insertClipboardData: (board: PlaitBoard, elements: PlaitElement[], startPoint: Point, elementHandler?: (element: PlaitElement, idsMap: Record<string, string>) => void) => void;
|
|
472
|
+
|
|
473
|
+
declare const moveXOfPoint: (point: Point, distance: number, direction?: Direction) => Point;
|
|
474
|
+
declare const moveYOfPoint: (point: Point, distance: number, direction?: Direction) => Point;
|
|
475
|
+
declare const getDirectionByIndex: (index: number) => Direction;
|
|
476
|
+
declare const getXDistanceBetweenPoint: (point1: Point, point2: Point, isHorizontal: boolean) => number;
|
|
477
|
+
|
|
478
|
+
interface PlaitImageBoard {
|
|
479
|
+
renderImage: (container: Element | DocumentFragment, props: ImageProps) => ImageComponentRef;
|
|
480
|
+
}
|
|
481
|
+
declare const withImage: <T extends PlaitBoard = PlaitBoard>(board: T) => T & PlaitImageBoard;
|
|
482
|
+
type ImageComponentRef = RenderComponentRef<ImageProps>;
|
|
483
|
+
interface ImageProps {
|
|
484
|
+
board: PlaitBoard;
|
|
485
|
+
imageItem: CommonImageItem;
|
|
486
|
+
element: PlaitElement;
|
|
487
|
+
isFocus?: boolean;
|
|
488
|
+
getRectangle: () => RectangleClient;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
declare const FOREIGN_OBJECT_IMAGE_CLASS_NAME = "foreign-object-image";
|
|
492
|
+
interface ImageGeneratorOptions<T> {
|
|
493
|
+
getRectangle: (element: T) => RectangleClient;
|
|
494
|
+
getImageItem: (element: T) => CommonImageItem;
|
|
495
|
+
}
|
|
496
|
+
declare class ImageGenerator<T extends PlaitElement = PlaitElement> extends Generator<T, GeneratorExtraData, ImageGeneratorOptions<T> & GeneratorOptions> {
|
|
497
|
+
board: PlaitBoard;
|
|
498
|
+
options: ImageGeneratorOptions<T>;
|
|
499
|
+
static key: string;
|
|
500
|
+
foreignObject: SVGForeignObjectElement;
|
|
501
|
+
imageComponentRef: ImageComponentRef;
|
|
502
|
+
activeGenerator: ActiveGenerator;
|
|
503
|
+
isFocus: boolean;
|
|
504
|
+
element: T;
|
|
505
|
+
constructor(board: PlaitBoard, options: ImageGeneratorOptions<T>);
|
|
506
|
+
canDraw(element: T): boolean;
|
|
507
|
+
draw(element: T): SVGGElement;
|
|
508
|
+
updateImage(nodeG: SVGGElement, previous: T, current: T): void;
|
|
509
|
+
setFocus(element: PlaitElement, isFocus: boolean): void;
|
|
510
|
+
destroy(): void;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
interface SetOptions<T extends PlaitElement = PlaitElement> {
|
|
514
|
+
callback?: (element: T, path: Path) => void;
|
|
515
|
+
getMemorizeKey?: (element: T) => string;
|
|
516
|
+
match?: (element: T) => boolean;
|
|
517
|
+
}
|
|
518
|
+
declare const setProperty: <T extends PlaitElement = PlaitElement>(board: PlaitBoard, properties: Partial<T>, options?: SetOptions<T>) => void;
|
|
519
|
+
declare const PropertyTransforms: {
|
|
520
|
+
setFillColor: (board: PlaitBoard, fill: string | null, options: SetOptions) => void;
|
|
521
|
+
setStrokeStyle: (board: PlaitBoard, strokeStyle: string, options: SetOptions) => void;
|
|
522
|
+
setProperty: <T extends PlaitElement = PlaitElement>(board: PlaitBoard, properties: Partial<T>, options?: SetOptions<T>) => void;
|
|
523
|
+
setStrokeWidth: (board: PlaitBoard, strokeWidth: number, options: SetOptions) => void;
|
|
524
|
+
setStrokeColor: (board: PlaitBoard, strokeColor: string | null, options: SetOptions) => void;
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
declare const alignTop: (board: PlaitBoard) => void;
|
|
528
|
+
declare const alignBottom: (board: PlaitBoard) => void;
|
|
529
|
+
declare const alignLeft: (board: PlaitBoard) => void;
|
|
530
|
+
declare const alignHorizontalCenter: (board: PlaitBoard) => void;
|
|
531
|
+
declare const alignVerticalCenter: (board: PlaitBoard) => void;
|
|
532
|
+
declare const alignRight: (board: PlaitBoard) => void;
|
|
533
|
+
declare const distributeHorizontal: (board: PlaitBoard) => void;
|
|
534
|
+
declare const distributeVertical: (board: PlaitBoard) => void;
|
|
535
|
+
interface AlignTransform {
|
|
536
|
+
alignTop: (board: PlaitBoard) => void;
|
|
537
|
+
alignHorizontalCenter: (board: PlaitBoard) => void;
|
|
538
|
+
alignBottom: (board: PlaitBoard) => void;
|
|
539
|
+
alignLeft: (board: PlaitBoard) => void;
|
|
540
|
+
alignVerticalCenter: (board: PlaitBoard) => void;
|
|
541
|
+
alignRight: (board: PlaitBoard) => void;
|
|
542
|
+
distributeHorizontal: (board: PlaitBoard) => void;
|
|
543
|
+
distributeVertical: (board: PlaitBoard) => void;
|
|
544
|
+
}
|
|
545
|
+
declare const AlignTransform: AlignTransform;
|
|
546
|
+
|
|
547
|
+
declare const normalizeShapePoints: (points: [Point, Point], shift?: boolean) => [Point, Point];
|
|
548
|
+
|
|
549
|
+
declare const withResize: <T extends PlaitElementOrArray = PlaitElementOrArray, K = ResizeHandle, P = ResizeOptions>(board: PlaitBoard, options: WithResizeOptions<T, K, P>) => PlaitBoard;
|
|
550
|
+
|
|
551
|
+
declare function withGroup(board: PlaitBoard): PlaitBoard;
|
|
552
|
+
|
|
553
|
+
declare abstract class ImageBaseComponent {
|
|
554
|
+
_isFocus: boolean;
|
|
555
|
+
element: PlaitElement;
|
|
556
|
+
board: PlaitBoard;
|
|
557
|
+
set isFocus(value: boolean);
|
|
558
|
+
get isFocus(): boolean;
|
|
559
|
+
abstract nativeElement(): HTMLElement;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
declare const getElementSize: (board: PlaitBoard | null, element: ParagraphElement, options: {
|
|
563
|
+
fontSize: number;
|
|
564
|
+
fontFamily: string;
|
|
565
|
+
}, containerMaxWidth?: number) => ElementSize;
|
|
566
|
+
declare const updateElementSizeCache: (board: PlaitBoard | null, element: ParagraphElement, size: ElementSize) => void;
|
|
567
|
+
declare const clearElementSizeCache: (board: PlaitBoard | null, element: ParagraphElement) => void;
|
|
568
|
+
declare function measureElement(board: PlaitBoard | null, element: ParagraphElement, options: {
|
|
569
|
+
fontSize: number;
|
|
570
|
+
fontFamily: string;
|
|
571
|
+
}, containerMaxWidth?: number): {
|
|
572
|
+
width: number;
|
|
573
|
+
height: number;
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
declare class PlaitCommonElementRef implements PlaitElementRef {
|
|
577
|
+
private textManages;
|
|
578
|
+
private generatorMap;
|
|
579
|
+
addGenerator<T extends Object = Generator>(key: string, generator: T): void;
|
|
580
|
+
getGenerator<T extends Object = Generator>(key: string): T;
|
|
581
|
+
initializeTextManage(textManage: TextManage | TextManage[]): void;
|
|
582
|
+
getTextManages(): TextManage[];
|
|
583
|
+
updateActiveSection: () => void;
|
|
584
|
+
destroyTextManage(): void;
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
declare class CommonElementFlavour<T extends PlaitElement = PlaitElement, K extends PlaitBoard = PlaitBoard, R extends PlaitCommonElementRef = PlaitCommonElementRef> extends ElementFlavour<T, K, R> {
|
|
588
|
+
constructor(elementRef?: PlaitCommonElementRef);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
declare class GroupGenerator extends Generator<PlaitGroup> {
|
|
592
|
+
static key: string;
|
|
593
|
+
canDraw(element: PlaitGroup): boolean;
|
|
594
|
+
draw(element: PlaitGroup, partialSelected: boolean): SVGGElement;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
declare class GroupComponent extends CommonElementFlavour<PlaitGroup, PlaitBoard> implements OnContextChanged<PlaitGroup, PlaitBoard> {
|
|
598
|
+
constructor();
|
|
599
|
+
activeGenerator: ActiveGenerator<PlaitGroup>;
|
|
600
|
+
groupGenerator: GroupGenerator;
|
|
601
|
+
initializeGenerator(): void;
|
|
602
|
+
initialize(): void;
|
|
603
|
+
onContextChanged(value: PlaitPluginElementContext<PlaitGroup, PlaitBoard>, previous: PlaitPluginElementContext<PlaitGroup, PlaitBoard>): void;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export { AStar, ActiveGenerator, AlignTransform, Alignment, BASE, BoardCreationMode, CommonElementFlavour, DEFAULT_FILL, DEFAULT_FONT_FAMILY, DEFAULT_ROUTE_MARGIN, FOREIGN_OBJECT_IMAGE_CLASS_NAME, Generator, GroupComponent, IS_RESIZING, IS_ROTATING, ImageBaseComponent, ImageGenerator, MediaKeys, PICTURE_ACCEPTED_UPLOAD_SIZE, PRIMARY_COLOR, PlaitCommonElementRef, PointGraph, PointNode, PriorityQueue, PropertyTransforms, RESIZE_HANDLE_DIAMETER, ROTATE_HANDLE_DISTANCE_TO_ELEMENT, ROTATE_HANDLE_SIZE, ResizeHandle, StrokeStyle, TRANSPARENT, TextManage, WithCommonPluginKey, WithTextPluginKey, acceptImageTypes, addElementOfFocusedImage, addResizing, addRotating, alignBottom, alignHorizontalCenter, alignLeft, alignRight, alignTop, alignVerticalCenter, animate, buildClipboardData, buildCompositionData, buildImage, buildText, calculatePolylineLength, clearElementSizeCache, createActiveGenerator, createGraph, distributeHorizontal, distributeVertical, drawFillPrimaryHandle, drawHandle, drawPrimaryHandle, drawRotateHandle, findFirstTextEditor, generateElbowLineRoute, getCreationMode, getCrossingPointsBetweenPointAndSegment, getDirectionBetweenPointAndPoint, getDirectionByIndex, getDirectionByPointOfRectangle, getDirectionByVector, getDirectionFactor, getDirectionFactorByDirectionComponent, getEditingTextEditor, getElementArea, getElementOfFocusedImage, getElementSize, getElementsText, getExtendPoint, getFirstTextEditor, getFirstTextManage, getGraphPoints, getIndexByResizeHandle, getLineHeightByFontSize, getMemorizedLatest, getNextPoint, getOppositeDirection, getPointByVectorComponent, getPointByVectorDirectionComponent, getPointOnPolyline, getPoints, getRatioByPoint, getRectangleResizeHandleRefs, getResizeHandleByIndex, getResizeHandlePointByIndex, getRotatedResizeCursorClassByAngle, getSourceAndTargetOuterRectangle, getStrokeLineDash, getSymmetricHandleIndex, getTextEditors, getTextEditorsByElement, getTextManages, getTimestamp, getUnitVectorByPointAndPoint, getXDistanceBetweenPoint, hasAfterDraw, hasMoreThanOnePoint, hasResizeHandle, insertClipboardData, isCornerHandle, isDelete, isDndMode, isDrawingMode, isEdgeHandle, isEnterHotkey, isExpandHotkey, isFilled, isPointOnSegment, isResizing, isResizingByCondition, isRotating, isSourceAndTargetIntersect, isSpaceHotkey, isTabHotkey, isVirtualKey, linear, measureElement, memorizeLatest, moveXOfPoint, moveYOfPoint, normalizeShapePoints, reduceRouteMargin, removeDuplicatePoints, removeElementOfFocusedImage, removeResizing, removeRotating, resetPointsAfterResize, rotateVector, rotateVectorAnti90, routeAdjust, selectImage, setCreationMode, setProperty, simplifyOrthogonalPoints, sortElementsByArea, updateElementSizeCache, withGroup, withImage, withResize, withText };
|
|
607
|
+
export type { ActiveGeneratorExtraData, ActiveGeneratorOptions, AdjustOptions, AfterDraw, AnimateOption, CommonImageItem, CustomElement, CustomText, ElbowLineRouteOptions, ElementSize, GeneratorExtraData, GeneratorOptions, ImageComponentRef, ImageGeneratorOptions, ImageProps, LinkElement, ParagraphElement, PlaitElementOrArray, PlaitImageBoard, PlaitTextBoard, RenderComponentRef, ResizeHitTestRef, ResizeOptions, ResizeRef, ResizeState, RotateRef, RouteAdjustOptions, SetOptions, TextChangeData, TextComponentRef, TextInterface, TextManageChangeData, TextPlugin, TextProps, WithResizeOptions, WithTextPluginOptions };
|
package/package.json
CHANGED
package/algorithms/a-star.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Point } from '@plait/core';
|
|
2
|
-
import { PointGraph, PointNode } from './data-structures/graph';
|
|
3
|
-
export declare class AStar {
|
|
4
|
-
private graph;
|
|
5
|
-
cameFrom: Map<PointNode, PointNode>;
|
|
6
|
-
constructor(graph: PointGraph);
|
|
7
|
-
heuristic(a: Point, b: Point): number;
|
|
8
|
-
search(start: Point, end: Point, previousStart: Point): void;
|
|
9
|
-
getRoute(start: Point, end: Point): Point[];
|
|
10
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Point } from '@plait/core';
|
|
2
|
-
export declare class PointNode {
|
|
3
|
-
data: Point;
|
|
4
|
-
distance: number;
|
|
5
|
-
adjacentNodes: PointNode[];
|
|
6
|
-
constructor(data: Point);
|
|
7
|
-
}
|
|
8
|
-
export declare class PointGraph {
|
|
9
|
-
private index;
|
|
10
|
-
add(p: Point): void;
|
|
11
|
-
connect(a: Point, b: Point): void;
|
|
12
|
-
has(p: Point): boolean;
|
|
13
|
-
get(p: Point): PointNode | null;
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { PointNode } from './graph';
|
|
2
|
-
export declare class PriorityQueue {
|
|
3
|
-
list: {
|
|
4
|
-
node: PointNode;
|
|
5
|
-
priority: number;
|
|
6
|
-
}[];
|
|
7
|
-
constructor();
|
|
8
|
-
enqueue(item: {
|
|
9
|
-
node: PointNode;
|
|
10
|
-
priority: number;
|
|
11
|
-
}): void;
|
|
12
|
-
dequeue(): {
|
|
13
|
-
node: PointNode;
|
|
14
|
-
priority: number;
|
|
15
|
-
} | undefined;
|
|
16
|
-
}
|
package/algorithms/index.d.ts
DELETED
package/constants/default.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export declare const BASE = 4;
|
|
2
|
-
export declare const PRIMARY_COLOR = "#6698FF";
|
|
3
|
-
export declare const RESIZE_HANDLE_DIAMETER = 9;
|
|
4
|
-
export declare const WithTextPluginKey = "plait-text-plugin-key";
|
|
5
|
-
export declare const DEFAULT_ROUTE_MARGIN = 30;
|
|
6
|
-
export declare const TRANSPARENT = "transparent";
|
|
7
|
-
export declare const ROTATE_HANDLE_DISTANCE_TO_ELEMENT = 4;
|
|
8
|
-
export declare const ROTATE_HANDLE_SIZE = 18;
|
|
9
|
-
export declare const DEFAULT_FONT_FAMILY = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Noto Sans', 'Noto Sans CJK SC', 'Microsoft Yahei', 'Hiragino Sans GB', Arial, sans-serif";
|
|
10
|
-
export declare const DEFAULT_FILL = "none";
|