@cliquify.me/types 4.0.13 → 4.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.d.ts +315 -322
  2. package/package.json +4 -11
  3. package/src/index.ts +816 -0
package/dist/index.d.ts CHANGED
@@ -1,179 +1,30 @@
1
- export interface State {
2
- tracks: ITrack[];
3
- trackItemIds: string[];
4
- trackItemsMap: Record<string, ITrackItem>;
5
- transitionIds: string[];
6
- transitionsMap: Record<string, ITransition>;
7
- scale: ITimelineScaleState;
8
- duration: number;
9
- activeIds: string[];
10
- trackItemDetailsMap: Record<string, IItem>;
11
- size: ISize;
12
- structure: ItemStructure[];
13
- fps: number;
14
- background: {
15
- type: "color" | "image";
16
- value: string;
17
- };
18
- acceptsMap: Record<string, string[]>;
19
- }
20
- export type ItemType = "text" | "image" | "video" | "audio" | "helper" | "caption" | "template" | "composition" | "illustration" | "shape" | "progressBar" | "progressFrame" | "radialAudioBars" | "linealAudioBars" | "waveAudioBars" | "hillAudioBars";
21
- export interface IDisplay {
22
- from: number;
23
- to: number;
24
- }
1
+ export type ItemType = "text" | "image" | "video" | "audio" | "helper" | "caption" | "template" | "composition" | "illustration" | "shape" | "rect" | "progressBar" | "progressFrame" | "radialAudioBars" | "linealAudioBars" | "waveAudioBars" | "hillAudioBars";
2
+ export type ITrackType = "main" | "text" | "image" | "video" | "audio" | "helper" | "caption" | "template" | "composition" | "illustration" | "shape" | "rect" | "progressBar" | "progressFrame" | "radialAudioBars" | "linealAudioBars";
3
+ export type ITransitionType = "none" | "fade" | "slide" | "wipe" | "flip" | "clockWipe" | "star" | "circle" | "rectangle" | "slidingDoors";
4
+ export type IKindHistory = "add" | "remove" | "update" | "replace" | "update:details" | "layer:selection" | "undo" | "design:resize" | "design:load" | "redo" | "add:transition";
25
5
  export interface ISize {
26
6
  width: number;
27
7
  height: number;
28
8
  type?: string;
29
9
  name?: string;
30
10
  }
31
- export interface IDesign {
32
- id: string | number;
33
- size: ISize;
34
- duration?: number;
35
- fps: number;
36
- tracks: ITrack[];
37
- trackItemIds: string[];
38
- trackItemsMap: Record<string, ITrackItemBase>;
39
- transitionIds: string[];
40
- transitionsMap: Record<string, ITransition>;
41
- trackItemDetailsMap: Record<string, IItem>;
42
- structure?: ItemStructure[];
43
- background?: {
44
- type: "color" | "image";
45
- value: string;
46
- };
11
+ export interface IDisplay {
12
+ from: number;
13
+ to: number;
47
14
  }
48
15
  export interface ITrim {
49
16
  from: number;
50
17
  to: number;
51
18
  }
52
- interface ICommonDetails {
53
- width?: number;
54
- height?: number;
55
- transform?: string;
56
- opacity?: number;
57
- border?: string;
58
- borderRadius?: number;
59
- boxShadow?: IBoxShadow;
60
- top?: number | string;
61
- left?: number | string;
62
- borderColor?: string;
63
- borderWidth?: number;
64
- }
65
19
  export interface IBoxShadow {
66
20
  color: string;
67
21
  x: number;
68
22
  y: number;
69
23
  blur: number;
70
24
  }
71
- export type ITrackItem = (ITrackItemBase & {
72
- type: "text";
73
- }) | (ITrackItemBase & {
74
- type: "image";
75
- }) | (ITrackItemBase & {
76
- type: "video";
77
- }) | (ITrackItemBase & {
78
- type: "audio";
79
- }) | (ITrackItemBase & {
80
- type: "helper";
81
- }) | (ITrackItemBase & {
82
- type: "caption";
83
- }) | (ITrackItemBase & {
84
- type: "template";
85
- }) | (ITrackItemBase & {
86
- type: "composition";
87
- }) | (ITrackItemBase & {
88
- type: "illustration";
89
- }) | (ITrackItemBase & {
90
- type: "shape";
91
- }) | (ITrackItemBase & {
92
- type: "progressBar";
93
- }) | (ITrackItemBase & {
94
- type: "progressFrame";
95
- }) | (ITrackItemBase & {
96
- type: "radialAudioBars";
97
- }) | (ITrackItemBase & {
98
- type: "linealAudioBars";
99
- }) | (ITrackItemBase & {
100
- type: "waveAudioBars";
101
- }) | (ITrackItemBase & {
102
- type: "hillAudioBars";
103
- });
104
- export interface IStateManager {
105
- getState(): State;
106
- subscribe(callback: (state: State) => void): void;
107
- updateState(partialState: Partial<State>, updateHistory?: IUpdateStateOptions): void;
108
- subscribeToScale: (callback: (v: {
109
- scale: State["scale"];
110
- }) => void) => void;
111
- subscribeToDuration: (callback: (duration: {
112
- duration: State["duration"];
113
- }) => void) => void;
114
- subscribeToActiveIds: (callback: (activeIds: {
115
- activeIds: State["activeIds"];
116
- }) => void) => void;
117
- subscribeToAddOrRemoveItems: (callback: (trackItemIds: {
118
- trackItemIds: State["trackItemIds"];
119
- }) => void) => void;
120
- subscribeToHistory: (callback: (history: {
121
- tracks: State["tracks"];
122
- trackItemsMap: State["trackItemsMap"];
123
- trackItemDetailsMap: State["trackItemDetailsMap"];
124
- trackItemIds: State["trackItemIds"];
125
- transitionIds: State["transitionIds"];
126
- transitionsMap: State["transitionsMap"];
127
- }) => void) => void;
128
- subscribeToUpdateTrackItem: (callback: (trackItemUpdate: {
129
- trackItemsMap: State["trackItemsMap"];
130
- }) => void) => void;
131
- subscribeToUpdateItemDetails: (callback: (trackItemUpdate: {
132
- trackItemDetailsMap: State["trackItemDetailsMap"];
133
- }) => void) => void;
134
- subscribeToUpdateTrackItemTiming: (callback: (trackItemUpdate: {
135
- trackItemsMap: State["trackItemsMap"];
136
- changedTrimIds?: string[];
137
- changedDisplayIds?: string[];
138
- }) => void) => void;
139
- subscribeToFps: (callback: (fps: {
140
- fps: State["fps"];
141
- }) => void) => void;
142
- subscribeToUpdateAnimations: (callback: (trackItemUpdate: {
143
- trackItemsMap: State["trackItemsMap"];
144
- changedAnimationIds?: string[];
145
- }) => void) => void;
146
- subscribeToTracks: (callback: (tracksUpdate: {
147
- tracks: State["tracks"];
148
- changedTracks: string[];
149
- }) => void) => void;
150
- subscribeToState: (callback: (tracksInfo: {
151
- tracks: State["tracks"];
152
- trackItemIds: State["trackItemIds"];
153
- trackItemsMap: State["trackItemsMap"];
154
- transitionIds: State["transitionIds"];
155
- transitionsMap: State["transitionsMap"];
156
- trackItemDetailsMap: State["trackItemDetailsMap"];
157
- structure: State["structure"];
158
- }) => void) => void;
159
- }
160
- export type IKindHistory = "add" | "remove" | "update" | "replace" | "update:details" | "layer:selection" | "undo" | "design:resize" | "design:load" | "redo" | "add:transition";
161
- export interface IUpdateStateOptions {
162
- updateHistory?: boolean;
163
- kind?: IKindHistory;
164
- }
165
- export type ITransitionType = "none" | "fade" | "slide" | "wipe" | "flip" | "clockWipe" | "star" | "circle" | "rectangle" | "slidingDoors";
166
- export interface ITransition {
167
- id: string;
168
- trackId: string;
169
- fromId: string;
170
- toId: string;
171
- type: string;
172
- name?: string;
173
- duration: number;
174
- preview?: string;
175
- direction?: any;
176
- kind: string;
25
+ export interface IMetadata {
26
+ resourceId: string;
27
+ order: number;
177
28
  }
178
29
  export interface IBasicAnimation {
179
30
  name: string;
@@ -194,6 +45,67 @@ export interface ICompositionAnimation {
194
45
  }[];
195
46
  };
196
47
  }
48
+ export interface ITransition {
49
+ id: string;
50
+ trackId: string;
51
+ fromId: string;
52
+ toId: string;
53
+ type: string;
54
+ name?: string;
55
+ duration: number;
56
+ preview?: string;
57
+ direction?: any;
58
+ kind: string;
59
+ }
60
+ export interface ITrack {
61
+ id: string;
62
+ type: ITrackType;
63
+ items: string[];
64
+ metadata?: Partial<IMetadata>;
65
+ accepts?: string[];
66
+ index?: number;
67
+ magnetic?: boolean;
68
+ static?: boolean;
69
+ }
70
+ export interface ITimelineScaleState {
71
+ unit: number;
72
+ zoom: number;
73
+ segments: number;
74
+ index: number;
75
+ }
76
+ export interface ITimelineScrollState {
77
+ /**
78
+ * Timeline scroll state by X-axis.
79
+ */
80
+ left: number;
81
+ /**
82
+ * Timeline scroll state by Y-axis.
83
+ */
84
+ top: number;
85
+ }
86
+ export interface CanvasSpacing {
87
+ left: number;
88
+ right: number;
89
+ }
90
+ export interface ItemStructure {
91
+ id: string;
92
+ items: string[];
93
+ transitions: string[];
94
+ tracks: ITrack[];
95
+ }
96
+ interface ICommonDetails {
97
+ width?: number;
98
+ height?: number;
99
+ transform?: string;
100
+ opacity?: number;
101
+ border?: string;
102
+ borderRadius?: number;
103
+ boxShadow?: IBoxShadow;
104
+ top?: number | string;
105
+ left?: number | string;
106
+ borderColor?: string;
107
+ borderWidth?: number;
108
+ }
197
109
  export interface ITrackItemBase {
198
110
  id: string;
199
111
  name: string;
@@ -219,6 +131,7 @@ export interface ITrackItemBase {
219
131
  transition: ITransition;
220
132
  };
221
133
  }
134
+ export type ITrackItem = IAudio | IImage | IText | IVideo | ICaption | ITemplate | IComposition | IIllustration | IShape | IRect | IProgressBar | IProgressFrame | IRadialAudioBars | ILinealAudioBars | IWaveAudioBars | IHillAudioBars;
222
135
  export interface ICaptionWord {
223
136
  end: number;
224
137
  start: number;
@@ -303,40 +216,6 @@ export interface ITextDetails extends ICommonDetails {
303
216
  blur: number;
304
217
  };
305
218
  }
306
- export interface IIllustrationDetails extends ICommonDetails {
307
- path: string;
308
- src: string;
309
- width: number;
310
- height: number;
311
- opacity: number;
312
- transform: string;
313
- border: string;
314
- top: string;
315
- left: string;
316
- flipX: boolean;
317
- flipY: boolean;
318
- rotate: string;
319
- svgString: string;
320
- initialSvgString: string;
321
- visibility: "visible" | "hidden";
322
- colorMap: Record<string, string>;
323
- }
324
- export interface IShapeDetails extends ICommonDetails {
325
- path: string;
326
- src: string;
327
- width: number;
328
- height: number;
329
- opacity: number;
330
- transform: string;
331
- border: string;
332
- top: string;
333
- left: string;
334
- flipX: boolean;
335
- flipY: boolean;
336
- rotate: string;
337
- visibility: "visible" | "hidden";
338
- backgroundColor: string;
339
- }
340
219
  export interface IImageDetails extends ICommonDetails {
341
220
  src: string;
342
221
  background: string;
@@ -363,10 +242,6 @@ export interface IImageDetails extends ICommonDetails {
363
242
  rotate: string;
364
243
  visibility: "visible" | "hidden";
365
244
  }
366
- export interface IAudioDetails extends ICommonDetails {
367
- src: string;
368
- volume?: number;
369
- }
370
245
  export interface IVideoDetails extends ICommonDetails {
371
246
  src: string;
372
247
  frames?: number;
@@ -391,75 +266,60 @@ export interface IVideoDetails extends ICommonDetails {
391
266
  rotate: string;
392
267
  visibility: "visible" | "hidden";
393
268
  }
394
- export interface ITimelineScaleState {
395
- unit: number;
396
- zoom: number;
397
- segments: number;
398
- index: number;
399
- }
400
- export type IItem = IAudio | IImage | IText | IVideo | ICaption | ITemplate | IComposition | IIllustration | IShape | IProgressBar | IProgressFrame | IRadialAudioBars | ILinealAudioBars | IWaveAudioBars | IHillAudioBars;
401
- export interface IComposition extends ITrackItemBase {
402
- type: "composition";
403
- trackItemIds: string[];
404
- trackItemsMap: Record<string, ITrackItem>;
405
- trackItemDetailsMap: Record<string, IItem>;
406
- tracks: ITrack[];
407
- size: ISize;
269
+ export interface IAudioDetails extends ICommonDetails {
270
+ src: string;
271
+ volume?: number;
408
272
  }
409
- export interface IAudio extends ITrackItemBase {
410
- type: "audio";
411
- details: IAudioDetails;
412
- }
413
- export interface ITemplate extends ITrackItemBase {
414
- type: "template";
415
- trackItemDetailsMap: Record<string, IItem>;
416
- trackItemIds: string[];
417
- trackItemsMap: Record<string, ITrackItem>;
418
- transitionsMap: Record<string, ITransition>;
419
- transitionIds: string[];
420
- size: ISize;
421
- tracks: ITrack[];
422
- structure: ItemStructure[];
423
- }
424
- export interface ICaption extends ITrackItemBase {
425
- type: "caption";
426
- details: ICaptionDetails;
427
- }
428
- export interface IText extends ITrackItemBase {
429
- type: "text";
430
- details: ITextDetails;
431
- }
432
- export interface IImage extends ITrackItemBase {
433
- type: "image";
434
- details: IImageDetails;
435
- }
436
- export interface IIllustration extends ITrackItemBase {
437
- type: "illustration";
438
- details: IIllustrationDetails;
439
- }
440
- export interface IProgressBar extends ITrackItemBase {
441
- type: "progressBar";
442
- details: IProgressBarDetails;
443
- }
444
- export interface IProgressFrame extends ITrackItemBase {
445
- type: "progressFrame";
446
- details: IProgressFrameDetails;
447
- }
448
- export interface IRadialAudioBars extends ITrackItemBase {
449
- type: "radialAudioBars";
450
- details: IRadialAudioBarsDetails;
451
- }
452
- export interface ILinealAudioBars extends ITrackItemBase {
453
- type: "linealAudioBars";
454
- details: ILinealAudioBarsDetails;
273
+ export interface IIllustrationDetails extends ICommonDetails {
274
+ path: string;
275
+ src: string;
276
+ width: number;
277
+ height: number;
278
+ opacity: number;
279
+ transform: string;
280
+ border: string;
281
+ top: string;
282
+ left: string;
283
+ flipX: boolean;
284
+ flipY: boolean;
285
+ rotate: string;
286
+ svgString: string;
287
+ initialSvgString: string;
288
+ visibility: "visible" | "hidden";
289
+ colorMap: Record<string, string>;
455
290
  }
456
- export interface IWaveAudioBars extends ITrackItemBase {
457
- type: "waveAudioBars";
458
- details: IWaveAudioBarsDetails;
291
+ export interface IShapeDetails extends ICommonDetails {
292
+ path: string;
293
+ src: string;
294
+ width: number;
295
+ height: number;
296
+ opacity: number;
297
+ transform: string;
298
+ border: string;
299
+ top: string;
300
+ left: string;
301
+ flipX: boolean;
302
+ flipY: boolean;
303
+ rotate: string;
304
+ visibility: "visible" | "hidden";
305
+ backgroundColor: string;
459
306
  }
460
- export interface IHillAudioBars extends ITrackItemBase {
461
- type: "hillAudioBars";
462
- details: IHillAudioBarsDetails;
307
+ export interface IRectDetails extends ICommonDetails {
308
+ width: number;
309
+ height: number;
310
+ opacity: number;
311
+ transform: string;
312
+ border: string;
313
+ top: string;
314
+ left: string;
315
+ flipX: boolean;
316
+ flipY: boolean;
317
+ rotate: string;
318
+ visibility: "visible" | "hidden";
319
+ backgroundColor: string;
320
+ boxShadow: IBoxShadow;
321
+ blur: number;
322
+ brightness: number;
463
323
  }
464
324
  export interface IProgressBarDetails extends ICommonDetails {
465
325
  width: number;
@@ -492,7 +352,7 @@ export interface IProgressFrameDetails extends ICommonDetails {
492
352
  inverted: boolean;
493
353
  barThickness: number;
494
354
  }
495
- export interface IWaveAudioBarsDetails extends ICommonDetails {
355
+ export interface IRadialAudioBarsDetails extends ICommonDetails {
496
356
  width: number;
497
357
  height: number;
498
358
  top: string;
@@ -508,15 +368,8 @@ export interface IWaveAudioBarsDetails extends ICommonDetails {
508
368
  reproduceAudio: boolean;
509
369
  radialBarColor: string;
510
370
  audioDatas: any[];
511
- offsetPixelSpeed: number;
512
- lineColor: string | string[];
513
- lineGap: number;
514
- topRoundness: number;
515
- bottomRoundness: number;
516
- lines: number;
517
- sections: number;
518
371
  }
519
- export interface IHillAudioBarsDetails extends ICommonDetails {
372
+ export interface ILinealAudioBarsDetails extends ICommonDetails {
520
373
  width: number;
521
374
  height: number;
522
375
  top: string;
@@ -530,15 +383,27 @@ export interface IHillAudioBarsDetails extends ICommonDetails {
530
383
  flipY: boolean;
531
384
  srcs: string[];
532
385
  reproduceAudio: boolean;
533
- radialBarColor: string;
534
386
  audioDatas: any[];
387
+ linealBarColor: string;
388
+ backgroundColor: string;
389
+ lineThickness: number;
390
+ gapSize: number;
391
+ roundness: number;
392
+ placement: string | null;
393
+ inverted: boolean;
535
394
  strokeColor: string;
536
395
  fillColor: string | null;
537
396
  strokeWidth: number | null;
538
397
  copies: number | null;
539
- blendMode: string | null;
398
+ offsetPixelSpeed: number;
399
+ lineColor: string | string[];
400
+ lineGap: number;
401
+ topRoundness: number;
402
+ bottomRoundness: number;
403
+ lines: number;
404
+ sections: number;
540
405
  }
541
- export interface IRadialAudioBarsDetails extends ICommonDetails {
406
+ export interface IWaveAudioBarsDetails extends ICommonDetails {
542
407
  width: number;
543
408
  height: number;
544
409
  top: string;
@@ -554,8 +419,15 @@ export interface IRadialAudioBarsDetails extends ICommonDetails {
554
419
  reproduceAudio: boolean;
555
420
  radialBarColor: string;
556
421
  audioDatas: any[];
422
+ offsetPixelSpeed: number;
423
+ lineColor: string | string[];
424
+ lineGap: number;
425
+ topRoundness: number;
426
+ bottomRoundness: number;
427
+ lines: number;
428
+ sections: number;
557
429
  }
558
- export interface ILinealAudioBarsDetails extends ICommonDetails {
430
+ export interface IHillAudioBarsDetails extends ICommonDetails {
559
431
  width: number;
560
432
  height: number;
561
433
  top: string;
@@ -569,68 +441,189 @@ export interface ILinealAudioBarsDetails extends ICommonDetails {
569
441
  flipY: boolean;
570
442
  srcs: string[];
571
443
  reproduceAudio: boolean;
444
+ radialBarColor: string;
572
445
  audioDatas: any[];
573
- linealBarColor: string;
574
- backgroundColor: string;
575
- lineThickness: number;
576
- gapSize: number;
577
- roundness: number;
578
- placement: string | null;
446
+ strokeColor: string;
447
+ fillColor: string | null;
448
+ strokeWidth: number | null;
449
+ copies: number | null;
450
+ blendMode: string | null;
579
451
  }
580
- export interface IShape extends ITrackItemBase {
581
- type: "shape";
582
- details: IShapeDetails;
452
+ export interface IText extends ITrackItemBase {
453
+ type: "text";
454
+ details: ITextDetails;
455
+ }
456
+ export interface ICaption extends ITrackItemBase {
457
+ type: "caption";
458
+ details: ICaptionDetails;
459
+ }
460
+ export interface IImage extends ITrackItemBase {
461
+ type: "image";
462
+ details: IImageDetails;
583
463
  }
584
464
  export interface IVideo extends ITrackItemBase {
585
465
  type: "video";
586
466
  details: IVideoDetails;
587
467
  }
588
- export interface ITrackItemsMap {
589
- [id: string]: ITrackItem;
468
+ export interface IAudio extends ITrackItemBase {
469
+ type: "audio";
470
+ details: IAudioDetails;
590
471
  }
591
- export interface IItemsDetailsMap {
592
- [id: string]: IItem;
472
+ export interface IIllustration extends ITrackItemBase {
473
+ type: "illustration";
474
+ details: IIllustrationDetails;
593
475
  }
594
- export interface ItransitionsMap {
595
- [id: string]: ITransition;
476
+ export interface IShape extends ITrackItemBase {
477
+ type: "shape";
478
+ details: IShapeDetails;
596
479
  }
597
- export interface IMetadata {
598
- resourceId: string;
599
- order: number;
480
+ export interface IRect extends ITrackItemBase {
481
+ type: "rect";
482
+ details: IRectDetails;
600
483
  }
601
- export interface ITrack {
602
- id: string;
603
- type: ITrackType;
604
- items: string[];
605
- metadata?: Partial<IMetadata>;
606
- accepts?: string[];
607
- index?: number;
608
- magnetic?: boolean;
609
- static?: boolean;
484
+ export interface IProgressBar extends ITrackItemBase {
485
+ type: "progressBar";
486
+ details: IProgressBarDetails;
610
487
  }
611
- export type ITrackItemAndDetails = ITrackItem & IItem;
612
- export type IRecordItemAndDetails = Record<string, ITrackItem & IItem>;
613
- export type ITrackType = "main" | "text" | "image" | "video" | "audio" | "helper" | "caption" | "template" | "composition" | "illustration" | "shape" | "progressBar" | "progressFrame" | "radialAudioBars" | "linealAudioBars" | "waveAudioBars" | 'hillAudioBars';
614
- export interface ITimelineScrollState {
615
- /**
616
- * Timeline scroll state by X-axis.
617
- */
618
- left: number;
619
- /**
620
- * Timeline scroll state by Y-axis.
621
- */
622
- top: number;
488
+ export interface IProgressFrame extends ITrackItemBase {
489
+ type: "progressFrame";
490
+ details: IProgressFrameDetails;
623
491
  }
624
- export interface CanvasSpacing {
625
- left: number;
626
- right: number;
492
+ export interface IRadialAudioBars extends ITrackItemBase {
493
+ type: "radialAudioBars";
494
+ details: IRadialAudioBarsDetails;
627
495
  }
628
- export interface ItemStructure {
629
- id: string;
630
- items: string[];
631
- transitions: string[];
496
+ export interface ILinealAudioBars extends ITrackItemBase {
497
+ type: "linealAudioBars";
498
+ details: ILinealAudioBarsDetails;
499
+ }
500
+ export interface IWaveAudioBars extends ITrackItemBase {
501
+ type: "waveAudioBars";
502
+ details: IWaveAudioBarsDetails;
503
+ }
504
+ export interface IHillAudioBars extends ITrackItemBase {
505
+ type: "hillAudioBars";
506
+ details: IHillAudioBarsDetails;
507
+ }
508
+ export interface IComposition extends ITrackItemBase {
509
+ type: "composition";
510
+ trackItemIds: string[];
511
+ trackItemsMap: Record<string, ITrackItem>;
512
+ tracks: ITrack[];
513
+ size: ISize;
514
+ }
515
+ export interface ITemplate extends ITrackItemBase {
516
+ type: "template";
517
+ trackItemIds: string[];
518
+ trackItemsMap: Record<string, ITrackItem>;
519
+ transitionsMap: Record<string, ITransition>;
520
+ transitionIds: string[];
521
+ size: ISize;
632
522
  tracks: ITrack[];
523
+ structure: ItemStructure[];
524
+ }
525
+ export interface State {
526
+ tracks: ITrack[];
527
+ trackItemIds: string[];
528
+ trackItemsMap: Record<string, ITrackItem>;
529
+ transitionIds: string[];
530
+ transitionsMap: Record<string, ITransition>;
531
+ scale: ITimelineScaleState;
532
+ duration: number;
533
+ activeIds: string[];
534
+ size: ISize;
535
+ structure: ItemStructure[];
536
+ fps: number;
537
+ background: {
538
+ type: "color" | "image";
539
+ value: string;
540
+ };
541
+ }
542
+ export interface IDesign {
543
+ id: string | number;
544
+ size: ISize;
545
+ duration?: number;
546
+ fps: number;
547
+ tracks: ITrack[];
548
+ trackItemIds: string[];
549
+ trackItemsMap: Record<string, ITrackItem>;
550
+ transitionIds: string[];
551
+ transitionsMap: Record<string, ITransition>;
552
+ structure?: ItemStructure[];
553
+ background?: {
554
+ type: "color" | "image";
555
+ value: string;
556
+ };
557
+ }
558
+ export interface IUpdateStateOptions {
559
+ updateHistory?: boolean;
560
+ kind?: IKindHistory;
561
+ }
562
+ export interface IStateManager {
563
+ getState(): State;
564
+ subscribe(callback: (state: State) => void): void;
565
+ updateState(partialState: Partial<State>, updateHistory?: IUpdateStateOptions): void;
566
+ subscribeToScale: (callback: (v: {
567
+ scale: State["scale"];
568
+ }) => void) => void;
569
+ subscribeToDuration: (callback: (duration: {
570
+ duration: State["duration"];
571
+ }) => void) => void;
572
+ subscribeToActiveIds: (callback: (activeIds: {
573
+ activeIds: State["activeIds"];
574
+ }) => void) => void;
575
+ subscribeToAddOrRemoveItems: (callback: (trackItemIds: {
576
+ trackItemIds: State["trackItemIds"];
577
+ }) => void) => void;
578
+ subscribeToHistory: (callback: (history: {
579
+ tracks: State["tracks"];
580
+ trackItemsMap: State["trackItemsMap"];
581
+ trackItemIds: State["trackItemIds"];
582
+ transitionIds: State["transitionIds"];
583
+ transitionsMap: State["transitionsMap"];
584
+ }) => void) => void;
585
+ subscribeToUpdateTrackItem: (callback: (trackItemUpdate: {
586
+ trackItemsMap: State["trackItemsMap"];
587
+ }) => void) => void;
588
+ subscribeToUpdateItemDetails: (callback: (trackItemUpdate: {
589
+ trackItemsMap: State["trackItemsMap"];
590
+ }) => void) => void;
591
+ subscribeToUpdateTrackItemTiming: (callback: (trackItemUpdate: {
592
+ trackItemsMap: State["trackItemsMap"];
593
+ changedTrimIds?: string[];
594
+ changedDisplayIds?: string[];
595
+ }) => void) => void;
596
+ subscribeToFps: (callback: (fps: {
597
+ fps: State["fps"];
598
+ }) => void) => void;
599
+ subscribeToUpdateAnimations: (callback: (trackItemUpdate: {
600
+ trackItemsMap: State["trackItemsMap"];
601
+ changedAnimationIds?: string[];
602
+ }) => void) => void;
603
+ subscribeToTracks: (callback: (tracksUpdate: {
604
+ tracks: State["tracks"];
605
+ changedTracks: string[];
606
+ }) => void) => void;
607
+ subscribeToState: (callback: (tracksInfo: {
608
+ tracks: State["tracks"];
609
+ trackItemIds: State["trackItemIds"];
610
+ trackItemsMap: State["trackItemsMap"];
611
+ transitionIds: State["transitionIds"];
612
+ transitionsMap: State["transitionsMap"];
613
+ structure: State["structure"];
614
+ }) => void) => void;
615
+ }
616
+ export interface ITrackItemsMap {
617
+ [id: string]: ITrackItem;
618
+ }
619
+ export interface IItemsDetailsMap {
620
+ [id: string]: ITrackItem;
621
+ }
622
+ export interface ItransitionsMap {
623
+ [id: string]: ITransition;
633
624
  }
625
+ export type ITrackItemAndDetails = ITrackItem;
626
+ export type IRecordItemAndDetails = Record<string, ITrackItem>;
634
627
  export interface IBulkAction {
635
628
  type: string;
636
629
  payload?: any;