@kittl/sdk 0.0.1

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/sdk.d.ts ADDED
@@ -0,0 +1,1916 @@
1
+ declare abstract class BatchClient<T extends Record<string, unknown>> {
2
+ abstract getPatches(): PatchTree<T>[];
3
+ abstract getOrigin(): Origin;
4
+ abstract getHistoryOrigin(): HistoryOrigins;
5
+ abstract getWorkingState(): KittlStateStore<T>;
6
+ abstract commit(): void;
7
+ }
8
+ declare abstract class KittlStateStore<T extends Record<string, unknown>> {
9
+ abstract getSnapshot(): T;
10
+ abstract subscribe<U>(selector: Selector<T, U>, callback: (selected: U, meta: {
11
+ patch: PatchTree<T>[];
12
+ senderOrigin: Origin;
13
+ }) => void, subscriberOrigin?: Origin): () => void;
14
+ abstract internalPatch(args: InternalPatchArgs<T>): void;
15
+ abstract resetWithState(state: T): void;
16
+ }
17
+ declare const BASIC_SHAPE_DEFAULT_VALUES: {
18
+ defaultIcon: LayerIconType | undefined;
19
+ shadowOptions?: {
20
+ color?: string | undefined | null;
21
+ blur?: number | undefined;
22
+ offset?: number;
23
+ angle?: number;
24
+ };
25
+ presets?: LinkedPreset[] | undefined;
26
+ gradients?: StateGradientInfo | undefined;
27
+ clipPathMaskId?: string | undefined | null;
28
+ childrenInfo?: {
29
+ objectName?: string;
30
+ id: string;
31
+ fallbackObjectName: string | null;
32
+ objectNameLayout?: WithObjectLayout;
33
+ fallbackObjectNameLayout?: WithObjectLayout;
34
+ } | undefined;
35
+ hiddenColors?: Record<string, NonNullable<Color>> | undefined;
36
+ inLoadingStage?: boolean | undefined;
37
+ objectName: string;
38
+ skewX: number | undefined;
39
+ skewY: number | undefined;
40
+ width: number;
41
+ height: number;
42
+ scaleX: number;
43
+ scaleY: number;
44
+ angle: number;
45
+ top: number;
46
+ left: number;
47
+ flipX: boolean;
48
+ flipY: boolean;
49
+ name?: string | undefined;
50
+ defaultName: string | undefined;
51
+ locked?: boolean | undefined;
52
+ hidden?: boolean | undefined;
53
+ opacity?: number | undefined;
54
+ stroke?: string;
55
+ strokeWidth?: number;
56
+ fill?: ColorInfo[] | undefined;
57
+ scalingCorners?: boolean | undefined;
58
+ cornerRadii?: SerializableCornerRadii | undefined;
59
+ id: DesignObjectId;
60
+ version: string;
61
+ type: ObjectType.BasicShape;
62
+ };
63
+ declare const BasicShapeType: {
64
+ readonly RECTANGLE: "rectangle";
65
+ readonly CIRCLE: "ellipse";
66
+ readonly STAR: "star";
67
+ readonly TRIANGLE: "polygon";
68
+ };
69
+ declare const DEFAULT_VALUES$1: {
70
+ globalCompositeOperation: BlendMode;
71
+ stroke?: string;
72
+ strokeWidth?: number;
73
+ shadowOptions?: {
74
+ color?: string | undefined | null;
75
+ blur?: number | undefined;
76
+ offset?: number;
77
+ angle?: number;
78
+ };
79
+ presets?: LinkedPreset[] | undefined;
80
+ opacity?: number | undefined;
81
+ objectName: string;
82
+ width: number;
83
+ height: number;
84
+ scaleX: number;
85
+ scaleY: number;
86
+ angle: number;
87
+ top: number;
88
+ left: number;
89
+ flipX: boolean;
90
+ flipY: boolean;
91
+ name?: string | undefined;
92
+ defaultName: string | undefined;
93
+ locked?: boolean | undefined;
94
+ inLoadingStage?: boolean | undefined;
95
+ clipPathMaskId?: string | undefined | null;
96
+ hidden?: boolean | undefined;
97
+ filters: SerialisedPhotoFilter[] | undefined;
98
+ fill?: ColorInfo[] | undefined;
99
+ cropX?: number | undefined;
100
+ cropY?: number | undefined;
101
+ cropWidth?: number | undefined;
102
+ cropHeight?: number | undefined;
103
+ id: DesignObjectId;
104
+ version: string;
105
+ type: ObjectType.IllustrationImage;
106
+ isGeneratedByAi?: boolean;
107
+ aiArtId?: string;
108
+ generatedContentId?: string;
109
+ generation?: {
110
+ meta?: GenerationMeta;
111
+ generationId?: string;
112
+ generatorKey: string;
113
+ };
114
+ };
115
+ declare const DEFAULT_VALUES$2: {
116
+ cropX?: number | undefined;
117
+ cropY?: number | undefined;
118
+ cropWidth?: number | undefined;
119
+ cropHeight?: number | undefined;
120
+ shadowOptions?: {
121
+ color?: string | undefined | null;
122
+ blur?: number | undefined;
123
+ offset?: number;
124
+ angle?: number;
125
+ };
126
+ stroke?: string;
127
+ strokeWidth?: number;
128
+ opacity?: number | undefined;
129
+ width: number;
130
+ height: number;
131
+ scaleX: number;
132
+ scaleY: number;
133
+ angle: number;
134
+ top: number;
135
+ left: number;
136
+ flipX: boolean;
137
+ flipY: boolean;
138
+ name?: string | undefined;
139
+ defaultName: string | undefined;
140
+ locked?: boolean | undefined;
141
+ hidden?: boolean | undefined;
142
+ id: DesignObjectId;
143
+ version: string;
144
+ type: ObjectType.Video;
145
+ };
146
+ declare const DEFAULT_VALUES: {
147
+ shapes: never[];
148
+ operation: ShapeBooleanOperation;
149
+ clipPathMaskId?: string | undefined | null;
150
+ scalingCorners?: boolean | undefined;
151
+ cornerRadii?: SerializableCornerRadii | undefined;
152
+ childrenInfo?: {
153
+ objectName?: string;
154
+ id: string;
155
+ fallbackObjectName: string | null;
156
+ objectNameLayout?: WithObjectLayout;
157
+ fallbackObjectNameLayout?: WithObjectLayout;
158
+ } | undefined;
159
+ shadowOptions?: {
160
+ color?: string | undefined | null;
161
+ blur?: number | undefined;
162
+ offset?: number;
163
+ angle?: number;
164
+ };
165
+ gradients?: StateGradientInfo | undefined;
166
+ presets?: LinkedPreset[] | undefined;
167
+ opacity?: number | undefined;
168
+ hiddenColors?: Record<string, NonNullable<Color>> | undefined;
169
+ stroke?: string;
170
+ strokeWidth?: number;
171
+ fill?: ColorInfo[] | undefined;
172
+ locked?: boolean | undefined;
173
+ hidden?: boolean | undefined;
174
+ skewX: number | undefined;
175
+ skewY: number | undefined;
176
+ width: number;
177
+ height: number;
178
+ scaleX: number;
179
+ scaleY: number;
180
+ angle: number;
181
+ top: number;
182
+ left: number;
183
+ flipX: boolean;
184
+ flipY: boolean;
185
+ name?: string | undefined;
186
+ defaultName: string | undefined;
187
+ id: DesignObjectId;
188
+ version: string;
189
+ type: ObjectType.CombinedShape;
190
+ };
191
+ declare const GUIDE_DEFAULT_VALUES: {
192
+ id: DesignObjectId;
193
+ version: string;
194
+ type: ObjectType.Guide;
195
+ };
196
+ declare const ILLUSTRATION_DEFAULT_VALUES: {
197
+ hiddenColors?: Record<string, NonNullable<Color>> | undefined;
198
+ clipPathMaskId?: string | undefined | null;
199
+ isGeneratedByAi?: boolean;
200
+ aiArtId?: string;
201
+ generatedContentId?: string;
202
+ generation?: {
203
+ meta?: GenerationMeta;
204
+ generationId?: string;
205
+ generatorKey: string;
206
+ };
207
+ childrenInfo?: {
208
+ objectName?: string;
209
+ id: string;
210
+ fallbackObjectName: string | null;
211
+ objectNameLayout?: WithObjectLayout;
212
+ fallbackObjectNameLayout?: WithObjectLayout;
213
+ } | undefined;
214
+ shadowOptions?: {
215
+ color?: string | undefined | null;
216
+ blur?: number | undefined;
217
+ offset?: number;
218
+ angle?: number;
219
+ };
220
+ gradients?: StateGradientInfo | undefined;
221
+ presets?: LinkedPreset[] | undefined;
222
+ opacity?: number | undefined;
223
+ stroke?: string;
224
+ strokeWidth?: number;
225
+ fill?: ColorInfo[] | undefined;
226
+ inLoadingStage?: boolean | undefined;
227
+ locked?: boolean | undefined;
228
+ hidden?: boolean | undefined;
229
+ objectName: string;
230
+ width: number;
231
+ height: number;
232
+ scaleX: number;
233
+ scaleY: number;
234
+ angle: number;
235
+ top: number;
236
+ left: number;
237
+ flipX: boolean;
238
+ flipY: boolean;
239
+ name?: string | undefined;
240
+ defaultName: string | undefined;
241
+ id: DesignObjectId;
242
+ version: string;
243
+ type: ObjectType.Illustration;
244
+ };
245
+ declare const LOADING_CARD_DEFAULT_VALUES: {
246
+ locked?: boolean | undefined;
247
+ hidden?: boolean | undefined;
248
+ width: number;
249
+ height: number;
250
+ scaleX: number;
251
+ scaleY: number;
252
+ angle: number;
253
+ top: number;
254
+ left: number;
255
+ flipX: boolean;
256
+ flipY: boolean;
257
+ name?: string | undefined;
258
+ defaultName: string | undefined;
259
+ id: DesignObjectId;
260
+ version: string;
261
+ type: ObjectType.LoadingCard;
262
+ };
263
+ declare const MASK_DEFAULT_VALUES: {
264
+ inLoadingStage?: boolean | undefined;
265
+ opacity?: number | undefined;
266
+ locked?: boolean | undefined;
267
+ hidden?: boolean | undefined;
268
+ objectName: string;
269
+ width: number;
270
+ height: number;
271
+ scaleX: number;
272
+ scaleY: number;
273
+ angle: number;
274
+ top: number;
275
+ left: number;
276
+ flipX: boolean;
277
+ flipY: boolean;
278
+ name?: string | undefined;
279
+ defaultName: string | undefined;
280
+ id: DesignObjectId;
281
+ version: string;
282
+ type: ObjectType.Mask;
283
+ };
284
+ declare const MOCKUP_DESIGN_DEFAULT_VALUES: {
285
+ hidden?: boolean | undefined;
286
+ locked?: boolean | undefined;
287
+ width: number;
288
+ height: number;
289
+ scaleX: number;
290
+ scaleY: number;
291
+ angle: number;
292
+ top: number;
293
+ left: number;
294
+ flipX: boolean;
295
+ flipY: boolean;
296
+ id: DesignObjectId;
297
+ version: string;
298
+ type: ObjectType.MockupDesign;
299
+ };
300
+ declare const PATH_TEXT_DEFAULT_VALUES: {
301
+ fontSize: number;
302
+ lineHeight: number;
303
+ textAlignment: TextAlignment;
304
+ letterSpacing: number;
305
+ stroke: string;
306
+ useLigatures: boolean;
307
+ strokeWidth?: number;
308
+ fill?: Color | undefined;
309
+ presets?: LinkedPreset[] | undefined;
310
+ opacity?: number | undefined;
311
+ locked?: boolean | undefined;
312
+ hidden?: boolean | undefined;
313
+ width: number;
314
+ height: number;
315
+ scaleX: number;
316
+ scaleY: number;
317
+ angle: number;
318
+ top: number;
319
+ left: number;
320
+ flipX: boolean;
321
+ flipY: boolean;
322
+ name?: string | undefined;
323
+ defaultName: string | undefined;
324
+ id: DesignObjectId;
325
+ version: string;
326
+ type: ObjectType.PathText;
327
+ };
328
+ declare const RICH_TEXT_DEFAULT_VALUES: {
329
+ activeTransformPlugin?: object | undefined;
330
+ presets?: LinkedPreset[] | undefined;
331
+ opacity?: number | undefined;
332
+ stroke?: string;
333
+ strokeWidth?: number;
334
+ fill?: Color | undefined;
335
+ locked?: boolean | undefined;
336
+ hidden?: boolean | undefined;
337
+ width: number;
338
+ height: number;
339
+ scaleX: number;
340
+ scaleY: number;
341
+ angle: number;
342
+ top: number;
343
+ left: number;
344
+ flipX: boolean;
345
+ flipY: boolean;
346
+ name?: string | undefined;
347
+ defaultName: string | undefined;
348
+ id: DesignObjectId;
349
+ version: string;
350
+ type: ObjectType.RichText;
351
+ };
352
+ declare const backgroundType = "background";
353
+ declare const clippingMaskType = "clippingMask";
354
+ declare const pathType = "path";
355
+ declare const stringColorKeys: readonly [
356
+ "stroke",
357
+ "shadow",
358
+ "decoration"
359
+ ];
360
+ declare const structuralGroupType = "structuralGroup";
361
+ declare enum Action {
362
+ MERGE = "MERGE",
363
+ SET = "SET",
364
+ DELETE = "DELETE"
365
+ }
366
+ declare enum BlendMode {
367
+ Normal = "normal",
368
+ SourceOver = "source-over",
369
+ Multiply = "multiply",
370
+ Screen = "screen",
371
+ Overlay = "overlay",
372
+ SoftLight = "soft-light",
373
+ HardLight = "hard-light",
374
+ ColorDodge = "color-dodge",
375
+ ColorBurn = "color-burn",
376
+ Lighten = "lighten",
377
+ Darken = "darken",
378
+ Difference = "difference",
379
+ Exclusion = "exclusion",
380
+ Lighter = "lighter",
381
+ Hue = "hue",
382
+ Saturation = "saturation",
383
+ Color = "color",
384
+ Luminosity = "luminosity",
385
+ AlphaMask = "destination-out"
386
+ }
387
+ declare enum BoardLayout {
388
+ Custom = "custom",
389
+ Standard = "standard",
390
+ TShirt = "tshirt",
391
+ BusinessCard = "businesscard",
392
+ A4 = "a4",
393
+ A5 = "a5",
394
+ Poster = "poster",
395
+ InstagramPost = "instagramPost",
396
+ InstagramPostPortrait = "instagramPostPortrait",
397
+ instagramPostSquare = "instagramPostSquare",
398
+ InstagramPostLandscape = "instagramPostLandscape",
399
+ InstagramStory = "instagramStory",
400
+ InstagramReel = "instagramReel",
401
+ FacebookPost = "facebookPost",
402
+ FacebookPostSquare = "facebookPostSquare",
403
+ FacebookPostLandscape = "facebookPostLandscape",
404
+ FacebookStory = "facebookStory",
405
+ YouTubeThumbnail = "youtubeThumbnail",
406
+ YouTubeProfileBanner = "youtubeProfileBanner",
407
+ YouTubeAdBanner = "youtubeAdBanner",
408
+ XPost = "xPost",
409
+ XHeader = "xHeader",
410
+ XCarouselAd = "xCarouselAd",
411
+ PinterestPin = "pinterestPin",
412
+ WebBannerAd = "webBannerAd",
413
+ Postcard = "postcard",
414
+ Letterhead = "letterhead",
415
+ Flyer = "flyer",
416
+ Brochure = "brochure",
417
+ Logo = "logo",
418
+ Presentation = "presentation",
419
+ AmazonTShirt = "amazonTShirt",
420
+ PrintfulTShirt = "printfulTShirt",
421
+ PrintfulAop = "printfulAop",
422
+ PrintfulHat = "printfulHat",
423
+ RedBubbleStandard = "redBubbleStandard",
424
+ RedBubbleSticker = "redBubbleSticker",
425
+ TeepublicStandard = "teepublicStandard",
426
+ DisplatePoster = "displatePoster",
427
+ PrintifyStandard = "printifyStandard",
428
+ PrintifyAop = "printifyAop",
429
+ PrintifyHoodie = "printifyHoodie",
430
+ PrintifyMug = "printifyMug",
431
+ PrintifyNotebook = "printifyNotebook",
432
+ PrintifySticker = "printifySticker",
433
+ AwkwardStylesTShirt = "awkwardStylesTShirt"
434
+ }
435
+ declare enum GradientType {
436
+ Linear = "linear",
437
+ Radial = "radial"
438
+ }
439
+ declare enum HistoryOrigins {
440
+ Tracked = "change:origin",
441
+ Untracked = "untracked:origin"
442
+ }
443
+ declare enum ImageFilterType {
444
+ "Saturation" = "Saturation",
445
+ "Contrast" = "Contrast",
446
+ "Brightness" = "Brightness",
447
+ "Vibrance" = "Vibrance",
448
+ "HueRotation" = "HueRotation",
449
+ "Noise" = "Noise",
450
+ "Blur" = "Blur",
451
+ "Convolute" = "Convolute",
452
+ "Pixelate" = "Pixelate",
453
+ "RemoveColor" = "RemoveColor"
454
+ }
455
+ declare enum LibraryPresetType {
456
+ FILL = "FILL",
457
+ TRANSFORMATION = "TRANSFORMATION",
458
+ PHOTO_FILTER = "PHOTO_FILTER",
459
+ SHADOW = "SHADOW",
460
+ TEXT = "TEXT",
461
+ TEXT_EFFECT = "TEXT_EFFECT",
462
+ TEXT_DECORATION = "TEXT_DECORATION",
463
+ COLOR_PALETTE = "COLOR_PALETTE"
464
+ }
465
+ declare enum ObjectType {
466
+ Artboard = "artboard",
467
+ Smartboard = "smartboard",
468
+ Videoboard = "videoboard",
469
+ MockupBoard = "mockupBoard",
470
+ Illustration = "illustration",
471
+ IllustrationImage = "illustrationImage",
472
+ Video = "video",
473
+ BasicShape = "basicShape",
474
+ VectorPath = "vectorPath",
475
+ CombinedShape = "combinedShape",
476
+ PathText = "pathText",
477
+ Mask = "mask",
478
+ RichText = "RichText",
479
+ Guide = "guide",
480
+ LoadingCard = "loadingCard",
481
+ MockupDesign = "mockupDesign",
482
+ ActiveSelection = "activeSelection",
483
+ WarpedImage = "warpedImage",
484
+ ArtboardTitle = "artboardTitle",
485
+ ArtboardTitleIcon = "artboardTitleIcon",
486
+ OverlayTexture = "overlayTexture",
487
+ CustomTextbox = "CustomTextbox",
488
+ ClipPath = "clipPath",
489
+ Path = "path",
490
+ Ruler = "ruler",
491
+ WarpControlRootPoint = "warpControlRootPoint",
492
+ Group = "group",
493
+ Circle = "circle",
494
+ Rect = "rect",
495
+ EditablePolygon = "editablePolygon"
496
+ }
497
+ declare enum Orientation {
498
+ HORIZONTAL = "horizontal",
499
+ VERTICAL = "vertical"
500
+ }
501
+ declare enum Origin {
502
+ CRDT = 1,
503
+ CANVAS = 2,
504
+ UI = 4,
505
+ VOLATILE = 8,
506
+ EVENTS_SYNC = 16
507
+ }
508
+ declare enum TextAlignment {
509
+ right = "right",
510
+ left = "left",
511
+ center = "center",
512
+ justify = "justify",
513
+ justifyLegacy = "justify-legacy"
514
+ }
515
+ declare enum Unit {
516
+ px = "px",
517
+ in = "in",
518
+ mm = "mm"
519
+ }
520
+ declare global {
521
+ interface Window {
522
+ kittl: KittlSDK;
523
+ }
524
+ }
525
+ export declare const kittl: KittlSDK;
526
+ export interface AIAPI {
527
+ spendCredits: (options: SpendCreditsOptions) => SdkResultAsync<SpendCreditsResult, Error>;
528
+ }
529
+ export interface AppStateAPI {
530
+ getSelectedObjectsIds(): string[];
531
+ setSelectedObjectsIds(ids: string[]): void;
532
+ getSelectedLayersIds(): string[];
533
+ setSelectedLayersIds(ids: string[]): void;
534
+ getSelectedArtboardIds(): string[];
535
+ setSelectedArtboardIds(ids: string[]): void;
536
+ getSelectedArtboardsObjectIds(): string[];
537
+ setSelectedArtboardsObjectIds(ids: string[]): void;
538
+ getAllSelectedObjectsIds(): string[];
539
+ setAllSelectedObjectsIds(ids: string[]): void;
540
+ getCanvasMode(): AppState["canvasMode"];
541
+ setCanvasMode(mode: AppState["canvasMode"], origin?: Origin): void;
542
+ getActiveTool(): ActiveTool | null;
543
+ setActiveTool(tool: ActiveTool | null): void;
544
+ viewport: ViewportAPI;
545
+ getHighlightedObjectId(): string | null;
546
+ setHighlightedObjectId(id: string | null): void;
547
+ setMany(fields: Partial<AppState>, origin?: Origin): void;
548
+ }
549
+ export interface AsyncAIAPI extends WithAsync<AIAPI> {
550
+ }
551
+ export interface AsyncAppStateAPI extends WithAsync<AppStateAPI> {
552
+ }
553
+ export interface AsyncAuthAPI {
554
+ startAuth: (request: AuthStartRequest) => Promise<SdkResult<AuthStartResult>>;
555
+ exchangeCode: (request: AuthExchangeRequest) => Promise<SdkResult<AuthTokenResponse>>;
556
+ getAuthToken: (request: AuthGetTokenRequest) => Promise<SdkResult<AuthTokenResponse | null>>;
557
+ refreshToken: (request: AuthRefreshRequest) => Promise<SdkResult<AuthTokenResponse>>;
558
+ logout: (request: AuthLogoutRequest) => Promise<SdkResult<void>>;
559
+ }
560
+ export interface AsyncContextAPI extends WithAsync<ContextAPI> {
561
+ }
562
+ export interface AsyncDesignAPI extends WithAsync<WithOptsRemoved<DesignAPI>> {
563
+ }
564
+ export interface AsyncFontAPI extends WithAsync<FontAPI> {
565
+ }
566
+ export interface AsyncStatelessAPI {
567
+ send: (message: {
568
+ type: string;
569
+ payload: Record<string, unknown>;
570
+ }) => SdkResultAsync<null>;
571
+ subscribe: (key: string, handler: (payload: Record<string, unknown>) => void) => SdkResultAsync<null>;
572
+ unsubscribe: (key: string) => SdkResultAsync<null>;
573
+ }
574
+ export interface AsyncUploadAPI extends WithAsync<UploadAPI> {
575
+ }
576
+ export interface AuthExchangeRequest {
577
+ code: string;
578
+ code_verifier?: string;
579
+ provider: string;
580
+ params?: Record<string, unknown>;
581
+ headers?: Record<string, string>;
582
+ }
583
+ export interface AuthGetTokenRequest {
584
+ provider: string;
585
+ }
586
+ export interface AuthLogoutRequest {
587
+ provider?: string;
588
+ }
589
+ export interface AuthRefreshRequest {
590
+ provider: string;
591
+ refresh_token: string;
592
+ }
593
+ export interface AuthStartRequest {
594
+ provider: string;
595
+ params?: Record<string, string | number | boolean>;
596
+ generatePKCE?: boolean;
597
+ }
598
+ export interface AuthStartResult {
599
+ code: string;
600
+ code_verifier?: string;
601
+ }
602
+ /**
603
+ * Token response returned by the token endpoint (code exchange or refresh).
604
+ */
605
+ export interface AuthTokenResponse {
606
+ access_token?: string;
607
+ refresh_token?: string;
608
+ expires_in?: number;
609
+ [key: string]: unknown;
610
+ }
611
+ export interface BackgroundImageOptions extends GeneratableObject {
612
+ objectName?: string;
613
+ globalCompositeOperation: BlendMode;
614
+ opacity: number;
615
+ filters?: SerialisedPhotoFilter[];
616
+ hidden?: boolean;
617
+ cropX?: number;
618
+ cropY?: number;
619
+ scaleX?: number;
620
+ scaleY?: number;
621
+ width?: number;
622
+ height?: number;
623
+ realWidth?: number;
624
+ realHeight?: number;
625
+ }
626
+ export interface BaseStandardArtboardOptions<T extends ArtboardLikeType = ArtboardLikeType> {
627
+ type?: T;
628
+ rx?: number | undefined;
629
+ ry?: number | undefined;
630
+ id?: string;
631
+ lockMovementX?: boolean;
632
+ lockMovementY?: boolean;
633
+ activeLayout: BoardLayout;
634
+ left?: number;
635
+ top?: number;
636
+ width: number;
637
+ height: number;
638
+ fill: string | GradientObject | undefined | null;
639
+ opacity?: number;
640
+ hidden?: boolean;
641
+ unit?: Unit;
642
+ dpi?: number;
643
+ fullSize?: boolean;
644
+ clip?: boolean;
645
+ presets?: LinkedPreset[];
646
+ printMargins?: PrintMargins;
647
+ scaleX?: number;
648
+ scaleY?: number;
649
+ }
650
+ export interface BaseStandardBoard<T extends ArtboardOptions = ArtboardOptions> {
651
+ id: string;
652
+ artboard: T;
653
+ title?: string;
654
+ texture?: TextureOptions;
655
+ backgroundImage?: BackgroundImageOptions;
656
+ }
657
+ export interface BoardAPI {
658
+ createStandardBoard(params: CreateBoardParams, opts?: DesignApiOptions): NormalizedBoard;
659
+ cloneArtboard(params: CloneArtboardParams, opts?: DesignApiOptions): NormalizedBoard;
660
+ updateArtboardBackground(params: UpdateArtboardBackgroundParams, opts?: DesignApiOptions): NormalizedBoard;
661
+ updateArtboard(params: UpdateArtboardParams, opts?: DesignApiOptions): NormalizedBoard;
662
+ }
663
+ export interface CanvasAPI {
664
+ getScreenshot(): Promise<{
665
+ data: string;
666
+ width: number;
667
+ height: number;
668
+ }>;
669
+ getPreviewImage: (id: string, options?: Partial<GetPreviewImageOptions>) => Promise<string | null>;
670
+ getExport: (options: GetExportOptions) => Promise<Blob | null>;
671
+ }
672
+ export interface ConfigAPI {
673
+ setConfig(config: Partial<DesignConfig>, opts?: DesignApiOptions): void;
674
+ }
675
+ export interface ContextAPI {
676
+ get(input?: ContextGetInput): KittlContext;
677
+ }
678
+ export interface ContextGetInput {
679
+ iframe?: Pick<HTMLIFrameElement, "getBoundingClientRect">;
680
+ }
681
+ export interface CreateLoadingCardInput extends CreateElementWithPositionAndSize {
682
+ imageGenerationId?: string;
683
+ startedAt?: number;
684
+ generatingModelKey?: string;
685
+ generationAverageSpeed?: number;
686
+ name?: string;
687
+ }
688
+ export interface DecorationOptions {
689
+ type: "horizontalLines" | "colorCut" | "obliqueLines" | "fadingColorCut";
690
+ color: string | null;
691
+ weight: number;
692
+ distance: number;
693
+ cutDistance: number;
694
+ }
695
+ export interface DesignAPI {
696
+ shape: ShapeAPI;
697
+ board: BoardAPI;
698
+ config: ConfigAPI;
699
+ text: TextAPI;
700
+ object: ObjectAPI;
701
+ guide: GuideAPI;
702
+ loadingCard: LoadingCardAPI;
703
+ image: ImageAPI;
704
+ illustration: IllustrationAPI;
705
+ state: StateAPI;
706
+ canvas: CanvasAPI;
707
+ mockupboard: MockupboardAPI;
708
+ smartboard: SmartboardAPI;
709
+ video: VideoAPI;
710
+ videoboard: VideoboardAPI;
711
+ layers: LayersAPI;
712
+ group: GroupAPI;
713
+ texture: TextureAPI;
714
+ }
715
+ export interface DesignConfig {
716
+ title?: string;
717
+ dpiVersion?: number;
718
+ designId?: string;
719
+ generationId?: string;
720
+ updatedAt?: string;
721
+ templateId?: number | string;
722
+ folderId?: string;
723
+ dpi?: number;
724
+ unit?: Unit;
725
+ overrideColorPalette?: string[];
726
+ overrideColorKeys?: string[];
727
+ overrideLuminosityRatio?: number;
728
+ previewBoardId?: string;
729
+ }
730
+ export interface DragAndDropDropImageInput {
731
+ x: number;
732
+ y: number;
733
+ grabOffsetX?: number;
734
+ grabOffsetY?: number;
735
+ src: string;
736
+ imgWidth?: number;
737
+ imgHeight?: number;
738
+ persistImage?: boolean;
739
+ }
740
+ export interface DragAndDropOffset {
741
+ left: number;
742
+ top: number;
743
+ }
744
+ export interface DragAndDropStartDragImageEventInput {
745
+ event: DragEvent;
746
+ img: HTMLImageElement;
747
+ persistImage?: boolean;
748
+ }
749
+ export interface FontAPI {
750
+ createFont: (params: {
751
+ name: string;
752
+ files: Blob[];
753
+ styles: string[];
754
+ extensionId?: string;
755
+ previewImage?: Blob;
756
+ }) => SdkResultAsync<UploadedFontFamily, Error>;
757
+ }
758
+ export interface FontVariation {
759
+ name: string;
760
+ min: number;
761
+ max: number;
762
+ default: number;
763
+ }
764
+ export interface GeneratableBoard<T extends Record<string, unknown> = never> {
765
+ generationSettings?: T;
766
+ }
767
+ export interface GeneratableObject {
768
+ generation?: {
769
+ meta?: GenerationMeta;
770
+ generationId?: string;
771
+ generatorKey: string;
772
+ };
773
+ }
774
+ export interface GenerationMeta {
775
+ generationEndsAt?: number;
776
+ pendingGenerationId: string;
777
+ }
778
+ export interface GetExportOptions {
779
+ format: "png" | "jpg" | "pdf" | "svg" | "mp4";
780
+ target: {
781
+ boardId: string;
782
+ } | {
783
+ nodeIds: string[];
784
+ };
785
+ dimensions?: {
786
+ multiplier: number;
787
+ } | {
788
+ pixelCount: number;
789
+ } | {
790
+ target: {
791
+ width: number;
792
+ height: number;
793
+ };
794
+ };
795
+ }
796
+ export interface GetObjectParams {
797
+ id: string;
798
+ }
799
+ export interface GetPreviewImageOptions {
800
+ targetPixelCount: number;
801
+ }
802
+ export interface GradientColorStop {
803
+ color: string | null;
804
+ offset: number;
805
+ opacity?: number;
806
+ }
807
+ export interface GradientInfo {
808
+ count: number;
809
+ angle: number;
810
+ offsets: number[];
811
+ gradientTransform?: number[];
812
+ coords?: {
813
+ x1: number;
814
+ x2: number;
815
+ y1: number;
816
+ y2: number;
817
+ r1?: number;
818
+ r2?: number;
819
+ };
820
+ type: GradientType;
821
+ }
822
+ export interface GradientObject {
823
+ id?: string;
824
+ key?: string;
825
+ colorStops: GradientColorStop[];
826
+ coords?: {
827
+ x1: number;
828
+ x2: number;
829
+ y1: number;
830
+ y2: number;
831
+ r1?: number;
832
+ r2?: number;
833
+ };
834
+ type: GradientType;
835
+ angle?: number;
836
+ gradientTransform?: number[];
837
+ }
838
+ export interface GroupAPI {
839
+ createGroup(input: CreateGroupParams, opts?: DesignApiOptions): void;
840
+ removeGroup(input: RemoveGroupParams, opts?: DesignApiOptions): void;
841
+ addIntoGroup(input: AddIntoGroupParams, opts?: DesignApiOptions): void;
842
+ removeFromGroup(input: RemoveFromGroupParams, opts?: DesignApiOptions): void;
843
+ }
844
+ export interface GuideAPI {
845
+ createGuide(input: CreateGuideInput, opts?: DesignApiOptions): NormalizedGuideObject;
846
+ updateGuide(input: UpdateGuideInput, opts?: DesignApiOptions): NormalizedGuideObject;
847
+ }
848
+ export interface IllustrationAPI {
849
+ addIllustration(params: AddIllustrationParams, opts?: DesignApiOptions): Promise<NormalizedIllustrationObject>;
850
+ updateIllustration(params: UpdateIllustrationParams, opts?: DesignApiOptions): NormalizedIllustrationObject;
851
+ }
852
+ export interface ImageAPI {
853
+ addImage(params: AddImageParams, opts?: DesignApiOptions): SdkResultAsync<NormalizedIllustrationImageObject, SdkError>;
854
+ updateImage(params: UpdateImageParams, opts?: DesignApiOptions): NormalizedIllustrationImageObject;
855
+ }
856
+ export interface KittlContext {
857
+ dragAndDrop: {
858
+ offset: DragAndDropOffset;
859
+ };
860
+ }
861
+ export interface KittlSDK {
862
+ loaded: boolean;
863
+ onLoadedCallback: (() => void) | null;
864
+ onReady: (cb: () => void) => void;
865
+ ai: AsyncAIAPI;
866
+ design: AsyncDesignAPI;
867
+ context: AsyncContextAPI;
868
+ dragAndDrop: PublicDragAndDropAPI;
869
+ state: AsyncAppStateAPI;
870
+ auth: AsyncAuthAPI;
871
+ upload: AsyncUploadAPI;
872
+ stateless: AsyncStatelessAPI;
873
+ font: AsyncFontAPI;
874
+ }
875
+ export interface LayersAPI {
876
+ moveTo(input: MoveToParams, opts?: DesignApiOptions): void;
877
+ sendForward(input: SendToParams, opts?: DesignApiOptions): void;
878
+ sendToFront(input: SendToParams, opts?: DesignApiOptions): void;
879
+ sendBackward(input: SendToParams, opts?: DesignApiOptions): void;
880
+ sendToBack(input: SendToParams, opts?: DesignApiOptions): void;
881
+ }
882
+ export interface LinkedFillPresetMeta {
883
+ key: string;
884
+ target: FillMetaTarget;
885
+ source?: string;
886
+ }
887
+ export interface LoadingCardAPI {
888
+ createLoadingCard(input: CreateLoadingCardInput, opts?: DesignApiOptions): NormalizedLoadingCardObject;
889
+ updateLoadingCard(input: UpdateLoadingCardInput, opts?: DesignApiOptions): NormalizedLoadingCardObject;
890
+ }
891
+ export interface MockupboardAPI {
892
+ addMockupBoard(params: AddMockupBoardParams, opts?: DesignApiOptions): NormalizedStandardBoard<MockupBoardOptions>;
893
+ addMockupDesignObject(params: AddMockupDesignObjectParams, opts?: DesignApiOptions): NormalizedMockupDesignObject;
894
+ updateMockupBoard(params: UpdateMockupBoardParams, opts?: DesignApiOptions): NormalizedStandardBoard<MockupBoardOptions>;
895
+ }
896
+ export interface ObjectAPI {
897
+ setLockedState(params: SetLockedParams, opts?: DesignApiOptions): WithLocked;
898
+ removeObject(params: RemoveObjectParams, opts?: DesignApiOptions): RemoveObjectResult;
899
+ setHiddenState(params: SetHiddenParams, opts?: DesignApiOptions): WithHidden;
900
+ rotateObject(params: RotateObjectParams, opts?: DesignApiOptions): WithObjectLayout;
901
+ getAllByFilter<T extends NormalizedObject>(predicate: (object: NormalizedObject) => boolean, opts?: DesignApiOptions): T[];
902
+ rename(input: RenameParams, opts?: DesignApiOptions): string;
903
+ getObject(params: GetObjectParams, opts?: DesignApiOptions): NormalizedObject;
904
+ _dangerouslyUpdate(updateParams: Partial<Omit<SerializedObject, "id">> & {
905
+ id: string;
906
+ }, opts?: DesignApiOptions): {
907
+ id: string;
908
+ };
909
+ }
910
+ export interface PhotoFilterOptions {
911
+ [ImageFilterType.Saturation]: {
912
+ saturation: number;
913
+ };
914
+ [ImageFilterType.Contrast]: {
915
+ contrast: number;
916
+ };
917
+ [ImageFilterType.Brightness]: {
918
+ brightness: number;
919
+ };
920
+ [ImageFilterType.Vibrance]: {
921
+ vibrance: number;
922
+ };
923
+ [ImageFilterType.HueRotation]: {
924
+ rotation: number;
925
+ };
926
+ [ImageFilterType.Noise]: {
927
+ noise: number;
928
+ };
929
+ [ImageFilterType.Blur]: {
930
+ blur: number;
931
+ };
932
+ [ImageFilterType.Convolute]: {
933
+ matrix: number[];
934
+ };
935
+ [ImageFilterType.Pixelate]: {
936
+ blocksize: number;
937
+ };
938
+ [ImageFilterType.RemoveColor]: {
939
+ color: string | null;
940
+ distance: number;
941
+ };
942
+ }
943
+ export interface PublicDragAndDropAPI {
944
+ startDragImageEvent(input: DragAndDropStartDragImageEventInput): void;
945
+ dropImage(input: DragAndDropDropImageInput): Promise<string | null>;
946
+ }
947
+ export interface RemoveObjectParams {
948
+ id: string;
949
+ }
950
+ export interface RemoveObjectResult {
951
+ removedObject: NormalizedObject;
952
+ }
953
+ export interface RotateObjectParams {
954
+ id: string;
955
+ angle: number;
956
+ origin?: {
957
+ x: OriginX;
958
+ y: OriginY;
959
+ };
960
+ }
961
+ export interface SdkBadInputError extends Error {
962
+ name: "SdkBadInputError";
963
+ message: string;
964
+ cause?: Error;
965
+ }
966
+ export interface SdkInternalError extends Error {
967
+ name: "SdkInternalError";
968
+ message: string;
969
+ cause?: Error;
970
+ }
971
+ export interface SetHiddenParams {
972
+ id: string;
973
+ hidden: boolean;
974
+ }
975
+ export interface SetLockedParams {
976
+ id: string;
977
+ locked: boolean;
978
+ }
979
+ export interface ShadowOptions {
980
+ angle: number;
981
+ offset: number;
982
+ blur: number;
983
+ color: string | null;
984
+ }
985
+ export interface ShapeAPI {
986
+ createPredefinedShape(input: CreateShapeInput, opts?: DesignApiOptions): NormalizedBasicShapeObject;
987
+ createBasicShape(input: CreateBasicShapeInput, opts?: DesignApiOptions): Promise<NormalizedBasicShapeObject>;
988
+ updateShape(input: UpdateShapeInput, opts?: DesignApiOptions): NormalizedBasicShapeObject;
989
+ convertShapeToMask(input: ConvertShapeToMaskInput, opts?: DesignApiOptions): DesignStructureObject;
990
+ }
991
+ export interface SmartboardAPI {
992
+ addSmartboard(params: AddSmartboardParams, opts?: DesignApiOptions): NormalizedStandardBoard<SmartboardOptions>;
993
+ updateSmartboard(params: UpdateSmartboardParams, opts?: DesignApiOptions): NormalizedStandardBoard<SmartboardOptions>;
994
+ }
995
+ export interface SpendCreditsOptions {
996
+ amount: number;
997
+ message: string;
998
+ onAccept?: () => void;
999
+ onDecline?: () => void;
1000
+ }
1001
+ export interface SpendCreditsResult {
1002
+ success: boolean;
1003
+ }
1004
+ export interface StandardArtboardOptions extends BaseStandardArtboardOptions<ObjectType.Artboard> {
1005
+ }
1006
+ export interface StateAPI {
1007
+ implementSubState(params: Partial<NormalizedDesignState>, opts?: DesignApiOptions): Partial<NormalizedDesignState>;
1008
+ }
1009
+ export interface StructureObjectMeta {
1010
+ name?: string;
1011
+ type?: LayerType;
1012
+ defaultIcon?: LayerIconType;
1013
+ hidden?: boolean;
1014
+ locked?: boolean;
1015
+ open?: boolean;
1016
+ linkedBoardId?: string;
1017
+ maskObjectId?: string;
1018
+ maskBackgroundColor?: string | null;
1019
+ }
1020
+ export interface TextAPI {
1021
+ addText(params: AddTextParams, opts?: DesignApiOptions): NormalizedRichTextObject;
1022
+ updateText(params: UpdateTextParams, opts?: DesignApiOptions): NormalizedRichTextObject;
1023
+ updateRenderPlugin(params: UpdateRenderPluginParams, opts?: DesignApiOptions): NormalizedRichTextObject;
1024
+ updateDecorationPlugin(params: UpdateDecorationPluginParams, opts?: DesignApiOptions): NormalizedRichTextObject;
1025
+ }
1026
+ export interface TextureAPI {
1027
+ setTexture(params: SetTextureParams, opts?: DesignApiOptions): SdkResult<NormalizedBoard, SdkError>;
1028
+ removeTexture(params: RemoveTextureParams, opts?: DesignApiOptions): SdkResult<NormalizedBoard, SdkError>;
1029
+ updateTexture(params: UpdateTextureParams, opts?: DesignApiOptions): SdkResult<NormalizedBoard, SdkError>;
1030
+ releaseTexture(params: ReleaseTextureParams, opts?: DesignApiOptions): SdkResult<IllustrationImageSerializedObject, SdkError>;
1031
+ }
1032
+ export interface TextureOptions {
1033
+ texture: string;
1034
+ mode: BlendMode;
1035
+ opacity: number;
1036
+ hidden?: boolean;
1037
+ loaded?: boolean;
1038
+ isAlphaMask?: boolean;
1039
+ renderClip?: boolean;
1040
+ }
1041
+ export interface TransformOptions {
1042
+ type: "freeLine" | "freeForm" | "circle" | "angle" | "arch" | "rise" | "wave" | "flag" | null;
1043
+ directionInverted?: boolean;
1044
+ curve?: number;
1045
+ isChanging?: boolean;
1046
+ }
1047
+ export interface UpdateGuideInput {
1048
+ id: string;
1049
+ top?: number;
1050
+ left?: number;
1051
+ }
1052
+ export interface UpdateLoadingCardInput {
1053
+ id: string;
1054
+ position?: CreateElementWithPositionAndSize["position"];
1055
+ size?: CreateElementWithPositionAndSize["size"];
1056
+ imageGenerationId?: string;
1057
+ startedAt?: number;
1058
+ generatingModelKey?: string;
1059
+ generationAverageSpeed?: number;
1060
+ name?: string;
1061
+ }
1062
+ export interface UploadAPI {
1063
+ image: UploadImageAPI;
1064
+ }
1065
+ export interface UploadImageAPI {
1066
+ upload: ({ blob, extensionId, }: {
1067
+ blob: Blob;
1068
+ extensionId?: string;
1069
+ }) => SdkResultAsync<UserImageUpload[], Error>;
1070
+ uploadTemp: ({ blob, }: {
1071
+ blob: Blob;
1072
+ }) => SdkResultAsync<TempUserImageUpload[], Error>;
1073
+ }
1074
+ export interface VideoAPI {
1075
+ addVideo(params: AddVideoParams, opts?: DesignApiOptions): Promise<NormalizedVideoObject>;
1076
+ updateVideo(params: UpdateVideoParams, opts?: DesignApiOptions): NormalizedVideoObject;
1077
+ removePlaylistItem(params: RemoveVideoPlaylistItemParams, opts?: DesignApiOptions): NormalizedVideoObject;
1078
+ updatePlaylistItem(params: UpdateVideoPlaylistItemParams, opts?: DesignApiOptions): Promise<NormalizedVideoObject>;
1079
+ }
1080
+ export interface VideoboardAPI {
1081
+ addVideoboard(params: AddVideoboardParams, opts?: DesignApiOptions): Promise<NormalizedStandardBoard<VideoboardOptions>>;
1082
+ setVideoOnVideoboard(params: SetVideoOnVideoboardParams, opts?: DesignApiOptions): Promise<NormalizedStandardBoard<VideoboardOptions>>;
1083
+ updateVideoboard(params: UpdateVideoboardParams, opts?: DesignApiOptions): NormalizedStandardBoard<VideoboardOptions>;
1084
+ removePlaylistItem(params: RemovePlaylistItemParams, opts?: DesignApiOptions): NormalizedStandardBoard<VideoboardOptions>;
1085
+ updatePlaylistItem(params: UpdatePlaylistItemParams, opts?: DesignApiOptions): Promise<NormalizedStandardBoard<VideoboardOptions>>;
1086
+ }
1087
+ export interface WithHidden {
1088
+ hidden?: boolean | undefined;
1089
+ }
1090
+ export interface WithLocked {
1091
+ locked?: boolean | undefined;
1092
+ }
1093
+ export interface WithObjectLayout {
1094
+ width: number;
1095
+ height: number;
1096
+ scaleX: number;
1097
+ scaleY: number;
1098
+ angle: number;
1099
+ top: number;
1100
+ left: number;
1101
+ flipX: boolean;
1102
+ flipY: boolean;
1103
+ }
1104
+ export type APIOptions<T extends Record<string, unknown>> = {
1105
+ batchClient?: BatchClient<T>;
1106
+ } | {
1107
+ origin?: Origin;
1108
+ historyOrigin?: HistoryOrigins;
1109
+ } | undefined;
1110
+ export type AbsolutePosition = {
1111
+ absolute: LeftTopPosition;
1112
+ };
1113
+ export type ActiveTool = {
1114
+ type: "artboard";
1115
+ } | {
1116
+ type: "move";
1117
+ } | {
1118
+ type: "pen";
1119
+ } | {
1120
+ type: "pen-vector-editing";
1121
+ } | {
1122
+ type: "comment";
1123
+ } | {
1124
+ type: "shape";
1125
+ shape: BasicShapeType;
1126
+ };
1127
+ export type AddIllustrationParams = {
1128
+ src: string;
1129
+ objectProperties?: IllustrationProperties;
1130
+ } & CreateElementWithPositionAndSize;
1131
+ export type AddImageParams = ({
1132
+ src: string;
1133
+ } | {
1134
+ width: number;
1135
+ height: number;
1136
+ src?: never;
1137
+ }) & GeneratableObject & {
1138
+ objectProperties?: ImageProperties;
1139
+ } & CreateElementWithPositionAndSize;
1140
+ export type AddIntoGroupParams = {
1141
+ groupId: string;
1142
+ objectIds: string[];
1143
+ };
1144
+ export type AddMockupBoardParams = {
1145
+ inputBoardIds: string[];
1146
+ mockupTemplateId: number;
1147
+ shouldMockupColorMatchArtboard?: boolean;
1148
+ initialDesigns?: AddMockupDesignObjectParams[];
1149
+ } & {
1150
+ position: AbsolutePosition | RelativePosition;
1151
+ size: Dimensions;
1152
+ };
1153
+ export type AddMockupDesignObjectParams = {
1154
+ mockupBoardId: string;
1155
+ inputBoardId: string;
1156
+ mockupTemplateId: number;
1157
+ initialNormalizedUnwarpedRect: MockupDesignRect;
1158
+ };
1159
+ export type AddSmartboardParams = {
1160
+ linkedBoardIds?: string[];
1161
+ } & {
1162
+ position: AbsolutePosition | RelativePosition;
1163
+ size: Dimensions;
1164
+ };
1165
+ export type AddTextParams = {
1166
+ text: string;
1167
+ id?: string;
1168
+ textProperties?: TextProperties;
1169
+ position: CreateElementWithPositionAndSize["position"];
1170
+ size: Dimensions;
1171
+ };
1172
+ export type AddVideoParams = {
1173
+ playlist: Omit<VideoPlaylistItem, "id">[];
1174
+ videoSize?: {
1175
+ width: number;
1176
+ height: number;
1177
+ };
1178
+ } & CreateElementWithPositionAndSize;
1179
+ export type AddVideoboardParams = {
1180
+ linkedBoardIds?: string[];
1181
+ video?: {
1182
+ width?: number;
1183
+ height?: number;
1184
+ playlist: Omit<VideoPlaylistItem, "id">[];
1185
+ };
1186
+ } & {
1187
+ position: AbsolutePosition | RelativePosition;
1188
+ size: Dimensions;
1189
+ };
1190
+ export type AppState = {
1191
+ selectedObjectsIds: string[];
1192
+ selectedLayersIds: string[];
1193
+ selectedArtboardIds: string[];
1194
+ selectedArtboardsObjectIds: string[];
1195
+ allSelectedObjectsIds: string[];
1196
+ canvasMode: CanvasMode | string;
1197
+ activeTool: ActiveTool | null;
1198
+ viewport: Viewport;
1199
+ highlightedObjectId: string | null;
1200
+ };
1201
+ export type ArtboardLikeType = ObjectType.Artboard | ObjectType.MockupBoard | ObjectType.Smartboard | ObjectType.Videoboard;
1202
+ export type ArtboardOptions = StandardArtboardOptions | SmartboardOptions | MockupBoardOptions | VideoboardOptions;
1203
+ export type AvailableShadowOptions = Partial<Pick<ShadowOptions, "blur">> & Omit<ShadowOptions, "blur">;
1204
+ export type BaseFloatingBoard = {
1205
+ id: string;
1206
+ floating: true;
1207
+ };
1208
+ export type BasicShapeConfigurableFields = {
1209
+ angle?: BasicShapeSerializedObject["angle"];
1210
+ flipX?: BasicShapeSerializedObject["flipX"];
1211
+ flipY?: BasicShapeSerializedObject["flipY"];
1212
+ hidden?: BasicShapeSerializedObject["hidden"];
1213
+ opacity?: BasicShapeSerializedObject["opacity"];
1214
+ skewX?: BasicShapeSerializedObject["skewX"];
1215
+ skewY?: BasicShapeSerializedObject["skewY"];
1216
+ cornerRadii?: BasicShapeSerializedObject["cornerRadii"];
1217
+ name?: BasicShapeSerializedObject["name"];
1218
+ shadowOptions?: BasicShapeSerializedObject["shadowOptions"];
1219
+ shadowColor?: NonNullable<BasicShapeSerializedObject["shadowOptions"]>["color"];
1220
+ fill?: BasicShapeSerializedObject["fill"];
1221
+ fillColor?: NonNullable<BasicShapeSerializedObject["fill"]>[number]["value"];
1222
+ stroke?: BasicShapeSerializedObject["stroke"];
1223
+ strokeWidth?: BasicShapeSerializedObject["strokeWidth"];
1224
+ };
1225
+ export type BasicShapeSerializedObject = typeof BASIC_SHAPE_DEFAULT_VALUES & {
1226
+ nPoints?: number | undefined;
1227
+ };
1228
+ export type BasicShapeType = (typeof BasicShapeType)[keyof typeof BasicShapeType];
1229
+ export type BridgedSdkResult<T> = T extends SdkResult<infer _R, infer _E> ? T : SdkResult<T, Error>;
1230
+ export type Builtin = Date | Function | Uint8Array | RegExp | Map<unknown, unknown> | Set<unknown>;
1231
+ export type CanvasMode = "erase" | "crop" | "reframe" | "inpaint" | null;
1232
+ export type CloneArtboardParams = {
1233
+ boardId: string;
1234
+ position: CreateElementWithPositionAndSize["position"];
1235
+ };
1236
+ export type Color = GradientObject | string | null | undefined;
1237
+ export type ColorInfo = StringColor | FullColor;
1238
+ export type CombinedShapeSerializedObject = Omit<typeof DEFAULT_VALUES, "shapes"> & {
1239
+ shapes: Shape[];
1240
+ };
1241
+ export type ConnectedArtboardOptions<T extends ArtboardLikeType = ArtboardLikeType> = BaseStandardArtboardOptions<T> & {
1242
+ inputBoardIds?: string[];
1243
+ };
1244
+ export type ConvertShapeToMaskInput = {
1245
+ id: NormalizedBasicShapeObject["id"];
1246
+ };
1247
+ export type CreateBasicShapeInput = CreateElementWithPositionAndSize & {
1248
+ objectName: string;
1249
+ objectProperties?: ShapeProperties;
1250
+ };
1251
+ export type CreateBoardParams = Omit<CreateElementWithPositionAndSize, "size" | "boardId"> & {
1252
+ title?: string;
1253
+ size: {
1254
+ width: number;
1255
+ height: number;
1256
+ };
1257
+ };
1258
+ export type CreateElementWithPositionAndSize = {
1259
+ boardId?: string;
1260
+ position: AbsolutePosition | RelativePosition;
1261
+ size?: Dimensions & {
1262
+ applyViewportScale?: boolean;
1263
+ };
1264
+ };
1265
+ export type CreateGroupParams = {
1266
+ structureIds: string[];
1267
+ };
1268
+ export type CreateGuideInput = {
1269
+ boardId?: string;
1270
+ } & OrientationConditional;
1271
+ export type CreateShapeInput = CreateElementWithPositionAndSize & {
1272
+ shapeType: BasicShapeType;
1273
+ objectProperties?: ShapeProperties;
1274
+ };
1275
+ export type DeepPartial<T> = {
1276
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
1277
+ };
1278
+ export type DesignApiOptions = APIOptions<NormalizedDesignState>;
1279
+ export type DesignObjectId = string;
1280
+ export type DesignStructureObject = {
1281
+ id?: StructureObjectId | null;
1282
+ meta?: StructureObjectMeta;
1283
+ parentId?: ID;
1284
+ };
1285
+ export type Dimensions = {
1286
+ width: number;
1287
+ height: number;
1288
+ };
1289
+ export type ElementLocation = "origin" | "center";
1290
+ export type Expand<T> = T extends infer O ? {
1291
+ [K in keyof O]: O[K];
1292
+ } : never;
1293
+ export type FillMetaTarget = "border" | "fill";
1294
+ export type FullColor = {
1295
+ key: "fill" | (Exclude<string, StringColorKeysType> & {});
1296
+ value: Color;
1297
+ visible: boolean;
1298
+ };
1299
+ export type FunctionType = (...args: never) => unknown;
1300
+ export type GuideSerializedObject = typeof GUIDE_DEFAULT_VALUES & OrientationDir;
1301
+ export type ID = string;
1302
+ export type IllustrationImageSerializedObject = typeof DEFAULT_VALUES$1 & {
1303
+ backgroundRemoved?: boolean | undefined;
1304
+ realWidth?: number | undefined;
1305
+ realHeight?: number | undefined;
1306
+ erasePaths?: {
1307
+ cacheKey: string;
1308
+ objectName: string | null;
1309
+ fallbackObjectName?: string;
1310
+ } | undefined;
1311
+ _eraseStrokeWidth?: number | undefined;
1312
+ };
1313
+ export type IllustrationProperties = {
1314
+ angle?: IllustrationSerializedObject["angle"];
1315
+ flipX?: IllustrationSerializedObject["flipX"];
1316
+ flipY?: IllustrationSerializedObject["flipY"];
1317
+ hidden?: IllustrationSerializedObject["hidden"];
1318
+ opacity?: IllustrationSerializedObject["opacity"];
1319
+ shadowOptions?: IllustrationSerializedObject["shadowOptions"];
1320
+ stroke?: IllustrationSerializedObject["stroke"];
1321
+ strokeWidth?: IllustrationSerializedObject["strokeWidth"];
1322
+ fill?: IllustrationSerializedObject["fill"];
1323
+ gradients?: IllustrationSerializedObject["gradients"];
1324
+ };
1325
+ export type IllustrationSerializedObject = typeof ILLUSTRATION_DEFAULT_VALUES;
1326
+ export type ImageProperties = {
1327
+ angle?: IllustrationImageSerializedObject["angle"];
1328
+ flipX?: IllustrationImageSerializedObject["flipX"];
1329
+ flipY?: IllustrationImageSerializedObject["flipY"];
1330
+ hidden?: IllustrationImageSerializedObject["hidden"];
1331
+ opacity?: IllustrationImageSerializedObject["opacity"];
1332
+ shadowOptions?: IllustrationImageSerializedObject["shadowOptions"];
1333
+ stroke?: IllustrationImageSerializedObject["stroke"];
1334
+ strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
1335
+ fill?: IllustrationImageSerializedObject["fill"];
1336
+ };
1337
+ export type InternalPatchArgs<T> = {
1338
+ patch: PatchTree<T> | PatchTree<T>[];
1339
+ origin: Origin;
1340
+ historyOrigin?: HistoryOrigins;
1341
+ };
1342
+ export type LayerIconType = "drawIcon";
1343
+ export type LayerType = Exclude<SerializableObjectType, ObjectType.Guide> | typeof structuralGroupType | typeof clippingMaskType | typeof backgroundType | typeof pathType;
1344
+ export type LayersMovePosition = "before" | "after" | "into";
1345
+ export type LeftTopPosition = {
1346
+ left: number;
1347
+ top: number;
1348
+ };
1349
+ export type LinkedPreset = {
1350
+ id: string;
1351
+ libraryId: string;
1352
+ } & LinkedPresetMeta;
1353
+ export type LinkedPresetMeta = {
1354
+ type: LibraryPresetType.FILL;
1355
+ meta: LinkedFillPresetMeta;
1356
+ } | {
1357
+ type: LibraryPresetType.TRANSFORMATION;
1358
+ meta?: never;
1359
+ } | {
1360
+ type: LibraryPresetType.PHOTO_FILTER;
1361
+ meta?: never;
1362
+ } | {
1363
+ type: LibraryPresetType.SHADOW;
1364
+ meta?: never;
1365
+ } | {
1366
+ type: LibraryPresetType.TEXT;
1367
+ meta?: never;
1368
+ } | {
1369
+ type: LibraryPresetType.TEXT_EFFECT;
1370
+ meta?: never;
1371
+ } | {
1372
+ type: LibraryPresetType.TEXT_DECORATION;
1373
+ meta?: never;
1374
+ };
1375
+ export type LoadingCardSerializedObject = typeof LOADING_CARD_DEFAULT_VALUES & {
1376
+ imageGenerationId?: string | undefined;
1377
+ startedAt?: number | undefined;
1378
+ generatingModelKey?: string | undefined;
1379
+ generationAverageSpeed?: number | undefined;
1380
+ };
1381
+ export type MaskSerializedObject = typeof MASK_DEFAULT_VALUES & {
1382
+ maskFill?: string | null | undefined;
1383
+ isClipPath?: boolean | undefined;
1384
+ };
1385
+ export type MockupBoardOptions = ConnectedArtboardOptions<ObjectType.MockupBoard> & {
1386
+ mockupTemplateId?: number;
1387
+ shouldMockupColorMatchArtboard?: boolean;
1388
+ };
1389
+ export type MockupDesignRect = {
1390
+ x: number;
1391
+ y: number;
1392
+ width: number;
1393
+ height: number;
1394
+ };
1395
+ export type MockupDesignSerializedObject = typeof MOCKUP_DESIGN_DEFAULT_VALUES & {
1396
+ inputBoardId: string;
1397
+ mockupTemplateId: number;
1398
+ initialNormalizedUnwarpedRect: MockupDesignRect;
1399
+ };
1400
+ export type MoveToParams = {
1401
+ boardOrObjectIds: string[];
1402
+ position: LayersMovePosition;
1403
+ targetId: string;
1404
+ };
1405
+ export type NormalizeArray<T> = T extends (infer U)[] ? Record<string, Normalized<U>> : never;
1406
+ export type NormalizeObject<T> = Expand<{
1407
+ [K in keyof T]: NormalizeValue<T[K]>;
1408
+ } & {
1409
+ [K in keyof T as undefined extends T[K] ? never : NonNullable<T[K]> extends Array<unknown> ? T[K] extends null ? never : `${Extract<K, string>}Indices` : never]: Record<string, string>;
1410
+ } & {
1411
+ [K in keyof T as undefined extends T[K] ? NonNullable<T[K]> extends Array<unknown> ? T[K] extends null | undefined ? never : `${Extract<K, string>}Indices` : never : never]?: Record<string, string>;
1412
+ }>;
1413
+ export type NormalizeValue<T> = T extends null | undefined ? T : NonNullable<T> extends unknown[] | readonly unknown[] ? undefined extends T ? NormalizeArray<NonNullable<T>> | undefined : NormalizeArray<T> : T extends Builtin ? T : NonNullable<T> extends object ? Normalized<T> : T;
1414
+ export type Normalized<T> = T extends null | undefined ? T : T extends Builtin ? T : T extends unknown[] | readonly unknown[] ? NormalizeArray<T> : T extends object ? NormalizeObject<T> : T;
1415
+ export type NormalizedBasicShapeObject = Normalized<BasicShapeSerializedObject>;
1416
+ export type NormalizedBoard = NormalizedStandardBoard | NormalizedFloatingBoard;
1417
+ export type NormalizedCombinedShapeObject = Normalized<CombinedShapeSerializedObject>;
1418
+ export type NormalizedDesignState = {
1419
+ boards: Record<ID, NormalizedBoard>;
1420
+ boardsIndices: Record<ID, string>;
1421
+ objects: Record<ID, NormalizedObject>;
1422
+ groupStructures: Record<ID, DesignStructureObject>;
1423
+ groupStructuresIndices: Record<ID, string>;
1424
+ config: DesignConfig;
1425
+ };
1426
+ export type NormalizedFloatingBoard = Normalized<BaseFloatingBoard>;
1427
+ export type NormalizedGuideObject = Normalized<GuideSerializedObject>;
1428
+ export type NormalizedIllustrationImageObject = Normalized<IllustrationImageSerializedObject>;
1429
+ export type NormalizedIllustrationObject = Normalized<IllustrationSerializedObject>;
1430
+ export type NormalizedLoadingCardObject = Normalized<LoadingCardSerializedObject>;
1431
+ export type NormalizedMaskObject = Normalized<MaskSerializedObject>;
1432
+ export type NormalizedMockupDesignObject = Normalized<MockupDesignSerializedObject>;
1433
+ export type NormalizedObject = NormalizedStandardObject | NormalizedGuideObject;
1434
+ export type NormalizedPathTextObject = Normalized<PathTextSerializedObject>;
1435
+ export type NormalizedRichTextObject = Normalized<RichTextSerializedObject>;
1436
+ export type NormalizedStandardBoard<T extends ArtboardOptions = ArtboardOptions> = Normalized<BaseStandardBoard<T>>;
1437
+ export type NormalizedStandardObject = NormalizedBasicShapeObject | NormalizedCombinedShapeObject | NormalizedIllustrationImageObject | NormalizedIllustrationObject | NormalizedLoadingCardObject | NormalizedMaskObject | NormalizedMockupDesignObject | NormalizedPathTextObject | NormalizedRichTextObject | NormalizedVideoObject;
1438
+ export type NormalizedVideoObject = Normalized<VideoSerializedObject>;
1439
+ export type NullablePathTextShadowOptions = PathTextShadowOptions | {
1440
+ type: null;
1441
+ };
1442
+ export type OrientationConditional = {
1443
+ orientation: Orientation.HORIZONTAL;
1444
+ top: number;
1445
+ } | {
1446
+ orientation: Orientation.VERTICAL;
1447
+ left: number;
1448
+ };
1449
+ export type OrientationDir = {
1450
+ orientation: Orientation.HORIZONTAL;
1451
+ top: number;
1452
+ } | {
1453
+ orientation: Orientation.VERTICAL;
1454
+ left: number;
1455
+ };
1456
+ export type OriginX = "left" | "center" | "right";
1457
+ export type OriginY = "top" | "center" | "bottom";
1458
+ export type PatchAction<T> = {
1459
+ action: Action.MERGE;
1460
+ value: DeepPartial<T>;
1461
+ } | {
1462
+ action: Action.SET;
1463
+ value: T;
1464
+ } | {
1465
+ action: Action.DELETE;
1466
+ };
1467
+ export type PatchTree<S> = {
1468
+ [K in keyof S]?: NonNullable<S[K]> extends object ? PatchAction<DeepPartial<S[K]>> | PatchTree<NonNullable<DeepPartial<S[K]>>> : PatchAction<DeepPartial<S[K]>>;
1469
+ };
1470
+ export type PathTextSerializedObject = typeof PATH_TEXT_DEFAULT_VALUES & {
1471
+ relativeSize?: number | undefined;
1472
+ overrideText?: string | undefined;
1473
+ transformOptions: PathTextTransformOptions;
1474
+ fontFamily?: string | undefined;
1475
+ fontWeight?: string | undefined;
1476
+ text: string;
1477
+ shadowOptions: NullablePathTextShadowOptions;
1478
+ adjustableWidth?: number | undefined;
1479
+ uppercase?: boolean | undefined;
1480
+ underline?: boolean | undefined;
1481
+ variation?: Record<string, number> | undefined;
1482
+ variationAxes?: Record<string, FontVariation> | undefined;
1483
+ decorationOptions?: DecorationOptions | undefined;
1484
+ isUserFont?: boolean | undefined;
1485
+ };
1486
+ export type PathTextShadowOptions = ShadingOptions & ShadowOptions & {
1487
+ color: string;
1488
+ };
1489
+ export type PathTextTransformOptions = TransformOptions & {
1490
+ points: {
1491
+ x: number;
1492
+ y: number;
1493
+ }[];
1494
+ };
1495
+ export type PrintMargins = {
1496
+ enabled: boolean;
1497
+ top: number;
1498
+ right: number;
1499
+ bottom: number;
1500
+ left: number;
1501
+ };
1502
+ export type RelativePosition = {
1503
+ relative: RelativeToObject | RelativeToViewport | RelativeToScreen;
1504
+ };
1505
+ export type RelativeToObject = {
1506
+ to: Exclude<string, "viewport">;
1507
+ location: ElementLocation;
1508
+ offset?: LeftTopPosition;
1509
+ };
1510
+ export type RelativeToScreen = {
1511
+ to: "screen";
1512
+ coordinates: ScreenCoordinates;
1513
+ offset?: LeftTopPosition;
1514
+ };
1515
+ export type RelativeToViewport = {
1516
+ to: "viewport";
1517
+ location: ElementLocation;
1518
+ offset?: LeftTopPosition;
1519
+ };
1520
+ export type ReleaseTextureParams = {
1521
+ boardId: string;
1522
+ };
1523
+ export type RemoveFromGroupParams = {
1524
+ objectIds: string[];
1525
+ };
1526
+ export type RemoveGroupParams = {
1527
+ groupId: string;
1528
+ };
1529
+ export type RemovePlaylistItemParams = {
1530
+ videoBoardId: string;
1531
+ playlistItemId: string;
1532
+ };
1533
+ export type RemoveTextureParams = {
1534
+ boardId: string;
1535
+ };
1536
+ export type RemoveVideoPlaylistItemParams = {
1537
+ videoId: string;
1538
+ playlistItemId: string;
1539
+ };
1540
+ export type RenameParams = {
1541
+ objectId: string;
1542
+ newName: string;
1543
+ };
1544
+ export type RichTextBasePluginSerializedObject = {
1545
+ id: string;
1546
+ name: string;
1547
+ version: string;
1548
+ };
1549
+ export type RichTextDecorationPluginSerializedObject = RichTextBasePluginSerializedObject & {
1550
+ fillStyle: string;
1551
+ [key: string]: string | number;
1552
+ };
1553
+ export type RichTextRenderPluginSerializedObject = RichTextBasePluginSerializedObject & {
1554
+ color: string;
1555
+ angle: number;
1556
+ offset: number;
1557
+ [key: string]: string | number;
1558
+ };
1559
+ export type RichTextSerializedObject = typeof RICH_TEXT_DEFAULT_VALUES & {
1560
+ text: string;
1561
+ activeRenderPlugins?: RichTextRenderPluginSerializedObject[];
1562
+ activeDecorationPlugins?: RichTextDecorationPluginSerializedObject[];
1563
+ [key: string]: unknown;
1564
+ };
1565
+ export type ScreenCoordinates = {
1566
+ x: number;
1567
+ y: number;
1568
+ };
1569
+ export type SdkError = SdkBadInputError | SdkInternalError;
1570
+ export type SdkResult<T, E = SdkError> = {
1571
+ isOk: true;
1572
+ result: T;
1573
+ error?: never;
1574
+ } | {
1575
+ isOk: false;
1576
+ result?: never;
1577
+ error: E;
1578
+ };
1579
+ export type SdkResultAsync<T, E = SdkError> = Promise<{
1580
+ isOk: true;
1581
+ result: T;
1582
+ error?: never;
1583
+ } | {
1584
+ isOk: false;
1585
+ result?: never;
1586
+ error: E;
1587
+ }>;
1588
+ export type Selector<T, U = unknown> = (state: T) => U;
1589
+ export type SendToParams = {
1590
+ boardOrObjectIds: string[];
1591
+ };
1592
+ export type SerialisedPhotoFilter = ({
1593
+ type: ImageFilterType;
1594
+ } & PhotoFilterOptions[ImageFilterType]) | {
1595
+ type: ImageFilterType;
1596
+ };
1597
+ export type SerializableCornerRadii = Record<string, Record<string, number>>;
1598
+ 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;
1599
+ export type SerializedObject = StandardSerializedObject | GuideSerializedObject;
1600
+ export type SetTextureParams = {
1601
+ boardId: string;
1602
+ texture: string;
1603
+ options?: Partial<TextureOptions>;
1604
+ };
1605
+ export type SetVideoOnVideoboardParams = {
1606
+ videoBoardId: string;
1607
+ video: {
1608
+ width?: number;
1609
+ height?: number;
1610
+ playlist: Omit<VideoPlaylistItem, "id">[];
1611
+ };
1612
+ } & Pick<VideoboardOptions, "generationSettings">;
1613
+ export type ShadingOptions = AvailableShadowOptions & {
1614
+ type: "drop" | "line" | "block" | "detail";
1615
+ outlineWidth?: number;
1616
+ borderColor?: string | null;
1617
+ };
1618
+ export type Shape = {
1619
+ groupId?: string;
1620
+ } & (BasicShapeSerializedObject | CombinedShapeSerializedObject | IllustrationSerializedObject | PathTextSerializedObject | RichTextSerializedObject);
1621
+ export type ShapeBooleanOperation = "unite" | "subtract" | "intersect" | "exclude" | "divide";
1622
+ export type ShapeProperties = {
1623
+ angle?: BasicShapeSerializedObject["angle"];
1624
+ flipX?: BasicShapeSerializedObject["flipX"];
1625
+ flipY?: BasicShapeSerializedObject["flipY"];
1626
+ hidden?: BasicShapeSerializedObject["hidden"];
1627
+ opacity?: BasicShapeSerializedObject["opacity"];
1628
+ skewX?: BasicShapeSerializedObject["skewX"];
1629
+ skewY?: BasicShapeSerializedObject["skewY"];
1630
+ cornerRadii?: BasicShapeSerializedObject["cornerRadii"];
1631
+ name?: BasicShapeSerializedObject["name"];
1632
+ shadowOptions?: BasicShapeSerializedObject["shadowOptions"];
1633
+ fill?: NonNullable<BasicShapeSerializedObject["fill"]>;
1634
+ fillColor?: NonNullable<BasicShapeSerializedObject["fill"]>[number]["value"];
1635
+ stroke?: NonNullable<BasicShapeSerializedObject["stroke"]>;
1636
+ strokeWidth?: NonNullable<BasicShapeSerializedObject["strokeWidth"]>;
1637
+ };
1638
+ export type SmartboardAction = SmartboardActionWithAiPrompt | SmartboardActionInitial;
1639
+ export type SmartboardActionInitial = {
1640
+ type: "noAction";
1641
+ aspectRatio?: SmartboardAspectRatio;
1642
+ modelId?: string;
1643
+ };
1644
+ export type SmartboardActionWithAiPrompt = {
1645
+ type: "aiPrompt";
1646
+ prompt: string;
1647
+ quality?: SmartboardQuality;
1648
+ aspectRatio?: SmartboardAspectRatio;
1649
+ transparentBackground?: boolean;
1650
+ background?: SmartboardBackground;
1651
+ modelId?: string;
1652
+ averageSpeed?: number;
1653
+ generatedContent?: SmartboardGeneratedContent;
1654
+ };
1655
+ export type SmartboardAspectRatio = string;
1656
+ export type SmartboardBackground = "transparent" | "opaque";
1657
+ export type SmartboardGeneratedContent = {
1658
+ id: string;
1659
+ status: "STARTED" | "COMPLETE" | "FAILED";
1660
+ objectName?: string;
1661
+ startedAt?: number;
1662
+ };
1663
+ export type SmartboardGenerationSettings = Record<string, unknown>;
1664
+ export type SmartboardOptions = ConnectedArtboardOptions<ObjectType.Smartboard> & {
1665
+ action?: SmartboardAction;
1666
+ } & GeneratableBoard<SmartboardGenerationSettings>;
1667
+ export type SmartboardQuality = "auto" | "high" | "medium" | "low";
1668
+ export type StandardSerializedObject = BasicShapeSerializedObject | CombinedShapeSerializedObject | IllustrationImageSerializedObject | IllustrationSerializedObject | LoadingCardSerializedObject | MaskSerializedObject | MockupDesignSerializedObject | PathTextSerializedObject | RichTextSerializedObject | VideoSerializedObject;
1669
+ export type StateGradientInfo = {
1670
+ [key: string]: GradientInfo;
1671
+ };
1672
+ export type StringColor = {
1673
+ key: StringColorKeysType;
1674
+ value: string | null | undefined;
1675
+ visible: boolean;
1676
+ };
1677
+ export type StringColorKeysType = (typeof stringColorKeys)[number];
1678
+ export type StructureObjectId = string;
1679
+ export type TempUserImageUpload = {
1680
+ objectId: string;
1681
+ mimeType: string;
1682
+ };
1683
+ export type TextProperties = {
1684
+ fontFamily?: string;
1685
+ fontSize?: number;
1686
+ fontWeight?: string | number;
1687
+ fill?: Color;
1688
+ textAlign?: "left" | "center" | "right" | "justify";
1689
+ lineHeight?: number;
1690
+ resizeBehavior?: "none" | "hug" | "hug-height";
1691
+ charSpacing?: number;
1692
+ underline?: boolean;
1693
+ overline?: boolean;
1694
+ linethrough?: boolean;
1695
+ angle?: number;
1696
+ scaleX?: number;
1697
+ scaleY?: number;
1698
+ stroke?: string;
1699
+ strokeWidth?: number;
1700
+ };
1701
+ export type UpdateArtboardBackgroundParams = {
1702
+ id: string;
1703
+ objectName: string;
1704
+ };
1705
+ export type UpdateArtboardParams = {
1706
+ id: string;
1707
+ artboard?: Partial<ArtboardOptions>;
1708
+ title?: string;
1709
+ texture?: TextureOptions;
1710
+ backgroundImage?: BackgroundImageOptions;
1711
+ };
1712
+ export type UpdateDecorationPluginParams = {
1713
+ textId: string;
1714
+ decorationPluginId: string;
1715
+ decorationPlugin: Partial<Omit<RichTextDecorationPluginSerializedObject, "id">>;
1716
+ };
1717
+ export type UpdateIllustrationParams = {
1718
+ id: string;
1719
+ left?: number;
1720
+ top?: number;
1721
+ width?: number;
1722
+ height?: number;
1723
+ objectName?: string;
1724
+ shadowOptions?: IllustrationSerializedObject["shadowOptions"];
1725
+ shadowColor?: NonNullable<IllustrationSerializedObject["shadowOptions"]>["color"];
1726
+ stroke?: IllustrationSerializedObject["stroke"];
1727
+ strokeWidth?: IllustrationSerializedObject["strokeWidth"];
1728
+ fill?: IllustrationSerializedObject["fill"];
1729
+ };
1730
+ export type UpdateImageParams = {
1731
+ id: IllustrationImageSerializedObject["id"];
1732
+ left?: IllustrationImageSerializedObject["left"];
1733
+ top?: IllustrationImageSerializedObject["top"];
1734
+ width?: IllustrationImageSerializedObject["width"];
1735
+ height?: IllustrationImageSerializedObject["height"];
1736
+ objectName?: IllustrationImageSerializedObject["objectName"];
1737
+ shadowOptions?: IllustrationImageSerializedObject["shadowOptions"];
1738
+ shadowColor?: NonNullable<IllustrationImageSerializedObject["shadowOptions"]>["color"];
1739
+ stroke?: IllustrationImageSerializedObject["stroke"];
1740
+ strokeWidth?: IllustrationImageSerializedObject["strokeWidth"];
1741
+ } & GeneratableObject;
1742
+ export type UpdateMockupBoardParams = {
1743
+ mockupBoardId: string;
1744
+ size?: Dimensions;
1745
+ mockupTemplateId?: number;
1746
+ shouldMockupColorMatchArtboard?: boolean;
1747
+ };
1748
+ export type UpdatePlaylistItemParams = {
1749
+ videoBoardId: string;
1750
+ playlistItemId: string;
1751
+ playlistItem: Omit<VideoPlaylistItem, "id">;
1752
+ };
1753
+ export type UpdateRenderPluginParams = {
1754
+ textId: string;
1755
+ renderPluginId: string;
1756
+ renderPlugin: Partial<Omit<RichTextRenderPluginSerializedObject, "id">>;
1757
+ };
1758
+ export type UpdateShapeInput = Partial<CreateElementWithPositionAndSize> & BasicShapeConfigurableFields & {
1759
+ id: NormalizedBasicShapeObject["id"];
1760
+ };
1761
+ export type UpdateSmartboardParams = {
1762
+ smartboardId: string;
1763
+ size?: Dimensions;
1764
+ backgroundImage?: Partial<BackgroundImageOptions>;
1765
+ } & Pick<SmartboardOptions, "generationSettings">;
1766
+ export type UpdateTextParams = {
1767
+ textId: string;
1768
+ text?: string;
1769
+ left?: number;
1770
+ top?: number;
1771
+ angle?: number;
1772
+ } & Partial<TextProperties>;
1773
+ export type UpdateTextureParams = {
1774
+ boardId: string;
1775
+ options: Partial<TextureOptions>;
1776
+ };
1777
+ export type UpdateVideoParams = {
1778
+ videoId: string;
1779
+ position?: AbsolutePosition | RelativePosition;
1780
+ size?: Dimensions;
1781
+ shadowOptions?: VideoSerializedObject["shadowOptions"];
1782
+ shadowColor?: NonNullable<VideoSerializedObject["shadowOptions"]>["color"];
1783
+ stroke?: VideoSerializedObject["stroke"];
1784
+ strokeWidth?: VideoSerializedObject["strokeWidth"];
1785
+ };
1786
+ export type UpdateVideoPlaylistItemParams = {
1787
+ videoId: string;
1788
+ playlistItemId: string;
1789
+ playlistItem: Omit<VideoPlaylistItem, "id">;
1790
+ };
1791
+ export type UpdateVideoboardParams = {
1792
+ videoBoardId: string;
1793
+ size?: Dimensions;
1794
+ } & Pick<VideoboardOptions, "generationSettings">;
1795
+ export type UploadedFontFamily = {
1796
+ id: string;
1797
+ name: string;
1798
+ fonts: UploadedFontStyle[];
1799
+ workspaceId?: string;
1800
+ preview?: string;
1801
+ extension?: {
1802
+ id: string;
1803
+ name?: string;
1804
+ };
1805
+ };
1806
+ export type UploadedFontStyle = {
1807
+ name: string;
1808
+ id: string;
1809
+ style: string | null;
1810
+ objectName: string;
1811
+ };
1812
+ export type UserImageUpload = {
1813
+ id: string;
1814
+ objectName: string;
1815
+ mimeType: string;
1816
+ };
1817
+ export type VideoBoardGenerationSettings = Record<string, unknown>;
1818
+ export type VideoPlaylistItem = {
1819
+ id: string;
1820
+ objectName?: string;
1821
+ meta?: GeneratableObject & {
1822
+ generation?: {
1823
+ isGenerating?: boolean;
1824
+ };
1825
+ };
1826
+ };
1827
+ export type VideoSerializedObject = typeof DEFAULT_VALUES$2 & {
1828
+ playlist: VideoPlaylistItem[];
1829
+ realWidth?: number;
1830
+ realHeight?: number;
1831
+ };
1832
+ export type VideoboardOptions = ConnectedArtboardOptions<ObjectType.Videoboard> & {
1833
+ video?: {
1834
+ width: number;
1835
+ height: number;
1836
+ playlist: VideoPlaylistItem[];
1837
+ };
1838
+ } & GeneratableBoard<VideoBoardGenerationSettings>;
1839
+ export type Viewport = {
1840
+ coords: {
1841
+ tl: {
1842
+ x: number;
1843
+ y: number;
1844
+ };
1845
+ tr: {
1846
+ x: number;
1847
+ y: number;
1848
+ };
1849
+ bl: {
1850
+ x: number;
1851
+ y: number;
1852
+ };
1853
+ br: {
1854
+ x: number;
1855
+ y: number;
1856
+ };
1857
+ };
1858
+ transform: [
1859
+ number,
1860
+ number,
1861
+ number,
1862
+ number,
1863
+ number,
1864
+ number
1865
+ ];
1866
+ };
1867
+ export type ViewportAPI = {
1868
+ get(): Viewport;
1869
+ set(patch: ViewportPatch, origin?: Origin): void;
1870
+ getTransform(): Viewport["transform"];
1871
+ setTransform(transform: Viewport["transform"], origin?: Origin): void;
1872
+ getZoom(): number;
1873
+ setZoom(zoom: number, origin?: Origin): void;
1874
+ getCoords(): Viewport["coords"];
1875
+ setCoords(coords: Viewport["coords"], origin?: Origin): void;
1876
+ getPosition(): {
1877
+ x: number;
1878
+ y: number;
1879
+ };
1880
+ setPosition(position: {
1881
+ x: number;
1882
+ y: number;
1883
+ }, origin?: Origin): void;
1884
+ };
1885
+ export type ViewportPatch = {
1886
+ transform: Viewport["transform"];
1887
+ zoom?: never;
1888
+ position?: never;
1889
+ } | {
1890
+ zoom: number;
1891
+ position?: {
1892
+ x: number;
1893
+ y: number;
1894
+ };
1895
+ transform?: never;
1896
+ } | {
1897
+ position: {
1898
+ x: number;
1899
+ y: number;
1900
+ };
1901
+ zoom?: never;
1902
+ transform?: never;
1903
+ };
1904
+ export type WithAsync<T> = {
1905
+ [K in keyof T]: T[K] extends (...args: infer Args) => infer Return ? Return extends Promise<infer U> ? (...args: Args) => Promise<BridgedSdkResult<U>> : (...args: Args) => Promise<BridgedSdkResult<Return>> : T[K] extends object ? T[K] extends FunctionType | Array<unknown> ? T[K] : WithAsync<T[K]> : T[K];
1906
+ };
1907
+ export type WithOptsRemoved<T> = {
1908
+ [K in keyof T]: T[K] extends (...args: infer Args) => infer Return ? Args extends [
1909
+ infer First,
1910
+ ...unknown[]
1911
+ ] ? (arg: First) => Return : T[K] : T[K] extends object ? WithOptsRemoved<T[K]> : T[K];
1912
+ };
1913
+
1914
+ export as namespace kittl;
1915
+
1916
+ export {};