@zsviczian/excalidraw 0.16.1-obsidian-8 → 0.17.0-obsidian-2
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/dist/excalidraw.development.js +407 -110
- package/dist/excalidraw.production.min.js +1 -1
- package/dist/excalidraw.production.min.js.LICENSE.txt +1 -1
- package/main.js +7 -1
- package/package.json +1 -1
- package/types/actions/actionAddToLibrary.d.ts +33 -6
- package/types/actions/actionBoundText.d.ts +22 -4
- package/types/actions/actionCanvas.d.ts +144 -27
- package/types/actions/actionClipboard.d.ts +77 -14
- package/types/actions/actionDeleteSelected.d.ts +33 -6
- package/types/actions/actionElementLock.d.ts +22 -4
- package/types/actions/actionExport.d.ts +96 -23
- package/types/actions/actionFinalize.d.ts +22 -4
- package/types/actions/actionFrame.d.ts +33 -6
- package/types/actions/actionGroup.d.ts +23 -5
- package/types/actions/actionLinearEditor.d.ts +11 -2
- package/types/actions/actionMenu.d.ts +27 -20
- package/types/actions/actionProperties.d.ts +143 -26
- package/types/actions/actionSelectAll.d.ts +11 -2
- package/types/actions/actionStyles.d.ts +11 -2
- package/types/actions/actionToggleGridMode.d.ts +11 -2
- package/types/actions/actionToggleObjectsSnapMode.d.ts +11 -2
- package/types/actions/actionToggleStats.d.ts +11 -2
- package/types/actions/actionToggleViewMode.d.ts +11 -2
- package/types/actions/actionToggleZenMode.d.ts +11 -2
- package/types/actions/index.d.ts +1 -1
- package/types/appState.d.ts +3 -3
- package/types/components/Actions.d.ts +3 -2
- package/types/components/App.d.ts +43 -13
- package/types/components/Button.d.ts +1 -1
- package/types/components/ImageExportDialog.d.ts +1 -1
- package/types/components/InlineIcon.d.ts +3 -0
- package/types/components/LayerUI.d.ts +6 -2
- package/types/components/MagicButton.d.ts +9 -0
- package/types/components/MagicSettings.d.ts +8 -0
- package/types/components/MobileMenu.d.ts +4 -3
- package/types/components/Paragraph.d.ts +4 -0
- package/types/components/TTDDialog/MermaidToExcalidraw.d.ts +13 -0
- package/types/components/TTDDialog/TTDDialog.d.ts +29 -0
- package/types/components/TTDDialog/TTDDialogInput.d.ts +9 -0
- package/types/components/TTDDialog/TTDDialogOutput.d.ts +7 -0
- package/types/components/TTDDialog/TTDDialogPanel.d.ts +16 -0
- package/types/components/TTDDialog/TTDDialogPanels.d.ts +4 -0
- package/types/components/TTDDialog/TTDDialogTab.d.ts +7 -0
- package/types/components/TTDDialog/TTDDialogTabTrigger.d.ts +8 -0
- package/types/components/TTDDialog/TTDDialogTabTriggers.d.ts +6 -0
- package/types/components/TTDDialog/TTDDialogTabs.d.ts +9 -0
- package/types/components/TTDDialog/TTDDialogTrigger.d.ts +8 -0
- package/types/components/TTDDialog/common.d.ts +33 -0
- package/types/components/TextField.d.ts +16 -0
- package/types/components/dropdownMenu/DropdownMenu.d.ts +6 -0
- package/types/components/dropdownMenu/DropdownMenuItem.d.ts +12 -0
- package/types/components/icons.d.ts +6 -0
- package/types/components/main-menu/MainMenu.d.ts +6 -0
- package/types/constants.d.ts +30 -3
- package/types/context/tunnels.d.ts +1 -0
- package/types/data/EditorLocalStorage.d.ts +8 -0
- package/types/data/ai/types.d.ts +242 -0
- package/types/data/index.d.ts +10 -2
- package/types/data/magic.d.ts +23 -0
- package/types/data/transform.d.ts +11 -7
- package/types/element/ElementCanvasButtons.d.ts +6 -0
- package/types/element/Hyperlink.d.ts +11 -2
- package/types/element/collision.d.ts +2 -2
- package/types/element/embeddable.d.ts +17 -21
- package/types/element/index.d.ts +3 -4
- package/types/element/linearElementEditor.d.ts +11 -2
- package/types/element/newElement.d.ts +7 -1
- package/types/element/textElement.d.ts +2 -2
- package/types/element/typeChecks.d.ts +10 -7
- package/types/element/types.d.ts +31 -2
- package/types/errors.d.ts +5 -0
- package/types/frame.d.ts +31 -20
- package/types/packages/excalidraw/index.d.ts +5 -3
- package/types/packages/excalidraw/webpack.preact.config.d.ts +170 -0
- package/types/packages/utils.d.ts +5 -4
- package/types/packages/withinBounds.d.ts +2 -2
- package/types/renderer/renderElement.d.ts +6 -1
- package/types/renderer/renderScene.d.ts +10 -5
- package/types/scene/Scene.d.ts +11 -6
- package/types/scene/ShapeCache.d.ts +1 -1
- package/types/scene/comparisons.d.ts +7 -6
- package/types/scene/export.d.ts +6 -5
- package/types/scene/types.d.ts +2 -0
- package/types/shapes.d.ts +1 -1
- package/types/types.d.ts +42 -25
- package/types/utils.d.ts +8 -3
package/types/scene/export.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { NonDeletedExcalidrawElement } from "../element/types";
|
|
1
|
+
import { ExcalidrawFrameLikeElement, NonDeletedExcalidrawElement } from "../element/types";
|
|
2
2
|
import { AppState, BinaryFiles } from "../types";
|
|
3
|
-
|
|
4
|
-
export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, }: {
|
|
3
|
+
export declare const exportToCanvas: (elements: readonly NonDeletedExcalidrawElement[], appState: AppState, files: BinaryFiles, { exportBackground, exportPadding, viewBackgroundColor, exportingFrame, }: {
|
|
5
4
|
exportBackground: boolean;
|
|
6
5
|
exportPadding?: number | undefined;
|
|
7
6
|
viewBackgroundColor: string;
|
|
7
|
+
exportingFrame?: ExcalidrawFrameLikeElement | null | undefined;
|
|
8
8
|
}, createCanvas?: (width: number, height: number) => {
|
|
9
9
|
canvas: HTMLCanvasElement;
|
|
10
10
|
scale: number;
|
|
@@ -16,9 +16,10 @@ export declare const exportToSvg: (elements: readonly NonDeletedExcalidrawElemen
|
|
|
16
16
|
viewBackgroundColor: string;
|
|
17
17
|
exportWithDarkMode?: boolean;
|
|
18
18
|
exportEmbedScene?: boolean;
|
|
19
|
-
|
|
19
|
+
frameRendering?: AppState["frameRendering"];
|
|
20
|
+
frameColor?: AppState["frameColor"];
|
|
20
21
|
}, files: BinaryFiles | null, opts?: {
|
|
21
|
-
serializeAsJSON?: () => string;
|
|
22
22
|
renderEmbeddables?: boolean;
|
|
23
|
+
exportingFrame?: ExcalidrawFrameLikeElement | null;
|
|
23
24
|
}) => Promise<SVGSVGElement>;
|
|
24
25
|
export declare const getExportSize: (elements: readonly NonDeletedExcalidrawElement[], exportPadding: number, scale: number) => [number, number];
|
package/types/scene/types.d.ts
CHANGED
|
@@ -82,6 +82,7 @@ export type ElementShapes = {
|
|
|
82
82
|
rectangle: Drawable;
|
|
83
83
|
ellipse: Drawable;
|
|
84
84
|
diamond: Drawable;
|
|
85
|
+
iframe: Drawable;
|
|
85
86
|
embeddable: Drawable;
|
|
86
87
|
freedraw: Drawable | null;
|
|
87
88
|
arrow: Drawable[];
|
|
@@ -89,4 +90,5 @@ export type ElementShapes = {
|
|
|
89
90
|
text: null;
|
|
90
91
|
image: null;
|
|
91
92
|
frame: null;
|
|
93
|
+
magicframe: null;
|
|
92
94
|
};
|
package/types/shapes.d.ts
CHANGED
|
@@ -59,4 +59,4 @@ export declare const SHAPES: readonly [{
|
|
|
59
59
|
readonly numericKey: "0";
|
|
60
60
|
readonly fillable: false;
|
|
61
61
|
}];
|
|
62
|
-
export declare const findShapeByKey: (key: string) => "
|
|
62
|
+
export declare const findShapeByKey: (key: string) => "text" | "image" | "line" | "arrow" | "selection" | "rectangle" | "diamond" | "ellipse" | "freedraw" | "eraser" | null;
|
package/types/types.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness,
|
|
2
|
+
import { PointerType, ExcalidrawLinearElement, NonDeletedExcalidrawElement, NonDeleted, TextAlign, ExcalidrawElement, GroupId, ExcalidrawBindableElement, Arrowhead, ChartType, FontFamilyValues, ExcalidrawTextElement, FileId, ExcalidrawImageElement, Theme, StrokeRoundness, ExcalidrawEmbeddableElement, ExcalidrawMagicFrameElement, ExcalidrawFrameLikeElement, ExcalidrawElementType } from "./element/types";
|
|
3
|
+
import { Action } from "./actions/types";
|
|
3
4
|
import { Point as RoughPoint } from "roughjs/bin/geometry";
|
|
4
5
|
import { LinearElementEditor } from "./element/linearElementEditor";
|
|
5
6
|
import { SuggestedBinding } from "./element/binding";
|
|
6
7
|
import { ImportedDataState } from "./data/types";
|
|
7
8
|
import type App from "./components/App";
|
|
8
|
-
import type {
|
|
9
|
+
import type { throttleRAF } from "./utils";
|
|
9
10
|
import { Spreadsheet } from "./charts";
|
|
10
11
|
import { Language } from "./i18n";
|
|
11
12
|
import { ClipboardData } from "./clipboard";
|
|
@@ -16,7 +17,7 @@ import type { FileSystemHandle } from "./data/filesystem";
|
|
|
16
17
|
import type { IMAGE_MIME_TYPES, MIME_TYPES } from "./constants";
|
|
17
18
|
import { ContextMenuItems } from "./components/ContextMenu";
|
|
18
19
|
import { SnapLine } from "./snapping";
|
|
19
|
-
import { Merge,
|
|
20
|
+
import { Merge, ValueOf } from "./utility-types";
|
|
20
21
|
import { ColorPaletteCustom } from "./colors";
|
|
21
22
|
export type Point = Readonly<RoughPoint>;
|
|
22
23
|
export type Collaborator = {
|
|
@@ -59,7 +60,8 @@ export type BinaryFileData = {
|
|
|
59
60
|
};
|
|
60
61
|
export type BinaryFileMetadata = Omit<BinaryFileData, "dataURL">;
|
|
61
62
|
export type BinaryFiles = Record<ExcalidrawElement["id"], BinaryFileData>;
|
|
62
|
-
export type ToolType = "selection" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "hand" | "frame" | "embeddable" | "laser" | "mermaid";
|
|
63
|
+
export type ToolType = "selection" | "rectangle" | "diamond" | "ellipse" | "arrow" | "line" | "freedraw" | "text" | "image" | "eraser" | "hand" | "frame" | "magicframe" | "embeddable" | "laser" | "mermaid";
|
|
64
|
+
export type ElementOrToolType = ExcalidrawElementType | ToolType | "custom";
|
|
63
65
|
export type ActiveTool = {
|
|
64
66
|
type: ToolType;
|
|
65
67
|
customType: null;
|
|
@@ -107,13 +109,11 @@ export type InteractiveCanvasAppState = Readonly<_CommonCanvasAppState & {
|
|
|
107
109
|
suggestedBindings: AppState["suggestedBindings"];
|
|
108
110
|
isRotating: AppState["isRotating"];
|
|
109
111
|
elementsToHighlight: AppState["elementsToHighlight"];
|
|
110
|
-
openSidebar: AppState["openSidebar"];
|
|
111
|
-
showHyperlinkPopup: AppState["showHyperlinkPopup"];
|
|
112
112
|
collaborators: AppState["collaborators"];
|
|
113
113
|
snapLines: AppState["snapLines"];
|
|
114
114
|
zenModeEnabled: AppState["zenModeEnabled"];
|
|
115
115
|
}>;
|
|
116
|
-
export
|
|
116
|
+
export interface AppState {
|
|
117
117
|
contextMenu: {
|
|
118
118
|
items: ContextMenuItems;
|
|
119
119
|
top: number;
|
|
@@ -133,7 +133,7 @@ export type AppState = {
|
|
|
133
133
|
isBindingEnabled: boolean;
|
|
134
134
|
startBoundElement: NonDeleted<ExcalidrawBindableElement> | null;
|
|
135
135
|
suggestedBindings: SuggestedBinding[];
|
|
136
|
-
frameToHighlight: NonDeleted<
|
|
136
|
+
frameToHighlight: NonDeleted<ExcalidrawFrameLikeElement> | null;
|
|
137
137
|
frameRendering: {
|
|
138
138
|
enabled: boolean;
|
|
139
139
|
name: boolean;
|
|
@@ -186,7 +186,15 @@ export type AppState = {
|
|
|
186
186
|
name: SidebarName;
|
|
187
187
|
tab?: SidebarTabName;
|
|
188
188
|
} | null;
|
|
189
|
-
openDialog:
|
|
189
|
+
openDialog: null | {
|
|
190
|
+
name: "imageExport" | "help" | "jsonExport";
|
|
191
|
+
} | {
|
|
192
|
+
name: "magicSettings";
|
|
193
|
+
source: "tool" | "generation" | "settings";
|
|
194
|
+
} | {
|
|
195
|
+
name: "ttd";
|
|
196
|
+
tab: string;
|
|
197
|
+
};
|
|
190
198
|
/**
|
|
191
199
|
* Reflects user preference for whether the default sidebar should be docked.
|
|
192
200
|
*
|
|
@@ -268,6 +276,7 @@ export type AppState = {
|
|
|
268
276
|
frameColor: {
|
|
269
277
|
stroke: string;
|
|
270
278
|
fill: string;
|
|
279
|
+
nameColor: string;
|
|
271
280
|
};
|
|
272
281
|
invertBindingBehaviour: boolean;
|
|
273
282
|
selectedLinearElement: LinearElementEditor | null;
|
|
@@ -277,7 +286,7 @@ export type AppState = {
|
|
|
277
286
|
y: number;
|
|
278
287
|
} | null;
|
|
279
288
|
objectsSnapModeEnabled: boolean;
|
|
280
|
-
}
|
|
289
|
+
}
|
|
281
290
|
export type UIAppState = Omit<AppState, "suggestedBindings" | "startBoundElement" | "cursorButton" | "scrollX" | "scrollY">;
|
|
282
291
|
export type NormalizedZoomValue = number & {
|
|
283
292
|
_brand: "normalizedZoom";
|
|
@@ -319,17 +328,13 @@ export type LibraryItem = {
|
|
|
319
328
|
export type LibraryItems = readonly LibraryItem[];
|
|
320
329
|
export type LibraryItems_anyVersion = LibraryItems | LibraryItems_v1;
|
|
321
330
|
export type LibraryItemsSource = ((currentLibraryItems: LibraryItems) => Blob | LibraryItems_anyVersion | Promise<LibraryItems_anyVersion | Blob>) | Blob | LibraryItems_anyVersion | Promise<LibraryItems_anyVersion | Blob>;
|
|
322
|
-
export type ExcalidrawAPIRefValue = ExcalidrawImperativeAPI | {
|
|
323
|
-
readyPromise?: ResolvablePromise<ExcalidrawImperativeAPI>;
|
|
324
|
-
ready?: false;
|
|
325
|
-
};
|
|
326
331
|
export type ExcalidrawInitialDataState = Merge<ImportedDataState, {
|
|
327
332
|
libraryItems?: Required<ImportedDataState>["libraryItems"] | Promise<Required<ImportedDataState>["libraryItems"]>;
|
|
328
333
|
}>;
|
|
329
334
|
export interface ExcalidrawProps {
|
|
330
335
|
onChange?: (elements: readonly ExcalidrawElement[], appState: AppState, files: BinaryFiles) => void;
|
|
331
336
|
initialData?: ExcalidrawInitialDataState | null | Promise<ExcalidrawInitialDataState | null>;
|
|
332
|
-
|
|
337
|
+
excalidrawAPI?: (api: ExcalidrawImperativeAPI) => void;
|
|
333
338
|
isCollaborating?: boolean;
|
|
334
339
|
onPointerUpdate?: (payload: {
|
|
335
340
|
pointer: {
|
|
@@ -375,6 +380,8 @@ export interface ExcalidrawProps {
|
|
|
375
380
|
renderWebview?: boolean;
|
|
376
381
|
renderEmbeddableMenu?: (appState: AppState) => JSX.Element | null;
|
|
377
382
|
renderMermaid?: boolean;
|
|
383
|
+
onContextMenu?: (element: readonly NonDeletedExcalidrawElement[], appState: AppState, onClose: (callback?: () => void) => void) => JSX.Element | null;
|
|
384
|
+
aiEnabled?: boolean;
|
|
378
385
|
}
|
|
379
386
|
export type SceneData = {
|
|
380
387
|
elements?: ImportedDataState["elements"];
|
|
@@ -392,7 +399,7 @@ export type ExportOpts = {
|
|
|
392
399
|
onExportToBackend?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => void;
|
|
393
400
|
renderCustomUI?: (exportedElements: readonly NonDeletedExcalidrawElement[], appState: UIAppState, files: BinaryFiles, canvas: HTMLCanvasElement) => JSX.Element;
|
|
394
401
|
};
|
|
395
|
-
type CanvasActions = Partial<{
|
|
402
|
+
export type CanvasActions = Partial<{
|
|
396
403
|
changeViewBackgroundColor: boolean;
|
|
397
404
|
clearCanvas: boolean;
|
|
398
405
|
export: false | ExportOpts;
|
|
@@ -401,9 +408,12 @@ type CanvasActions = Partial<{
|
|
|
401
408
|
toggleTheme: boolean | null;
|
|
402
409
|
saveAsImage: boolean;
|
|
403
410
|
}>;
|
|
404
|
-
type UIOptions = Partial<{
|
|
411
|
+
export type UIOptions = Partial<{
|
|
405
412
|
dockedSidebarBreakpoint: number;
|
|
406
413
|
canvasActions: CanvasActions;
|
|
414
|
+
tools: {
|
|
415
|
+
image: boolean;
|
|
416
|
+
};
|
|
407
417
|
/** @deprecated does nothing. Will be removed in 0.15 */
|
|
408
418
|
welcomeScreen?: boolean;
|
|
409
419
|
}>;
|
|
@@ -417,6 +427,7 @@ export type AppProps = Merge<ExcalidrawProps, {
|
|
|
417
427
|
handleKeyboardGlobally: boolean;
|
|
418
428
|
isCollaborating: boolean;
|
|
419
429
|
children?: React.ReactNode;
|
|
430
|
+
aiEnabled: boolean;
|
|
420
431
|
}>;
|
|
421
432
|
/** A subset of App class properties that we need to use elsewhere
|
|
422
433
|
* in the app, eg Manager. Factored out into a separate type to keep DRY. */
|
|
@@ -446,6 +457,8 @@ export type AppClassProperties = {
|
|
|
446
457
|
togglePenMode: App["togglePenMode"];
|
|
447
458
|
setActiveTool: App["setActiveTool"];
|
|
448
459
|
setOpenDialog: App["setOpenDialog"];
|
|
460
|
+
insertEmbeddableElement: App["insertEmbeddableElement"];
|
|
461
|
+
onMagicframeToolSelect: App["onMagicframeToolSelect"];
|
|
449
462
|
};
|
|
450
463
|
export type PointerDownState = Readonly<{
|
|
451
464
|
origin: Readonly<{
|
|
@@ -521,12 +534,11 @@ export type ExcalidrawImperativeAPI = {
|
|
|
521
534
|
getSceneElements: InstanceType<typeof App>["getSceneElements"];
|
|
522
535
|
getAppState: () => InstanceType<typeof App>["state"];
|
|
523
536
|
getFiles: () => InstanceType<typeof App>["files"];
|
|
537
|
+
registerAction: (action: Action) => void;
|
|
524
538
|
refresh: InstanceType<typeof App>["refresh"];
|
|
525
539
|
setToast: InstanceType<typeof App>["setToast"];
|
|
526
540
|
addFiles: (data: BinaryFileData[]) => void;
|
|
527
541
|
updateContainerSize: InstanceType<typeof App>["updateContainerSize"];
|
|
528
|
-
readyPromise: ResolvablePromise<ExcalidrawImperativeAPI>;
|
|
529
|
-
ready: true;
|
|
530
542
|
id: string;
|
|
531
543
|
setLocalFont: (showOnPanel: boolean) => void;
|
|
532
544
|
selectElements: (elements: readonly ExcalidrawElement[]) => void;
|
|
@@ -551,11 +563,15 @@ export type ExcalidrawImperativeAPI = {
|
|
|
551
563
|
onPointerUp: (callback: (activeTool: AppState["activeTool"], pointerDownState: PointerDownState, event: PointerEvent) => void) => UnsubscribeCallback;
|
|
552
564
|
};
|
|
553
565
|
export type Device = Readonly<{
|
|
554
|
-
|
|
555
|
-
|
|
566
|
+
viewport: {
|
|
567
|
+
isMobile: boolean;
|
|
568
|
+
isLandscape: boolean;
|
|
569
|
+
};
|
|
570
|
+
editor: {
|
|
571
|
+
isMobile: boolean;
|
|
572
|
+
canFitSidebar: boolean;
|
|
573
|
+
};
|
|
556
574
|
isTouchScreen: boolean;
|
|
557
|
-
canDeviceFitSidebar: boolean;
|
|
558
|
-
isLandscape: boolean;
|
|
559
575
|
}>;
|
|
560
576
|
type FrameNameBounds = {
|
|
561
577
|
x: number;
|
|
@@ -565,10 +581,10 @@ type FrameNameBounds = {
|
|
|
565
581
|
angle: number;
|
|
566
582
|
};
|
|
567
583
|
export type FrameNameBoundsCache = {
|
|
568
|
-
get: (frameElement:
|
|
584
|
+
get: (frameElement: ExcalidrawFrameLikeElement | ExcalidrawMagicFrameElement) => FrameNameBounds | null;
|
|
569
585
|
_cache: Map<string, FrameNameBounds & {
|
|
570
586
|
zoom: AppState["zoom"]["value"];
|
|
571
|
-
versionNonce:
|
|
587
|
+
versionNonce: ExcalidrawFrameLikeElement["versionNonce"];
|
|
572
588
|
}>;
|
|
573
589
|
};
|
|
574
590
|
export type KeyboardModifiersObject = {
|
|
@@ -578,4 +594,5 @@ export type KeyboardModifiersObject = {
|
|
|
578
594
|
metaKey: boolean;
|
|
579
595
|
};
|
|
580
596
|
export type Primitive = number | string | boolean | bigint | symbol | null | undefined;
|
|
597
|
+
export type JSONValue = string | number | boolean | null | object;
|
|
581
598
|
export {};
|
package/types/utils.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EVENT } from "./constants";
|
|
2
|
-
import { FontFamilyValues, FontString
|
|
2
|
+
import { FontFamilyValues, FontString } from "./element/types";
|
|
3
3
|
import { ActiveTool, AppState, ToolType, Zoom } from "./types";
|
|
4
4
|
export declare const setDateTimeForTests: (dateTime: string) => void;
|
|
5
5
|
export declare const getDateTime: () => string;
|
|
@@ -186,8 +186,11 @@ export declare const isShallowEqual: <T extends Record<string, any>, I extends k
|
|
|
186
186
|
export declare const composeEventHandlers: <E>(originalEventHandler?: ((event: E) => void) | undefined, ourEventHandler?: ((event: E) => void) | undefined, { checkForDefaultPrevented }?: {
|
|
187
187
|
checkForDefaultPrevented?: boolean | undefined;
|
|
188
188
|
}) => (event: E) => void;
|
|
189
|
-
|
|
190
|
-
|
|
189
|
+
/**
|
|
190
|
+
* supply `null` as message if non-never value is valid, you just need to
|
|
191
|
+
* typecheck against it
|
|
192
|
+
*/
|
|
193
|
+
export declare const assertNever: (value: never, message: string | null, softAssert?: boolean) => never;
|
|
191
194
|
/**
|
|
192
195
|
* Memoizes on values of `opts` object (strict equality).
|
|
193
196
|
*/
|
|
@@ -197,3 +200,5 @@ export declare const memoize: <T extends Record<string, any>, R extends unknown>
|
|
|
197
200
|
export declare const isRenderThrottlingEnabled: () => boolean;
|
|
198
201
|
/** Checks if value is inside given collection. Useful for type-safety. */
|
|
199
202
|
export declare const isMemberOf: <T extends string>(collection: Set<T> | Record<T, any> | Map<T, any> | readonly T[], value: string) => value is T;
|
|
203
|
+
export declare const cloneJSON: <T>(obj: T) => T;
|
|
204
|
+
export declare const isFiniteNumber: (value: any) => value is number;
|