@kittl/sdk 0.0.7 → 0.0.9
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/editorContentPanel/sdk.d.ts +2752 -0
- package/dist/editorContentPanel/sdk.esm.js +1286 -0
- package/dist/editorContentPanel/sdk.js +1286 -0
- package/dist/editorScriptRunner/sdk.d.ts +2685 -0
- package/dist/editorScriptRunner/sdk.esm.js +1284 -0
- package/dist/editorScriptRunner/sdk.js +1282 -0
- package/dist/kittl-sdk.esm.js +207 -159
- package/dist/kittl-sdk.js +208 -158
- package/dist/sdk.d.ts +547 -215
- package/dist/sharedFileBrowser/sdk.d.ts +2752 -0
- package/dist/sharedFileBrowser/sdk.esm.js +1001 -0
- package/dist/sharedFileBrowser/sdk.js +1001 -0
- package/package.json +19 -1
package/dist/sdk.d.ts
CHANGED
|
@@ -10,9 +10,9 @@ declare abstract class KittlStateStore<T extends Record<string, unknown>> {
|
|
|
10
10
|
abstract subscribe<U>(selector: Selector<T, U>, callback: (selected: U, meta: {
|
|
11
11
|
patch: PatchTree<T>[];
|
|
12
12
|
senderOrigin: Origin;
|
|
13
|
-
}) => void, subscriberOrigin?: Origin): () => void;
|
|
13
|
+
}) => void, subscriberOrigin?: Origin, options?: SubscribeOptions): () => void;
|
|
14
14
|
abstract internalPatch(args: InternalPatchArgs<T>): void;
|
|
15
|
-
abstract resetWithState(state: T): void;
|
|
15
|
+
abstract resetWithState(state: T, origin?: Origin): void;
|
|
16
16
|
}
|
|
17
17
|
declare class SdkBadInputError extends Error {
|
|
18
18
|
readonly name: "SdkBadInputError";
|
|
@@ -32,7 +32,6 @@ declare const BASIC_SHAPE_DEFAULT_VALUES: {
|
|
|
32
32
|
offset?: number;
|
|
33
33
|
angle?: number;
|
|
34
34
|
};
|
|
35
|
-
presets?: LinkedPreset[] | undefined;
|
|
36
35
|
gradients?: StateGradientInfo | undefined;
|
|
37
36
|
clipPathMaskId?: string | undefined | null;
|
|
38
37
|
childrenInfo?: {
|
|
@@ -86,7 +85,6 @@ declare const DEFAULT_VALUES$1: {
|
|
|
86
85
|
offset?: number;
|
|
87
86
|
angle?: number;
|
|
88
87
|
};
|
|
89
|
-
presets?: LinkedPreset[] | undefined;
|
|
90
88
|
opacity?: number | undefined;
|
|
91
89
|
objectName: string;
|
|
92
90
|
width: number;
|
|
@@ -119,7 +117,8 @@ declare const DEFAULT_VALUES$1: {
|
|
|
119
117
|
generation?: {
|
|
120
118
|
meta?: GenerationMeta;
|
|
121
119
|
generationId?: string;
|
|
122
|
-
|
|
120
|
+
aiArtId?: string;
|
|
121
|
+
generatorKey?: string;
|
|
123
122
|
};
|
|
124
123
|
};
|
|
125
124
|
declare const DEFAULT_VALUES$2: {
|
|
@@ -173,7 +172,6 @@ declare const DEFAULT_VALUES: {
|
|
|
173
172
|
angle?: number;
|
|
174
173
|
};
|
|
175
174
|
gradients?: StateGradientInfo | undefined;
|
|
176
|
-
presets?: LinkedPreset[] | undefined;
|
|
177
175
|
opacity?: number | undefined;
|
|
178
176
|
hiddenColors?: Record<string, NonNullable<Color>> | undefined;
|
|
179
177
|
stroke?: string | null;
|
|
@@ -198,19 +196,25 @@ declare const DEFAULT_VALUES: {
|
|
|
198
196
|
version: string;
|
|
199
197
|
type: ObjectType.CombinedShape;
|
|
200
198
|
};
|
|
199
|
+
declare const EXPORT_MIME_TYPES: {
|
|
200
|
+
readonly jpeg: "image/jpeg";
|
|
201
|
+
readonly mp4: "video/mp4";
|
|
202
|
+
readonly pdf: "application/pdf";
|
|
203
|
+
readonly png: "image/png";
|
|
204
|
+
readonly svg: "image/svg+xml";
|
|
205
|
+
};
|
|
201
206
|
declare const GUIDE_DEFAULT_VALUES: {
|
|
202
207
|
id: DesignObjectId;
|
|
203
208
|
version: string;
|
|
204
209
|
type: ObjectType.Guide;
|
|
205
210
|
};
|
|
206
|
-
declare const GenerationOperation: {
|
|
207
|
-
readonly INPAINT: "inpaint";
|
|
208
|
-
};
|
|
209
211
|
declare const GenerationStatus: {
|
|
210
212
|
readonly CREATED: "CREATED";
|
|
213
|
+
readonly QUEUED: "QUEUED";
|
|
211
214
|
readonly STARTED: "STARTED";
|
|
212
215
|
readonly COMPLETE: "COMPLETE";
|
|
213
216
|
readonly FAILED: "FAILED";
|
|
217
|
+
readonly CANCELLED: "CANCELLED";
|
|
214
218
|
};
|
|
215
219
|
declare const ILLUSTRATION_DEFAULT_VALUES: {
|
|
216
220
|
hiddenColors?: Record<string, NonNullable<Color>> | undefined;
|
|
@@ -221,7 +225,8 @@ declare const ILLUSTRATION_DEFAULT_VALUES: {
|
|
|
221
225
|
generation?: {
|
|
222
226
|
meta?: GenerationMeta;
|
|
223
227
|
generationId?: string;
|
|
224
|
-
|
|
228
|
+
aiArtId?: string;
|
|
229
|
+
generatorKey?: string;
|
|
225
230
|
};
|
|
226
231
|
childrenInfo?: {
|
|
227
232
|
objectName?: string;
|
|
@@ -237,7 +242,6 @@ declare const ILLUSTRATION_DEFAULT_VALUES: {
|
|
|
237
242
|
angle?: number;
|
|
238
243
|
};
|
|
239
244
|
gradients?: StateGradientInfo | undefined;
|
|
240
|
-
presets?: LinkedPreset[] | undefined;
|
|
241
245
|
opacity?: number | undefined;
|
|
242
246
|
stroke?: string | null;
|
|
243
247
|
strokeWidth?: number;
|
|
@@ -325,7 +329,6 @@ declare const PATH_TEXT_DEFAULT_VALUES: {
|
|
|
325
329
|
useLigatures: boolean;
|
|
326
330
|
strokeWidth?: number;
|
|
327
331
|
fill?: Color | undefined;
|
|
328
|
-
presets?: LinkedPreset[] | undefined;
|
|
329
332
|
opacity?: number | undefined;
|
|
330
333
|
locked?: boolean | undefined;
|
|
331
334
|
hidden?: boolean | undefined;
|
|
@@ -344,8 +347,17 @@ declare const PATH_TEXT_DEFAULT_VALUES: {
|
|
|
344
347
|
version: string;
|
|
345
348
|
type: ObjectType.PathText;
|
|
346
349
|
};
|
|
350
|
+
declare const PendingOperation: {
|
|
351
|
+
readonly GENERATE: "generate";
|
|
352
|
+
readonly INPAINT: "inpaint";
|
|
353
|
+
readonly ERASE_AND_FILL: "eraseAndFill";
|
|
354
|
+
readonly VECTORIZE: "vectorize";
|
|
355
|
+
readonly LAYERIZE: "layerize";
|
|
356
|
+
readonly UPSCALE: "upscale";
|
|
357
|
+
readonly REMOVE_BACKGROUND: "removeBackground";
|
|
358
|
+
readonly REFRAME: "reframe";
|
|
359
|
+
};
|
|
347
360
|
declare const RICH_TEXT_DEFAULT_VALUES: {
|
|
348
|
-
presets?: LinkedPreset[] | undefined;
|
|
349
361
|
opacity?: number | undefined;
|
|
350
362
|
stroke?: string | null;
|
|
351
363
|
strokeWidth?: number;
|
|
@@ -372,6 +384,17 @@ declare const ResultType: {
|
|
|
372
384
|
readonly IMAGE: "image";
|
|
373
385
|
readonly ERROR: "error";
|
|
374
386
|
};
|
|
387
|
+
declare const UploadType: {
|
|
388
|
+
readonly EXTENSION: "EXTENSION";
|
|
389
|
+
readonly AI_GENERATED: "AI_GENERATED";
|
|
390
|
+
readonly AI_GENERATED_SETS: "AI_GENERATED_SETS";
|
|
391
|
+
readonly AI_UPSCALED: "AI_UPSCALED";
|
|
392
|
+
readonly AI_EDITED: "AI_EDITED";
|
|
393
|
+
readonly MOCKUP: "MOCKUP";
|
|
394
|
+
readonly CLIPPED: "CLIPPED";
|
|
395
|
+
readonly BRAND_KIT: "BRAND_KIT";
|
|
396
|
+
readonly QUICK_EDIT: "QUICK_EDIT";
|
|
397
|
+
};
|
|
375
398
|
declare const backgroundType = "background";
|
|
376
399
|
declare const clippingMaskType = "clippingMask";
|
|
377
400
|
declare const pathType = "path";
|
|
@@ -464,26 +487,20 @@ declare enum HistoryOrigins {
|
|
|
464
487
|
Untracked = "untracked:origin"
|
|
465
488
|
}
|
|
466
489
|
declare enum ImageFilterType {
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
}
|
|
478
|
-
declare enum
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
PHOTO_FILTER = "PHOTO_FILTER",
|
|
482
|
-
SHADOW = "SHADOW",
|
|
483
|
-
TEXT = "TEXT",
|
|
484
|
-
TEXT_EFFECT = "TEXT_EFFECT",
|
|
485
|
-
TEXT_DECORATION = "TEXT_DECORATION",
|
|
486
|
-
COLOR_PALETTE = "COLOR_PALETTE"
|
|
490
|
+
Saturation = "Saturation",
|
|
491
|
+
Contrast = "Contrast",
|
|
492
|
+
Brightness = "Brightness",
|
|
493
|
+
Vibrance = "Vibrance",
|
|
494
|
+
HueRotation = "HueRotation",
|
|
495
|
+
Noise = "Noise",
|
|
496
|
+
Blur = "Blur",
|
|
497
|
+
Convolute = "Convolute",
|
|
498
|
+
Pixelate = "Pixelate",
|
|
499
|
+
RemoveColor = "RemoveColor"
|
|
500
|
+
}
|
|
501
|
+
declare enum InpaintingSelectionMode {
|
|
502
|
+
ADD = "add",
|
|
503
|
+
SUBTRACT = "subtract"
|
|
487
504
|
}
|
|
488
505
|
declare enum ObjectType {
|
|
489
506
|
Artboard = "artboard",
|
|
@@ -503,7 +520,6 @@ declare enum ObjectType {
|
|
|
503
520
|
LoadingCard = "loadingCard",
|
|
504
521
|
MockupDesign = "mockupDesign",
|
|
505
522
|
ActiveSelection = "activeSelection",
|
|
506
|
-
WarpedImage = "warpedImage",
|
|
507
523
|
ArtboardTitle = "artboardTitle",
|
|
508
524
|
ArtboardTitleIcon = "artboardTitleIcon",
|
|
509
525
|
OverlayTexture = "overlayTexture",
|
|
@@ -526,7 +542,8 @@ declare enum Origin {
|
|
|
526
542
|
UI = 4,
|
|
527
543
|
VOLATILE = 8,
|
|
528
544
|
EVENTS_SYNC = 16,
|
|
529
|
-
API = 32
|
|
545
|
+
API = 32,
|
|
546
|
+
UNDO_REDO = 64
|
|
530
547
|
}
|
|
531
548
|
declare enum TextAlignment {
|
|
532
549
|
right = "right",
|
|
@@ -551,12 +568,13 @@ export interface AIGenerationInputSettings {
|
|
|
551
568
|
prompt: string;
|
|
552
569
|
taskType?: AIGenerationModelTaskType;
|
|
553
570
|
promptStyleId?: number;
|
|
554
|
-
model
|
|
571
|
+
model?: {
|
|
555
572
|
id: string;
|
|
556
573
|
};
|
|
557
574
|
additionalParams?: Record<string, unknown>;
|
|
558
575
|
actionOrigin?: AIGenerationActionOrigin;
|
|
559
576
|
type: AIGenerationContentType;
|
|
577
|
+
referenceImageMode?: AIGenerationReferenceImageMode;
|
|
560
578
|
}
|
|
561
579
|
export interface AIGenerationOutputSettings {
|
|
562
580
|
id?: string;
|
|
@@ -567,12 +585,12 @@ export interface AIGenerationOutputSettings {
|
|
|
567
585
|
}
|
|
568
586
|
export interface AddFontStyleOptions {
|
|
569
587
|
fontFamilyId: string;
|
|
570
|
-
|
|
588
|
+
files: Blob[];
|
|
571
589
|
styles: string[];
|
|
572
590
|
}
|
|
573
591
|
export interface AppStateAPI {
|
|
574
592
|
getSelectedObjectsIds(): string[];
|
|
575
|
-
setSelectedObjectsIds(ids: string[]): void;
|
|
593
|
+
setSelectedObjectsIds(ids: string[], origin?: Origin): void;
|
|
576
594
|
getSelectedLayersIds(): string[];
|
|
577
595
|
setSelectedLayersIds(ids: string[]): void;
|
|
578
596
|
getSelectedArtboardIds(): string[];
|
|
@@ -581,15 +599,31 @@ export interface AppStateAPI {
|
|
|
581
599
|
setSelectedArtboardsObjectIds(ids: string[]): void;
|
|
582
600
|
getAllSelectedObjectsIds(): string[];
|
|
583
601
|
setAllSelectedObjectsIds(ids: string[]): void;
|
|
584
|
-
getCanvasMode():
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
602
|
+
getCanvasMode(): CanvasModeKind | string;
|
|
603
|
+
getCanvasModeTargetId(): string | null;
|
|
604
|
+
setCanvasMode(mode: CanvasModeKind | string, origin?: Origin): void;
|
|
605
|
+
setCanvasModeWithTarget(mode: CanvasModeKind, options?: SetCanvasModeWithTargetOptions): void;
|
|
606
|
+
setCustomCanvasMode<const Id extends string>(params: SetCustomCanvasModeParams<Id>, origin?: Origin): void;
|
|
607
|
+
getActiveTool(): ActiveTool;
|
|
608
|
+
setActiveTool(tool: ActiveTool, origin?: Origin): void;
|
|
588
609
|
getIsDragPanning(): boolean;
|
|
589
610
|
viewport: ViewportAPI;
|
|
590
611
|
getHighlightedObjectId(): string | null;
|
|
591
612
|
setHighlightedObjectId(id: string | null): void;
|
|
592
|
-
setMany(fields: Partial<
|
|
613
|
+
setMany(fields: Partial<AppStateWithoutModes>, origin?: Origin): void;
|
|
614
|
+
getIsViewOnlyMode(): boolean;
|
|
615
|
+
setIsViewOnlyMode(isViewOnlyMode: boolean): void;
|
|
616
|
+
setCanvasSettings: (settings: Partial<SettingsType>) => void;
|
|
617
|
+
getCanvasSettings(): SettingsType;
|
|
618
|
+
getPenToolSetting(): AppState["penToolSetting"];
|
|
619
|
+
setPenToolSetting(setting: Partial<AppState["penToolSetting"]>): void;
|
|
620
|
+
getOutlineLoading(): AppState["outlineLoading"];
|
|
621
|
+
setOutlineLoading(id: string, loading: boolean): void;
|
|
622
|
+
isObjectLoading(id: string): boolean;
|
|
623
|
+
getPendingOperations(): AppState["pendingOperations"];
|
|
624
|
+
isOperationPending(id: string, operation?: PendingOperation): boolean;
|
|
625
|
+
setPendingOperation(id: string, operation: PendingOperation, origin?: Origin): void;
|
|
626
|
+
clearPendingOperation(id: string, operation: PendingOperation, origin?: Origin): void;
|
|
593
627
|
}
|
|
594
628
|
export interface AsyncAIAPI {
|
|
595
629
|
spendCredits: (options: SpendCreditsOptions) => SdkResultAsync<SpendCreditsResult, Error>;
|
|
@@ -598,29 +632,9 @@ export interface AsyncAIAPI {
|
|
|
598
632
|
unregisterHandler: (generatorId: string) => SdkResultAsync<void, Error>;
|
|
599
633
|
}
|
|
600
634
|
export interface AsyncAppStateAPI extends WithAsync<AppStateAPI> {
|
|
635
|
+
setCustomCanvasMode<const Id extends string>(params: SetCustomCanvasModeParams<Id>, origin?: Origin): Promise<BridgedSdkResult<void>>;
|
|
601
636
|
}
|
|
602
637
|
export interface AsyncAppStateSubscriptionAPI {
|
|
603
|
-
/**
|
|
604
|
-
* Subscribe to one or more paths in the app state.
|
|
605
|
-
* Each path is a dot-separated string like `'selectedObjectsIds'`.
|
|
606
|
-
* The callback receives the current value at each path as positional
|
|
607
|
-
* arguments whenever any subscribed value changes.
|
|
608
|
-
* Returns a single unsubscribe function that tears down all subscriptions.
|
|
609
|
-
*
|
|
610
|
-
* @example
|
|
611
|
-
* // Single path
|
|
612
|
-
* const unsub = await kittl.appStore.subscribe(
|
|
613
|
-
* ['selectedObjectsIds'],
|
|
614
|
-
* (ids) => console.log('selection changed:', ids)
|
|
615
|
-
* );
|
|
616
|
-
*
|
|
617
|
-
* // Multiple paths
|
|
618
|
-
* const unsub = await kittl.appStore.subscribe(
|
|
619
|
-
* ['selectedObjectsIds', 'activeTool'],
|
|
620
|
-
* (ids, tool) => console.log('changed:', ids, tool)
|
|
621
|
-
* );
|
|
622
|
-
* unsub();
|
|
623
|
-
*/
|
|
624
638
|
subscribe<T extends readonly AppStateSelectorPath[]>(paths: [
|
|
625
639
|
...T
|
|
626
640
|
], callback: (...values: {
|
|
@@ -641,38 +655,20 @@ export interface AsyncBatchDesignAPI extends AsyncDesignAPI {
|
|
|
641
655
|
export interface AsyncContextAPI extends Omit<WithAsync<ContextAPI>, "subscribe"> {
|
|
642
656
|
subscribe(callback: ContextSubscriptionCallback): Promise<() => void>;
|
|
643
657
|
}
|
|
644
|
-
export interface AsyncDataAPI extends WithAsync<
|
|
658
|
+
export interface AsyncDataAPI extends WithAsync<DataAPI> {
|
|
645
659
|
}
|
|
646
660
|
export interface AsyncDesignAPI extends WithAsync<WithOptsRemoved<DesignAPI>> {
|
|
647
661
|
}
|
|
648
662
|
export interface AsyncDesignStateAPI {
|
|
649
|
-
/**
|
|
650
|
-
* Subscribe to one or more paths in the design state.
|
|
651
|
-
* Each path is a dot-separated string like `'objects.id1.width'`.
|
|
652
|
-
* The callback receives the current value at each path as positional
|
|
653
|
-
* arguments whenever any subscribed value changes.
|
|
654
|
-
* Returns a single unsubscribe function that tears down all subscriptions.
|
|
655
|
-
*
|
|
656
|
-
* @example
|
|
657
|
-
* // Single path
|
|
658
|
-
* const unsub = await kittl.designStore.subscribe(
|
|
659
|
-
* ['objects.id1.width'],
|
|
660
|
-
* (width) => console.log('width changed:', width)
|
|
661
|
-
* );
|
|
662
|
-
*
|
|
663
|
-
* // Multiple paths
|
|
664
|
-
* const unsub = await kittl.designStore.subscribe(
|
|
665
|
-
* ['objects.id1.width', 'objects.id1.height'],
|
|
666
|
-
* (width, height) => console.log('changed:', width, height)
|
|
667
|
-
* );
|
|
668
|
-
* unsub();
|
|
669
|
-
*/
|
|
670
663
|
subscribe<T extends readonly DesignStateSelectorPath[]>(paths: [
|
|
671
664
|
...T
|
|
672
665
|
], callback: (...values: {
|
|
673
666
|
[K in keyof T]: T[K] extends string ? DeepValue<SelectorState, T[K]> | undefined : unknown;
|
|
674
667
|
}) => void): Promise<() => void>;
|
|
675
668
|
}
|
|
669
|
+
export interface AsyncExportAPI extends Omit<WithAsync<ExportAPI>, "showExportModal"> {
|
|
670
|
+
showExportModal<Mime extends ExportMimeType>(request: ExportRequest<Mime>): Promise<BridgedSdkResult<ExportResult>>;
|
|
671
|
+
}
|
|
676
672
|
export interface AsyncFontAPI extends WithAsync<FontAPI> {
|
|
677
673
|
}
|
|
678
674
|
export interface AsyncStatelessAPI {
|
|
@@ -710,9 +706,6 @@ export interface AuthStartResult {
|
|
|
710
706
|
code: string;
|
|
711
707
|
code_verifier?: string;
|
|
712
708
|
}
|
|
713
|
-
/**
|
|
714
|
-
* Token response returned by the token endpoint (code exchange or refresh).
|
|
715
|
-
*/
|
|
716
709
|
export interface AuthTokenResponse {
|
|
717
710
|
access_token?: string;
|
|
718
711
|
refresh_token?: string;
|
|
@@ -742,8 +735,8 @@ export interface BaseStandardArtboardOptions<T extends ArtboardLikeType = Artboa
|
|
|
742
735
|
lockMovementX?: boolean;
|
|
743
736
|
lockMovementY?: boolean;
|
|
744
737
|
activeLayout: BoardLayout;
|
|
745
|
-
left
|
|
746
|
-
top
|
|
738
|
+
left: number;
|
|
739
|
+
top: number;
|
|
747
740
|
width: number;
|
|
748
741
|
height: number;
|
|
749
742
|
fill: string | GradientObject | undefined | null;
|
|
@@ -753,7 +746,6 @@ export interface BaseStandardArtboardOptions<T extends ArtboardLikeType = Artboa
|
|
|
753
746
|
dpi?: number;
|
|
754
747
|
fullSize?: boolean;
|
|
755
748
|
clip?: boolean;
|
|
756
|
-
presets?: LinkedPreset[];
|
|
757
749
|
printMargins?: PrintMargins;
|
|
758
750
|
scaleX?: number;
|
|
759
751
|
scaleY?: number;
|
|
@@ -764,12 +756,15 @@ export interface BaseStandardBoard<T extends ArtboardOptions = ArtboardOptions>
|
|
|
764
756
|
title?: string;
|
|
765
757
|
texture?: TextureOptions;
|
|
766
758
|
backgroundImage?: BackgroundImageOptions;
|
|
759
|
+
originTemplateId?: string;
|
|
767
760
|
}
|
|
768
761
|
export interface BoardAPI {
|
|
769
762
|
createStandardBoard(params: CreateBoardParams, opts?: DesignApiOptions): NormalizedBoard;
|
|
770
763
|
cloneArtboard(params: CloneArtboardParams, opts?: DesignApiOptions): NormalizedBoard;
|
|
771
764
|
updateArtboardBackground(params: UpdateArtboardBackgroundParams, opts?: DesignApiOptions): NormalizedBoard;
|
|
772
765
|
updateArtboard(params: UpdateArtboardParams, opts?: DesignApiOptions): NormalizedBoard;
|
|
766
|
+
connectBoards(params: ConnectBoardsParams, opts?: DesignApiOptions): void;
|
|
767
|
+
disconnectBoards(params: DisconnectBoardsParams, opts?: DesignApiOptions): void;
|
|
773
768
|
}
|
|
774
769
|
export interface CanvasAPI {
|
|
775
770
|
getScreenshot(): Promise<{
|
|
@@ -808,7 +803,9 @@ export interface CreateLoadingCardInput extends CreateElementWithPositionAndSize
|
|
|
808
803
|
generationAverageSpeed?: number;
|
|
809
804
|
name?: string;
|
|
810
805
|
}
|
|
811
|
-
export interface
|
|
806
|
+
export interface CustomCanvasModeStateById {
|
|
807
|
+
}
|
|
808
|
+
export interface DataAPI {
|
|
812
809
|
mockups: MockupDataAPI;
|
|
813
810
|
fonts: FontDataAPI;
|
|
814
811
|
}
|
|
@@ -842,8 +839,13 @@ export interface DesignAPI {
|
|
|
842
839
|
layers: LayersAPI;
|
|
843
840
|
group: GroupAPI;
|
|
844
841
|
texture: TextureAPI;
|
|
842
|
+
placement: PlacementAPI;
|
|
845
843
|
}
|
|
846
844
|
export interface DesignConfig {
|
|
845
|
+
microEditor?: {
|
|
846
|
+
mainObjectId?: DesignObjectId;
|
|
847
|
+
layerized?: boolean;
|
|
848
|
+
};
|
|
847
849
|
title?: string;
|
|
848
850
|
dpiVersion?: number;
|
|
849
851
|
designId?: string;
|
|
@@ -882,9 +884,11 @@ export interface ErrorGenerationResult {
|
|
|
882
884
|
message: string;
|
|
883
885
|
subtitle: string;
|
|
884
886
|
status: "warning" | "error";
|
|
887
|
+
isRecognized?: boolean;
|
|
888
|
+
errorKey?: string;
|
|
885
889
|
}
|
|
886
890
|
export interface FileBrowserAPI {
|
|
887
|
-
registerUploadBrowser: (tab: FileBrowserTab) => Promise<SdkResponse<void>>;
|
|
891
|
+
registerUploadBrowser: (tab: Omit<FileBrowserTab, "onEvent">) => Promise<SdkResponse<void>>;
|
|
888
892
|
}
|
|
889
893
|
export interface FontAPI {
|
|
890
894
|
createFont: (params: {
|
|
@@ -934,7 +938,8 @@ export interface GeneratableObject {
|
|
|
934
938
|
generation?: {
|
|
935
939
|
meta?: GenerationMeta;
|
|
936
940
|
generationId?: string;
|
|
937
|
-
|
|
941
|
+
aiArtId?: string;
|
|
942
|
+
generatorKey?: string;
|
|
938
943
|
};
|
|
939
944
|
}
|
|
940
945
|
export interface GenerationCreditUse {
|
|
@@ -952,11 +957,15 @@ export interface GenerationInputData {
|
|
|
952
957
|
}
|
|
953
958
|
export interface GenerationMeta {
|
|
954
959
|
generationEndsAt?: number;
|
|
960
|
+
generationStartedAt?: number;
|
|
955
961
|
pendingGenerationId: string;
|
|
956
|
-
|
|
962
|
+
pendingGeneratorKey?: string;
|
|
963
|
+
operation?: PendingOperation;
|
|
957
964
|
}
|
|
958
965
|
export interface GenerationStartedResultCommonProps {
|
|
959
966
|
generationEndsAt?: number;
|
|
967
|
+
generationStartedAt?: number;
|
|
968
|
+
scheduledStartAt?: number;
|
|
960
969
|
}
|
|
961
970
|
export interface GetExportOptions {
|
|
962
971
|
format: "png" | "jpg" | "pdf" | "svg" | "mp4";
|
|
@@ -991,6 +1000,8 @@ export interface GetObjectParams {
|
|
|
991
1000
|
}
|
|
992
1001
|
export interface GetPreviewImageOptions {
|
|
993
1002
|
targetPixelCount: number;
|
|
1003
|
+
format: "png" | "jpg";
|
|
1004
|
+
quality: number;
|
|
994
1005
|
}
|
|
995
1006
|
export interface GradientColorStop {
|
|
996
1007
|
color: string | null;
|
|
@@ -1039,13 +1050,18 @@ export interface GuideAPI {
|
|
|
1039
1050
|
updateGuide(input: UpdateGuideInput, opts?: DesignApiOptions): NormalizedGuideObject;
|
|
1040
1051
|
}
|
|
1041
1052
|
export interface IllustrationAPI {
|
|
1042
|
-
|
|
1043
|
-
|
|
1053
|
+
getPaths: (params: GetIllustrationPathsParams) => SdkResultAsync<IllustrationSerializedChildren, SdkError>;
|
|
1054
|
+
renamePath: (params: RenameIllustrationPathParams, opts?: DesignApiOptions) => SdkResultAsync<void, SdkError>;
|
|
1055
|
+
removePaths: (params: RemoveIllustrationPathParams, opts?: DesignApiOptions) => SdkResultAsync<void, SdkError>;
|
|
1056
|
+
togglePathLocked: (params: ToggleLockIllustrationPathParams, opts?: DesignApiOptions) => SdkResultAsync<void, SdkError>;
|
|
1057
|
+
togglePathHidden: (params: ToggleHideIllustrationPathParams, opts?: DesignApiOptions) => SdkResultAsync<void, SdkError>;
|
|
1058
|
+
addIllustration(params: AddIllustrationParams, opts?: DesignApiOptions): Promise<AddedIllustration>;
|
|
1059
|
+
updateIllustration(params: UpdateIllustrationParams, opts?: UpdateObjectApiOptions): NormalizedIllustrationObject;
|
|
1044
1060
|
}
|
|
1045
1061
|
export interface ImageAPI {
|
|
1046
1062
|
addImage(params: AddImageParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1047
|
-
updateImage(params: UpdateImageParams, opts?:
|
|
1048
|
-
updateImageSource(params: UpdateImageSourceParams, opts?:
|
|
1063
|
+
updateImage(params: UpdateImageParams, opts?: UpdateObjectApiOptions): NormalizedIllustrationImageObject;
|
|
1064
|
+
updateImageSource(params: UpdateImageSourceParams, opts?: UpdateObjectApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1049
1065
|
resetImageCrop(params: ResetImageCropParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1050
1066
|
resetImageBackgroundRemoval(params: ResetImageBackgroundRemovalParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
|
|
1051
1067
|
}
|
|
@@ -1056,19 +1072,27 @@ export interface ImageGenerationResult {
|
|
|
1056
1072
|
export interface ImageGenerationStartedResult extends GenerationStartedResultCommonProps {
|
|
1057
1073
|
type: typeof ResultType.IMAGE;
|
|
1058
1074
|
}
|
|
1075
|
+
export interface ImageUploadAPI {
|
|
1076
|
+
upload: (params: {
|
|
1077
|
+
blob: Blob;
|
|
1078
|
+
}) => SdkResultAsync<UserImageUpload[], Error>;
|
|
1079
|
+
uploadTemp: (params: {
|
|
1080
|
+
blob: Blob;
|
|
1081
|
+
}) => SdkResultAsync<TempUserImageUpload[], Error>;
|
|
1082
|
+
}
|
|
1059
1083
|
export interface KittlContext {
|
|
1060
1084
|
colorScheme: EditorColorScheme;
|
|
1061
1085
|
dragAndDrop: {
|
|
1062
1086
|
offset: DragAndDropOffset;
|
|
1063
1087
|
};
|
|
1064
1088
|
}
|
|
1065
|
-
export interface KittlSDK {
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
onReady: (cb: () => void) => void;
|
|
1089
|
+
export interface KittlSDK extends KittlSDKLifecycle, KittlSDKEditorAPIs, KittlSDKFileBrowserAPI {
|
|
1090
|
+
}
|
|
1091
|
+
export interface KittlSDKEditorAPIs {
|
|
1069
1092
|
ai: AsyncAIAPI;
|
|
1070
1093
|
data: AsyncDataAPI;
|
|
1071
1094
|
design: AsyncDesignAPI;
|
|
1095
|
+
export: AsyncExportAPI;
|
|
1072
1096
|
designStore: AsyncDesignStateAPI;
|
|
1073
1097
|
appStore: AsyncAppStateSubscriptionAPI;
|
|
1074
1098
|
context: AsyncContextAPI;
|
|
@@ -1076,11 +1100,18 @@ export interface KittlSDK {
|
|
|
1076
1100
|
state: AsyncAppStateAPI;
|
|
1077
1101
|
auth: AsyncAuthAPI;
|
|
1078
1102
|
upload: AsyncUploadAPI;
|
|
1079
|
-
fileBrowser: FileBrowserAPI;
|
|
1080
1103
|
stateless: AsyncStatelessAPI;
|
|
1081
1104
|
font: AsyncFontAPI;
|
|
1082
1105
|
createBatch: () => Promise<AsyncBatchDesignAPI>;
|
|
1083
1106
|
}
|
|
1107
|
+
export interface KittlSDKFileBrowserAPI {
|
|
1108
|
+
fileBrowser: FileBrowserAPI;
|
|
1109
|
+
}
|
|
1110
|
+
export interface KittlSDKLifecycle {
|
|
1111
|
+
loaded: boolean;
|
|
1112
|
+
onLoadedCallback: (() => void) | null;
|
|
1113
|
+
onReady: (cb: () => void) => void;
|
|
1114
|
+
}
|
|
1084
1115
|
export interface LayersAPI {
|
|
1085
1116
|
moveTo(input: MoveToParams, opts?: DesignApiOptions): void;
|
|
1086
1117
|
sendForward(input: SendToParams, opts?: DesignApiOptions): void;
|
|
@@ -1088,14 +1119,9 @@ export interface LayersAPI {
|
|
|
1088
1119
|
sendBackward(input: SendToParams, opts?: DesignApiOptions): void;
|
|
1089
1120
|
sendToBack(input: SendToParams, opts?: DesignApiOptions): void;
|
|
1090
1121
|
}
|
|
1091
|
-
export interface LinkedFillPresetMeta {
|
|
1092
|
-
key: string;
|
|
1093
|
-
target: FillMetaTarget;
|
|
1094
|
-
source?: string;
|
|
1095
|
-
}
|
|
1096
1122
|
export interface LoadingCardAPI {
|
|
1097
1123
|
createLoadingCard(input: CreateLoadingCardInput, opts?: DesignApiOptions): NormalizedLoadingCardObject;
|
|
1098
|
-
updateLoadingCard(input: UpdateLoadingCardInput, opts?:
|
|
1124
|
+
updateLoadingCard(input: UpdateLoadingCardInput, opts?: UpdateObjectApiOptions): NormalizedLoadingCardObject;
|
|
1099
1125
|
}
|
|
1100
1126
|
export interface MockupDataAPI {
|
|
1101
1127
|
get(id: number): SdkResultAsync<CatalogItem>;
|
|
@@ -1130,8 +1156,10 @@ export interface MockupboardAPI {
|
|
|
1130
1156
|
updateMockupBoard(params: UpdateMockupBoardParams, opts?: DesignApiOptions): NormalizedStandardBoard<MockupBoardOptions>;
|
|
1131
1157
|
}
|
|
1132
1158
|
export interface ObjectAPI {
|
|
1159
|
+
setColors(params: SetColorsParams, opts?: DesignApiOptions): void;
|
|
1160
|
+
getColors(params: GetColorsParams): SDKColorEntry[];
|
|
1133
1161
|
setLockedState(params: SetLockedParams, opts?: DesignApiOptions): WithLocked;
|
|
1134
|
-
removeObject(params: RemoveObjectParams, opts?: DesignApiOptions): RemoveObjectResult;
|
|
1162
|
+
removeObject(params: RemoveObjectParams, opts?: DesignApiOptions): RemoveObjectResult | null;
|
|
1135
1163
|
setHiddenState(params: SetHiddenParams, opts?: DesignApiOptions): WithHidden;
|
|
1136
1164
|
rotateObject(params: RotateObjectParams, opts?: DesignApiOptions): WithObjectLayout;
|
|
1137
1165
|
getAllByFilter<T extends NormalizedObject>(predicate: (object: NormalizedObject) => boolean, opts?: DesignApiOptions): T[];
|
|
@@ -1187,15 +1215,25 @@ export interface PhotoFilterOptions {
|
|
|
1187
1215
|
distance: number;
|
|
1188
1216
|
};
|
|
1189
1217
|
}
|
|
1218
|
+
export interface PlacementAPI {
|
|
1219
|
+
getSmartPlacement(params: SmartPlacementInput, opts?: {
|
|
1220
|
+
batchClient?: BatchClient<NormalizedDesignState>;
|
|
1221
|
+
}): SmartPlacementOutput;
|
|
1222
|
+
}
|
|
1190
1223
|
export interface PublicDragAndDropAPI {
|
|
1191
1224
|
startDragImageEvent(input: DragAndDropStartDragImageEventInput): void;
|
|
1192
1225
|
dropImage(input: DragAndDropDropImageInput): Promise<string | null>;
|
|
1193
1226
|
}
|
|
1227
|
+
export interface PublicExportAPI {
|
|
1228
|
+
bypassExportDialog: BypassExportDialog;
|
|
1229
|
+
showExportModal: <Mime extends ExportMimeType>(request: ExportRequest<Mime>) => Promise<ExportResult>;
|
|
1230
|
+
}
|
|
1194
1231
|
export interface RemoveObjectParams {
|
|
1195
1232
|
id: string;
|
|
1233
|
+
skipIfMissing?: boolean;
|
|
1196
1234
|
}
|
|
1197
1235
|
export interface RemoveObjectResult {
|
|
1198
|
-
|
|
1236
|
+
removedObjectId: string;
|
|
1199
1237
|
}
|
|
1200
1238
|
export interface RichTextCompressedStylesV1 {
|
|
1201
1239
|
version: "v1";
|
|
@@ -1240,12 +1278,13 @@ export interface ShadowOptions {
|
|
|
1240
1278
|
export interface ShapeAPI {
|
|
1241
1279
|
createPredefinedShape(input: CreateShapeInput, opts?: DesignApiOptions): NormalizedBasicShapeObject;
|
|
1242
1280
|
createBasicShape(input: CreateBasicShapeInput, opts?: DesignApiOptions): Promise<NormalizedBasicShapeObject>;
|
|
1243
|
-
updateShape(input: UpdateShapeInput, opts?:
|
|
1281
|
+
updateShape(input: UpdateShapeInput, opts?: UpdateObjectApiOptions): NormalizedBasicShapeObject;
|
|
1244
1282
|
convertShapeToMask(input: ConvertShapeToMaskInput, opts?: DesignApiOptions): DesignStructureObject;
|
|
1245
1283
|
}
|
|
1246
1284
|
export interface SmartboardAPI {
|
|
1247
1285
|
addSmartboard(params: AddSmartboardParams, opts?: DesignApiOptions): NormalizedStandardBoard<SmartboardOptions>;
|
|
1248
1286
|
updateSmartboard(params: UpdateSmartboardParams, opts?: DesignApiOptions): NormalizedStandardBoard<SmartboardOptions>;
|
|
1287
|
+
updateBackgroundImage(params: UpdateSmartboardBackgroundImageParams, opts?: DesignApiOptions): Promise<NormalizedStandardBoard<SmartboardOptions>>;
|
|
1249
1288
|
}
|
|
1250
1289
|
export interface SpendCreditsOptions {
|
|
1251
1290
|
amount: number;
|
|
@@ -1262,10 +1301,13 @@ export interface StartGenerationResult {
|
|
|
1262
1301
|
generationId: string;
|
|
1263
1302
|
}
|
|
1264
1303
|
export interface StateAPI {
|
|
1265
|
-
implementSubState(params: Partial<NormalizedDesignState>, opts?:
|
|
1304
|
+
implementSubState(params: Partial<NormalizedDesignState>, opts?: ImplementSubStateOptions): Partial<NormalizedDesignState>;
|
|
1266
1305
|
getState(): NormalizedDesignState;
|
|
1267
1306
|
}
|
|
1268
1307
|
export interface StructureObjectMeta {
|
|
1308
|
+
textBadge?: {
|
|
1309
|
+
styleId: string;
|
|
1310
|
+
};
|
|
1269
1311
|
name?: string;
|
|
1270
1312
|
type?: LayerType;
|
|
1271
1313
|
defaultIcon?: LayerIconType;
|
|
@@ -1278,7 +1320,7 @@ export interface StructureObjectMeta {
|
|
|
1278
1320
|
}
|
|
1279
1321
|
export interface TextAPI {
|
|
1280
1322
|
addText(params: AddTextParams, opts?: DesignApiOptions): NormalizedRichTextObject;
|
|
1281
|
-
updateText(params: UpdateTextParams, opts?:
|
|
1323
|
+
updateText(params: UpdateTextParams, opts?: UpdateObjectApiOptions): NormalizedRichTextObject;
|
|
1282
1324
|
updateRenderPlugin(params: UpdateRenderPluginParams, opts?: DesignApiOptions): NormalizedRichTextObject;
|
|
1283
1325
|
updateDecorationPlugin(params: UpdateDecorationPluginParams, opts?: DesignApiOptions): NormalizedRichTextObject;
|
|
1284
1326
|
}
|
|
@@ -1328,15 +1370,7 @@ export interface UpdateLoadingCardInput {
|
|
|
1328
1370
|
name?: string;
|
|
1329
1371
|
}
|
|
1330
1372
|
export interface UploadAPI {
|
|
1331
|
-
image:
|
|
1332
|
-
}
|
|
1333
|
-
export interface UploadImageAPI {
|
|
1334
|
-
upload: ({ blob, }: {
|
|
1335
|
-
blob: Blob;
|
|
1336
|
-
}) => SdkResultAsync<UserImageUpload[], Error>;
|
|
1337
|
-
uploadTemp: ({ blob, }: {
|
|
1338
|
-
blob: Blob;
|
|
1339
|
-
}) => SdkResultAsync<TempUserImageUpload[], Error>;
|
|
1373
|
+
image: ImageUploadAPI;
|
|
1340
1374
|
}
|
|
1341
1375
|
export interface UserTokenResult {
|
|
1342
1376
|
success: true;
|
|
@@ -1344,8 +1378,10 @@ export interface UserTokenResult {
|
|
|
1344
1378
|
}
|
|
1345
1379
|
export interface VideoAPI {
|
|
1346
1380
|
addVideo(params: AddVideoParams, opts?: DesignApiOptions): Promise<NormalizedVideoObject>;
|
|
1347
|
-
updateVideo(params: UpdateVideoParams, opts?:
|
|
1381
|
+
updateVideo(params: UpdateVideoParams, opts?: UpdateObjectApiOptions): NormalizedVideoObject;
|
|
1348
1382
|
removePlaylistItem(params: RemoveVideoPlaylistItemParams, opts?: DesignApiOptions): NormalizedVideoObject;
|
|
1383
|
+
reorderPlaylistItem(params: ReorderVideoPlaylistItemParams, opts?: DesignApiOptions): NormalizedVideoObject;
|
|
1384
|
+
addPlaylistItem(params: AddVideoPlaylistItemParams, opts?: DesignApiOptions): NormalizedVideoObject;
|
|
1349
1385
|
updatePlaylistItem(params: UpdateVideoPlaylistItemParams, opts?: DesignApiOptions): Promise<NormalizedVideoObject>;
|
|
1350
1386
|
}
|
|
1351
1387
|
export interface VideoGenerationResult {
|
|
@@ -1383,9 +1419,10 @@ export interface WithObjectLayout {
|
|
|
1383
1419
|
flipX: boolean;
|
|
1384
1420
|
flipY: boolean;
|
|
1385
1421
|
}
|
|
1386
|
-
export type AIGenerationActionOrigin = "COPILOT" | "RIGHT_PANEL" | "LEFT_PANEL" | "MICRO_APP" | "IMAGE_SETS" | "AI_CHAT" | "SMARTBOARD" | "AI_INPUT_GENERATE_IMAGE" | "AI_INPUT_REMIX_IMAGE" | "AI_INPUT_GENERATE_VIDEO" | "AI_HUB_GENERATE_IMAGE" | "AI_HUB_REMIX_IMAGE" | "AI_HUB_GENERATE_VIDEO" | "VIDEOBOARD" | "AGENT" | "WORKFLOW";
|
|
1422
|
+
export type AIGenerationActionOrigin = "COPILOT" | "RIGHT_PANEL" | "LEFT_PANEL" | "MICRO_APP" | "IMAGE_SETS" | "AI_CHAT" | "SMARTBOARD" | "AI_INPUT_GENERATE_IMAGE" | "AI_INPUT_REMIX_IMAGE" | "AI_INPUT_GENERATE_VIDEO" | "AI_INPUT_MICRO_EDITOR_REMIX" | "AI_INPUT_MICRO_EDITOR_INPAINT" | "AI_HUB_GENERATE_IMAGE" | "AI_HUB_REMIX_IMAGE" | "AI_HUB_GENERATE_VIDEO" | "VIDEOBOARD" | "AGENT" | "AI_HUB_AGENT" | "WORKFLOW" | "MCP" | "MCP_WORKFLOW" | "AI_AGENT" | "AI_AGENT_CHAT" | "AI_AGENT_CHAT_WEBSITE";
|
|
1387
1423
|
export type AIGenerationContentType = "image" | "video";
|
|
1388
1424
|
export type AIGenerationModelTaskType = "IMAGE_TO_IMAGE" | "IMAGE_INPAINT" | "IMAGE_OUTPAINT" | "TEXT_TO_IMAGE" | "IMAGE_TO_VIDEO";
|
|
1425
|
+
export type AIGenerationReferenceImageMode = "keyframe" | "reference";
|
|
1389
1426
|
export type APIOptions<T extends Record<string, unknown>> = {
|
|
1390
1427
|
batchClient?: BatchClient<T>;
|
|
1391
1428
|
} | {
|
|
@@ -1407,6 +1444,8 @@ export type ActiveTool = {
|
|
|
1407
1444
|
type: "pen-vector-editing";
|
|
1408
1445
|
} | {
|
|
1409
1446
|
type: "comment";
|
|
1447
|
+
} | {
|
|
1448
|
+
type: "text";
|
|
1410
1449
|
} | {
|
|
1411
1450
|
type: "shape";
|
|
1412
1451
|
shape: BasicShapeType;
|
|
@@ -1423,6 +1462,7 @@ export type AddImageParams = ({
|
|
|
1423
1462
|
src?: never;
|
|
1424
1463
|
}) & GeneratableObject & {
|
|
1425
1464
|
objectProperties?: ImageProperties;
|
|
1465
|
+
crop?: ImageCrop;
|
|
1426
1466
|
} & CreateElementWithPositionAndSize;
|
|
1427
1467
|
export type AddIntoGroupParams = {
|
|
1428
1468
|
groupId: string;
|
|
@@ -1431,6 +1471,7 @@ export type AddIntoGroupParams = {
|
|
|
1431
1471
|
export type AddMockupBoardParams = {
|
|
1432
1472
|
inputBoardIds: string[];
|
|
1433
1473
|
mockupTemplateId: number;
|
|
1474
|
+
fill?: string;
|
|
1434
1475
|
shouldMockupColorMatchArtboard?: boolean;
|
|
1435
1476
|
initialDesigns?: AddMockupDesignObjectParams[];
|
|
1436
1477
|
} & {
|
|
@@ -1457,49 +1498,64 @@ export type AddTextParams = {
|
|
|
1457
1498
|
size: Dimensions;
|
|
1458
1499
|
};
|
|
1459
1500
|
export type AddVideoParams = {
|
|
1460
|
-
playlist:
|
|
1501
|
+
playlist: VideoPlaylistItemInput[];
|
|
1461
1502
|
videoSize?: {
|
|
1462
1503
|
width: number;
|
|
1463
1504
|
height: number;
|
|
1464
1505
|
};
|
|
1465
1506
|
} & CreateElementWithPositionAndSize;
|
|
1507
|
+
export type AddVideoPlaylistItemParams = {
|
|
1508
|
+
videoId: string;
|
|
1509
|
+
playlistItem: VideoPlaylistItemInput;
|
|
1510
|
+
playlistItemId?: string;
|
|
1511
|
+
previousPlaylistItemId?: string;
|
|
1512
|
+
nextPlaylistItemId?: string;
|
|
1513
|
+
};
|
|
1466
1514
|
export type AddVideoboardParams = {
|
|
1467
1515
|
linkedBoardIds?: string[];
|
|
1468
1516
|
video?: {
|
|
1469
1517
|
width?: number;
|
|
1470
1518
|
height?: number;
|
|
1471
|
-
playlist:
|
|
1519
|
+
playlist: VideoPlaylistItemInput[];
|
|
1472
1520
|
};
|
|
1473
1521
|
} & {
|
|
1474
1522
|
position: AbsolutePosition | RelativePosition;
|
|
1475
1523
|
size: Dimensions;
|
|
1476
1524
|
};
|
|
1525
|
+
export type AddedIllustration = NormalizedIllustrationObject & {
|
|
1526
|
+
hasTextElements: boolean;
|
|
1527
|
+
};
|
|
1528
|
+
export type AnimateViewportParams = ViewportPatch & ViewportAnimationSettings;
|
|
1529
|
+
export type AnimateViewportToBoundsParams = ViewportAnimationSettings & ObjectPositionRect & {
|
|
1530
|
+
viewportPadding?: ViewportBoundsPadding;
|
|
1531
|
+
};
|
|
1532
|
+
export type AnimateViewportToCenterParams = ViewportAnimationSettings & ObjectPositionRect;
|
|
1477
1533
|
export type AppState = {
|
|
1478
1534
|
selectedObjectsIds: string[];
|
|
1479
1535
|
selectedLayersIds: string[];
|
|
1480
1536
|
selectedArtboardIds: string[];
|
|
1481
1537
|
selectedArtboardsObjectIds: string[];
|
|
1482
1538
|
allSelectedObjectsIds: string[];
|
|
1483
|
-
canvasMode: CanvasMode
|
|
1484
|
-
activeTool: ActiveTool
|
|
1539
|
+
canvasMode: CanvasMode;
|
|
1540
|
+
activeTool: ActiveTool;
|
|
1485
1541
|
viewport: Viewport;
|
|
1486
1542
|
isDragPanning: boolean;
|
|
1487
1543
|
highlightedObjectId: string | null;
|
|
1544
|
+
isViewOnlyMode: boolean;
|
|
1545
|
+
hasLegacyOutOfBoundsObjects: boolean;
|
|
1546
|
+
canvasSettings: SettingsType;
|
|
1547
|
+
penToolSetting: {
|
|
1548
|
+
stroke: string | null | undefined;
|
|
1549
|
+
strokeWidth: number;
|
|
1550
|
+
fill: Color;
|
|
1551
|
+
};
|
|
1552
|
+
outlineLoading: Record<string, boolean>;
|
|
1553
|
+
objectLoading: Record<string, boolean>;
|
|
1554
|
+
pendingOperations: Record<string, PendingOperation>;
|
|
1488
1555
|
};
|
|
1489
|
-
/**
|
|
1490
|
-
* A dot-separated string path into the app state.
|
|
1491
|
-
* The first segment must be a valid top-level key of AppState.
|
|
1492
|
-
*
|
|
1493
|
-
* @example
|
|
1494
|
-
* 'selectedObjectsIds'
|
|
1495
|
-
* 'viewport.coords.tl.x'
|
|
1496
|
-
* 'activeTool.type'
|
|
1497
|
-
*/
|
|
1498
1556
|
export type AppStateSelectorPath = AppStateTopLevelKey | `${AppStateTopLevelKey}.${string}`;
|
|
1499
|
-
/**
|
|
1500
|
-
* Top-level keys of AppState that extensions can subscribe to.
|
|
1501
|
-
*/
|
|
1502
1557
|
export type AppStateTopLevelKey = keyof AppState;
|
|
1558
|
+
export type AppStateWithoutModes = Omit<AppState, "canvasMode" | "activeTool" | "viewport" | "isDragPanning" | "highlightedObjectId" | "canvasSettings" | "objectLoading">;
|
|
1503
1559
|
export type ArtboardLikeType = ObjectType.Artboard | ObjectType.MockupBoard | ObjectType.Smartboard | ObjectType.Videoboard;
|
|
1504
1560
|
export type ArtboardOptions = StandardArtboardOptions | SmartboardOptions | MockupBoardOptions | VideoboardOptions;
|
|
1505
1561
|
export type AvailableShadowOptions = Partial<Pick<ShadowOptions, "blur">> & Omit<ShadowOptions, "blur">;
|
|
@@ -1528,9 +1584,45 @@ export type BasicShapeSerializedObject = typeof BASIC_SHAPE_DEFAULT_VALUES & {
|
|
|
1528
1584
|
nPoints?: number | undefined;
|
|
1529
1585
|
};
|
|
1530
1586
|
export type BasicShapeType = (typeof BasicShapeType)[keyof typeof BasicShapeType];
|
|
1587
|
+
export type BoardRelinkOptions = {
|
|
1588
|
+
relinkBoardAfterPlacement?: boolean;
|
|
1589
|
+
};
|
|
1590
|
+
export type BoundingBox = {
|
|
1591
|
+
left: number;
|
|
1592
|
+
top: number;
|
|
1593
|
+
width: number;
|
|
1594
|
+
height: number;
|
|
1595
|
+
};
|
|
1596
|
+
export type BoundingRect = {
|
|
1597
|
+
top: number;
|
|
1598
|
+
left: number;
|
|
1599
|
+
bottom: number;
|
|
1600
|
+
right: number;
|
|
1601
|
+
};
|
|
1531
1602
|
export type BridgedSdkResult<T> = T extends SdkResult<infer _R, infer _E> ? T : SdkResult<T, Error>;
|
|
1532
|
-
export type Builtin = Date |
|
|
1533
|
-
export type
|
|
1603
|
+
export type Builtin = Date | ((...args: never[]) => unknown) | Uint8Array | RegExp | Map<unknown, unknown> | Set<unknown>;
|
|
1604
|
+
export type BypassExportDialog = (options: GetExportOptions) => Promise<Blob | null>;
|
|
1605
|
+
export type CanvasMode = {
|
|
1606
|
+
mode: "crop";
|
|
1607
|
+
targetId: string;
|
|
1608
|
+
} | {
|
|
1609
|
+
mode: "erase";
|
|
1610
|
+
targetId: string;
|
|
1611
|
+
} | {
|
|
1612
|
+
mode: "erase-and-fill";
|
|
1613
|
+
targetId: string;
|
|
1614
|
+
} | {
|
|
1615
|
+
mode: "reframe";
|
|
1616
|
+
targetId: string;
|
|
1617
|
+
} | {
|
|
1618
|
+
mode: "inpaint";
|
|
1619
|
+
targetId: string;
|
|
1620
|
+
} | {
|
|
1621
|
+
mode: "custom";
|
|
1622
|
+
id: string;
|
|
1623
|
+
state: JSONObject;
|
|
1624
|
+
} | null;
|
|
1625
|
+
export type CanvasModeKind = "erase" | "erase-and-fill" | "crop" | "reframe" | "inpaint" | null;
|
|
1534
1626
|
export type CharacterIndex = number;
|
|
1535
1627
|
export type CloneArtboardParams = {
|
|
1536
1628
|
boardId: string;
|
|
@@ -1541,6 +1633,10 @@ export type ColorInfo = StringColor | FullColor;
|
|
|
1541
1633
|
export type CombinedShapeSerializedObject = Omit<typeof DEFAULT_VALUES, "shapes"> & {
|
|
1542
1634
|
shapes: Shape[];
|
|
1543
1635
|
};
|
|
1636
|
+
export type ConnectBoardsParams = {
|
|
1637
|
+
inputBoardId: string;
|
|
1638
|
+
targetBoardId: string;
|
|
1639
|
+
};
|
|
1544
1640
|
export type ConnectedArtboardOptions<T extends ArtboardLikeType = ArtboardLikeType> = BaseStandardArtboardOptions<T> & {
|
|
1545
1641
|
inputBoardIds?: string[];
|
|
1546
1642
|
};
|
|
@@ -1576,36 +1672,24 @@ export type CreateShapeInput = CreateElementWithPositionAndSize & {
|
|
|
1576
1672
|
shapeType: BasicShapeType;
|
|
1577
1673
|
objectProperties?: ShapeProperties;
|
|
1578
1674
|
};
|
|
1675
|
+
export type CubicBezierEasing = {
|
|
1676
|
+
type: "cubic-bezier";
|
|
1677
|
+
controlPoints: readonly [
|
|
1678
|
+
x1: number,
|
|
1679
|
+
y1: number,
|
|
1680
|
+
x2: number,
|
|
1681
|
+
y2: number
|
|
1682
|
+
];
|
|
1683
|
+
};
|
|
1684
|
+
export type CustomCanvasModeId<Id extends string> = Id extends Exclude<CanvasModeKind, null> ? never : Id;
|
|
1685
|
+
export type CustomCanvasModeState<Id extends string> = Id extends keyof CustomCanvasModeStateById ? CustomCanvasModeStateById[Id] extends JSONObject ? CustomCanvasModeStateById[Id] : never : JSONObject;
|
|
1579
1686
|
export type DeepPartial<T> = {
|
|
1580
1687
|
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
1581
1688
|
};
|
|
1582
|
-
/**
|
|
1583
|
-
* Resolves a dot-separated string path against a type `T`.
|
|
1584
|
-
*
|
|
1585
|
-
* For `Record<string, V>` intermediaries (e.g. `objects`), any string
|
|
1586
|
-
* key is accepted and the type continues into `V`.
|
|
1587
|
-
*
|
|
1588
|
-
* @example
|
|
1589
|
-
* DeepValue<SelectorState, 'objects.id1.width'> // number | undefined
|
|
1590
|
-
* DeepValue<SelectorState, 'config'> // DesignConfig
|
|
1591
|
-
* DeepValue<AppState, 'viewport.coords.tl.x'> // number
|
|
1592
|
-
*/
|
|
1593
1689
|
export type DeepValue<T, P extends string> = P extends `${infer K}.${infer Rest}` ? K extends keyof T ? DeepValue<NonNullable<T[K]>, Rest> : T extends Record<string, infer V> ? DeepValue<NonNullable<V>, Rest> : undefined : P extends keyof T ? T[P] : T extends Record<string, infer V> ? V : undefined;
|
|
1594
1690
|
export type DesignApiOptions = APIOptions<NormalizedDesignState>;
|
|
1595
1691
|
export type DesignObjectId = string;
|
|
1596
|
-
/**
|
|
1597
|
-
* A dot-separated string path into the design state.
|
|
1598
|
-
* The first segment must be a valid top-level key of NormalizedDesignState.
|
|
1599
|
-
*
|
|
1600
|
-
* @example
|
|
1601
|
-
* 'objects.id1.width'
|
|
1602
|
-
* 'config.title'
|
|
1603
|
-
* 'boards.board1.backgroundColor'
|
|
1604
|
-
*/
|
|
1605
1692
|
export type DesignStateSelectorPath = DesignStateTopLevelKey | `${DesignStateTopLevelKey}.${string}`;
|
|
1606
|
-
/**
|
|
1607
|
-
* Top-level keys of NormalizedDesignState that extensions can subscribe to.
|
|
1608
|
-
*/
|
|
1609
1693
|
export type DesignStateTopLevelKey = keyof NormalizedDesignState;
|
|
1610
1694
|
export type DesignStructureObject = {
|
|
1611
1695
|
id?: StructureObjectId | null;
|
|
@@ -1616,15 +1700,34 @@ export type Dimensions = {
|
|
|
1616
1700
|
width: number;
|
|
1617
1701
|
height: number;
|
|
1618
1702
|
};
|
|
1703
|
+
export type DisconnectBoardsParams = ConnectBoardsParams;
|
|
1704
|
+
export type EasingName = "linear" | "ease" | "ease-in" | "ease-out" | "ease-in-out";
|
|
1619
1705
|
export type EditorColorScheme = "light" | "dark";
|
|
1620
1706
|
export type ElementLocation = "origin" | "center";
|
|
1621
1707
|
export type Expand<T> = T extends infer O ? {
|
|
1622
1708
|
[K in keyof O]: O[K];
|
|
1623
1709
|
} : never;
|
|
1710
|
+
export type ExportAPI = PublicExportAPI;
|
|
1711
|
+
export type ExportFieldValue = string | number | boolean | string[];
|
|
1712
|
+
export type ExportFieldValues = Record<string, ExportFieldValue>;
|
|
1713
|
+
export type ExportMimeType = (typeof EXPORT_MIME_TYPES)[keyof typeof EXPORT_MIME_TYPES];
|
|
1714
|
+
export type ExportRequest<Mime extends ExportMimeType = ExportMimeType> = {
|
|
1715
|
+
target: readonly string[];
|
|
1716
|
+
title: string;
|
|
1717
|
+
exportLabel: string;
|
|
1718
|
+
customFields?: readonly PlainInputSetting[];
|
|
1719
|
+
mimeTypes?: readonly Mime[];
|
|
1720
|
+
initialFileFormat?: Mime;
|
|
1721
|
+
};
|
|
1722
|
+
export type ExportResult = {
|
|
1723
|
+
blobs: readonly Blob[];
|
|
1724
|
+
settings: ExportFieldValues;
|
|
1725
|
+
};
|
|
1624
1726
|
export type FileBrowserContent = FileBrowserItem | FileBrowserFolder;
|
|
1625
1727
|
export type FileBrowserFetchContentParams = {
|
|
1626
1728
|
id?: string;
|
|
1627
1729
|
next?: string | number;
|
|
1730
|
+
formats?: readonly FileBrowserMediaFormat[];
|
|
1628
1731
|
};
|
|
1629
1732
|
export type FileBrowserFetchContentResult = {
|
|
1630
1733
|
content: FileBrowserContent[];
|
|
@@ -1643,16 +1746,25 @@ export type FileBrowserItem = {
|
|
|
1643
1746
|
label: string;
|
|
1644
1747
|
id: string;
|
|
1645
1748
|
preview?: string;
|
|
1749
|
+
animatedPreview?: string;
|
|
1646
1750
|
content: {
|
|
1647
1751
|
data: string;
|
|
1752
|
+
mimeType?: string;
|
|
1753
|
+
uploadType?: UploadType;
|
|
1648
1754
|
};
|
|
1649
1755
|
};
|
|
1756
|
+
export type FileBrowserMediaFormat = "image" | "video";
|
|
1650
1757
|
export type FileBrowserTab = {
|
|
1651
1758
|
id: string;
|
|
1652
1759
|
label: string;
|
|
1760
|
+
order?: number;
|
|
1761
|
+
emptyState?: FileBrowserTabEmptyState;
|
|
1762
|
+
supportedFormats?: readonly FileBrowserMediaFormat[];
|
|
1653
1763
|
fetchContent: (params?: FileBrowserFetchContentParams) => Promise<FileBrowserFetchContentResult>;
|
|
1764
|
+
onEvent?: (event: FileBrowserTabEvent) => void;
|
|
1654
1765
|
};
|
|
1655
|
-
export type
|
|
1766
|
+
export type FileBrowserTabEmptyState = "aiCreations" | "uploads";
|
|
1767
|
+
export type FileBrowserTabEvent = "close" | "open" | "upload";
|
|
1656
1768
|
export type FlattenUnion<T> = UnionToIntersection<T extends unknown ? Partial<T> : never>;
|
|
1657
1769
|
export type FontListDto = PaginatedResult<FontFamilyDto>;
|
|
1658
1770
|
export type FontVariationSettings = Record<string, number> & Partial<Record<KnownFontVariationAxis, number>>;
|
|
@@ -1663,7 +1775,6 @@ export type FullColor = {
|
|
|
1663
1775
|
visible: boolean;
|
|
1664
1776
|
};
|
|
1665
1777
|
export type FunctionType = (...args: never) => unknown;
|
|
1666
|
-
export type GenerationOperation = (typeof GenerationOperation)[keyof typeof GenerationOperation];
|
|
1667
1778
|
export type GenerationStatus = (typeof GenerationStatus)[keyof typeof GenerationStatus];
|
|
1668
1779
|
export type GenerationStatusUpdate = {
|
|
1669
1780
|
generationId: string;
|
|
@@ -1671,6 +1782,12 @@ export type GenerationStatusUpdate = {
|
|
|
1671
1782
|
inputData: undefined;
|
|
1672
1783
|
creditUse: undefined;
|
|
1673
1784
|
result: undefined;
|
|
1785
|
+
} | {
|
|
1786
|
+
generationId: string;
|
|
1787
|
+
status: typeof GenerationStatus.QUEUED;
|
|
1788
|
+
inputData?: GenerationInputData;
|
|
1789
|
+
creditUse?: GenerationCreditUse;
|
|
1790
|
+
result?: StartedGenerationResult;
|
|
1674
1791
|
} | {
|
|
1675
1792
|
generationId: string;
|
|
1676
1793
|
status: typeof GenerationStatus.STARTED;
|
|
@@ -1689,6 +1806,18 @@ export type GenerationStatusUpdate = {
|
|
|
1689
1806
|
inputData: GenerationInputData | undefined;
|
|
1690
1807
|
creditUse?: GenerationCreditUse;
|
|
1691
1808
|
result: ErrorGenerationResult;
|
|
1809
|
+
} | {
|
|
1810
|
+
generationId: string;
|
|
1811
|
+
status: typeof GenerationStatus.CANCELLED;
|
|
1812
|
+
inputData?: GenerationInputData;
|
|
1813
|
+
creditUse?: GenerationCreditUse;
|
|
1814
|
+
result: undefined;
|
|
1815
|
+
};
|
|
1816
|
+
export type GetColorsParams = {
|
|
1817
|
+
objectId: string;
|
|
1818
|
+
};
|
|
1819
|
+
export type GetIllustrationPathsParams = {
|
|
1820
|
+
id: string;
|
|
1692
1821
|
};
|
|
1693
1822
|
export type GuideSerializedObject = typeof GUIDE_DEFAULT_VALUES & OrientationDir;
|
|
1694
1823
|
export type ID = string;
|
|
@@ -1705,9 +1834,13 @@ export type IllustrationImageSerializedObject = typeof DEFAULT_VALUES$1 & {
|
|
|
1705
1834
|
} | undefined;
|
|
1706
1835
|
eraseStrokeWidth?: number | undefined;
|
|
1707
1836
|
inpaintingStrokeWidth?: number | undefined;
|
|
1837
|
+
inpaintingSelectionMode?: InpaintingSelectionMode;
|
|
1838
|
+
eraseAndFillStrokeWidth?: number | undefined;
|
|
1839
|
+
unsplashId?: string | undefined;
|
|
1708
1840
|
};
|
|
1709
1841
|
export type IllustrationProperties = {
|
|
1710
1842
|
angle?: IllustrationSerializedObject["angle"];
|
|
1843
|
+
defaultName?: IllustrationSerializedObject["defaultName"];
|
|
1711
1844
|
flipX?: IllustrationSerializedObject["flipX"];
|
|
1712
1845
|
flipY?: IllustrationSerializedObject["flipY"];
|
|
1713
1846
|
hidden?: IllustrationSerializedObject["hidden"];
|
|
@@ -1719,7 +1852,42 @@ export type IllustrationProperties = {
|
|
|
1719
1852
|
gradients?: IllustrationSerializedObject["gradients"];
|
|
1720
1853
|
generation?: IllustrationSerializedObject["generation"];
|
|
1721
1854
|
};
|
|
1855
|
+
export type IllustrationSerializedChild = {
|
|
1856
|
+
id: string;
|
|
1857
|
+
isChild: true;
|
|
1858
|
+
baseFill?: string | GradientObject | null;
|
|
1859
|
+
baseStroke?: string | GradientObject | null;
|
|
1860
|
+
name?: string | null;
|
|
1861
|
+
defaultName: string;
|
|
1862
|
+
width: number;
|
|
1863
|
+
height: number;
|
|
1864
|
+
fillRule?: CanvasFillRule;
|
|
1865
|
+
strokeLineCap?: CanvasLineCap;
|
|
1866
|
+
strokeLineJoin?: CanvasLineJoin;
|
|
1867
|
+
strokeWidth?: number;
|
|
1868
|
+
strokeUniform?: boolean;
|
|
1869
|
+
strokeDashArray?: number[];
|
|
1870
|
+
strokeDashOffset?: number;
|
|
1871
|
+
strokeMiterLimit?: number;
|
|
1872
|
+
transform: number[];
|
|
1873
|
+
type: string;
|
|
1874
|
+
opacity: number;
|
|
1875
|
+
locked: boolean;
|
|
1876
|
+
hidden: boolean;
|
|
1877
|
+
path: (string | number)[][];
|
|
1878
|
+
pathOffset?: {
|
|
1879
|
+
x: number;
|
|
1880
|
+
y: number;
|
|
1881
|
+
};
|
|
1882
|
+
};
|
|
1883
|
+
export type IllustrationSerializedChildren = IllustrationSerializedChild[];
|
|
1722
1884
|
export type IllustrationSerializedObject = typeof ILLUSTRATION_DEFAULT_VALUES;
|
|
1885
|
+
export type ImageCrop = {
|
|
1886
|
+
x: number;
|
|
1887
|
+
y: number;
|
|
1888
|
+
width: number;
|
|
1889
|
+
height: number;
|
|
1890
|
+
};
|
|
1723
1891
|
export type ImageProperties = {
|
|
1724
1892
|
angle?: IllustrationImageSerializedObject["angle"];
|
|
1725
1893
|
flipX?: IllustrationImageSerializedObject["flipX"];
|
|
@@ -1730,13 +1898,33 @@ export type ImageProperties = {
|
|
|
1730
1898
|
stroke?: IllustrationImageSerializedObject["stroke"];
|
|
1731
1899
|
strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
|
|
1732
1900
|
fill?: IllustrationImageSerializedObject["fill"];
|
|
1901
|
+
defaultName?: IllustrationImageSerializedObject["defaultName"];
|
|
1902
|
+
unsplashId?: IllustrationImageSerializedObject["unsplashId"];
|
|
1903
|
+
};
|
|
1904
|
+
export type ImplementSubStateOptions = DesignApiOptions & {
|
|
1905
|
+
placement?: ImplementSubStatePlacement;
|
|
1906
|
+
};
|
|
1907
|
+
export type ImplementSubStatePlacement = {
|
|
1908
|
+
afterExistingStandardBoards: {
|
|
1909
|
+
gap?: number;
|
|
1910
|
+
top?: number;
|
|
1911
|
+
};
|
|
1912
|
+
} | {
|
|
1913
|
+
absolute: {
|
|
1914
|
+
left: number;
|
|
1915
|
+
top?: number;
|
|
1916
|
+
gap?: number;
|
|
1917
|
+
};
|
|
1733
1918
|
};
|
|
1734
1919
|
export type InternalPatchArgs<T> = {
|
|
1735
1920
|
patch: PatchTree<T> | PatchTree<T>[];
|
|
1736
1921
|
origin: Origin;
|
|
1737
1922
|
historyOrigin?: HistoryOrigins;
|
|
1738
|
-
transactionMeta?: TransactionMeta;
|
|
1739
1923
|
};
|
|
1924
|
+
export type JSONObject = {
|
|
1925
|
+
[key: string]: JSONValue;
|
|
1926
|
+
};
|
|
1927
|
+
export type JSONValue = null | boolean | number | string | Array<JSONValue> | JSONObject;
|
|
1740
1928
|
export type KnownFontVariationAxis = "wght" | "wdth" | "slnt" | "ital" | "opsz" | "GRAD";
|
|
1741
1929
|
export type LayerIconType = "drawIcon";
|
|
1742
1930
|
export type LayerType = Exclude<SerializableObjectType, ObjectType.Guide> | typeof structuralGroupType | typeof clippingMaskType | typeof backgroundType | typeof pathType;
|
|
@@ -1751,32 +1939,6 @@ export type LineHeight = {
|
|
|
1751
1939
|
};
|
|
1752
1940
|
export type LineHeightUnit = "px" | "%";
|
|
1753
1941
|
export type LineIndex = number;
|
|
1754
|
-
export type LinkedPreset = {
|
|
1755
|
-
id: string;
|
|
1756
|
-
libraryId: string;
|
|
1757
|
-
} & LinkedPresetMeta;
|
|
1758
|
-
export type LinkedPresetMeta = {
|
|
1759
|
-
type: LibraryPresetType.FILL;
|
|
1760
|
-
meta: LinkedFillPresetMeta;
|
|
1761
|
-
} | {
|
|
1762
|
-
type: LibraryPresetType.TRANSFORMATION;
|
|
1763
|
-
meta?: never;
|
|
1764
|
-
} | {
|
|
1765
|
-
type: LibraryPresetType.PHOTO_FILTER;
|
|
1766
|
-
meta?: never;
|
|
1767
|
-
} | {
|
|
1768
|
-
type: LibraryPresetType.SHADOW;
|
|
1769
|
-
meta?: never;
|
|
1770
|
-
} | {
|
|
1771
|
-
type: LibraryPresetType.TEXT;
|
|
1772
|
-
meta?: never;
|
|
1773
|
-
} | {
|
|
1774
|
-
type: LibraryPresetType.TEXT_EFFECT;
|
|
1775
|
-
meta?: never;
|
|
1776
|
-
} | {
|
|
1777
|
-
type: LibraryPresetType.TEXT_DECORATION;
|
|
1778
|
-
meta?: never;
|
|
1779
|
-
};
|
|
1780
1942
|
export type LoadingCardSerializedObject = typeof LOADING_CARD_DEFAULT_VALUES & {
|
|
1781
1943
|
imageGenerationId?: string | undefined;
|
|
1782
1944
|
startedAt?: number | undefined;
|
|
@@ -1844,6 +2006,14 @@ export type NormalizedVideoObject = Normalized<VideoSerializedObject>;
|
|
|
1844
2006
|
export type NullablePathTextShadowOptions = PathTextShadowOptions | {
|
|
1845
2007
|
type: null;
|
|
1846
2008
|
};
|
|
2009
|
+
export type ObjectPosition = {
|
|
2010
|
+
top: number;
|
|
2011
|
+
left: number;
|
|
2012
|
+
};
|
|
2013
|
+
export type ObjectPositionRect = {
|
|
2014
|
+
width: number;
|
|
2015
|
+
height: number;
|
|
2016
|
+
} & ObjectPosition;
|
|
1847
2017
|
export type OnGenerationStatusUpdate = (update: GenerationStatusUpdate) => void | Promise<void>;
|
|
1848
2018
|
export type OrAnyString<T extends string> = T | (string & {});
|
|
1849
2019
|
export type OrientationConditional = {
|
|
@@ -1899,6 +2069,34 @@ export type PathTextTransformOptions = TransformOptions & {
|
|
|
1899
2069
|
y: number;
|
|
1900
2070
|
}[];
|
|
1901
2071
|
};
|
|
2072
|
+
export type PendingOperation = (typeof PendingOperation)[keyof typeof PendingOperation];
|
|
2073
|
+
export type PlainInputSetting = {
|
|
2074
|
+
isPremium?: boolean;
|
|
2075
|
+
name: "combineBoards" | (string & {});
|
|
2076
|
+
label?: string;
|
|
2077
|
+
disabled?: true;
|
|
2078
|
+
} & ({
|
|
2079
|
+
type: "selection";
|
|
2080
|
+
options: readonly SelectionOption[];
|
|
2081
|
+
default?: string;
|
|
2082
|
+
} | {
|
|
2083
|
+
type: "input";
|
|
2084
|
+
propType: "string";
|
|
2085
|
+
unit?: string;
|
|
2086
|
+
default?: string;
|
|
2087
|
+
} | {
|
|
2088
|
+
type: "input";
|
|
2089
|
+
propType: "number";
|
|
2090
|
+
unit?: string;
|
|
2091
|
+
default?: number;
|
|
2092
|
+
max?: number;
|
|
2093
|
+
min?: number;
|
|
2094
|
+
} | {
|
|
2095
|
+
type: "input";
|
|
2096
|
+
propType: "boolean";
|
|
2097
|
+
unit?: string;
|
|
2098
|
+
default?: boolean;
|
|
2099
|
+
});
|
|
1902
2100
|
export type PrintMargins = {
|
|
1903
2101
|
enabled: boolean;
|
|
1904
2102
|
top: number;
|
|
@@ -1933,6 +2131,10 @@ export type RemoveFromGroupParams = {
|
|
|
1933
2131
|
export type RemoveGroupParams = {
|
|
1934
2132
|
groupId: string;
|
|
1935
2133
|
};
|
|
2134
|
+
export type RemoveIllustrationPathParams = {
|
|
2135
|
+
illustrationId: string;
|
|
2136
|
+
pathIds: string[];
|
|
2137
|
+
};
|
|
1936
2138
|
export type RemovePlaylistItemParams = {
|
|
1937
2139
|
videoBoardId: string;
|
|
1938
2140
|
playlistItemId: string;
|
|
@@ -1944,10 +2146,21 @@ export type RemoveVideoPlaylistItemParams = {
|
|
|
1944
2146
|
videoId: string;
|
|
1945
2147
|
playlistItemId: string;
|
|
1946
2148
|
};
|
|
2149
|
+
export type RenameIllustrationPathParams = {
|
|
2150
|
+
illustrationId: string;
|
|
2151
|
+
pathId: string;
|
|
2152
|
+
newName: string;
|
|
2153
|
+
};
|
|
1947
2154
|
export type RenameParams = {
|
|
1948
2155
|
objectId: string;
|
|
1949
2156
|
newName: string;
|
|
1950
2157
|
};
|
|
2158
|
+
export type ReorderVideoPlaylistItemParams = {
|
|
2159
|
+
videoId: string;
|
|
2160
|
+
playlistItemId: string;
|
|
2161
|
+
previousPlaylistItemId?: string;
|
|
2162
|
+
nextPlaylistItemId?: string;
|
|
2163
|
+
};
|
|
1951
2164
|
export type ResetImageBackgroundRemovalParams = {
|
|
1952
2165
|
id: IllustrationImageSerializedObject["id"];
|
|
1953
2166
|
};
|
|
@@ -1976,7 +2189,7 @@ export type RichTextRenderPluginSerializedObject = RichTextBasePluginSerializedO
|
|
|
1976
2189
|
offset: number;
|
|
1977
2190
|
[key: string]: string | number;
|
|
1978
2191
|
};
|
|
1979
|
-
export type RichTextResizeBehavior = "hug" | "none" | "hug-height";
|
|
2192
|
+
export type RichTextResizeBehavior = "hug" | "none" | "hug-height" | "fixed-box-fit";
|
|
1980
2193
|
export type RichTextSerializedCharacterStyle = Partial<{
|
|
1981
2194
|
fontFamily: string;
|
|
1982
2195
|
fontWeight: FontWeight;
|
|
@@ -2033,6 +2246,37 @@ export type RichTextSerializedTransformPluginObject = RichTextBasePluginSerializ
|
|
|
2033
2246
|
curveHeight?: number;
|
|
2034
2247
|
directionInverted?: boolean;
|
|
2035
2248
|
};
|
|
2249
|
+
export type SDKColor = string | SDKGradient;
|
|
2250
|
+
export type SDKColorEntry = {
|
|
2251
|
+
key: string;
|
|
2252
|
+
color: SDKColor | null;
|
|
2253
|
+
};
|
|
2254
|
+
export type SDKColorStop = {
|
|
2255
|
+
offset: number;
|
|
2256
|
+
color: string | null;
|
|
2257
|
+
};
|
|
2258
|
+
export type SDKGradient = SDKLinearGradient | SDKRadialGradient;
|
|
2259
|
+
export type SDKLinearGradient = {
|
|
2260
|
+
type: GradientType.Linear;
|
|
2261
|
+
colorStops: SDKColorStop[];
|
|
2262
|
+
angle: number;
|
|
2263
|
+
coords: SDKLinearGradientCoords;
|
|
2264
|
+
};
|
|
2265
|
+
export type SDKLinearGradientCoords = {
|
|
2266
|
+
x1: number;
|
|
2267
|
+
y1: number;
|
|
2268
|
+
x2: number;
|
|
2269
|
+
y2: number;
|
|
2270
|
+
};
|
|
2271
|
+
export type SDKRadialGradient = {
|
|
2272
|
+
type: GradientType.Radial;
|
|
2273
|
+
colorStops: SDKColorStop[];
|
|
2274
|
+
angle: number;
|
|
2275
|
+
coords: SDKRadialGradientCoords;
|
|
2276
|
+
};
|
|
2277
|
+
export type SDKRadialGradientCoords = SDKLinearGradientCoords & {
|
|
2278
|
+
r2: number;
|
|
2279
|
+
};
|
|
2036
2280
|
export type ScreenCoordinates = {
|
|
2037
2281
|
x: number;
|
|
2038
2282
|
y: number;
|
|
@@ -2063,12 +2307,13 @@ export type SdkResultAsync<T, E = SdkError> = Promise<{
|
|
|
2063
2307
|
result?: never;
|
|
2064
2308
|
error: E;
|
|
2065
2309
|
}>;
|
|
2310
|
+
export type SelectionOption = {
|
|
2311
|
+
value: string;
|
|
2312
|
+
label: string;
|
|
2313
|
+
disabled?: true;
|
|
2314
|
+
isPremium?: true;
|
|
2315
|
+
};
|
|
2066
2316
|
export type Selector<T, U = unknown> = (state: T) => U;
|
|
2067
|
-
/**
|
|
2068
|
-
* The design state shape exposed to string path selectors.
|
|
2069
|
-
* `objects` values are flattened so that variant-specific properties
|
|
2070
|
-
* (e.g. `width`, `fill`) are accessible without manual narrowing.
|
|
2071
|
-
*/
|
|
2072
2317
|
export type SelectorState = Omit<NormalizedDesignState, "objects"> & {
|
|
2073
2318
|
objects: Record<string, FlattenUnion<NormalizedObject>>;
|
|
2074
2319
|
};
|
|
@@ -2084,6 +2329,18 @@ export type SerialisedPhotoFilter = ({
|
|
|
2084
2329
|
export type SerializableCornerRadii = Record<string, Record<string, number>>;
|
|
2085
2330
|
export type SerializableObjectType = ObjectType.IllustrationImage | ObjectType.Illustration | ObjectType.Artboard | ObjectType.Smartboard | ObjectType.Videoboard | ObjectType.MockupBoard | ObjectType.PathText | ObjectType.RichText | ObjectType.MockupDesign | ObjectType.OverlayTexture | ObjectType.Mask | ObjectType.BasicShape | ObjectType.VectorPath | ObjectType.Guide | ObjectType.CombinedShape | ObjectType.LoadingCard | ObjectType.Video;
|
|
2086
2331
|
export type SerializedObject = StandardSerializedObject | GuideSerializedObject;
|
|
2332
|
+
export type SetCanvasModeWithTargetOptions = {
|
|
2333
|
+
origin?: Origin;
|
|
2334
|
+
targetId?: string | null;
|
|
2335
|
+
};
|
|
2336
|
+
export type SetColorsParams = {
|
|
2337
|
+
objectId: string;
|
|
2338
|
+
colorEntries: SDKColorEntry[];
|
|
2339
|
+
};
|
|
2340
|
+
export type SetCustomCanvasModeParams<Id extends string> = {
|
|
2341
|
+
id: CustomCanvasModeId<Id>;
|
|
2342
|
+
state: CustomCanvasModeState<Id>;
|
|
2343
|
+
};
|
|
2087
2344
|
export type SetTextureParams = {
|
|
2088
2345
|
boardId: string;
|
|
2089
2346
|
texture: string;
|
|
@@ -2094,9 +2351,16 @@ export type SetVideoOnVideoboardParams = {
|
|
|
2094
2351
|
video: {
|
|
2095
2352
|
width?: number;
|
|
2096
2353
|
height?: number;
|
|
2097
|
-
playlist:
|
|
2354
|
+
playlist: VideoPlaylistItemInput[];
|
|
2098
2355
|
};
|
|
2099
2356
|
} & Pick<VideoboardOptions, "generationSettings">;
|
|
2357
|
+
export type SettingsType = {
|
|
2358
|
+
gridSize: number;
|
|
2359
|
+
showGrid: boolean;
|
|
2360
|
+
showRuler: boolean;
|
|
2361
|
+
showPrintMargins: boolean;
|
|
2362
|
+
enableGuideRedraw: boolean;
|
|
2363
|
+
};
|
|
2100
2364
|
export type ShadingOptions = AvailableShadowOptions & {
|
|
2101
2365
|
type: "drop" | "line" | "block" | "detail";
|
|
2102
2366
|
outlineWidth?: number;
|
|
@@ -2122,6 +2386,17 @@ export type ShapeProperties = {
|
|
|
2122
2386
|
stroke?: NonNullable<BasicShapeSerializedObject["stroke"]>;
|
|
2123
2387
|
strokeWidth?: NonNullable<BasicShapeSerializedObject["strokeWidth"]>;
|
|
2124
2388
|
};
|
|
2389
|
+
export type SmartPlacementInput = {
|
|
2390
|
+
objects: BoundingBox[];
|
|
2391
|
+
padding?: number;
|
|
2392
|
+
applyViewportScale?: boolean;
|
|
2393
|
+
ignoredIds?: string[];
|
|
2394
|
+
targetBoardId?: string;
|
|
2395
|
+
};
|
|
2396
|
+
export type SmartPlacementOutput = {
|
|
2397
|
+
insertionBoundingBox: BoundingBox;
|
|
2398
|
+
objectPlacements: BoundingBox[];
|
|
2399
|
+
};
|
|
2125
2400
|
export type SmartboardAction = SmartboardActionWithAiPrompt | SmartboardActionInitial;
|
|
2126
2401
|
export type SmartboardActionInitial = {
|
|
2127
2402
|
type: "noAction";
|
|
@@ -2164,6 +2439,9 @@ export type StringColor = {
|
|
|
2164
2439
|
};
|
|
2165
2440
|
export type StringColorKeysType = (typeof stringColorKeys)[number];
|
|
2166
2441
|
export type StructureObjectId = string;
|
|
2442
|
+
export type SubscribeOptions = {
|
|
2443
|
+
skipDedupe?: boolean;
|
|
2444
|
+
};
|
|
2167
2445
|
export type SuccessGenerationResult = VideoGenerationResult | ImageGenerationResult;
|
|
2168
2446
|
export type TempUserImageUpload = {
|
|
2169
2447
|
objectId: string;
|
|
@@ -2179,7 +2457,7 @@ export type TextProperties = {
|
|
|
2179
2457
|
fill?: Color;
|
|
2180
2458
|
textAlign?: TextAlign;
|
|
2181
2459
|
lineHeightValue?: LineHeight;
|
|
2182
|
-
resizeBehavior?:
|
|
2460
|
+
resizeBehavior?: RichTextResizeBehavior;
|
|
2183
2461
|
charSpacing?: number;
|
|
2184
2462
|
underline?: boolean;
|
|
2185
2463
|
overline?: boolean;
|
|
@@ -2190,15 +2468,16 @@ export type TextProperties = {
|
|
|
2190
2468
|
stroke?: string | null;
|
|
2191
2469
|
strokeWidth?: number;
|
|
2192
2470
|
};
|
|
2193
|
-
export type
|
|
2194
|
-
|
|
2195
|
-
|
|
2471
|
+
export type ToggleHideIllustrationPathParams = {
|
|
2472
|
+
illustrationId: string;
|
|
2473
|
+
pathId: string;
|
|
2474
|
+
hidden: boolean;
|
|
2475
|
+
};
|
|
2476
|
+
export type ToggleLockIllustrationPathParams = {
|
|
2477
|
+
illustrationId: string;
|
|
2478
|
+
pathId: string;
|
|
2479
|
+
locked: boolean;
|
|
2196
2480
|
};
|
|
2197
|
-
/**
|
|
2198
|
-
* Collapses a union type into a single object type where:
|
|
2199
|
-
* - Properties shared by all members keep their original type.
|
|
2200
|
-
* - Properties that exist only on some members become optional.
|
|
2201
|
-
*/
|
|
2202
2481
|
export type UnionToIntersection<U> = (U extends unknown ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
|
|
2203
2482
|
export type UpdateArtboardBackgroundParams = {
|
|
2204
2483
|
id: string;
|
|
@@ -2236,27 +2515,34 @@ export type UpdateImageParams = {
|
|
|
2236
2515
|
width?: IllustrationImageSerializedObject["width"];
|
|
2237
2516
|
height?: IllustrationImageSerializedObject["height"];
|
|
2238
2517
|
objectName?: IllustrationImageSerializedObject["objectName"];
|
|
2518
|
+
backgroundRemoved?: IllustrationImageSerializedObject["backgroundRemoved"];
|
|
2519
|
+
objectNameWithBackground?: IllustrationImageSerializedObject["objectNameWithBackground"];
|
|
2239
2520
|
shadowOptions?: IllustrationImageSerializedObject["shadowOptions"];
|
|
2240
2521
|
shadowColor?: NonNullable<IllustrationImageSerializedObject["shadowOptions"]>["color"];
|
|
2241
2522
|
stroke?: IllustrationImageSerializedObject["stroke"];
|
|
2242
2523
|
strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
|
|
2524
|
+
inpaintingStrokeWidth?: IllustrationImageSerializedObject["inpaintingStrokeWidth"];
|
|
2525
|
+
inpaintingSelectionMode?: IllustrationImageSerializedObject["inpaintingSelectionMode"];
|
|
2243
2526
|
} & GeneratableObject;
|
|
2244
2527
|
export type UpdateImageSourceParams = {
|
|
2245
2528
|
id: IllustrationImageSerializedObject["id"];
|
|
2246
2529
|
objectName: IllustrationImageSerializedObject["objectName"];
|
|
2247
2530
|
keepObjectDimensions?: boolean;
|
|
2531
|
+
resizeMode?: "preserve-rendered-bounds" | "preserve-min-dimension";
|
|
2248
2532
|
flatten?: boolean;
|
|
2249
2533
|
};
|
|
2250
2534
|
export type UpdateMockupBoardParams = {
|
|
2251
2535
|
mockupBoardId: string;
|
|
2252
2536
|
size?: Dimensions;
|
|
2253
2537
|
mockupTemplateId?: number;
|
|
2538
|
+
fill?: string;
|
|
2254
2539
|
shouldMockupColorMatchArtboard?: boolean;
|
|
2255
2540
|
};
|
|
2541
|
+
export type UpdateObjectApiOptions = (Exclude<DesignApiOptions, undefined> & BoardRelinkOptions) | undefined;
|
|
2256
2542
|
export type UpdatePlaylistItemParams = {
|
|
2257
2543
|
videoBoardId: string;
|
|
2258
2544
|
playlistItemId: string;
|
|
2259
|
-
playlistItem: Omit<
|
|
2545
|
+
playlistItem: Partial<Omit<VideoPlaylistItemInput, "id">>;
|
|
2260
2546
|
};
|
|
2261
2547
|
export type UpdateRenderPluginParams = {
|
|
2262
2548
|
textId: string;
|
|
@@ -2266,6 +2552,9 @@ export type UpdateRenderPluginParams = {
|
|
|
2266
2552
|
export type UpdateShapeInput = Partial<CreateElementWithPositionAndSize> & BasicShapeConfigurableFields & {
|
|
2267
2553
|
id: NormalizedBasicShapeObject["id"];
|
|
2268
2554
|
};
|
|
2555
|
+
export type UpdateSmartboardBackgroundImageParams = {
|
|
2556
|
+
smartboardId: string;
|
|
2557
|
+
} & Partial<Pick<BackgroundImageOptions, "objectName" | "generation" | "opacity" | "filters" | "globalCompositeOperation" | "hidden">>;
|
|
2269
2558
|
export type UpdateSmartboardParams = {
|
|
2270
2559
|
smartboardId: string;
|
|
2271
2560
|
size?: Dimensions;
|
|
@@ -2294,12 +2583,13 @@ export type UpdateVideoParams = {
|
|
|
2294
2583
|
export type UpdateVideoPlaylistItemParams = {
|
|
2295
2584
|
videoId: string;
|
|
2296
2585
|
playlistItemId: string;
|
|
2297
|
-
playlistItem: Omit<
|
|
2586
|
+
playlistItem: Partial<Omit<VideoPlaylistItemInput, "id">>;
|
|
2298
2587
|
};
|
|
2299
2588
|
export type UpdateVideoboardParams = {
|
|
2300
2589
|
videoBoardId: string;
|
|
2301
2590
|
size?: Dimensions;
|
|
2302
2591
|
} & Pick<VideoboardOptions, "generationSettings">;
|
|
2592
|
+
export type UploadType = (typeof UploadType)[keyof typeof UploadType];
|
|
2303
2593
|
export type UploadedFontFamily = {
|
|
2304
2594
|
id: string;
|
|
2305
2595
|
name: string;
|
|
@@ -2326,12 +2616,20 @@ export type VideoBoardGenerationSettings = Record<string, unknown>;
|
|
|
2326
2616
|
export type VideoPlaylistItem = {
|
|
2327
2617
|
id: string;
|
|
2328
2618
|
objectName?: string;
|
|
2619
|
+
startOffset?: number;
|
|
2620
|
+
endOffset?: number;
|
|
2621
|
+
playbackRate: number;
|
|
2622
|
+
volume: number;
|
|
2329
2623
|
meta?: GeneratableObject & {
|
|
2330
2624
|
generation?: {
|
|
2331
2625
|
isGenerating?: boolean;
|
|
2332
2626
|
};
|
|
2333
2627
|
};
|
|
2334
2628
|
};
|
|
2629
|
+
export type VideoPlaylistItemInput = Omit<VideoPlaylistItem, "id" | "playbackRate" | "volume"> & {
|
|
2630
|
+
playbackRate?: number;
|
|
2631
|
+
volume?: number;
|
|
2632
|
+
};
|
|
2335
2633
|
export type VideoSerializedObject = typeof DEFAULT_VALUES$2 & {
|
|
2336
2634
|
playlist: VideoPlaylistItem[];
|
|
2337
2635
|
realWidth?: number;
|
|
@@ -2377,8 +2675,16 @@ export type ViewportAPI = {
|
|
|
2377
2675
|
set(patch: ViewportPatch, origin?: Origin): void;
|
|
2378
2676
|
getTransform(): Viewport["transform"];
|
|
2379
2677
|
setTransform(transform: Viewport["transform"], origin?: Origin): void;
|
|
2678
|
+
getPixelSize(): {
|
|
2679
|
+
width: number;
|
|
2680
|
+
height: number;
|
|
2681
|
+
};
|
|
2380
2682
|
getZoom(): number;
|
|
2381
2683
|
setZoom(zoom: number, origin?: Origin): void;
|
|
2684
|
+
zoomToPoint(screenPoint: {
|
|
2685
|
+
x: number;
|
|
2686
|
+
y: number;
|
|
2687
|
+
}, zoom: number, origin?: Origin): void;
|
|
2382
2688
|
getCoords(): Viewport["coords"];
|
|
2383
2689
|
setCoords(coords: Viewport["coords"], origin?: Origin): void;
|
|
2384
2690
|
getPosition(): {
|
|
@@ -2389,7 +2695,33 @@ export type ViewportAPI = {
|
|
|
2389
2695
|
x: number;
|
|
2390
2696
|
y: number;
|
|
2391
2697
|
}, origin?: Origin): void;
|
|
2698
|
+
centerOnBounds(bounds: BoundingRect, origin?: Origin): void;
|
|
2699
|
+
panTo(position: {
|
|
2700
|
+
x: number;
|
|
2701
|
+
y: number;
|
|
2702
|
+
}, origin?: Origin): void;
|
|
2703
|
+
animateTo(params: AnimateViewportParams, origin?: Origin): Promise<ViewportAnimationResult>;
|
|
2704
|
+
animateToBounds(params: AnimateViewportToBoundsParams, origin?: Origin): Promise<ViewportAnimationResult>;
|
|
2705
|
+
centerToBounds(params: AnimateViewportToCenterParams, origin?: Origin): Promise<ViewportAnimationResult>;
|
|
2706
|
+
expandToBounds(params: AnimateViewportToBoundsParams, origin?: Origin): Promise<ViewportAnimationResult>;
|
|
2707
|
+
};
|
|
2708
|
+
export type ViewportAnimationResult = {
|
|
2709
|
+
status: "completed";
|
|
2710
|
+
} | {
|
|
2711
|
+
status: "interrupted";
|
|
2712
|
+
reason: "superseded" | "viewport-updated" | "destroyed";
|
|
2713
|
+
};
|
|
2714
|
+
export type ViewportAnimationSettings = {
|
|
2715
|
+
duration?: number;
|
|
2716
|
+
ease?: ViewportEasing;
|
|
2717
|
+
};
|
|
2718
|
+
export type ViewportBoundsPadding = number | {
|
|
2719
|
+
left?: number;
|
|
2720
|
+
right?: number;
|
|
2721
|
+
top?: number;
|
|
2722
|
+
bottom?: number;
|
|
2392
2723
|
};
|
|
2724
|
+
export type ViewportEasing = EasingName | CubicBezierEasing;
|
|
2393
2725
|
export type ViewportPatch = {
|
|
2394
2726
|
transform: Viewport["transform"];
|
|
2395
2727
|
zoom?: never;
|