@cliquify.me/types 3.1.9 → 3.1.11
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/package.json +11 -4
- package/src/index.ts +0 -491
package/package.json
CHANGED
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cliquify.me/types",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
8
|
-
"main": "
|
|
9
|
-
"module": "
|
|
10
|
-
"types": "
|
|
8
|
+
"main": "dist/index.umd.js",
|
|
9
|
+
"module": "dist/index.es.js",
|
|
10
|
+
"types": "dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.umd.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
11
18
|
"devDependencies": {
|
|
12
19
|
"@types/node": "^20.11.24",
|
|
13
20
|
"typescript": "^5.3.3",
|
package/src/index.ts
DELETED
|
@@ -1,491 +0,0 @@
|
|
|
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
|
-
}
|
|
15
|
-
|
|
16
|
-
export type ItemType =
|
|
17
|
-
| "text"
|
|
18
|
-
| "image"
|
|
19
|
-
| "video"
|
|
20
|
-
| "audio"
|
|
21
|
-
| "helper"
|
|
22
|
-
| "caption"
|
|
23
|
-
| "template";
|
|
24
|
-
|
|
25
|
-
export interface IDisplay {
|
|
26
|
-
from: number;
|
|
27
|
-
to: number;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface ISize {
|
|
31
|
-
width: number;
|
|
32
|
-
height: number;
|
|
33
|
-
type?: string;
|
|
34
|
-
name?: string;
|
|
35
|
-
}
|
|
36
|
-
export interface IDesign {
|
|
37
|
-
id: string | number;
|
|
38
|
-
size: ISize;
|
|
39
|
-
duration?: number;
|
|
40
|
-
fps: number; // frames per second
|
|
41
|
-
tracks: ITrack[];
|
|
42
|
-
trackItemIds: string[];
|
|
43
|
-
trackItemsMap: Record<string, ITrackItemBase>;
|
|
44
|
-
transitionIds: string[];
|
|
45
|
-
transitionsMap: Record<string, ITransition>;
|
|
46
|
-
trackItemDetailsMap: Record<string, IItem>;
|
|
47
|
-
structure?: ItemStructure[];
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export interface ITrim {
|
|
51
|
-
from: number;
|
|
52
|
-
to: number;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
interface ICommonDetails {
|
|
56
|
-
width?: number;
|
|
57
|
-
height?: number;
|
|
58
|
-
transform?: string;
|
|
59
|
-
opacity?: number;
|
|
60
|
-
border?: string;
|
|
61
|
-
borderRadius?: number;
|
|
62
|
-
boxShadow?: IBoxShadow;
|
|
63
|
-
top?: number | string;
|
|
64
|
-
left?: number | string;
|
|
65
|
-
borderColor?: string;
|
|
66
|
-
borderWidth?: number;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export interface IBoxShadow {
|
|
70
|
-
color: string;
|
|
71
|
-
x: number;
|
|
72
|
-
y: number;
|
|
73
|
-
blur: number;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export type ITrackItem =
|
|
77
|
-
| (ITrackItemBase & { type: "text" })
|
|
78
|
-
| (ITrackItemBase & { type: "image" })
|
|
79
|
-
| (ITrackItemBase & { type: "video" })
|
|
80
|
-
| (ITrackItemBase & { type: "audio" })
|
|
81
|
-
| (ITrackItemBase & { type: "helper" })
|
|
82
|
-
| (ITrackItemBase & { type: "caption" })
|
|
83
|
-
| (ITrackItemBase & { type: "template" });
|
|
84
|
-
|
|
85
|
-
export interface IStateManager {
|
|
86
|
-
getState(): State;
|
|
87
|
-
subscribe(callback: (state: State) => void): void;
|
|
88
|
-
updateState(
|
|
89
|
-
partialState: Partial<State>,
|
|
90
|
-
updateHistory?: IUpdateStateOptions
|
|
91
|
-
): void;
|
|
92
|
-
subscribeToScale: (callback: (v: { scale: State["scale"] }) => void) => void;
|
|
93
|
-
subscribeToDuration: (
|
|
94
|
-
callback: (duration: { duration: State["duration"] }) => void
|
|
95
|
-
) => void;
|
|
96
|
-
subscribeToActiveIds: (
|
|
97
|
-
callback: (activeIds: { activeIds: State["activeIds"] }) => void
|
|
98
|
-
) => void;
|
|
99
|
-
subscribeToAddOrRemoveItems: (
|
|
100
|
-
callback: (trackItemIds: { trackItemIds: State["trackItemIds"] }) => void
|
|
101
|
-
) => void;
|
|
102
|
-
subscribeToHistory: (
|
|
103
|
-
callback: (history: {
|
|
104
|
-
tracks: State["tracks"];
|
|
105
|
-
trackItemsMap: State["trackItemsMap"];
|
|
106
|
-
trackItemDetailsMap: State["trackItemDetailsMap"];
|
|
107
|
-
trackItemIds: State["trackItemIds"];
|
|
108
|
-
transitionIds: State["transitionIds"];
|
|
109
|
-
transitionsMap: State["transitionsMap"];
|
|
110
|
-
}) => void
|
|
111
|
-
) => void;
|
|
112
|
-
subscribeToUpdateTrackItem: (
|
|
113
|
-
callback: (trackItemUpdate: {
|
|
114
|
-
trackItemsMap: State["trackItemsMap"];
|
|
115
|
-
}) => void
|
|
116
|
-
) => void;
|
|
117
|
-
subscribeToUpdateItemDetails: (
|
|
118
|
-
callback: (trackItemUpdate: {
|
|
119
|
-
trackItemDetailsMap: State["trackItemDetailsMap"];
|
|
120
|
-
}) => void
|
|
121
|
-
) => void;
|
|
122
|
-
|
|
123
|
-
subscribeToUpdateTrackItemTiming: (
|
|
124
|
-
callback: (trackItemUpdate: {
|
|
125
|
-
trackItemsMap: State["trackItemsMap"];
|
|
126
|
-
changedTrimIds?: string[];
|
|
127
|
-
changedDisplayIds?: string[];
|
|
128
|
-
}) => void
|
|
129
|
-
) => void;
|
|
130
|
-
|
|
131
|
-
subscribeToFps: (callback: (fps: { fps: State["fps"] }) => void) => void;
|
|
132
|
-
|
|
133
|
-
subscribeToUpdateAnimations: (
|
|
134
|
-
callback: (trackItemUpdate: {
|
|
135
|
-
trackItemsMap: State["trackItemsMap"];
|
|
136
|
-
changedAnimationIds?: string[];
|
|
137
|
-
}) => void
|
|
138
|
-
) => void;
|
|
139
|
-
|
|
140
|
-
subscribeToTracks: (
|
|
141
|
-
callback: (tracksUpdate: {
|
|
142
|
-
tracks: State["tracks"];
|
|
143
|
-
changedTracks: string[];
|
|
144
|
-
}) => void
|
|
145
|
-
) => void;
|
|
146
|
-
|
|
147
|
-
subscribeToState: (
|
|
148
|
-
callback: (tracksInfo: {
|
|
149
|
-
tracks: State["tracks"];
|
|
150
|
-
trackItemIds: State["trackItemIds"];
|
|
151
|
-
trackItemsMap: State["trackItemsMap"];
|
|
152
|
-
transitionIds: State["transitionIds"];
|
|
153
|
-
transitionsMap: State["transitionsMap"];
|
|
154
|
-
trackItemDetailsMap: State["trackItemDetailsMap"];
|
|
155
|
-
structure: State["structure"];
|
|
156
|
-
}) => void
|
|
157
|
-
) => void;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export type IKindHistory =
|
|
161
|
-
| "add"
|
|
162
|
-
| "remove"
|
|
163
|
-
| "update"
|
|
164
|
-
| "replace"
|
|
165
|
-
| "update:details"
|
|
166
|
-
| "layer:selection"
|
|
167
|
-
| "undo"
|
|
168
|
-
| "design:resize"
|
|
169
|
-
| "design:load"
|
|
170
|
-
| "redo"
|
|
171
|
-
| "add:transition";
|
|
172
|
-
|
|
173
|
-
export interface IUpdateStateOptions {
|
|
174
|
-
updateHistory?: boolean;
|
|
175
|
-
kind?: IKindHistory;
|
|
176
|
-
}
|
|
177
|
-
export type ITransitionType =
|
|
178
|
-
| "none"
|
|
179
|
-
| "fade"
|
|
180
|
-
| "slide"
|
|
181
|
-
| "wipe"
|
|
182
|
-
| "flip"
|
|
183
|
-
| "clockWipe"
|
|
184
|
-
| "star"
|
|
185
|
-
| "circle"
|
|
186
|
-
| "rectangle"
|
|
187
|
-
| "slidingDoors";
|
|
188
|
-
|
|
189
|
-
export interface ITransition {
|
|
190
|
-
id: string;
|
|
191
|
-
trackId: string;
|
|
192
|
-
fromId: string;
|
|
193
|
-
toId: string;
|
|
194
|
-
type: string;
|
|
195
|
-
name?: string;
|
|
196
|
-
duration: number;
|
|
197
|
-
preview?: string;
|
|
198
|
-
direction?: any;
|
|
199
|
-
kind: string;
|
|
200
|
-
}
|
|
201
|
-
|
|
202
|
-
export interface IBasicAnimation {
|
|
203
|
-
name: string;
|
|
204
|
-
composition: ICompositionAnimation[];
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
export interface ICompositionAnimation {
|
|
208
|
-
property: string;
|
|
209
|
-
from: number;
|
|
210
|
-
to: number;
|
|
211
|
-
durationInFrames: number;
|
|
212
|
-
ease?: (t: number) => number;
|
|
213
|
-
easing: string;
|
|
214
|
-
delay: number;
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
export interface ITrackItemBase {
|
|
218
|
-
id: string;
|
|
219
|
-
name: string;
|
|
220
|
-
type: ItemType;
|
|
221
|
-
preview?: string;
|
|
222
|
-
display: IDisplay;
|
|
223
|
-
duration?: number;
|
|
224
|
-
trim?: ITrim;
|
|
225
|
-
isMain?: boolean;
|
|
226
|
-
animations?: {
|
|
227
|
-
in: IBasicAnimation;
|
|
228
|
-
out: IBasicAnimation;
|
|
229
|
-
};
|
|
230
|
-
playbackRate?: number;
|
|
231
|
-
modifier?: IDisplay;
|
|
232
|
-
details?: any;
|
|
233
|
-
activeEdit?: boolean;
|
|
234
|
-
metadata: Record<string, any>;
|
|
235
|
-
transitionInfo?: {
|
|
236
|
-
isFrom: boolean;
|
|
237
|
-
isTo: boolean;
|
|
238
|
-
transition: ITransition;
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
export interface ICaptionWord {
|
|
243
|
-
end: number;
|
|
244
|
-
start: number;
|
|
245
|
-
word: string;
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
export interface ICaptionDetails extends ICommonDetails {
|
|
249
|
-
skewX: number;
|
|
250
|
-
skewY: number;
|
|
251
|
-
text: string;
|
|
252
|
-
fontSize: number;
|
|
253
|
-
fontFamily: string;
|
|
254
|
-
fontUrl: string;
|
|
255
|
-
color: string;
|
|
256
|
-
lineHeight: number | string;
|
|
257
|
-
letterSpacing: number | string;
|
|
258
|
-
fontWeight: number;
|
|
259
|
-
fontStyle: string;
|
|
260
|
-
textDecoration: string;
|
|
261
|
-
textAlign: "center" | "left" | "right";
|
|
262
|
-
wordSpacing: number | string;
|
|
263
|
-
textShadow: string;
|
|
264
|
-
backgroundColor: string;
|
|
265
|
-
opacity: number;
|
|
266
|
-
width: number;
|
|
267
|
-
height: number;
|
|
268
|
-
top: number | string;
|
|
269
|
-
left: number | string;
|
|
270
|
-
border: string;
|
|
271
|
-
wordWrap: "normal" | "break-word";
|
|
272
|
-
wordBreak: "normal" | "break-word" | "break-all";
|
|
273
|
-
WebkitTextStrokeColor: string;
|
|
274
|
-
WebkitTextStrokeWidth: string;
|
|
275
|
-
borderWidth: number;
|
|
276
|
-
borderColor: string;
|
|
277
|
-
boxShadow: { color: string; x: number; y: number; blur: number };
|
|
278
|
-
textTransform: "capitalize" | "uppercase" | "lowercase";
|
|
279
|
-
words: ICaptionWord[];
|
|
280
|
-
appearedColor?: string;
|
|
281
|
-
activeColor?: string;
|
|
282
|
-
activeFillColor?: string;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export interface ITextDetails extends ICommonDetails {
|
|
286
|
-
skewX: number;
|
|
287
|
-
skewY: number;
|
|
288
|
-
text: string;
|
|
289
|
-
fontSize: number;
|
|
290
|
-
fontFamily: string;
|
|
291
|
-
fontUrl: string;
|
|
292
|
-
color: string;
|
|
293
|
-
lineHeight: number | string;
|
|
294
|
-
letterSpacing: number | string;
|
|
295
|
-
fontWeight: number;
|
|
296
|
-
fontStyle: string;
|
|
297
|
-
textDecoration: string;
|
|
298
|
-
textAlign: "center" | "left" | "right";
|
|
299
|
-
wordSpacing: number | string;
|
|
300
|
-
textShadow: string;
|
|
301
|
-
backgroundColor: string;
|
|
302
|
-
opacity: number;
|
|
303
|
-
width: number;
|
|
304
|
-
textTransform: "capitalize" | "uppercase" | "lowercase";
|
|
305
|
-
height: number;
|
|
306
|
-
top: number | string;
|
|
307
|
-
left: number | string;
|
|
308
|
-
border: string;
|
|
309
|
-
wordWrap: "normal" | "break-word";
|
|
310
|
-
wordBreak: "normal" | "break-word" | "break-all";
|
|
311
|
-
WebkitTextStrokeColor: string;
|
|
312
|
-
WebkitTextStrokeWidth: string;
|
|
313
|
-
borderWidth: number;
|
|
314
|
-
borderColor: string;
|
|
315
|
-
boxShadow: { color: string; x: number; y: number; blur: number };
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
export interface IImageDetails extends ICommonDetails {
|
|
319
|
-
src: string;
|
|
320
|
-
background: string;
|
|
321
|
-
width: number;
|
|
322
|
-
height: number;
|
|
323
|
-
opacity: number;
|
|
324
|
-
transform: string;
|
|
325
|
-
border: string;
|
|
326
|
-
borderRadius: number;
|
|
327
|
-
boxShadow: IBoxShadow;
|
|
328
|
-
top: string;
|
|
329
|
-
left: string;
|
|
330
|
-
transformOrigin: string;
|
|
331
|
-
crop: {
|
|
332
|
-
x: number;
|
|
333
|
-
y: number;
|
|
334
|
-
width: number;
|
|
335
|
-
height: number;
|
|
336
|
-
};
|
|
337
|
-
blur: number;
|
|
338
|
-
brightness: number;
|
|
339
|
-
flipX: boolean;
|
|
340
|
-
flipY: boolean;
|
|
341
|
-
rotate: string;
|
|
342
|
-
visibility: "visible" | "hidden";
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export interface IAudioDetails extends ICommonDetails {
|
|
346
|
-
src: string;
|
|
347
|
-
volume?: number;
|
|
348
|
-
}
|
|
349
|
-
|
|
350
|
-
export interface IVideoDetails extends ICommonDetails {
|
|
351
|
-
src: string;
|
|
352
|
-
frames?: number;
|
|
353
|
-
background?: string;
|
|
354
|
-
stream?: ReadableStream<Uint8Array>;
|
|
355
|
-
blob?: Blob;
|
|
356
|
-
width: number;
|
|
357
|
-
height: number;
|
|
358
|
-
volume?: number;
|
|
359
|
-
boxShadow?: IBoxShadow;
|
|
360
|
-
transformOrigin?: string;
|
|
361
|
-
crop?: {
|
|
362
|
-
x: number;
|
|
363
|
-
y: number;
|
|
364
|
-
width: number;
|
|
365
|
-
height: number;
|
|
366
|
-
};
|
|
367
|
-
blur: number;
|
|
368
|
-
brightness: number;
|
|
369
|
-
flipX: boolean;
|
|
370
|
-
flipY: boolean;
|
|
371
|
-
rotate: string;
|
|
372
|
-
visibility: "visible" | "hidden";
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export interface ITimelineScaleState {
|
|
376
|
-
unit: number;
|
|
377
|
-
zoom: number;
|
|
378
|
-
segments: number;
|
|
379
|
-
index: number;
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
export type IItem = IAudio | IImage | IText | IVideo | ICaption | ITemplate;
|
|
383
|
-
|
|
384
|
-
export interface IAudio extends ITrackItemBase {
|
|
385
|
-
type: "audio";
|
|
386
|
-
details: IAudioDetails;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
export interface ITemplate extends ITrackItemBase {
|
|
390
|
-
type: "template";
|
|
391
|
-
trackItemsDetails: Record<string, IItem>;
|
|
392
|
-
trackItemIds: string[];
|
|
393
|
-
trackItemsMap: Record<string, ITrackItem>;
|
|
394
|
-
transitionsMap: Record<string, ITransition>;
|
|
395
|
-
transitionIds: string[];
|
|
396
|
-
size: ISize;
|
|
397
|
-
}
|
|
398
|
-
|
|
399
|
-
export interface ITemplateDetails {
|
|
400
|
-
width: number;
|
|
401
|
-
height: number;
|
|
402
|
-
top: number;
|
|
403
|
-
left: number;
|
|
404
|
-
scale: number;
|
|
405
|
-
rotate: number;
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
export interface ICaption extends ITrackItemBase {
|
|
409
|
-
type: "caption";
|
|
410
|
-
details: ICaptionDetails;
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
export interface IText extends ITrackItemBase {
|
|
414
|
-
type: "text";
|
|
415
|
-
details: ITextDetails;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export interface IImage extends ITrackItemBase {
|
|
419
|
-
type: "image";
|
|
420
|
-
details: IImageDetails;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
export interface IVideo extends ITrackItemBase {
|
|
424
|
-
type: "video";
|
|
425
|
-
details: IVideoDetails;
|
|
426
|
-
}
|
|
427
|
-
|
|
428
|
-
export interface ITrackItemsMap {
|
|
429
|
-
[id: string]: ITrackItem;
|
|
430
|
-
}
|
|
431
|
-
|
|
432
|
-
export interface IItemsDetailsMap {
|
|
433
|
-
[id: string]: IItem;
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
export interface ItransitionsMap {
|
|
437
|
-
[id: string]: ITransition;
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
export interface IMetadata {
|
|
441
|
-
resourceId: string;
|
|
442
|
-
order: number;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
export interface ITrack {
|
|
446
|
-
id: string;
|
|
447
|
-
type: ITrackType;
|
|
448
|
-
items: string[];
|
|
449
|
-
metadata?: Partial<IMetadata>;
|
|
450
|
-
accepts?: ItemType[];
|
|
451
|
-
index?: number;
|
|
452
|
-
magnetic?: boolean;
|
|
453
|
-
static?: boolean;
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
export type ITrackItemAndDetails = ITrackItem & IItem;
|
|
457
|
-
export type IRecordItemAndDetails = Record<string, ITrackItem & IItem>;
|
|
458
|
-
|
|
459
|
-
export type ITrackType =
|
|
460
|
-
| "main"
|
|
461
|
-
| "text"
|
|
462
|
-
| "image"
|
|
463
|
-
| "video"
|
|
464
|
-
| "audio"
|
|
465
|
-
| "helper"
|
|
466
|
-
| "caption"
|
|
467
|
-
| "template";
|
|
468
|
-
|
|
469
|
-
export interface ITimelineScrollState {
|
|
470
|
-
/**
|
|
471
|
-
* Timeline scroll state by X-axis.
|
|
472
|
-
*/
|
|
473
|
-
left: number;
|
|
474
|
-
|
|
475
|
-
/**
|
|
476
|
-
* Timeline scroll state by Y-axis.
|
|
477
|
-
*/
|
|
478
|
-
top: number;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
export interface CanvasSpacing {
|
|
482
|
-
left: number;
|
|
483
|
-
right: number;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
export interface ItemStructure {
|
|
487
|
-
id: string;
|
|
488
|
-
items: string[];
|
|
489
|
-
transitions: string[];
|
|
490
|
-
tracks: ITrack[];
|
|
491
|
-
}
|