@zsviczian/excalidraw 0.11.0-obsidian-16 → 0.11.0-obsidian-19

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/types/types.d.ts CHANGED
@@ -29,6 +29,7 @@ export declare type Collaborator = {
29
29
  background: string;
30
30
  stroke: string;
31
31
  };
32
+ src?: string;
32
33
  };
33
34
  export declare type DataURL = string & {
34
35
  _brand: "DataURL";
@@ -41,6 +42,13 @@ export declare type BinaryFileData = {
41
42
  };
42
43
  export declare type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
43
44
  export declare type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
45
+ export declare type LastActiveToolBeforeEraser = {
46
+ type: typeof SHAPES[number]["value"] | "eraser";
47
+ customType: null;
48
+ } | {
49
+ type: "custom";
50
+ customType: string;
51
+ } | null;
44
52
  export declare type AppState = {
45
53
  isLoading: boolean;
46
54
  errorMessage: string | null;
@@ -55,7 +63,13 @@ export declare type AppState = {
55
63
  editingLinearElement: LinearElementEditor | null;
56
64
  activeTool: {
57
65
  type: typeof SHAPES[number]["value"] | "eraser";
58
- lastActiveToolBeforeEraser: typeof SHAPES[number]["value"] | null;
66
+ lastActiveToolBeforeEraser: LastActiveToolBeforeEraser;
67
+ locked: boolean;
68
+ customType: null;
69
+ } | {
70
+ type: "custom";
71
+ customType: string;
72
+ lastActiveToolBeforeEraser: LastActiveToolBeforeEraser;
59
73
  locked: boolean;
60
74
  };
61
75
  penMode: boolean;
@@ -363,6 +377,7 @@ export declare type ExcalidrawImperativeAPI = {
363
377
  sendToBack: (elements: readonly ExcalidrawElement[]) => void;
364
378
  bringToFront: (elements: readonly ExcalidrawElement[]) => void;
365
379
  restore: InstanceType<typeof App>["restore"];
380
+ setMobileModeAllowed: (allow: boolean) => void;
366
381
  };
367
382
  export declare type DeviceType = {
368
383
  isMobile: boolean;
package/types/utils.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  import { EVENT } from "./constants";
2
2
  import { FontFamilyValues, FontString } from "./element/types";
3
- import { AppState, Zoom } from "./types";
3
+ import { AppState, LastActiveToolBeforeEraser, Zoom } from "./types";
4
+ import { SHAPES } from "./shapes";
4
5
  export declare const setDateTimeForTests: (dateTime: string) => void;
5
6
  export declare const getDateTime: () => string;
6
7
  export declare const capitalizeString: (str: string) => string;
@@ -29,6 +30,14 @@ export declare const chunk: <T extends unknown>(array: readonly T[], size: numbe
29
30
  export declare const selectNode: (node: Element) => void;
30
31
  export declare const removeSelection: () => void;
31
32
  export declare const distance: (x: number, y: number) => number;
33
+ export declare const updateActiveTool: (appState: Pick<AppState, "activeTool">, data: ({
34
+ type: typeof SHAPES[number]["value"] | "eraser";
35
+ } | {
36
+ type: "custom";
37
+ customType: string;
38
+ }) & {
39
+ lastActiveToolBeforeEraser?: LastActiveToolBeforeEraser;
40
+ }) => AppState["activeTool"];
32
41
  export declare const resetCursor: (canvas: HTMLCanvasElement | null) => void;
33
42
  export declare const setCursor: (canvas: HTMLCanvasElement | null, cursor: string) => void;
34
43
  export declare const setEraserCursor: (canvas: HTMLCanvasElement | null, theme: AppState["theme"]) => void;