@excalidraw/excalidraw 0.14.2-cef6094 → 0.14.2-fe83e29

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 (35) hide show
  1. package/dist/excalidraw.development.js +37 -26
  2. package/dist/excalidraw.production.min.js +1 -1
  3. package/package.json +1 -1
  4. package/types/actions/actionAddToLibrary.d.ts +2 -1
  5. package/types/actions/actionBoundText.d.ts +2 -1
  6. package/types/actions/actionCanvas.d.ts +9 -9
  7. package/types/actions/actionClipboard.d.ts +3 -3
  8. package/types/actions/actionDeleteSelected.d.ts +3 -3
  9. package/types/actions/actionDuplicateSelection.d.ts +1 -1
  10. package/types/actions/actionExport.d.ts +8 -8
  11. package/types/actions/actionFinalize.d.ts +2 -2
  12. package/types/actions/actionLinearEditor.d.ts +2 -1
  13. package/types/actions/actionMenu.d.ts +3 -3
  14. package/types/actions/actionProperties.d.ts +13 -13
  15. package/types/actions/actionStyles.d.ts +1 -1
  16. package/types/actions/actionToggleGridMode.d.ts +1 -1
  17. package/types/actions/actionToggleLock.d.ts +1 -1
  18. package/types/actions/actionToggleStats.d.ts +1 -1
  19. package/types/actions/actionToggleViewMode.d.ts +1 -1
  20. package/types/actions/actionToggleZenMode.d.ts +1 -1
  21. package/types/actions/shortcuts.d.ts +1 -0
  22. package/types/actions/types.d.ts +1 -0
  23. package/types/components/BraveMeasureTextError.d.ts +2 -0
  24. package/types/components/ErrorDialog.d.ts +3 -2
  25. package/types/constants.d.ts +1 -0
  26. package/types/data/blob.d.ts +1 -0
  27. package/types/element/Hyperlink.d.ts +1 -1
  28. package/types/element/linearElementEditor.d.ts +1 -1
  29. package/types/element/mutateElement.d.ts +1 -0
  30. package/types/element/newElement.d.ts +1 -0
  31. package/types/element/textElement.d.ts +3 -0
  32. package/types/element/typeChecks.d.ts +1 -0
  33. package/types/element/types.d.ts +1 -0
  34. package/types/types.d.ts +3 -2
  35. package/types/utility-types.d.ts +22 -0
package/types/types.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, FileId, ExcalidrawImageElement, Theme, StrokeRoundness } from "./element/types";
3
2
  import { SHAPES } from "./shapes";
4
3
  import { Point as RoughPoint } from "roughjs/bin/geometry";
@@ -16,6 +15,8 @@ import Library from "./data/library";
16
15
  import type { FileSystemHandle } from "./data/filesystem";
17
16
  import type { ALLOWED_IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
18
17
  import { ContextMenuItems } from "./components/ContextMenu";
18
+ import { Merge, ForwardRef } from "./utility-types";
19
+ import React from "react";
19
20
  export declare type Point = Readonly<RoughPoint>;
20
21
  export declare type Collaborator = {
21
22
  pointer?: {
@@ -70,7 +71,7 @@ export declare type AppState = {
70
71
  } | null;
71
72
  showWelcomeScreen: boolean;
72
73
  isLoading: boolean;
73
- errorMessage: string | null;
74
+ errorMessage: React.ReactNode;
74
75
  draggingElement: NonDeletedExcalidrawElement | null;
75
76
  resizingElement: NonDeletedExcalidrawElement | null;
76
77
  multiElement: NonDeleted<ExcalidrawLinearElement> | null;
@@ -0,0 +1,22 @@
1
+ /// <reference types="react" />
2
+ export declare type Mutable<T> = {
3
+ -readonly [P in keyof T]: T[P];
4
+ };
5
+ export declare type ValueOf<T> = T[keyof T];
6
+ export declare type Merge<M, N> = Omit<M, keyof N> & N;
7
+ /** utility type to assert that the second type is a subtype of the first type.
8
+ * Returns the subtype. */
9
+ export declare type SubtypeOf<Supertype, Subtype extends Supertype> = Subtype;
10
+ export declare type ResolutionType<T extends (...args: any) => any> = T extends (...args: any) => Promise<infer R> ? R : any;
11
+ export declare type MarkOptional<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
12
+ export declare type MarkRequired<T, RK extends keyof T> = Exclude<T, RK> & Required<Pick<T, RK>>;
13
+ export declare type MarkNonNullable<T, K extends keyof T> = {
14
+ [P in K]-?: P extends K ? NonNullable<T[P]> : T[P];
15
+ } & {
16
+ [P in keyof T]: T[P];
17
+ };
18
+ export declare type NonOptional<T> = Exclude<T, undefined>;
19
+ export declare type SignatureType<T> = T extends (...args: infer R) => any ? R : never;
20
+ export declare type CallableType<T extends (...args: any[]) => any> = (...args: SignatureType<T>) => ReturnType<T>;
21
+ export declare type ForwardRef<T, P = any> = Parameters<CallableType<React.ForwardRefRenderFunction<T, P>>>[1];
22
+ export declare type ExtractSetType<T extends Set<any>> = T extends Set<infer U> ? U : never;