@rendley/sdk 1.2.1 → 1.3.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.
@@ -1132,7 +1132,7 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
1132
1132
  setSubtitlesOffset(offset: number): void;
1133
1133
  render(currentTime: number): null;
1134
1134
  private processUpdate;
1135
- getSubtitleText(currentTime: number): string | undefined;
1135
+ updateMediaData(newMediaId?: string): Promise<boolean>;
1136
1136
  private updatePIXIFilters;
1137
1137
  hasSprite(): boolean;
1138
1138
  update(currentTime: number): void;
@@ -71,6 +71,7 @@ export declare class ClipStyle<T extends PIXI.Sprite = PIXI.Sprite> {
71
71
  constructor(options: ClipStyleOptions);
72
72
  positionToCenter(): void;
73
73
  scaleDownToFit(): void;
74
+ replaceMediaDataId(mediaDataId: string): void;
74
75
  setCornerRadius(radii: number | [number, number, number, number], relative?: boolean): void;
75
76
  getCornerRadius(): number[];
76
77
  setScale(scaleX: number, scaleY: number): void;
@@ -15,6 +15,7 @@ export declare class AudioClip extends Clip {
15
15
  init(layerId: string): Promise<void>;
16
16
  private getGlobalTimeToClipTime;
17
17
  getIsProcessing(): boolean;
18
+ updateMediaData(newMediaId?: string): Promise<boolean>;
18
19
  preload(currentTime: number): void;
19
20
  addActionToQueue(action: string, params?: object): void;
20
21
  processNextQueue(): void;
@@ -13,6 +13,7 @@ export declare class GifClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
13
13
  constructor(options: GifClipOptions);
14
14
  init(layerId: string): Promise<void>;
15
15
  private getGlobalTimeToClipTime;
16
+ updateMediaData(newMediaId?: string): Promise<boolean>;
16
17
  preload(currentTime: number): void;
17
18
  private play;
18
19
  private pause;
@@ -7,6 +7,7 @@ export interface ImageClipOptions extends ClipOptions<ClipStyle> {
7
7
  export declare class ImageClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
8
8
  constructor(options: ImageClipOptions);
9
9
  init(layerId: string): Promise<void>;
10
+ updateMediaData(newMediaId?: string): Promise<boolean>;
10
11
  preload(currentTime: number): void;
11
12
  updateVisibility(currentTime: number): void;
12
13
  update(currentTime: number): void;
@@ -1,12 +1,6 @@
1
- import { z } from "zod";
2
1
  import { TextSprite } from "./TextSprite";
3
2
  import { ClipStyle, ClipStyleOptions } from "../../ClipStyle";
4
- declare const FontWeightSchema: z.ZodEnum<["normal", "bold", "bolder", "lighter", "100", "200", "300", "400", "500", "600", "700", "800", "900"]>;
5
- declare const TextAlignSchema: z.ZodEnum<["left", "center", "right", "justify"]>;
6
- declare const FontStyleSchema: z.ZodEnum<["normal", "italic", "oblique"]>;
7
- type TextStyleFontWeight = z.infer<typeof FontWeightSchema>;
8
- type TextStyleAlign = z.infer<typeof TextAlignSchema>;
9
- type TextStyleFontStyle = z.infer<typeof FontStyleSchema>;
3
+ import { TextStyleAlign, TextStyleFontStyle, TextStyleFontWeight } from '../../../../types/text.types';
10
4
  interface TextClipStyleOptions extends ClipStyleOptions {
11
5
  fontSize?: number;
12
6
  color?: string;
@@ -21,6 +21,7 @@ export declare class VideoClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>
21
21
  init(layerId: string): Promise<void>;
22
22
  private getGlobalTimeToClipTime;
23
23
  getIsProcessing(): boolean;
24
+ updateMediaData(newMediaId?: string): Promise<boolean>;
24
25
  preload(currentTime: number): void;
25
26
  addActionToQueue(action: string, params?: object): void;
26
27
  processNextQueue(): void;
@@ -27,6 +27,7 @@ export declare enum EventsEnum {
27
27
  CLIP_EFFECT_REMOVED = "clip:effect:removed",
28
28
  LIBRARY_ADDED = "library:added",
29
29
  LIBRARY_REMOVED = "library:removed",
30
+ LIBRARY_REPLACED = "library:replaced",
30
31
  LIBRARY_ERROR = "library:error",
31
32
  LIBRARY_MEDIA_UPDATED = "library:media:updated",
32
33
  LIBRARY_PROGRESS = "library:progress",
@@ -140,6 +141,9 @@ export type EventPayloadMap = {
140
141
  [EventsEnum.LIBRARY_REMOVED]: {
141
142
  mediaDataId: string;
142
143
  };
144
+ [EventsEnum.LIBRARY_REPLACED]: {
145
+ mediaDataId: string;
146
+ };
143
147
  [EventsEnum.LIBRARY_ERROR]: {
144
148
  mediaDataId: string;
145
149
  error: Error;
@@ -3,7 +3,7 @@ import { z } from "zod";
3
3
  import { AudioClipOptions, Clip, ImageClipOptions, TextClipOptions, VideoClipOptions } from "../clip";
4
4
  import { GifClipOptions } from "../clip/clips/gif/GifClip";
5
5
  import { ShapeClipOptions } from "../clip/clips/shape/ShapeClip";
6
- import { Transition } from "../transition/Transition";
6
+ import { Transition, TransitionOptions } from "../transition/Transition";
7
7
  type ClipOptions = ImageClipOptions | VideoClipOptions | TextClipOptions | AudioClipOptions | GifClipOptions | ShapeClipOptions;
8
8
  export type ClipTypeRange = Pick<ClipOptions, "startTime" | "duration">;
9
9
  export declare const LayerSchema: z.ZodObject<{
@@ -86,7 +86,7 @@ export declare class Layer {
86
86
  removeClip(clipId: string, shouldNotDestroy?: boolean): boolean;
87
87
  moveClipToLayer(clipId: string, newLayerId: string): void;
88
88
  splitClip(clipId: string, time: number): Promise<Clip | null>;
89
- addTransition(transition: Transition): void;
89
+ addTransition(data: TransitionOptions | Transition): void;
90
90
  removeTransition(transitionId: string): void;
91
91
  getDuration(): number;
92
92
  hasEmptySpace(startTime: number, endTime: number): boolean;
@@ -7,16 +7,22 @@ export declare const LibrarySchema: z.ZodObject<{
7
7
  type: z.ZodString;
8
8
  filename: z.ZodString;
9
9
  permanentUrl: z.ZodOptional<z.ZodString>;
10
+ hash: z.ZodOptional<z.ZodString>;
11
+ mimeType: z.ZodOptional<z.ZodString>;
10
12
  }, "strip", z.ZodTypeAny, {
11
13
  type: string;
12
14
  id: string;
13
15
  filename: string;
14
16
  permanentUrl?: string | undefined;
17
+ hash?: string | undefined;
18
+ mimeType?: string | undefined;
15
19
  }, {
16
20
  type: string;
17
21
  id: string;
18
22
  filename: string;
19
23
  permanentUrl?: string | undefined;
24
+ hash?: string | undefined;
25
+ mimeType?: string | undefined;
20
26
  }>, "many">;
21
27
  subtitles: z.ZodArray<z.ZodObject<{
22
28
  id: z.ZodString;
@@ -70,6 +76,8 @@ export declare const LibrarySchema: z.ZodObject<{
70
76
  id: string;
71
77
  filename: string;
72
78
  permanentUrl?: string | undefined;
79
+ hash?: string | undefined;
80
+ mimeType?: string | undefined;
73
81
  }[];
74
82
  }, {
75
83
  subtitles: {
@@ -87,6 +95,8 @@ export declare const LibrarySchema: z.ZodObject<{
87
95
  id: string;
88
96
  filename: string;
89
97
  permanentUrl?: string | undefined;
98
+ hash?: string | undefined;
99
+ mimeType?: string | undefined;
90
100
  }[];
91
101
  }>;
92
102
  export declare class Library {
@@ -98,6 +108,8 @@ export declare class Library {
98
108
  getMediaById(id: string): MediaData | undefined;
99
109
  addMedia(file: File | string | Uint8Array, mimeType?: string): Promise<string | null>;
100
110
  deleteMedia(id: string): Promise<void>;
111
+ storeAllMedia(): Promise<void>;
112
+ replaceMedia(id: string, file: File | string | Uint8Array, mimeType?: string): Promise<boolean>;
101
113
  addSubtitles(subtitles: Subtitles): string;
102
114
  removeSubtitles(id: string): void;
103
115
  getSubtitlesById(id: string): Subtitles | undefined;
@@ -117,6 +129,8 @@ export declare class Library {
117
129
  id: string;
118
130
  filename: string;
119
131
  permanentUrl?: string | undefined;
132
+ hash?: string | undefined;
133
+ mimeType?: string | undefined;
120
134
  }[];
121
135
  };
122
136
  static deserialize(data: object): Library;
@@ -6,16 +6,22 @@ export declare const MediaDataSchema: z.ZodObject<{
6
6
  type: z.ZodString;
7
7
  filename: z.ZodString;
8
8
  permanentUrl: z.ZodOptional<z.ZodString>;
9
+ hash: z.ZodOptional<z.ZodString>;
10
+ mimeType: z.ZodOptional<z.ZodString>;
9
11
  }, "strip", z.ZodTypeAny, {
10
12
  type: string;
11
13
  id: string;
12
14
  filename: string;
13
15
  permanentUrl?: string | undefined;
16
+ hash?: string | undefined;
17
+ mimeType?: string | undefined;
14
18
  }, {
15
19
  type: string;
16
20
  id: string;
17
21
  filename: string;
18
22
  permanentUrl?: string | undefined;
23
+ hash?: string | undefined;
24
+ mimeType?: string | undefined;
19
25
  }>;
20
26
  export declare class MediaData {
21
27
  private id;
@@ -29,14 +35,19 @@ export declare class MediaData {
29
35
  duration?: number;
30
36
  blobUrl?: string;
31
37
  data?: Uint8Array;
38
+ size?: number;
32
39
  metadata?: MediaInfo;
33
40
  storePath?: string;
34
- audioSplit?: string;
35
41
  permanentUrl?: string;
36
- constructor();
42
+ hash?: string;
43
+ mimeType?: string;
44
+ audioSplit?: string;
45
+ constructor(id?: string);
37
46
  init(): Promise<void>;
38
47
  destroy(): void;
39
48
  getId(): string;
49
+ store(): Promise<void>;
50
+ restore(): Promise<boolean>;
40
51
  readFileIntoBlob(file: File, mimeType?: string): Promise<Blob>;
41
52
  checkCompatibilityOrTranscode(filePath: string, blobUrl: string, hasAudio: boolean): Promise<boolean>;
42
53
  hookM3U8(file: File | string | Uint8Array, mimeType: string | undefined): Promise<{
@@ -74,11 +85,15 @@ export declare class MediaData {
74
85
  }>;
75
86
  load(file: File | string | Uint8Array, mimeType?: string): Promise<void>;
76
87
  setPermanentUrl(url: string | null): void;
88
+ getHash(): string | undefined;
89
+ private computeHash;
77
90
  serialize(): {
78
91
  type: string;
79
92
  id: string;
80
93
  filename: string;
81
94
  permanentUrl?: string | undefined;
95
+ hash?: string | undefined;
96
+ mimeType?: string | undefined;
82
97
  };
83
98
  static deserialize(data: object): MediaData;
84
99
  }
@@ -0,0 +1,17 @@
1
+ import { StorageMediaData, StorageProviderBase, StorageProviderTypeEnum } from "./StorageProviderBase";
2
+ export declare class StorageController {
3
+ storageStack: StorageProviderBase[];
4
+ constructor();
5
+ addProvider(provider: StorageProviderBase): void;
6
+ removeProvider(provider: StorageProviderBase): void;
7
+ getProviders(type?: StorageProviderTypeEnum): StorageProviderBase | StorageProviderBase[] | undefined;
8
+ init(projectId: string): Promise<void>;
9
+ destroy(): Promise<void>;
10
+ beginBatch(): Promise<void>;
11
+ endBatch(): Promise<void>;
12
+ storeMedia(storageData: StorageMediaData): Promise<boolean>;
13
+ getMedia(mediaHash: string): Promise<StorageMediaData | null>;
14
+ removeMedia(mediaHash: string): Promise<void>;
15
+ hasMedia(mediaHash: string): Promise<boolean>;
16
+ syncProviders(master: StorageProviderBase): Promise<boolean>;
17
+ }
@@ -0,0 +1,32 @@
1
+ export declare enum StorageProviderTypeEnum {
2
+ NONE = 0,
3
+ LOCAL = 1,
4
+ REMOTE = 2
5
+ }
6
+ export interface StorageStoreResults {
7
+ success: boolean;
8
+ processNext: boolean;
9
+ allowedProviderTypes?: StorageProviderTypeEnum;
10
+ }
11
+ export interface StorageMediaData {
12
+ hash: string;
13
+ data: Uint8Array;
14
+ fileName?: string;
15
+ mimeType?: string;
16
+ type?: string;
17
+ }
18
+ export declare abstract class StorageProviderBase {
19
+ type: StorageProviderTypeEnum;
20
+ constructor(type: StorageProviderTypeEnum);
21
+ abstract init(projectId: string): Promise<void>;
22
+ abstract destroy(): Promise<void>;
23
+ abstract sync(master: StorageProviderBase): Promise<boolean>;
24
+ abstract storeMedia(storageData: StorageMediaData): Promise<StorageStoreResults>;
25
+ abstract hasMedia(mediaHash: string): Promise<boolean>;
26
+ abstract getMedia(mediaHash: string): Promise<StorageMediaData | null>;
27
+ abstract removeMedia(mediaHash: string): Promise<boolean>;
28
+ abstract getMediaHashList(): Promise<string[]>;
29
+ beginBatch(): Promise<void>;
30
+ endBatch(): Promise<void>;
31
+ abstract isActive(): boolean;
32
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./providers/StorageIndexedDB";
2
+ export * from "./StorageController";
3
+ export * from "./StorageProviderBase";
@@ -0,0 +1,20 @@
1
+ import { StorageMediaData, StorageProviderBase, StorageStoreResults } from "../StorageProviderBase";
2
+ export declare class StorageIndexedDB extends StorageProviderBase {
3
+ private db;
4
+ private dbPromise;
5
+ private active;
6
+ private projectId;
7
+ private isInit;
8
+ constructor();
9
+ private checkIfReady;
10
+ init(projectId: string): Promise<void>;
11
+ lazyInit(projectId: string): Promise<void>;
12
+ destroy(): Promise<void>;
13
+ storeMedia(storageData: StorageMediaData): Promise<StorageStoreResults>;
14
+ hasMedia(mediaHash: string): Promise<boolean>;
15
+ getMedia(mediaHash: string): Promise<StorageMediaData | null>;
16
+ removeMedia(mediaHash: string): Promise<boolean>;
17
+ getMediaHashList(): Promise<string[]>;
18
+ sync(master: StorageProviderBase): Promise<boolean>;
19
+ isActive(): boolean;
20
+ }
@@ -1,8 +1,244 @@
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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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?: "bold" | "normal" | "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 getInitialTweenValue;
201
+ constructor();
4
202
  init(): void;
203
+ setHighlightAnimation(animation: HighlightAnimationEnum, speedMultiplier?: number): void;
204
+ updateSubtitlesClips(subtitleId: string): void;
205
+ setTextMode(mode: TextModeType): void;
206
+ setMainTextStyle(style: MainTextStyle): void;
207
+ setHighlightedTextStyle(style: HighlightTextStyle): void;
208
+ private extractWordInfo;
209
+ private getSubtitleText;
210
+ private getHighlightedWordInfo;
211
+ private restartTween;
5
212
  update(currentTime: number): void;
6
213
  convertSRTToSubtitles(srt: string): Subtitles;
7
214
  extractSubtitlesFromVideo(mediaDataId: string): Promise<string> | "";
215
+ destroy(): void;
216
+ serialize(): {
217
+ textMode: "full" | "partial";
218
+ highlightAnimation: HighlightAnimationEnum;
219
+ highlightAnimationSpeed: number;
220
+ mainTextStyle: {
221
+ fontSize?: number | undefined;
222
+ color?: string | undefined;
223
+ fontWeight?: "bold" | "normal" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
224
+ fontFamily?: string | undefined;
225
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
226
+ wordWrapWidth?: number | null | undefined;
227
+ strokeThickness?: number | undefined;
228
+ strokeColor?: string | undefined;
229
+ };
230
+ highlightTextStyle: {
231
+ color?: string | undefined;
232
+ fontSize?: number | undefined;
233
+ fontWeight?: "bold" | "normal" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900" | undefined;
234
+ fontFamily?: string | undefined;
235
+ fontStyle?: "normal" | "italic" | "oblique" | undefined;
236
+ backgroundColor?: string | undefined;
237
+ backgroundPadding?: number | undefined;
238
+ strokeThickness?: number | undefined;
239
+ strokeColor?: string | undefined;
240
+ };
241
+ };
242
+ static deserialize(data: object): SubtitlesManager;
8
243
  }
244
+ export {};
@@ -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>;
@@ -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.1",
3
+ "version": "1.3.0",
4
4
  "license": "LICENSE",
5
5
  "author": "Onix Technologies",
6
6
  "homepage": "https://rendley.com",