microboard-temp 0.13.40 → 0.13.42

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.
Files changed (140) hide show
  1. package/dist/cjs/browser.js +55017 -51755
  2. package/dist/cjs/index.js +55012 -51755
  3. package/dist/cjs/node.js +56725 -53463
  4. package/dist/esm/browser.js +55493 -52294
  5. package/dist/esm/index.js +55462 -52268
  6. package/dist/esm/node.js +57248 -54055
  7. package/dist/types/Board.d.ts +14 -8
  8. package/dist/types/BoardCommand.d.ts +2 -2
  9. package/dist/types/Camera/Camera.d.ts +4 -1
  10. package/dist/types/Events/BaseCommand.d.ts +17 -0
  11. package/dist/types/Events/Command.d.ts +11 -20
  12. package/dist/types/Events/CreateCommand.d.ts +5 -0
  13. package/dist/types/Events/Events.d.ts +2 -1
  14. package/dist/types/Events/EventsOperations.d.ts +23 -15
  15. package/dist/types/Events/Log/EventsLog.d.ts +4 -3
  16. package/dist/types/Events/Log/createEventsList.d.ts +3 -1
  17. package/dist/types/Events/Log/getSnapshotFromList.d.ts +5 -2
  18. package/dist/types/Events/index.d.ts +2 -1
  19. package/dist/types/Items/AINode/AINode.d.ts +4 -5
  20. package/dist/types/Items/AINode/AINodeData.d.ts +1 -0
  21. package/dist/types/Items/Anchor/Anchor.d.ts +2 -1
  22. package/dist/types/Items/Arc/Arc.d.ts +4 -1
  23. package/dist/types/Items/Audio/Audio.d.ts +6 -5
  24. package/dist/types/Items/BaseItem/BaseItem.d.ts +16 -12
  25. package/dist/types/Items/BaseItem/index.d.ts +1 -0
  26. package/dist/types/Items/Comment/Comment.d.ts +11 -15
  27. package/dist/types/Items/Connector/Connector.d.ts +14 -19
  28. package/dist/types/Items/Connector/ConnectorCommand.d.ts +2 -2
  29. package/dist/types/Items/Connector/ConnectorOperations.d.ts +3 -3
  30. package/dist/types/Items/Connector/ConnectorTypes.d.ts +10 -0
  31. package/dist/types/Items/Connector/Pointers/Pointers.d.ts +21 -4
  32. package/dist/types/Items/Connector/Pointers/index.d.ts +1 -1
  33. package/dist/types/Items/Connector/getLine/getLine.d.ts +1 -1
  34. package/dist/types/Items/Connector/index.d.ts +3 -2
  35. package/dist/types/Items/Curve/Curve.d.ts +9 -10
  36. package/dist/types/Items/Drawing/Drawing.d.ts +10 -8
  37. package/dist/types/Items/Drawing/DrawingCommand.d.ts +2 -2
  38. package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +11 -8
  39. package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +16 -8
  40. package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +10 -4
  41. package/dist/types/Items/Frame/Frame.d.ts +12 -4
  42. package/dist/types/Items/Frame/FrameData.d.ts +5 -3
  43. package/dist/types/Items/Frame/FrameOperation.d.ts +13 -1
  44. package/dist/types/Items/Geometry.d.ts +1 -1
  45. package/dist/types/Items/Group/Group.d.ts +11 -6
  46. package/dist/types/Items/Image/Image.d.ts +8 -6
  47. package/dist/types/Items/Item.d.ts +15 -15
  48. package/dist/types/Items/Line/Line.d.ts +1 -1
  49. package/dist/types/Items/Mbr/Mbr.d.ts +5 -5
  50. package/dist/types/Items/Mbr/updateRects.d.ts +1 -2
  51. package/dist/types/Items/Path/Path.d.ts +1 -0
  52. package/dist/types/Items/Path/Paths.d.ts +2 -0
  53. package/dist/types/Items/Placeholder/Placeholder.d.ts +16 -10
  54. package/dist/types/Items/Point/Point.d.ts +1 -1
  55. package/dist/types/Items/RegisterItem.d.ts +4 -2
  56. package/dist/types/Items/RichText/CanvasText/Render.d.ts +1 -1
  57. package/dist/types/Items/RichText/Editor/BlockNode.d.ts +10 -3
  58. package/dist/types/Items/RichText/EditorContainer.d.ts +5 -6
  59. package/dist/types/Items/RichText/RichText.d.ts +13 -7
  60. package/dist/types/Items/RichText/RichTextCommand.d.ts +2 -2
  61. package/dist/types/Items/RichText/RichTextData.d.ts +2 -0
  62. package/dist/types/Items/RichText/RichTextOperations.d.ts +4 -3
  63. package/dist/types/Items/RichText/editorHelpers/common/getAreAllChildrenEmpty.d.ts +1 -1
  64. package/dist/types/Items/RichText/editorHelpers/lists/getBlockParentList.d.ts +2 -2
  65. package/dist/types/Items/RichText/setNodeStyles.d.ts +2 -5
  66. package/dist/types/Items/Shape/BPMN/BPMN_Annotation/index.d.ts +2 -1
  67. package/dist/types/Items/Shape/BPMN/BPMN_DataObject/index.d.ts +3 -1
  68. package/dist/types/Items/Shape/BPMN/BPMN_DataStore/index.d.ts +3 -1
  69. package/dist/types/Items/Shape/BPMN/BPMN_EndEvent/index.d.ts +3 -1
  70. package/dist/types/Items/Shape/BPMN/BPMN_EventSubprocess/index.d.ts +3 -1
  71. package/dist/types/Items/Shape/BPMN/BPMN_Gateway/index.d.ts +3 -1
  72. package/dist/types/Items/Shape/BPMN/BPMN_GatewayParallel/index.d.ts +3 -1
  73. package/dist/types/Items/Shape/BPMN/BPMN_GatewayXOR/index.d.ts +3 -1
  74. package/dist/types/Items/Shape/BPMN/BPMN_Group/index.d.ts +3 -1
  75. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEvent/index.d.ts +3 -1
  76. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEventNoneInterrupting/index.d.ts +3 -1
  77. package/dist/types/Items/Shape/BPMN/BPMN_Participant/index.d.ts +3 -1
  78. package/dist/types/Items/Shape/BPMN/BPMN_StartEvent/index.d.ts +3 -1
  79. package/dist/types/Items/Shape/BPMN/BPMN_StartEventNoneInterrupting/index.d.ts +3 -1
  80. package/dist/types/Items/Shape/BPMN/BPMN_Task/index.d.ts +3 -1
  81. package/dist/types/Items/Shape/BPMN/BPMN_Transaction/index.d.ts +3 -1
  82. package/dist/types/Items/Shape/Basic/ArrowBlockLeft/index.d.ts +3 -1
  83. package/dist/types/Items/Shape/Basic/ArrowBlockRigth/index.d.ts +3 -1
  84. package/dist/types/Items/Shape/Basic/ArrowLeft/index.d.ts +3 -1
  85. package/dist/types/Items/Shape/Basic/ArrowLeftRight/index.d.ts +3 -1
  86. package/dist/types/Items/Shape/Basic/ArrowRight/index.d.ts +3 -1
  87. package/dist/types/Items/Shape/Basic/BracesLeft/index.d.ts +2 -1
  88. package/dist/types/Items/Shape/Basic/BracesRight/index.d.ts +2 -1
  89. package/dist/types/Items/Shape/Basic/Circle/index.d.ts +3 -1
  90. package/dist/types/Items/Shape/Basic/Cloud/index.d.ts +3 -1
  91. package/dist/types/Items/Shape/Basic/Cross/index.d.ts +3 -1
  92. package/dist/types/Items/Shape/Basic/Cylinder/index.d.ts +3 -1
  93. package/dist/types/Items/Shape/Basic/Hexagon/index.d.ts +3 -1
  94. package/dist/types/Items/Shape/Basic/Octagon/index.d.ts +3 -1
  95. package/dist/types/Items/Shape/Basic/Parallelogram/index.d.ts +3 -1
  96. package/dist/types/Items/Shape/Basic/Pentagon/index.d.ts +3 -1
  97. package/dist/types/Items/Shape/Basic/PredefinedProcess/index.d.ts +3 -1
  98. package/dist/types/Items/Shape/Basic/Rectangle/index.d.ts +3 -1
  99. package/dist/types/Items/Shape/Basic/ReversedParallelogram/index.d.ts +3 -1
  100. package/dist/types/Items/Shape/Basic/ReversedTriangle/index.d.ts +3 -1
  101. package/dist/types/Items/Shape/Basic/Rhombus/index.d.ts +3 -1
  102. package/dist/types/Items/Shape/Basic/RoundedRectangle/index.d.ts +3 -1
  103. package/dist/types/Items/Shape/Basic/SpeachBubble/index.d.ts +3 -1
  104. package/dist/types/Items/Shape/Basic/Star/index.d.ts +3 -1
  105. package/dist/types/Items/Shape/Basic/Trapezoid/index.d.ts +3 -1
  106. package/dist/types/Items/Shape/Basic/Triangle/index.d.ts +3 -1
  107. package/dist/types/Items/Shape/Shape.d.ts +9 -3
  108. package/dist/types/Items/Shape/ShapeCommand.d.ts +2 -2
  109. package/dist/types/Items/Shape/ShapeData.d.ts +2 -0
  110. package/dist/types/Items/Shape/ShapeOperation.d.ts +1 -1
  111. package/dist/types/Items/Shape/ShapeType.d.ts +3 -0
  112. package/dist/types/Items/Shape/index.d.ts +1 -3
  113. package/dist/types/Items/Sticker/Sticker.d.ts +8 -6
  114. package/dist/types/Items/Sticker/StickerOperation.d.ts +3 -3
  115. package/dist/types/Items/Transformation/Matrix.d.ts +1 -1
  116. package/dist/types/Items/Transformation/TransformationCommand.d.ts +1 -1
  117. package/dist/types/Items/Video/Video.d.ts +8 -7
  118. package/dist/types/Items/index.d.ts +2 -1
  119. package/dist/types/Keyboard/types.d.ts +2 -1
  120. package/dist/types/Selection/Selection.d.ts +15 -12
  121. package/dist/types/Selection/Transformer/TextTransformer/getTextResizeType.d.ts +1 -1
  122. package/dist/types/Selection/Transformer/TransformerHelpers/AnchorType.d.ts +1 -1
  123. package/dist/types/Selection/Transformer/TransformerHelpers/getOppositePoint.d.ts +1 -1
  124. package/dist/types/Selection/Transformer/TransformerHelpers/getResizeMatrix.d.ts +1 -1
  125. package/dist/types/Selection/Transformer/TransformerHelpers/getResizedMbr.d.ts +1 -1
  126. package/dist/types/SessionStorage.d.ts +1 -1
  127. package/dist/types/Settings.d.ts +15 -10
  128. package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +5 -3
  129. package/dist/types/SpatialIndex/SpacialIndex.d.ts +8 -1
  130. package/dist/types/Tools/AddConnector/AddConnector.d.ts +1 -1
  131. package/dist/types/Tools/AddDrawing/AddDrawing.d.ts +1 -1
  132. package/dist/types/Tools/AddDrawing/AddHighlighter.d.ts +1 -1
  133. package/dist/types/Tools/Tools.d.ts +3 -2
  134. package/dist/types/Validators/Validators.d.ts +4 -3
  135. package/dist/types/api/MockPath2D.d.ts +3 -3
  136. package/dist/types/api/Path2DFactory.d.ts +1 -1
  137. package/dist/types/itemFactories.d.ts +27 -1
  138. package/dist/types/parserHTML.d.ts +10 -3
  139. package/dist/types/sha256.d.ts +1 -1
  140. package/package.json +1 -1
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const Rhombus: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const RoundedRectangle: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const SpeachBubble: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const Star: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const Trapezoid: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,6 @@
1
- import { Mbr, Path, Point } from '../../../../Items';
1
+ import { Mbr } from '../../../Mbr/Mbr';
2
+ import { Path } from '../../../Path/Path';
3
+ import { Point } from '../../../Point/Point';
2
4
  export declare const Triangle: {
3
5
  name: string;
4
6
  textBounds: Mbr;
@@ -1,4 +1,10 @@
1
- import { Mbr, Line, Point, Transformation, Path, Paths, Matrix } from "..";
1
+ import { Mbr } from "../Mbr/Mbr";
2
+ import { Line } from "../Line/Line";
3
+ import { Point } from "../Point/Point";
4
+ import { Transformation } from "../Transformation/Transformation";
5
+ import { Path } from "../Path/Path";
6
+ import { Paths } from "../Path/Paths";
7
+ import { Matrix } from "../Transformation/Matrix";
2
8
  import { ShapeType } from "./index";
3
9
  import { BorderStyle, BorderWidth } from "../Path";
4
10
  import { RichText } from "../RichText";
@@ -365,8 +371,8 @@ export declare class Shape extends BaseItem {
365
371
  constructor(board: Board, id?: string, shapeType?: ShapeType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: "solid" | "dot" | "dash" | "longDash" | "dotDash" | "tripleDotDash" | "looseDoubleDotDash", borderWidth?: number, mbr?: Mbr);
366
372
  private saveShapeData;
367
373
  emit(operation: ShapeOperation): void;
368
- serialize(): ShapeData;
369
- deserialize(data: SerializedItemData<ShapeData>): this;
374
+ serialize(): SerializedItemData<ShapeData>;
375
+ deserialize(data: SerializedItemData<ShapeData> | ShapeData): this;
370
376
  setId(id: string): this;
371
377
  protected onParentChanged(newParent: string): void;
372
378
  getId(): string;
@@ -1,12 +1,12 @@
1
1
  import { Shape } from "./Shape";
2
2
  import { ShapeOperation } from "./ShapeOperation";
3
- import { Command } from "../../Events";
3
+ import { Command, Operation } from "../../Events";
4
4
  export declare class ShapeCommand implements Command {
5
5
  private shape;
6
6
  private operation;
7
7
  private reverse;
8
8
  constructor(shape: Shape[], operation: ShapeOperation);
9
- merge(op: ShapeOperation): this;
9
+ merge(op: Operation): this;
10
10
  apply(): void;
11
11
  revert(): void;
12
12
  getReverse(): {
@@ -16,6 +16,7 @@ export interface ShapeData {
16
16
  transformation: TransformationData;
17
17
  text: RichTextData;
18
18
  linkTo?: string;
19
+ [key: string]: unknown;
19
20
  }
20
21
  export declare class DefaultShapeData implements ShapeData {
21
22
  shapeType: ShapeType;
@@ -29,6 +30,7 @@ export declare class DefaultShapeData implements ShapeData {
29
30
  text: DefaultRichTextData;
30
31
  linkTo?: string | undefined;
31
32
  readonly itemType = "Shape";
33
+ [key: string]: unknown;
32
34
  constructor(shapeType?: ShapeType, backgroundColor?: ColorValue, backgroundOpacity?: number, borderColor?: ColorValue, borderOpacity?: number, borderStyle?: BorderStyle, borderWidth?: BorderWidth, transformation?: DefaultTransformationData, text?: DefaultRichTextData, linkTo?: string | undefined);
33
35
  }
34
36
  export declare const ADD_TO_SELECTION = true;
@@ -1,5 +1,5 @@
1
1
  import { BorderStyle } from "../Path";
2
- import { ShapeType } from "./index";
2
+ import { ShapeType } from "./ShapeType";
3
3
  import { ColorValue } from "../../..";
4
4
  export type ShapeOperation = SetBackgroundColor | SetBackgroundOpacity | SetBorderColor | SetBorderOpacity | SetBorderStyle | SetBorderWidth | SetShapeType;
5
5
  interface BaseShapeOperation {
@@ -0,0 +1,3 @@
1
+ export type BasicShapeType = "Rectangle" | "Triangle" | "ReversedTriangle" | "Circle" | "ArrowLeft" | "ArrowLeftRight" | "ArrowRight" | "ArrowBlockLeft" | "ArrowBlockRight" | "BracesLeft" | "BracesRight" | "Cloud" | "Cross" | "Cylinder" | "Hexagon" | "Octagon" | "Parallelogram" | "ReversedParallelogram" | "Pentagon" | "PredefinedProcess" | "Rhombus" | "RoundedRectangle" | "SpeachBubble" | "Star" | "Trapezoid";
2
+ export type BPMN_ShapeType = "BPMN_Gateway" | "BPMN_DataStore" | "BPMN_GatewayParallel" | "BPMN_GatewayXOR" | "BPMN_EndEvent" | "BPMN_StartEvent" | "BPMN_StartEventNoneInterrupting" | "BPMN_IntermediateEvent" | "BPMN_IntermediateEventNoneInterrupting" | "BPMN_Group" | "BPMN_Participant" | "BPMN_Task" | "BPMN_Transaction" | "BPMN_EventSubprocess" | "BPMN_Annotation" | "BPMN_DataObject";
3
+ export type ShapeType = BasicShapeType | BPMN_ShapeType;
@@ -1,8 +1,6 @@
1
- import { BasicShapes } from "./Basic";
2
- import { BPMN } from "./BPMN";
3
1
  export { Shape, Shapes } from "./Shape";
4
2
  export { ShapeCommand } from "./ShapeCommand";
5
3
  export type { ShapeOperation } from "./ShapeOperation";
6
4
  export * from "./ShapeData";
7
- export type ShapeType = keyof typeof BasicShapes | BPMN;
5
+ export type { ShapeType } from "./ShapeType";
8
6
  export { DefaultShapeData } from "./ShapeData";
@@ -1,20 +1,22 @@
1
1
  import { Operation } from "../../Events";
2
2
  import { Subject } from "../../Subject";
3
- import { Line } from "../Line";
3
+ import { Line } from "../Line/Line";
4
4
  import { Matrix } from "../Transformation/Matrix";
5
5
  import { Mbr } from "../Mbr/Mbr";
6
- import { Path, Paths } from "../Path";
6
+ import { Path } from "../Path/Path";
7
+ import { Paths } from "../Path/Paths";
7
8
  import { Point } from "../Point/Point";
8
9
  import { Transformation } from "../Transformation/Transformation";
9
10
  import { ResizeType } from "../../Selection/Transformer/TransformerHelpers/getResizeType";
10
11
  import { DrawingContext } from "../DrawingContext";
11
12
  import { GeometricNormal } from "../GeometricNormal";
12
- import { RichText } from "../RichText";
13
+ import { RichText } from "../RichText/RichText";
13
14
  import { StickerData, StickerOperation } from "./StickerOperation";
14
15
  import { LinkTo } from "../LinkTo/LinkTo";
15
16
  import { Board } from "../../Board";
16
17
  import { DocumentFactory } from "../../api/DocumentFactory";
17
- import { BaseItem } from "../BaseItem";
18
+ import { BaseItem } from "../BaseItem/BaseItem";
19
+ import type { SerializedItemData } from "../BaseItem/BaseItem";
18
20
  import { ColorValue } from "../../..";
19
21
  export declare const stickerColors: {
20
22
  [color: string]: string;
@@ -39,8 +41,8 @@ export declare class Sticker extends BaseItem {
39
41
  constructor(board: Board, id?: string, backgroundColor?: ColorValue);
40
42
  emit(operation: StickerOperation): void;
41
43
  saveStickerData(): void;
42
- serialize(): StickerData;
43
- deserialize(data: Partial<StickerData>): this;
44
+ serialize(): SerializedItemData<StickerData>;
45
+ deserialize(data: SerializedItemData<StickerData> | StickerData): this;
44
46
  private transformPath;
45
47
  setId(id: string): this;
46
48
  protected onParentChanged(newParent: string): void;
@@ -1,14 +1,14 @@
1
- import { LinkTo } from '../LinkTo/LinkTo';
2
1
  import { DefaultRichTextData } from '../RichText/RichTextData';
3
2
  import { DefaultTransformationData } from '../Transformation/TransformationData';
4
3
  import { ColorValue } from '../../..';
5
4
  export declare class StickerData {
6
5
  backgroundColor: ColorValue;
7
6
  transformation: DefaultTransformationData;
8
- linkTo?: (string | LinkTo) | undefined;
7
+ linkTo?: string | undefined;
9
8
  text: DefaultRichTextData;
10
9
  readonly itemType = "Sticker";
11
- constructor(backgroundColor?: ColorValue, transformation?: DefaultTransformationData, linkTo?: (string | LinkTo) | undefined, text?: DefaultRichTextData);
10
+ [key: string]: unknown;
11
+ constructor(backgroundColor?: ColorValue, transformation?: DefaultTransformationData, linkTo?: string | undefined, text?: DefaultRichTextData);
12
12
  }
13
13
  interface SetBackgroundColor {
14
14
  class: 'Sticker';
@@ -1,4 +1,4 @@
1
- import { Point } from '..';
1
+ import { Point } from '../Point/Point';
2
2
  export declare class Matrix {
3
3
  translateX: number;
4
4
  translateY: number;
@@ -16,7 +16,7 @@ export declare class TransformationCommand implements Command {
16
16
  /** Map from Transformation → Item, populated when items are passed to the constructor. */
17
17
  private itemsMap;
18
18
  constructor(transformation: Transformation[], operation: TransformationOperation, items?: TransformableItem[]);
19
- merge(op: TransformationOperation): this;
19
+ merge(op: Operation): this;
20
20
  apply(): void;
21
21
  revert(): void;
22
22
  getReverse(): {
@@ -1,14 +1,14 @@
1
1
  import { DocumentFactory } from "../../api/DocumentFactory";
2
2
  import { Board } from "../../Board";
3
3
  import { Events, Operation } from "../../Events";
4
- import { Point } from "../../Items";
4
+ import { Point } from "../Point/Point";
5
5
  import { DrawingContext } from "../DrawingContext";
6
6
  import { LinkTo } from "../LinkTo/LinkTo";
7
7
  import { Mbr } from "../Mbr";
8
8
  import { Path, Paths } from "../Path";
9
9
  import { TransformationData, Transformation } from "../Transformation";
10
10
  import { Subject } from "../../Subject";
11
- import { BaseItem } from "../BaseItem/BaseItem";
11
+ import { BaseItem, SerializedItemData } from "../BaseItem/BaseItem";
12
12
  export interface VideoItemData {
13
13
  itemType: "Video";
14
14
  url?: string;
@@ -17,6 +17,7 @@ export interface VideoItemData {
17
17
  isStorageUrl: boolean;
18
18
  previewUrl?: string;
19
19
  extension: string;
20
+ [key: string]: unknown;
20
21
  }
21
22
  export interface Dimension {
22
23
  height: number;
@@ -33,6 +34,9 @@ export declare class VideoItem extends BaseItem {
33
34
  private extension;
34
35
  readonly itemType = "Video";
35
36
  parent: string;
37
+ private url;
38
+ private previewUrl;
39
+ private isStorageUrl;
36
40
  preview: HTMLImageElement;
37
41
  readonly transformation: Transformation;
38
42
  readonly linkTo: LinkTo;
@@ -40,9 +44,6 @@ export declare class VideoItem extends BaseItem {
40
44
  loadCallbacks: ((video: VideoItem) => void)[];
41
45
  beforeLoadCallbacks: ((video: VideoItem) => void)[];
42
46
  transformationRenderBlock?: boolean;
43
- private url;
44
- private previewUrl;
45
- private isStorageUrl;
46
47
  videoDimension: Dimension;
47
48
  board: Board;
48
49
  private isPlaying;
@@ -80,8 +81,8 @@ export declare class VideoItem extends BaseItem {
80
81
  updateMbr(): void;
81
82
  render(context: DrawingContext): void;
82
83
  renderHTML(documentFactory: DocumentFactory): HTMLElement;
83
- serialize(): VideoItemData;
84
- deserialize(data: Partial<VideoItemData>): VideoItem;
84
+ serialize(): SerializedItemData<VideoItemData>;
85
+ deserialize(data: SerializedItemData<VideoItemData> | VideoItemData): this;
85
86
  apply(op: Operation): void;
86
87
  emit(operation: Operation): void;
87
88
  setId(id: string): this;
@@ -1,3 +1,5 @@
1
+ export { BaseItem } from "./BaseItem";
2
+ export type { BaseItemData, SerializedItemData } from "./BaseItem";
1
3
  export { Point } from "./Point";
2
4
  export { Line } from "./Line";
3
5
  export { CubicBezier, QuadraticBezier } from "./Curve";
@@ -15,7 +17,6 @@ export * from "./Frame";
15
17
  export * from "./Video";
16
18
  export * from "./Audio";
17
19
  export * from "./AINode";
18
- export * from "./Point";
19
20
  export * from "./Image";
20
21
  export * from "./Drawing";
21
22
  export * from "./Placeholder";
@@ -1,4 +1,5 @@
1
1
  import type { SelectionContext } from "../Selection/Selection";
2
+ import { Board } from '../Board';
2
3
  import hotkeys from "hotkeys.json";
3
4
  export type Hotkey = {
4
5
  key: {
@@ -13,7 +14,7 @@ export type Hotkey = {
13
14
  };
14
15
  };
15
16
  export type HotkeyName = keyof typeof hotkeys;
16
- export type HotkeyCb = (event?: KeyboardEvent) => void;
17
+ export type HotkeyCb = (event?: KeyboardEvent, board?: Board) => void;
17
18
  export type HotkeyConfig = {
18
19
  cb: HotkeyCb;
19
20
  selectionContext?: SelectionContext[];
@@ -1,21 +1,24 @@
1
1
  import { Board } from "../Board";
2
- import { Item, RichText, Mbr, ItemData } from "../Items";
3
- import { AINode } from "../Items/AINode";
2
+ import type { Item, ItemData } from "../Items/Item";
3
+ import type { BaseItem } from "../Items/BaseItem/BaseItem";
4
+ import type { RichText } from "../Items/RichText/RichText";
5
+ import { Mbr } from "../Items/Mbr/Mbr";
6
+ import { AINode } from "../Items/AINode/AINode";
4
7
  import { HorisontalAlignment, VerticalAlignment } from "../Items/Alignment";
5
- import { ConnectorLineStyle } from "../Items/Connector";
8
+ import { ColorValue } from "../Color/ColorValue";
9
+ import { ConnectorLineStyle } from "../Items/Connector/ConnectorTypes";
6
10
  import { ConnectorPointerStyle } from "../Items/Connector/Pointers/Pointers";
7
11
  import { DrawingContext } from "../Items/DrawingContext";
8
12
  import { FrameType } from "../Items/Frame/Basic";
9
- import { BorderStyle } from "../Items/Path";
10
- import { TextStyle } from "../Items/RichText";
11
- import { ShapeType } from "../Items/Shape";
13
+ import { BorderStyle } from "../Items/Path/Path";
14
+ import { TextStyle } from "../Items/RichText/Editor/TextNode";
15
+ import { ShapeType } from "../Items/Shape/ShapeType";
12
16
  import { ApplyMatrixItem } from "../Items/Transformation/TransformationOperations";
13
17
  import { Subject } from "../Subject";
14
18
  import { Tool } from "../Tools/Tool";
15
19
  import { QuickAddButtons } from "./QuickAddButtons";
16
20
  import { SelectionItems } from "./SelectionItems";
17
21
  import { BaseSelection, BaseRange } from "slate";
18
- import { BaseItem } from "../Items/BaseItem";
19
22
  export type SelectionContext = "SelectUnderPointer" | "HoverUnderPointer" | "EditUnderPointer" | "EditTextUnderPointer" | "SelectByRect" | "None";
20
23
  type SelectionSnapshot = {
21
24
  selectedItems: string;
@@ -106,14 +109,14 @@ export declare class BoardSelection {
106
109
  isTextEmpty(): boolean;
107
110
  getAutosize(): boolean;
108
111
  getFontSize(biggest?: boolean): number;
109
- getFontHighlight(): string;
110
- getFontColor(): string;
111
- getFillColor(): string;
112
+ getFontHighlight(): ColorValue | string;
113
+ getFontColor(): ColorValue | string;
114
+ getFillColor(): ColorValue | string;
112
115
  getBorderStyle(): string;
113
- getStrokeColor(): string;
116
+ getStrokeColor(): ColorValue | string;
114
117
  getStrokeWidth(): number;
115
118
  getConnectorLineWidth(): number;
116
- getConnectorLineColor(): string;
119
+ getConnectorLineColor(): ColorValue | string;
117
120
  getStartPointerStyle(): ConnectorPointerStyle;
118
121
  getEndPointerStyle(): ConnectorPointerStyle;
119
122
  setStartPointerStyle(style: ConnectorPointerStyle): void;
@@ -1,5 +1,5 @@
1
1
  import { Point, Mbr } from "../../../Items";
2
- import { ResizeType } from "../TransformerHelpers/getResizeType.ts";
2
+ import { ResizeType } from "../TransformerHelpers/getResizeType";
3
3
  /**
4
4
  * A funciton to get the resize type of a text item.
5
5
  * A text item does not have top and bottom anchors.
@@ -1,3 +1,3 @@
1
- import { ResizeType } from "./getResizeType.ts";
1
+ import { ResizeType } from "./getResizeType";
2
2
  export type AnchorType = "default" | "nw-resize" | "n-resize" | "ne-resize" | "e-resize" | "se-resize" | "s-resize" | "sw-resize" | "w-resize";
3
3
  export declare function getAnchorFromResizeType(resizeType?: ResizeType): AnchorType;
@@ -1,3 +1,3 @@
1
1
  import { Mbr, Point } from "../../../Items/index";
2
- import { ResizeType } from "./getResizeType.ts";
2
+ import { ResizeType } from "./getResizeType";
3
3
  export declare function getOppositePoint(resizeType: ResizeType, mbr: Mbr): Point;
@@ -1,5 +1,5 @@
1
1
  import { Point, Mbr, Matrix } from "../../../Items/index";
2
- import { ResizeType } from "./getResizeType.ts";
2
+ import { ResizeType } from "./getResizeType";
3
3
  export declare function getResize(resizeType: ResizeType, pointer: Point, mbr: Mbr, opposite: Point): {
4
4
  matrix: Matrix;
5
5
  mbr: Mbr;
@@ -1,3 +1,3 @@
1
1
  import { Point, Mbr } from "../../../Items/index";
2
- import { ResizeType } from "./getResizeType.ts";
2
+ import { ResizeType } from "./getResizeType";
3
3
  export declare function getResizedMbr(resizeType: ResizeType, pointer: Point, mbr: Mbr, opposite: Point): Mbr;
@@ -1,6 +1,6 @@
1
1
  import { ShapeData } from './Items';
2
2
  import { ConnectorLineStyle } from './Items/Connector';
3
- import { ConnectionLineWidth } from './Items/Connector/Connector';
3
+ import { ConnectionLineWidth } from './Items/Connector/ConnectorTypes';
4
4
  import { ConnectorEdge } from './Items/Connector/Pointers';
5
5
  import { ConnectorPointerStyle } from './Items/Connector/Pointers/Pointers';
6
6
  import { BorderStyle } from './Items/Path';
@@ -1,29 +1,35 @@
1
1
  import { Path2DFactory } from "./api/Path2DFactory";
2
+ import type { Board } from "./Board";
2
3
  import { BrowserDocumentFactory } from "./api/BrowserDocumentFactory";
3
4
  import { BrowserPath2D } from "./api/BrowserPath2DFactory";
4
5
  import { MockDocumentFactory } from "./api/MockDocumentFactory";
5
6
  import { MockPath2D } from "./api/MockPath2D";
7
+ import { TFunction } from "i18next";
6
8
  import type { BorderStyle } from "./Items/Path/Path";
7
9
  import type { Theme, ColorValue } from "./Color/ColorValue";
10
+ export type { Theme, ColorValue };
11
+ import type { PresenceEventType } from "./Presence/Events";
12
+ import type { SocketMsg } from "./Events/MessageRouter/boardMessageInterface";
13
+ import type { Editor } from "slate";
8
14
  export interface Connection {
9
15
  connectionId: number;
10
16
  getCurrentUser: () => string;
11
17
  connect(): Promise<void>;
12
- subscribe(board: any): void;
13
- unsubscribe(board: any): void;
14
- publishPresenceEvent(boardId: string, event: any): void;
18
+ subscribe(board: Board): void;
19
+ unsubscribe(board: Board): void;
20
+ publishPresenceEvent(boardId: string, event: PresenceEventType): void;
15
21
  publishAuth(): Promise<void>;
16
22
  publishLogout(): void;
17
- onMessage?: (msg: any) => void;
23
+ onMessage?: (msg: SocketMsg) => void;
18
24
  onAccessDenied: (boardId: string, forceUpdate?: boolean) => void;
19
25
  notifyAboutLostConnection: () => void;
20
26
  dismissNotificationAboutLostConnection: () => void;
21
27
  resetConnection: () => void;
22
- send: (msg: any) => void;
28
+ send: (msg: SocketMsg) => void;
23
29
  }
24
30
  export interface I18NextInterface {
25
- t: (key: string, options?: any) => string;
26
- changeLanguage: (lng: string, callback?: (err: any, t: any) => void) => Promise<any>;
31
+ t: (key: string, options?: Record<string, any>) => string;
32
+ changeLanguage: (lng: string, callback?: (err: any, t: TFunction) => void) => Promise<TFunction>;
27
33
  }
28
34
  export interface NotifyFunction {
29
35
  (options: {
@@ -109,8 +115,8 @@ type GetYouTubeIdFunction = (url?: string) => string | null;
109
115
  type GetDOMParser = () => {
110
116
  parseFromString: (str: string, type: DOMParserSupportedType) => Document;
111
117
  };
112
- type ReactEditorFocus = (editor: any) => void;
113
- type ReactEditorToSlatePoint = (editor: any, domNode: Node, offset: number, options: any) => any;
118
+ type ReactEditorFocus = (editor: Editor) => void;
119
+ type ReactEditorToSlatePoint = (editor: Editor, domNode: Node, offset: number, options: any) => any;
114
120
  /**
115
121
  * Set properties before using the board.
116
122
  * @property {Path2DFactory} - The factory for creating Path2D objects.
@@ -261,4 +267,3 @@ export declare const conf: {
261
267
  GRAVITY_MAX_DISTANCE: number;
262
268
  };
263
269
  export type Settings = typeof conf;
264
- export {};
@@ -1,9 +1,11 @@
1
1
  import { Subject } from "../Subject";
2
- import { DrawingContext, Item, Point, Mbr } from "../Items";
2
+ import { DrawingContext } from "../Items/DrawingContext";
3
+ import { Item, ItemDataWithId } from "../Items/Item";
4
+ import { Point } from "../Items/Point/Point";
5
+ import { Mbr } from "../Items/Mbr/Mbr";
3
6
  import { Camera } from "../Camera";
4
7
  import { Pointer } from "../Pointer";
5
- import { BaseItem } from "../Items/BaseItem";
6
- import { ItemDataWithId } from "../Items/Item";
8
+ import type { BaseItem } from "../Items/BaseItem/BaseItem";
7
9
  import { ItemsIndexRecord } from "../BoardOperations";
8
10
  import { Items } from "./SpacialIndex";
9
11
  export declare class SimpleSpatialIndex {
@@ -1,7 +1,12 @@
1
1
  import { DocumentFactory } from '../api/DocumentFactory';
2
2
  import { ItemsIndexRecord } from '../BoardOperations';
3
3
  import { Camera } from '../Camera';
4
- import { Item, Mbr, Point, Connector, Comment } from '../Items';
4
+ import type { Item } from "../Items/Item";
5
+ import { Mbr } from "../Items/Mbr/Mbr";
6
+ import { Point } from "../Items/Point/Point";
7
+ import type { Connector } from "../Items/Connector/Connector";
8
+ import type { Comment } from "../Items/Comment/Comment";
9
+ import type { FrameType } from "../Items/Frame/Basic";
5
10
  import { DrawingContext } from '../Items/DrawingContext';
6
11
  import { Pointer } from '../Pointer';
7
12
  import { Subject } from '../Subject';
@@ -74,6 +79,8 @@ export declare class Items {
74
79
  getLastZIndex(): number;
75
80
  getLinkedConnectorsById(id: string): Connector[];
76
81
  getConnectorsByItemIds(startPointerItemId?: string, endPointerItemId?: string): Connector[];
82
+ setFrameType(frameType: FrameType): void;
83
+ getFrameType(): FrameType;
77
84
  render(context: DrawingContext): void;
78
85
  renderHTML(documentFactory: DocumentFactory): string;
79
86
  getWholeHTML(documentFactory: DocumentFactory): string;
@@ -1,7 +1,7 @@
1
1
  import { Board } from '../../Board';
2
2
  import { Connector, Item, Point } from '../../Items';
3
3
  import { ConnectorLineStyle } from '../../Items/Connector';
4
- import { ConnectionLineWidth } from '../../Items/Connector/Connector';
4
+ import { ConnectionLineWidth } from '../../Items/Connector/ConnectorTypes';
5
5
  import { ConnectorSnap } from '../../Items/Connector/ConnectorSnap';
6
6
  import { ConnectorPointerStyle } from '../../Items/Connector/Pointers/Pointers';
7
7
  import { DrawingContext } from '../../Items/DrawingContext';
@@ -12,7 +12,7 @@ export declare class AddDrawing extends BoardTool {
12
12
  strokeColor: ColorValue | string;
13
13
  strokeStyle: BorderStyle;
14
14
  constructor(board: Board);
15
- private updateSettings;
15
+ protected updateSettings(): void;
16
16
  setStrokeWidth(strokeWidth: number): void;
17
17
  setStrokeColor(strokeColor: ColorValue | string): void;
18
18
  getStrokeWidth(): number;
@@ -10,5 +10,5 @@ export declare class AddHighlighter extends AddDrawing {
10
10
  constructor(board: Board);
11
11
  isHighlighter(): boolean;
12
12
  protected applyDrawingRole(drawing: Drawing): void;
13
- private updateSettings;
13
+ protected updateSettings(): void;
14
14
  }
@@ -17,7 +17,8 @@ import { ToolContext } from "./ToolContext";
17
17
  import { Subject } from "../Subject";
18
18
  import { CustomTool } from "./CustomTool";
19
19
  import { Tool } from "./Tool";
20
- export declare const registeredTools: Record<string, typeof CustomTool>;
20
+ export type CustomToolConstructor = new (board: Board, name: string, ...args: any[]) => CustomTool;
21
+ export declare const registeredTools: Record<string, CustomToolConstructor>;
21
22
  export declare class Tools extends ToolContext {
22
23
  protected board: Board;
23
24
  readonly subject: Subject<Tools>;
@@ -26,7 +27,7 @@ export declare class Tools extends ToolContext {
26
27
  addRegisteredTool(toolName: string, clearSelection?: boolean): void;
27
28
  getAddRegisteredTool(toolName: string): Tool | undefined;
28
29
  setTool(tool: BoardTool): void;
29
- setBeforeNavigateMode(mode: any): void;
30
+ switchMode(mode: "navigate" | "select"): void;
30
31
  navigate(): void;
31
32
  getNavigate(): Navigate | undefined;
32
33
  select(clearSelection?: boolean): void;
@@ -1,5 +1,6 @@
1
1
  import { ItemData } from "../Items";
2
2
  export type ItemsMap = Record<string, ItemData>;
3
- export declare function validateItemsMap(parsedObject: any): parsedObject is ItemsMap;
4
- export declare const itemValidators: Record<string, (data: any) => boolean>;
5
- export declare function validateRichTextData(richTextData: any): boolean;
3
+ export declare function validateItemsMap(parsedObject: unknown): parsedObject is ItemsMap;
4
+ export type ItemValidator = (data: unknown) => boolean;
5
+ export declare const itemValidators: Record<string, ItemValidator>;
6
+ export declare function validateRichTextData(richTextData: unknown): boolean;
@@ -5,7 +5,7 @@ import { Path2DFactory } from "./Path2DFactory";
5
5
  * All methods are stubbed and don't perform actual path operations.
6
6
  */
7
7
  export declare class MockPath2D implements Path2DFactory {
8
- nativePath: any;
8
+ nativePath: unknown;
9
9
  private commands;
10
10
  constructor(d?: string);
11
11
  addPath(path: Path2DFactory, transform?: DOMMatrix2DInit): void;
@@ -25,7 +25,7 @@ export declare class MockPath2D implements Path2DFactory {
25
25
  */
26
26
  getCommands(): {
27
27
  method: string;
28
- args: any[];
28
+ args: unknown[];
29
29
  }[];
30
30
  /**
31
31
  * Clear all recorded commands
@@ -37,7 +37,7 @@ export declare class MockPath2D implements Path2DFactory {
37
37
  * @param method - The method name to check
38
38
  * @param args - Optional arguments to verify
39
39
  */
40
- wasCalledWith(method: string, args?: any[]): boolean;
40
+ wasCalledWith(method: string, args?: unknown[]): boolean;
41
41
  /**
42
42
  * Get the number of times a specific command was called
43
43
  * @param method - The method name to count
@@ -1,5 +1,5 @@
1
1
  export interface Path2DFactory {
2
- nativePath: any;
2
+ nativePath: unknown;
3
3
  /**
4
4
  * Adds the given path to the current path, optionally applying a transformation.
5
5
  * @param path - The Path2D to add.
@@ -1,8 +1,34 @@
1
1
  import { Board } from "./Board";
2
- import { ItemData, Item } from "./Items";
2
+ import type { RichTextData } from "./Items/RichText/RichTextData";
3
+ import type { ItemData, Item } from "./Items/Item";
4
+ import type { ShapeData } from "./Items/Shape/ShapeData";
5
+ import type { ConnectorData } from "./Items/Connector/ConnectorOperations";
6
+ import type { FrameData } from "./Items/Frame/FrameData";
7
+ import { AINodeData } from "./Items/AINode";
8
+ import { AudioItemData } from "./Items/Audio";
9
+ import { DrawingData } from "./Items/Drawing";
10
+ import { GroupData } from "./Items/Group";
11
+ import { ImageItemData } from "./Items/Image";
12
+ import { PlaceholderData } from "./Items/Placeholder";
13
+ import { StickerData } from "./Items/Sticker/StickerOperation";
14
+ import { VideoItemData } from "./Items/Video";
15
+ import { CommentData } from "./Items/Comment";
3
16
  interface ItemFactory {
4
17
  (id: string, data: ItemData, board: Board): Item;
5
18
  }
6
19
  export type ItemFactories = Record<string, ItemFactory>;
7
20
  export declare const itemFactories: ItemFactories;
21
+ export declare function isStickerData(data: ItemData): data is StickerData;
22
+ export declare function isCommentData(data: ItemData): data is CommentData;
23
+ export declare function isAINodeData(data: ItemData): data is AINodeData;
24
+ export declare function isShapeData(data: ItemData): data is ShapeData;
25
+ export declare function isRichTextData(data: ItemData): data is RichTextData;
26
+ export declare function isConnectorData(data: ItemData): data is ConnectorData;
27
+ export declare function isImageItemData(data: ItemData): data is ImageItemData;
28
+ export declare function isVideoItemData(data: ItemData): data is VideoItemData;
29
+ export declare function isAudioItemData(data: ItemData): data is AudioItemData;
30
+ export declare function isDrawingData(data: ItemData): data is DrawingData;
31
+ export declare function isFrameData(data: ItemData): data is FrameData;
32
+ export declare function isPlaceholderData(data: ItemData): data is PlaceholderData;
33
+ export declare function isGroupData(data: ItemData): data is GroupData;
8
34
  export {};