@rendley/sdk 1.2.2 → 1.4.0

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 (31) hide show
  1. package/dist/Engine.d.ts +65 -4
  2. package/dist/index.cjs +1 -1
  3. package/dist/index.d.ts +2 -0
  4. package/dist/index.js +1 -1
  5. package/dist/libs/ffmpeg/classes.d.ts +1 -0
  6. package/dist/libs/ffmpeg/const.d.ts +2 -1
  7. package/dist/modules/clip/Clip.d.ts +27 -16
  8. package/dist/modules/clip/ClipStyle.d.ts +1 -0
  9. package/dist/modules/clip/clips/custom/CustomClip.d.ts +6 -5
  10. package/dist/modules/clip/clips/lottie/LottieClip.d.ts +6 -5
  11. package/dist/modules/clip/clips/shape/ShapeClip.d.ts +6 -5
  12. package/dist/modules/clip/clips/text/TextClip.d.ts +6 -6
  13. package/dist/modules/clip/clips/text/TextStyle.d.ts +6 -10
  14. package/dist/modules/layer/Layer.d.ts +2 -2
  15. package/dist/modules/library/Library.d.ts +19 -0
  16. package/dist/modules/library/MediaData.d.ts +28 -1
  17. package/dist/modules/settings/Settings.d.ts +29 -0
  18. package/dist/modules/settings/index.d.ts +1 -0
  19. package/dist/modules/storage/StorageController.d.ts +17 -0
  20. package/dist/modules/storage/StorageProviderBase.d.ts +33 -0
  21. package/dist/modules/storage/index.d.ts +3 -0
  22. package/dist/modules/storage/providers/StorageIndexedDB.d.ts +20 -0
  23. package/dist/modules/subtitleManager/SubtitleManager.d.ts +238 -1
  24. package/dist/modules/timeline/Timeline.d.ts +4 -0
  25. package/dist/types/text.types.d.ts +7 -0
  26. package/dist/utils/animation/animation.d.ts +2 -0
  27. package/dist/utils/cachedAccess/cachedAccess.d.ts +18 -0
  28. package/dist/utils/file/uint8ArrayToHex.d.ts +1 -0
  29. package/dist/utils/math/degToRad.d.ts +1 -0
  30. package/dist/utils/math/radToDeg.d.ts +1 -0
  31. package/package.json +1 -1
@@ -1,8 +1,245 @@
1
+ import { z } from "zod";
1
2
  import { Subtitles } from "../library/Subtitles";
2
- export declare class SubtitleManager {
3
+ export declare enum HighlightAnimationEnum {
4
+ NONE = "none",
5
+ POP = "pop",
6
+ POP_ROTATE = "pop_rotate",
7
+ WIGGLE = "wiggle"
8
+ }
9
+ declare const MainTextStyleSchema: z.ZodObject<{
10
+ fontSize: z.ZodOptional<z.ZodNumber>;
11
+ color: z.ZodOptional<z.ZodString>;
12
+ fontWeight: z.ZodOptional<z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>>;
13
+ fontFamily: z.ZodOptional<z.ZodString>;
14
+ fontStyle: z.ZodOptional<z.ZodEnum<["normal", "italic", "oblique"]>>;
15
+ wordWrapWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
16
+ strokeThickness: z.ZodOptional<z.ZodNumber>;
17
+ strokeColor: z.ZodOptional<z.ZodString>;
18
+ }, "strip", z.ZodTypeAny, {
19
+ fontSize?: number | undefined;
20
+ color?: string | undefined;
21
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
22
+ fontFamily?: string | undefined;
23
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
24
+ wordWrapWidth?: number | null | undefined;
25
+ strokeThickness?: number | undefined;
26
+ strokeColor?: string | undefined;
27
+ }, {
28
+ fontSize?: number | undefined;
29
+ color?: string | undefined;
30
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
31
+ fontFamily?: string | undefined;
32
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
33
+ wordWrapWidth?: number | null | undefined;
34
+ strokeThickness?: number | undefined;
35
+ strokeColor?: string | undefined;
36
+ }>;
37
+ declare const HighlightTextStyleSchema: z.ZodObject<{
38
+ color: z.ZodOptional<z.ZodString>;
39
+ fontSize: z.ZodOptional<z.ZodNumber>;
40
+ fontWeight: z.ZodOptional<z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>>;
41
+ fontFamily: z.ZodOptional<z.ZodString>;
42
+ fontStyle: z.ZodOptional<z.ZodEnum<["normal", "italic", "oblique"]>>;
43
+ backgroundColor: z.ZodOptional<z.ZodString>;
44
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
45
+ strokeThickness: z.ZodOptional<z.ZodNumber>;
46
+ strokeColor: z.ZodOptional<z.ZodString>;
47
+ }, "strip", z.ZodTypeAny, {
48
+ color?: string | undefined;
49
+ fontSize?: number | undefined;
50
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
51
+ fontFamily?: string | undefined;
52
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
53
+ backgroundColor?: string | undefined;
54
+ backgroundPadding?: number | undefined;
55
+ strokeThickness?: number | undefined;
56
+ strokeColor?: string | undefined;
57
+ }, {
58
+ color?: string | undefined;
59
+ fontSize?: number | undefined;
60
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
61
+ fontFamily?: string | undefined;
62
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
63
+ backgroundColor?: string | undefined;
64
+ backgroundPadding?: number | undefined;
65
+ strokeThickness?: number | undefined;
66
+ strokeColor?: string | undefined;
67
+ }>;
68
+ declare const TextModeSchema: z.ZodEnum<["full", "partial"]>;
69
+ export type HighlightTextStyle = z.infer<typeof HighlightTextStyleSchema>;
70
+ export type MainTextStyle = z.infer<typeof MainTextStyleSchema>;
71
+ export type TextModeType = z.infer<typeof TextModeSchema>;
72
+ export declare const SubtitlesManagerSchema: z.ZodObject<{
73
+ textMode: z.ZodEnum<["full", "partial"]>;
74
+ highlightAnimation: z.ZodNativeEnum<typeof HighlightAnimationEnum>;
75
+ highlightAnimationSpeed: z.ZodNumber;
76
+ mainTextStyle: z.ZodObject<{
77
+ fontSize: z.ZodOptional<z.ZodNumber>;
78
+ color: z.ZodOptional<z.ZodString>;
79
+ fontWeight: z.ZodOptional<z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>>;
80
+ fontFamily: z.ZodOptional<z.ZodString>;
81
+ fontStyle: z.ZodOptional<z.ZodEnum<["normal", "italic", "oblique"]>>;
82
+ wordWrapWidth: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
83
+ strokeThickness: z.ZodOptional<z.ZodNumber>;
84
+ strokeColor: z.ZodOptional<z.ZodString>;
85
+ }, "strip", z.ZodTypeAny, {
86
+ fontSize?: number | undefined;
87
+ color?: string | undefined;
88
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
89
+ fontFamily?: string | undefined;
90
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
91
+ wordWrapWidth?: number | null | undefined;
92
+ strokeThickness?: number | undefined;
93
+ strokeColor?: string | undefined;
94
+ }, {
95
+ fontSize?: number | undefined;
96
+ color?: string | undefined;
97
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
98
+ fontFamily?: string | undefined;
99
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
100
+ wordWrapWidth?: number | null | undefined;
101
+ strokeThickness?: number | undefined;
102
+ strokeColor?: string | undefined;
103
+ }>;
104
+ highlightTextStyle: z.ZodObject<{
105
+ color: z.ZodOptional<z.ZodString>;
106
+ fontSize: z.ZodOptional<z.ZodNumber>;
107
+ fontWeight: z.ZodOptional<z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>>;
108
+ fontFamily: z.ZodOptional<z.ZodString>;
109
+ fontStyle: z.ZodOptional<z.ZodEnum<["normal", "italic", "oblique"]>>;
110
+ backgroundColor: z.ZodOptional<z.ZodString>;
111
+ backgroundPadding: z.ZodOptional<z.ZodNumber>;
112
+ strokeThickness: z.ZodOptional<z.ZodNumber>;
113
+ strokeColor: z.ZodOptional<z.ZodString>;
114
+ }, "strip", z.ZodTypeAny, {
115
+ color?: string | undefined;
116
+ fontSize?: number | undefined;
117
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
118
+ fontFamily?: string | undefined;
119
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
120
+ backgroundColor?: string | undefined;
121
+ backgroundPadding?: number | undefined;
122
+ strokeThickness?: number | undefined;
123
+ strokeColor?: string | undefined;
124
+ }, {
125
+ color?: string | undefined;
126
+ fontSize?: number | undefined;
127
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
128
+ fontFamily?: string | undefined;
129
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
130
+ backgroundColor?: string | undefined;
131
+ backgroundPadding?: number | undefined;
132
+ strokeThickness?: number | undefined;
133
+ strokeColor?: string | undefined;
134
+ }>;
135
+ }, "strip", z.ZodTypeAny, {
136
+ textMode: "full" | "partial";
137
+ highlightAnimation: HighlightAnimationEnum;
138
+ highlightAnimationSpeed: number;
139
+ mainTextStyle: {
140
+ fontSize?: number | undefined;
141
+ color?: string | undefined;
142
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
143
+ fontFamily?: string | undefined;
144
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
145
+ wordWrapWidth?: number | null | undefined;
146
+ strokeThickness?: number | undefined;
147
+ strokeColor?: string | undefined;
148
+ };
149
+ highlightTextStyle: {
150
+ color?: string | undefined;
151
+ fontSize?: number | undefined;
152
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
153
+ fontFamily?: string | undefined;
154
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
155
+ backgroundColor?: string | undefined;
156
+ backgroundPadding?: number | undefined;
157
+ strokeThickness?: number | undefined;
158
+ strokeColor?: string | undefined;
159
+ };
160
+ }, {
161
+ textMode: "full" | "partial";
162
+ highlightAnimation: HighlightAnimationEnum;
163
+ highlightAnimationSpeed: number;
164
+ mainTextStyle: {
165
+ fontSize?: number | undefined;
166
+ color?: string | undefined;
167
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
168
+ fontFamily?: string | undefined;
169
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
170
+ wordWrapWidth?: number | null | undefined;
171
+ strokeThickness?: number | undefined;
172
+ strokeColor?: string | undefined;
173
+ };
174
+ highlightTextStyle: {
175
+ color?: string | undefined;
176
+ fontSize?: number | undefined;
177
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
178
+ fontFamily?: string | undefined;
179
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
180
+ backgroundColor?: string | undefined;
181
+ backgroundPadding?: number | undefined;
182
+ strokeThickness?: number | undefined;
183
+ strokeColor?: string | undefined;
184
+ };
185
+ }>;
186
+ export declare class SubtitlesManager {
187
+ private mainText;
3
188
  private textContainer;
189
+ private maskGraphics;
190
+ private highlightedText;
191
+ private highlightBackground;
192
+ private textMode;
193
+ private highlightAnimation;
194
+ private highlightAnimationSpeed;
195
+ private tween;
196
+ private tweenGroup;
197
+ private wordTween;
198
+ private backgroundColor;
199
+ private backgroundPadding;
200
+ private wordWrapWidth;
201
+ private getInitialTweenValue;
202
+ constructor();
4
203
  init(): void;
204
+ setHighlightAnimation(animation: HighlightAnimationEnum, speedMultiplier?: number): void;
205
+ updateSubtitlesClips(subtitleId: string): void;
206
+ setTextMode(mode: TextModeType): void;
207
+ setMainTextStyle(style: MainTextStyle): void;
208
+ setHighlightedTextStyle(style: HighlightTextStyle): void;
209
+ private extractWordInfo;
210
+ private getSubtitleText;
211
+ private getHighlightedWordInfo;
212
+ private restartTween;
5
213
  update(currentTime: number): void;
6
214
  convertSRTToSubtitles(srt: string): Subtitles;
7
215
  extractSubtitlesFromVideo(mediaDataId: string): Promise<string> | "";
216
+ destroy(): void;
217
+ serialize(): {
218
+ textMode: "full" | "partial";
219
+ highlightAnimation: HighlightAnimationEnum;
220
+ highlightAnimationSpeed: number;
221
+ mainTextStyle: {
222
+ fontSize?: number | undefined;
223
+ color?: string | undefined;
224
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
225
+ fontFamily?: string | undefined;
226
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
227
+ wordWrapWidth?: number | null | undefined;
228
+ strokeThickness?: number | undefined;
229
+ strokeColor?: string | undefined;
230
+ };
231
+ highlightTextStyle: {
232
+ color?: string | undefined;
233
+ fontSize?: number | undefined;
234
+ fontWeight?: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
235
+ fontFamily?: string | undefined;
236
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
237
+ backgroundColor?: string | undefined;
238
+ backgroundPadding?: number | undefined;
239
+ strokeThickness?: number | undefined;
240
+ strokeColor?: string | undefined;
241
+ };
242
+ };
243
+ static deserialize(data: object): SubtitlesManager;
8
244
  }
245
+ export {};
@@ -68,6 +68,7 @@ export declare const TimelineSchema: z.ZodObject<{
68
68
  transitionSrc: string;
69
69
  }[];
70
70
  }>, "many">;
71
+ fitDuration: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
71
72
  }, "strip", z.ZodTypeAny, {
72
73
  startTime: number;
73
74
  fps: number;
@@ -87,6 +88,7 @@ export declare const TimelineSchema: z.ZodObject<{
87
88
  transitionSrc: string;
88
89
  }[];
89
90
  }[];
91
+ fitDuration: number;
90
92
  }, {
91
93
  startTime: number;
92
94
  fps: number;
@@ -106,6 +108,7 @@ export declare const TimelineSchema: z.ZodObject<{
106
108
  transitionSrc: string;
107
109
  }[];
108
110
  }[];
111
+ fitDuration?: number | undefined;
109
112
  }>;
110
113
  export declare class Timeline {
111
114
  private startTime;
@@ -163,6 +166,7 @@ export declare class Timeline {
163
166
  transitionSrc: string;
164
167
  }[];
165
168
  }[];
169
+ fitDuration: number;
166
170
  };
167
171
  static deserialize(data: object): Timeline;
168
172
  }
@@ -0,0 +1,7 @@
1
+ import { z } from "zod";
2
+ export declare const FontWeightSchema: z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>;
3
+ export declare const TextAlignSchema: z.ZodEnum<["left", "center", "right", "justify"]>;
4
+ export declare const FontStyleSchema: z.ZodEnum<["normal", "italic", "oblique"]>;
5
+ export type TextStyleFontWeight = z.infer<typeof FontWeightSchema>;
6
+ export type TextStyleAlign = z.infer<typeof TextAlignSchema>;
7
+ export type TextStyleFontStyle = z.infer<typeof FontStyleSchema>;
@@ -234,11 +234,13 @@ export declare class AnimationController {
234
234
  private startTime;
235
235
  private endTime;
236
236
  private duration;
237
+ private animatedProperties;
237
238
  constructor(setCallback: SetCallbackType, getCallback: GetCallbackType);
238
239
  loadFromUrl(url: string): Promise<this>;
239
240
  loadFromAnimationData(data: AnimationData): this;
240
241
  private initialize;
241
242
  isLoaded(): boolean;
243
+ getAnimatedProperties(): Set<string>;
242
244
  getAnimationData(): AnimationData;
243
245
  setSpeed(speed: number): this;
244
246
  getSpeed(): number | undefined;
@@ -0,0 +1,18 @@
1
+ import { Clip } from '../../modules/clip';
2
+ export declare class CachedAccess {
3
+ private static instance;
4
+ static getInstance(): CachedAccess;
5
+ private constructor();
6
+ private readonly clipIdToLayerId;
7
+ private readonly clipIdToClip;
8
+ private readonly mediaIdToClips;
9
+ private readonly subtitlesIdToClips;
10
+ setClipInfo(clipId: string, layerId: string, clip: Clip): void;
11
+ updateSubtitlesIdToClips(subtitlesIdOld: string | undefined, subtitlesId: string | undefined, clip: Clip): void;
12
+ updateClipIdToLayerId(oldLayerId: string, newLayerId: string, clipId: string): void;
13
+ removeClipInfo(clipId: string): void;
14
+ layerIdFromClipId(clipId: string): string | undefined;
15
+ clipFromClipId(clipId: string): Clip | undefined;
16
+ clipsFromMediaId(mediaId: string): Clip[];
17
+ clipsFromSubtitlesId(subtitlesId: string): Clip[];
18
+ }
@@ -0,0 +1 @@
1
+ export declare const uint8ArrayToHex: (data: Uint8Array) => string;
@@ -0,0 +1 @@
1
+ export declare function degToRad(degrees: number): number;
@@ -0,0 +1 @@
1
+ export declare function radToDeg(rad: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rendley/sdk",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "license": "LICENSE",
5
5
  "author": "Onix Technologies",
6
6
  "homepage": "https://rendley.com",