@plait/core 0.64.9 → 0.65.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/interfaces/board.d.ts +3 -3
- package/interfaces/element.d.ts +3 -3
- package/interfaces/node.d.ts +1 -1
- package/package.json +1 -1
- package/utils/common.d.ts +2 -2
- package/utils/dom/common.d.ts +2 -2
- package/utils/z-index.d.ts +2 -2
package/interfaces/board.d.ts
CHANGED
|
@@ -99,9 +99,9 @@ export declare const PlaitBoard: {
|
|
|
99
99
|
isReadonly(board: PlaitBoard): boolean | undefined;
|
|
100
100
|
hasBeenTextEditing(board: PlaitBoard): boolean;
|
|
101
101
|
getPointer<T = PlaitPointerType>(board: PlaitBoard): T;
|
|
102
|
-
isPointer<
|
|
103
|
-
isInPointer<
|
|
102
|
+
isPointer<T = PlaitPointerType>(board: PlaitBoard, pointer: T): boolean;
|
|
103
|
+
isInPointer<T = PlaitPointerType>(board: PlaitBoard, pointers: T[]): boolean;
|
|
104
104
|
getMovingPointInBoard(board: PlaitBoard): Point | undefined;
|
|
105
105
|
isMovingPointInBoard(board: PlaitBoard): boolean;
|
|
106
|
-
getThemeColors<
|
|
106
|
+
getThemeColors<T extends ThemeColor = ThemeColor>(board: PlaitBoard): T[];
|
|
107
107
|
};
|
package/interfaces/element.d.ts
CHANGED
|
@@ -14,9 +14,9 @@ export declare const PlaitElement: {
|
|
|
14
14
|
getElementRef<T extends PlaitElementRef = PlaitElementRef>(value: PlaitElement): T;
|
|
15
15
|
getElementG(value: PlaitElement): SVGGElement;
|
|
16
16
|
hasMounted(element: PlaitElement): boolean;
|
|
17
|
-
getContainerG<
|
|
18
|
-
suppressThrow:
|
|
19
|
-
}):
|
|
17
|
+
getContainerG<T extends boolean>(value: PlaitElement, options: {
|
|
18
|
+
suppressThrow: T;
|
|
19
|
+
}): T extends true ? SVGGElement | null : SVGGElement;
|
|
20
20
|
};
|
|
21
21
|
export interface ComponentType<T> {
|
|
22
22
|
new (...args: any[]): T;
|
package/interfaces/node.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const PlaitNode: {
|
|
|
15
15
|
* the tree, but you can pass the `reverse: true` option to go bottom-up.
|
|
16
16
|
*/
|
|
17
17
|
parents(root: PlaitBoard, path: Path, options?: NodeParentsOptions): Generator<PlaitNode, void, undefined>;
|
|
18
|
-
get<T extends
|
|
18
|
+
get<T extends PlaitNode = PlaitElement>(root: PlaitBoard, path: Path): T;
|
|
19
19
|
last(board: PlaitBoard, path: Path): PlaitElement;
|
|
20
20
|
first(board: PlaitBoard, path: Path): PlaitElement;
|
|
21
21
|
};
|
package/package.json
CHANGED
package/utils/common.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export interface MoveNodeOption {
|
|
|
5
5
|
newPath: Path;
|
|
6
6
|
}
|
|
7
7
|
export declare const throttleRAF: (board: PlaitBoard, key: string, fn: () => void) => void;
|
|
8
|
-
export declare const debounce: <T>(func: (args?: T
|
|
8
|
+
export declare const debounce: <T>(func: (args?: T) => void, wait: number, options?: {
|
|
9
9
|
leading: boolean;
|
|
10
|
-
}) => (args?: T
|
|
10
|
+
}) => (args?: T) => void;
|
|
11
11
|
export declare const getElementsIndices: (board: PlaitBoard, elements: PlaitElement[]) => number[];
|
|
12
12
|
export declare const getHighestIndexOfElement: (board: PlaitBoard, elements: PlaitElement[]) => number;
|
|
13
13
|
export declare const moveElementsToNewPath: (board: PlaitBoard, moveOptions: MoveNodeOption[]) => void;
|
package/utils/dom/common.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export declare const NS = "http://www.w3.org/2000/svg";
|
|
|
4
4
|
export declare function createG(): SVGGElement;
|
|
5
5
|
export declare function createPath(): SVGPathElement;
|
|
6
6
|
export declare function createRect(rectangle: RectangleClient, options?: Options): SVGRectElement;
|
|
7
|
-
export declare const setStrokeLinecap: (g: SVGGElement, value:
|
|
8
|
-
export declare const setPathStrokeLinecap: (g: SVGGElement, value:
|
|
7
|
+
export declare const setStrokeLinecap: (g: SVGGElement, value: "round" | "square") => void;
|
|
8
|
+
export declare const setPathStrokeLinecap: (g: SVGGElement, value: "round" | "square") => void;
|
|
9
9
|
export declare function createMask(): SVGMaskElement;
|
|
10
10
|
export declare function createSVG(): SVGSVGElement;
|
|
11
11
|
export declare function createText(x: number, y: number, fill: string, textContent: string): SVGTextElement;
|
package/utils/z-index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { PlaitBoard } from '../interfaces';
|
|
2
2
|
import { MoveNodeOption } from './common';
|
|
3
|
-
export declare const getOneMoveOptions: (board: PlaitBoard, direction:
|
|
4
|
-
export declare const getAllMoveOptions: (board: PlaitBoard, direction:
|
|
3
|
+
export declare const getOneMoveOptions: (board: PlaitBoard, direction: "down" | "up") => MoveNodeOption[];
|
|
4
|
+
export declare const getAllMoveOptions: (board: PlaitBoard, direction: "down" | "up") => MoveNodeOption[];
|
|
5
5
|
export declare const canSetZIndex: (board: PlaitBoard) => boolean;
|