microboard-temp 0.13.41 → 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 (118) hide show
  1. package/dist/cjs/browser.js +56773 -53598
  2. package/dist/cjs/index.js +56767 -53597
  3. package/dist/cjs/node.js +56335 -53160
  4. package/dist/esm/browser.js +54045 -50933
  5. package/dist/esm/index.js +54041 -50934
  6. package/dist/esm/node.js +57517 -54411
  7. package/dist/types/Board.d.ts +9 -7
  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 +5 -4
  11. package/dist/types/Events/Command.d.ts +11 -7
  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/index.d.ts +2 -1
  18. package/dist/types/Items/AINode/AINode.d.ts +1 -1
  19. package/dist/types/Items/Anchor/Anchor.d.ts +2 -1
  20. package/dist/types/Items/Arc/Arc.d.ts +4 -1
  21. package/dist/types/Items/Audio/Audio.d.ts +2 -2
  22. package/dist/types/Items/BaseItem/BaseItem.d.ts +8 -7
  23. package/dist/types/Items/Connector/Connector.d.ts +12 -17
  24. package/dist/types/Items/Connector/ConnectorCommand.d.ts +2 -2
  25. package/dist/types/Items/Connector/ConnectorOperations.d.ts +1 -1
  26. package/dist/types/Items/Connector/ConnectorTypes.d.ts +10 -0
  27. package/dist/types/Items/Connector/Pointers/Pointers.d.ts +3 -2
  28. package/dist/types/Items/Connector/Pointers/index.d.ts +1 -1
  29. package/dist/types/Items/Connector/getLine/getLine.d.ts +1 -1
  30. package/dist/types/Items/Connector/index.d.ts +3 -2
  31. package/dist/types/Items/Curve/Curve.d.ts +4 -4
  32. package/dist/types/Items/Drawing/Drawing.d.ts +6 -5
  33. package/dist/types/Items/Drawing/DrawingCommand.d.ts +2 -2
  34. package/dist/types/Items/Examples/CardGame/Card/Card.d.ts +11 -8
  35. package/dist/types/Items/Examples/CardGame/Dice/Dice.d.ts +10 -1
  36. package/dist/types/Items/Examples/CardGame/Screen/Screen.d.ts +6 -1
  37. package/dist/types/Items/Frame/Frame.d.ts +11 -2
  38. package/dist/types/Items/Frame/FrameData.d.ts +3 -3
  39. package/dist/types/Items/Geometry.d.ts +1 -1
  40. package/dist/types/Items/Group/Group.d.ts +7 -3
  41. package/dist/types/Items/Image/Image.d.ts +4 -3
  42. package/dist/types/Items/Item.d.ts +15 -15
  43. package/dist/types/Items/Line/Line.d.ts +1 -1
  44. package/dist/types/Items/Mbr/Mbr.d.ts +5 -5
  45. package/dist/types/Items/Placeholder/Placeholder.d.ts +12 -7
  46. package/dist/types/Items/Point/Point.d.ts +1 -1
  47. package/dist/types/Items/RegisterItem.d.ts +4 -2
  48. package/dist/types/Items/RichText/EditorContainer.d.ts +2 -2
  49. package/dist/types/Items/RichText/RichText.d.ts +11 -5
  50. package/dist/types/Items/RichText/RichTextCommand.d.ts +2 -2
  51. package/dist/types/Items/RichText/RichTextOperations.d.ts +1 -1
  52. package/dist/types/Items/RichText/editorHelpers/common/getAreAllChildrenEmpty.d.ts +1 -1
  53. package/dist/types/Items/RichText/editorHelpers/lists/getBlockParentList.d.ts +2 -2
  54. package/dist/types/Items/Shape/BPMN/BPMN_Annotation/index.d.ts +2 -1
  55. package/dist/types/Items/Shape/BPMN/BPMN_DataObject/index.d.ts +3 -1
  56. package/dist/types/Items/Shape/BPMN/BPMN_DataStore/index.d.ts +3 -1
  57. package/dist/types/Items/Shape/BPMN/BPMN_EndEvent/index.d.ts +3 -1
  58. package/dist/types/Items/Shape/BPMN/BPMN_EventSubprocess/index.d.ts +3 -1
  59. package/dist/types/Items/Shape/BPMN/BPMN_Gateway/index.d.ts +3 -1
  60. package/dist/types/Items/Shape/BPMN/BPMN_GatewayParallel/index.d.ts +3 -1
  61. package/dist/types/Items/Shape/BPMN/BPMN_GatewayXOR/index.d.ts +3 -1
  62. package/dist/types/Items/Shape/BPMN/BPMN_Group/index.d.ts +3 -1
  63. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEvent/index.d.ts +3 -1
  64. package/dist/types/Items/Shape/BPMN/BPMN_IntermediateEventNoneInterrupting/index.d.ts +3 -1
  65. package/dist/types/Items/Shape/BPMN/BPMN_Participant/index.d.ts +3 -1
  66. package/dist/types/Items/Shape/BPMN/BPMN_StartEvent/index.d.ts +3 -1
  67. package/dist/types/Items/Shape/BPMN/BPMN_StartEventNoneInterrupting/index.d.ts +3 -1
  68. package/dist/types/Items/Shape/BPMN/BPMN_Task/index.d.ts +3 -1
  69. package/dist/types/Items/Shape/BPMN/BPMN_Transaction/index.d.ts +3 -1
  70. package/dist/types/Items/Shape/Basic/ArrowBlockLeft/index.d.ts +3 -1
  71. package/dist/types/Items/Shape/Basic/ArrowBlockRigth/index.d.ts +3 -1
  72. package/dist/types/Items/Shape/Basic/ArrowLeft/index.d.ts +3 -1
  73. package/dist/types/Items/Shape/Basic/ArrowLeftRight/index.d.ts +3 -1
  74. package/dist/types/Items/Shape/Basic/ArrowRight/index.d.ts +3 -1
  75. package/dist/types/Items/Shape/Basic/BracesLeft/index.d.ts +2 -1
  76. package/dist/types/Items/Shape/Basic/BracesRight/index.d.ts +2 -1
  77. package/dist/types/Items/Shape/Basic/Circle/index.d.ts +3 -1
  78. package/dist/types/Items/Shape/Basic/Cloud/index.d.ts +3 -1
  79. package/dist/types/Items/Shape/Basic/Cross/index.d.ts +3 -1
  80. package/dist/types/Items/Shape/Basic/Cylinder/index.d.ts +3 -1
  81. package/dist/types/Items/Shape/Basic/Hexagon/index.d.ts +3 -1
  82. package/dist/types/Items/Shape/Basic/Octagon/index.d.ts +3 -1
  83. package/dist/types/Items/Shape/Basic/Parallelogram/index.d.ts +3 -1
  84. package/dist/types/Items/Shape/Basic/Pentagon/index.d.ts +3 -1
  85. package/dist/types/Items/Shape/Basic/PredefinedProcess/index.d.ts +3 -1
  86. package/dist/types/Items/Shape/Basic/Rectangle/index.d.ts +3 -1
  87. package/dist/types/Items/Shape/Basic/ReversedParallelogram/index.d.ts +3 -1
  88. package/dist/types/Items/Shape/Basic/ReversedTriangle/index.d.ts +3 -1
  89. package/dist/types/Items/Shape/Basic/Rhombus/index.d.ts +3 -1
  90. package/dist/types/Items/Shape/Basic/RoundedRectangle/index.d.ts +3 -1
  91. package/dist/types/Items/Shape/Basic/SpeachBubble/index.d.ts +3 -1
  92. package/dist/types/Items/Shape/Basic/Star/index.d.ts +3 -1
  93. package/dist/types/Items/Shape/Basic/Trapezoid/index.d.ts +3 -1
  94. package/dist/types/Items/Shape/Basic/Triangle/index.d.ts +3 -1
  95. package/dist/types/Items/Shape/Shape.d.ts +7 -1
  96. package/dist/types/Items/Shape/ShapeCommand.d.ts +2 -2
  97. package/dist/types/Items/Shape/ShapeOperation.d.ts +1 -1
  98. package/dist/types/Items/Shape/ShapeType.d.ts +3 -0
  99. package/dist/types/Items/Shape/index.d.ts +1 -3
  100. package/dist/types/Items/Sticker/Sticker.d.ts +6 -4
  101. package/dist/types/Items/Transformation/Matrix.d.ts +1 -1
  102. package/dist/types/Items/Transformation/TransformationCommand.d.ts +1 -1
  103. package/dist/types/Items/Video/Video.d.ts +1 -1
  104. package/dist/types/Items/index.d.ts +2 -3
  105. package/dist/types/Selection/Selection.d.ts +10 -7
  106. package/dist/types/SessionStorage.d.ts +1 -1
  107. package/dist/types/Settings.d.ts +14 -9
  108. package/dist/types/SpatialIndex/SimpleSpatialIndex.d.ts +5 -3
  109. package/dist/types/SpatialIndex/SpacialIndex.d.ts +8 -1
  110. package/dist/types/Tools/AddConnector/AddConnector.d.ts +1 -1
  111. package/dist/types/Tools/Tools.d.ts +3 -2
  112. package/dist/types/Validators/Validators.d.ts +4 -3
  113. package/dist/types/api/MockPath2D.d.ts +3 -3
  114. package/dist/types/api/Path2DFactory.d.ts +1 -1
  115. package/dist/types/itemFactories.d.ts +27 -1
  116. package/dist/types/parserHTML.d.ts +1 -2
  117. package/dist/types/sha256.d.ts +1 -1
  118. 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";
@@ -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(): {
@@ -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, SerializedItemData } 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;
@@ -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,7 +1,7 @@
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";
@@ -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,13 +17,10 @@ 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";
22
23
  export * from "./Group";
23
- export { BaseItem } from "./BaseItem";
24
- export type { BaseItemData, SerializedItemData } from "./BaseItem";
25
24
  export type { Item, ItemType, ItemData } from "./Item";
26
25
  export { registerItem } from "./RegisterItem";
27
26
  export { Star } from "./Examples/Star";
@@ -1,15 +1,18 @@
1
1
  import { Board } from "../Board";
2
- import { Item, BaseItem, 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 { ColorValue } from "../..";
6
- import { ConnectorLineStyle } from "../Items/Connector";
8
+ import { ColorValue } from "../Color/ColorValue";
9
+ import { ConnectorLineStyle } from "../Items/Connector/ConnectorTypes";
7
10
  import { ConnectorPointerStyle } from "../Items/Connector/Pointers/Pointers";
8
11
  import { DrawingContext } from "../Items/DrawingContext";
9
12
  import { FrameType } from "../Items/Frame/Basic";
10
- import { BorderStyle } from "../Items/Path";
11
- import { TextStyle } from "../Items/RichText";
12
- 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";
13
16
  import { ApplyMatrixItem } from "../Items/Transformation/TransformationOperations";
14
17
  import { Subject } from "../Subject";
15
18
  import { Tool } from "../Tools/Tool";
@@ -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,30 +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";
8
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";
9
14
  export interface Connection {
10
15
  connectionId: number;
11
16
  getCurrentUser: () => string;
12
17
  connect(): Promise<void>;
13
- subscribe(board: any): void;
14
- unsubscribe(board: any): void;
15
- publishPresenceEvent(boardId: string, event: any): void;
18
+ subscribe(board: Board): void;
19
+ unsubscribe(board: Board): void;
20
+ publishPresenceEvent(boardId: string, event: PresenceEventType): void;
16
21
  publishAuth(): Promise<void>;
17
22
  publishLogout(): void;
18
- onMessage?: (msg: any) => void;
23
+ onMessage?: (msg: SocketMsg) => void;
19
24
  onAccessDenied: (boardId: string, forceUpdate?: boolean) => void;
20
25
  notifyAboutLostConnection: () => void;
21
26
  dismissNotificationAboutLostConnection: () => void;
22
27
  resetConnection: () => void;
23
- send: (msg: any) => void;
28
+ send: (msg: SocketMsg) => void;
24
29
  }
25
30
  export interface I18NextInterface {
26
- t: (key: string, options?: any) => string;
27
- 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>;
28
33
  }
29
34
  export interface NotifyFunction {
30
35
  (options: {
@@ -110,8 +115,8 @@ type GetYouTubeIdFunction = (url?: string) => string | null;
110
115
  type GetDOMParser = () => {
111
116
  parseFromString: (str: string, type: DOMParserSupportedType) => Document;
112
117
  };
113
- type ReactEditorFocus = (editor: any) => void;
114
- 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;
115
120
  /**
116
121
  * Set properties before using the board.
117
122
  * @property {Path2DFactory} - The factory for creating Path2D objects.
@@ -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';
@@ -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
- switchMode(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 {};
@@ -1,5 +1,4 @@
1
- import { ItemType } from "./Items";
2
- import { ItemDataWithId } from "./Items/Item";
1
+ import { ItemType, ItemDataWithId } from "./Items/Item";
3
2
  import { BaseItemData } from "./Items/BaseItem/BaseItem";
4
3
  type MapTagByType = Record<ItemType, string>;
5
4
  export declare const tagByType: MapTagByType;
@@ -1,2 +1,2 @@
1
- export declare function sha256(message: any): Promise<string>;
1
+ export declare function sha256(message: string): Promise<string>;
2
2
  export declare function fileTosha256(file: File): Promise<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "microboard-temp",
3
- "version": "0.13.41",
3
+ "version": "0.13.42",
4
4
  "description": "A flexible interactive whiteboard library",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",