@plait/core 0.64.8 → 0.65.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.
@@ -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<T_1 = PlaitPointerType>(board: PlaitBoard, pointer: T_1): boolean;
103
- isInPointer<T_2 = PlaitPointerType>(board: PlaitBoard, pointers: T_2[]): boolean;
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<T_3 extends ThemeColor = ThemeColor>(board: PlaitBoard): T_3[];
106
+ getThemeColors<T extends ThemeColor = ThemeColor>(board: PlaitBoard): T[];
107
107
  };
@@ -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<T_1 extends boolean>(value: PlaitElement, options: {
18
- suppressThrow: T_1;
19
- }): T_1 extends true ? SVGGElement | null : SVGGElement;
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;
@@ -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 PlaitElement = PlaitElement>(root: PlaitBoard, path: Path): T;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plait/core",
3
- "version": "0.64.8",
3
+ "version": "0.65.0-next.0",
4
4
  "peerDependencies": {
5
5
  "immer": "^10.0.3",
6
6
  "is-hotkey": "^0.2.0",
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 | undefined) => void, wait: number, options?: {
8
+ export declare const debounce: <T>(func: (args?: T) => void, wait: number, options?: {
9
9
  leading: boolean;
10
- }) => (args?: T | undefined) => void;
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;
@@ -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: 'round' | 'square') => void;
8
- export declare const setPathStrokeLinecap: (g: SVGGElement, value: 'round' | 'square') => void;
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;
@@ -1,5 +1,5 @@
1
1
  import { PlaitBoard } from '../interfaces';
2
2
  import { MoveNodeOption } from './common';
3
- export declare const getOneMoveOptions: (board: PlaitBoard, direction: 'down' | 'up') => MoveNodeOption[];
4
- export declare const getAllMoveOptions: (board: PlaitBoard, direction: 'down' | 'up') => MoveNodeOption[];
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;