@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.
- package/dist/Engine.d.ts +65 -4
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/dist/libs/ffmpeg/classes.d.ts +1 -0
- package/dist/libs/ffmpeg/const.d.ts +2 -1
- package/dist/modules/clip/Clip.d.ts +27 -16
- package/dist/modules/clip/ClipStyle.d.ts +1 -0
- package/dist/modules/clip/clips/custom/CustomClip.d.ts +6 -5
- package/dist/modules/clip/clips/lottie/LottieClip.d.ts +6 -5
- package/dist/modules/clip/clips/shape/ShapeClip.d.ts +6 -5
- package/dist/modules/clip/clips/text/TextClip.d.ts +6 -6
- package/dist/modules/clip/clips/text/TextStyle.d.ts +6 -10
- package/dist/modules/layer/Layer.d.ts +2 -2
- package/dist/modules/library/Library.d.ts +19 -0
- package/dist/modules/library/MediaData.d.ts +28 -1
- package/dist/modules/settings/Settings.d.ts +29 -0
- package/dist/modules/settings/index.d.ts +1 -0
- package/dist/modules/storage/StorageController.d.ts +17 -0
- package/dist/modules/storage/StorageProviderBase.d.ts +33 -0
- package/dist/modules/storage/index.d.ts +3 -0
- package/dist/modules/storage/providers/StorageIndexedDB.d.ts +20 -0
- package/dist/modules/subtitleManager/SubtitleManager.d.ts +238 -1
- package/dist/modules/timeline/Timeline.d.ts +4 -0
- package/dist/types/text.types.d.ts +7 -0
- package/dist/utils/animation/animation.d.ts +2 -0
- package/dist/utils/cachedAccess/cachedAccess.d.ts +18 -0
- package/dist/utils/file/uint8ArrayToHex.d.ts +1 -0
- package/dist/utils/math/degToRad.d.ts +1 -0
- package/dist/utils/math/radToDeg.d.ts +1 -0
- package/package.json +1 -1
|
@@ -142,6 +142,7 @@ export declare class FFmpeg {
|
|
|
142
142
|
* @category File System
|
|
143
143
|
*/
|
|
144
144
|
deleteDir: (path: string, { signal }?: FFMessageOptions) => Promise<OK>;
|
|
145
|
+
getBuildInfo: () => Promise<string>;
|
|
145
146
|
prepareRenderer: (settings: FFMessageRenderSettings, { signal }?: FFMessageOptions) => Promise<OK>;
|
|
146
147
|
addFrameToRenderer: ({ data }: FFMessageFrameData, { signal }?: FFMessageOptions) => Promise<OK>;
|
|
147
148
|
cancelRenderer: ({ signal }?: FFMessageOptions) => Promise<OK>;
|
|
@@ -35,5 +35,6 @@ export declare enum FFMessageType {
|
|
|
35
35
|
AUTH_GET_SECONDS = "AUTH_GET_SECONDS",
|
|
36
36
|
AUTH_IS_AUTHENTICATED = "AUTH_IS_AUTHENTICATED",
|
|
37
37
|
AUTH_GET_LICENSE_TYPE = "AUTH_GET_LICENSE_TYPE",
|
|
38
|
-
FETCH_TS_CHUNKS = "FETCH_TS_CHUNKS"
|
|
38
|
+
FETCH_TS_CHUNKS = "FETCH_TS_CHUNKS",
|
|
39
|
+
GET_BUILD_INFO = "GET_BUILD_INFO"
|
|
39
40
|
}
|
|
@@ -889,9 +889,15 @@ export declare const ClipSchema: z.ZodObject<{
|
|
|
889
889
|
animationLoopCount?: number | undefined;
|
|
890
890
|
loopSmoothing?: number | undefined;
|
|
891
891
|
}>>;
|
|
892
|
+
customData: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodUnknown], null>, "many">>;
|
|
892
893
|
}, "strip", z.ZodTypeAny, {
|
|
893
894
|
type: string;
|
|
894
895
|
id: string;
|
|
896
|
+
subtitlesOffset: number;
|
|
897
|
+
startTime: number;
|
|
898
|
+
duration: number;
|
|
899
|
+
leftTrim: number;
|
|
900
|
+
rightTrim: number;
|
|
895
901
|
filters: {
|
|
896
902
|
options: {
|
|
897
903
|
lutUrl: string;
|
|
@@ -900,11 +906,6 @@ export declare const ClipSchema: z.ZodObject<{
|
|
|
900
906
|
sourceId: string;
|
|
901
907
|
}[];
|
|
902
908
|
effects: unknown[];
|
|
903
|
-
subtitlesOffset: number;
|
|
904
|
-
startTime: number;
|
|
905
|
-
duration: number;
|
|
906
|
-
leftTrim: number;
|
|
907
|
-
rightTrim: number;
|
|
908
909
|
warpMode: WarpModeEnum;
|
|
909
910
|
mediaDataId?: string | undefined;
|
|
910
911
|
subtitlesId?: string | undefined;
|
|
@@ -976,9 +977,15 @@ export declare const ClipSchema: z.ZodObject<{
|
|
|
976
977
|
animationLoopCount?: number | undefined;
|
|
977
978
|
loopSmoothing?: number | undefined;
|
|
978
979
|
} | undefined;
|
|
980
|
+
customData?: [string, unknown][] | undefined;
|
|
979
981
|
}, {
|
|
980
982
|
type: string;
|
|
981
983
|
id: string;
|
|
984
|
+
subtitlesOffset: number;
|
|
985
|
+
startTime: number;
|
|
986
|
+
duration: number;
|
|
987
|
+
leftTrim: number;
|
|
988
|
+
rightTrim: number;
|
|
982
989
|
filters: {
|
|
983
990
|
options: {
|
|
984
991
|
lutUrl: string;
|
|
@@ -987,11 +994,6 @@ export declare const ClipSchema: z.ZodObject<{
|
|
|
987
994
|
sourceId: string;
|
|
988
995
|
}[];
|
|
989
996
|
effects: unknown[];
|
|
990
|
-
subtitlesOffset: number;
|
|
991
|
-
startTime: number;
|
|
992
|
-
duration: number;
|
|
993
|
-
leftTrim: number;
|
|
994
|
-
rightTrim: number;
|
|
995
997
|
warpMode: WarpModeEnum;
|
|
996
998
|
mediaDataId?: string | undefined;
|
|
997
999
|
subtitlesId?: string | undefined;
|
|
@@ -1063,6 +1065,7 @@ export declare const ClipSchema: z.ZodObject<{
|
|
|
1063
1065
|
animationLoopCount?: number | undefined;
|
|
1064
1066
|
loopSmoothing?: number | undefined;
|
|
1065
1067
|
} | undefined;
|
|
1068
|
+
customData?: [string, unknown][] | undefined;
|
|
1066
1069
|
}>;
|
|
1067
1070
|
export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipStyle = ClipStyle> {
|
|
1068
1071
|
id: string;
|
|
@@ -1079,6 +1082,7 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1079
1082
|
protected subtitlesOffset: number;
|
|
1080
1083
|
protected type: string;
|
|
1081
1084
|
protected hasTransition: boolean;
|
|
1085
|
+
protected customData?: Map<string, unknown>;
|
|
1082
1086
|
sprite: T;
|
|
1083
1087
|
style: K;
|
|
1084
1088
|
state: ClipState;
|
|
@@ -1090,7 +1094,14 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1090
1094
|
protected setAnimationPropertyValue(property: string, value: any): void;
|
|
1091
1095
|
protected getAnimationPropertyValue(property: string): number | string;
|
|
1092
1096
|
protected resetAnimationPropertyValue(property: string): void;
|
|
1097
|
+
setCustomData(key: string, value: unknown, overwrite?: boolean): boolean;
|
|
1098
|
+
getCustomData(key: string): unknown;
|
|
1099
|
+
hasCustomData(key: string): boolean;
|
|
1100
|
+
clearAllCustomData(): void;
|
|
1101
|
+
setAllCustomData(data: Map<string, unknown>): void;
|
|
1102
|
+
getAllCustomData(): Map<string, unknown> | undefined;
|
|
1093
1103
|
isReady(): boolean;
|
|
1104
|
+
getId(): string;
|
|
1094
1105
|
getStartTime(): number;
|
|
1095
1106
|
getEndTime(): number;
|
|
1096
1107
|
getLeftTrim(): number;
|
|
@@ -1132,7 +1143,6 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1132
1143
|
setSubtitlesOffset(offset: number): void;
|
|
1133
1144
|
render(currentTime: number): null;
|
|
1134
1145
|
private processUpdate;
|
|
1135
|
-
getSubtitleText(currentTime: number): string | undefined;
|
|
1136
1146
|
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
1137
1147
|
private updatePIXIFilters;
|
|
1138
1148
|
hasSprite(): boolean;
|
|
@@ -1144,6 +1154,11 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1144
1154
|
serialize(): {
|
|
1145
1155
|
type: string;
|
|
1146
1156
|
id: string;
|
|
1157
|
+
subtitlesOffset: number;
|
|
1158
|
+
startTime: number;
|
|
1159
|
+
duration: number;
|
|
1160
|
+
leftTrim: number;
|
|
1161
|
+
rightTrim: number;
|
|
1147
1162
|
filters: {
|
|
1148
1163
|
options: {
|
|
1149
1164
|
lutUrl: string;
|
|
@@ -1152,11 +1167,6 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1152
1167
|
sourceId: string;
|
|
1153
1168
|
}[];
|
|
1154
1169
|
effects: unknown[];
|
|
1155
|
-
subtitlesOffset: number;
|
|
1156
|
-
startTime: number;
|
|
1157
|
-
duration: number;
|
|
1158
|
-
leftTrim: number;
|
|
1159
|
-
rightTrim: number;
|
|
1160
1170
|
warpMode: WarpModeEnum;
|
|
1161
1171
|
mediaDataId?: string | undefined;
|
|
1162
1172
|
subtitlesId?: string | undefined;
|
|
@@ -1228,6 +1238,7 @@ export declare class Clip<T extends PIXI.Sprite = PIXI.Sprite, K extends ClipSty
|
|
|
1228
1238
|
animationLoopCount?: number | undefined;
|
|
1229
1239
|
loopSmoothing?: number | undefined;
|
|
1230
1240
|
} | undefined;
|
|
1241
|
+
customData?: [string, unknown][] | undefined;
|
|
1231
1242
|
};
|
|
1232
1243
|
static deserialize(data: object): Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>;
|
|
1233
1244
|
}
|
|
@@ -68,6 +68,7 @@ export declare class ClipStyle<T extends PIXI.Sprite = PIXI.Sprite> {
|
|
|
68
68
|
protected animationScaleMultiplier: [number, number];
|
|
69
69
|
protected animationRotationOffset: number;
|
|
70
70
|
protected animationAlphaMultiplier: number;
|
|
71
|
+
private lastCornerRadius;
|
|
71
72
|
constructor(options: ClipStyleOptions);
|
|
72
73
|
positionToCenter(): void;
|
|
73
74
|
scaleDownToFit(): void;
|
|
@@ -11,6 +11,11 @@ export declare class CustomClip extends Clip<PIXI.Sprite, ClipStyle> {
|
|
|
11
11
|
serialize(): {
|
|
12
12
|
type: string;
|
|
13
13
|
id: string;
|
|
14
|
+
subtitlesOffset: number;
|
|
15
|
+
startTime: number;
|
|
16
|
+
duration: number;
|
|
17
|
+
leftTrim: number;
|
|
18
|
+
rightTrim: number;
|
|
14
19
|
filters: {
|
|
15
20
|
options: {
|
|
16
21
|
lutUrl: string;
|
|
@@ -19,11 +24,6 @@ export declare class CustomClip extends Clip<PIXI.Sprite, ClipStyle> {
|
|
|
19
24
|
sourceId: string;
|
|
20
25
|
}[];
|
|
21
26
|
effects: unknown[];
|
|
22
|
-
subtitlesOffset: number;
|
|
23
|
-
startTime: number;
|
|
24
|
-
duration: number;
|
|
25
|
-
leftTrim: number;
|
|
26
|
-
rightTrim: number;
|
|
27
27
|
warpMode: import('../../../../index').WarpModeEnum;
|
|
28
28
|
mediaDataId?: string | undefined;
|
|
29
29
|
subtitlesId?: string | undefined;
|
|
@@ -95,6 +95,7 @@ export declare class CustomClip extends Clip<PIXI.Sprite, ClipStyle> {
|
|
|
95
95
|
animationLoopCount?: number | undefined;
|
|
96
96
|
loopSmoothing?: number | undefined;
|
|
97
97
|
} | undefined;
|
|
98
|
+
customData?: [string, unknown][] | undefined;
|
|
98
99
|
};
|
|
99
100
|
static deserialize(payload: object): CustomClip;
|
|
100
101
|
}
|
|
@@ -73,6 +73,11 @@ export declare class LottieClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>
|
|
|
73
73
|
serialize(): {
|
|
74
74
|
type: string;
|
|
75
75
|
id: string;
|
|
76
|
+
subtitlesOffset: number;
|
|
77
|
+
startTime: number;
|
|
78
|
+
duration: number;
|
|
79
|
+
leftTrim: number;
|
|
80
|
+
rightTrim: number;
|
|
76
81
|
filters: {
|
|
77
82
|
options: {
|
|
78
83
|
lutUrl: string;
|
|
@@ -81,11 +86,6 @@ export declare class LottieClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>
|
|
|
81
86
|
sourceId: string;
|
|
82
87
|
}[];
|
|
83
88
|
effects: unknown[];
|
|
84
|
-
subtitlesOffset: number;
|
|
85
|
-
startTime: number;
|
|
86
|
-
duration: number;
|
|
87
|
-
leftTrim: number;
|
|
88
|
-
rightTrim: number;
|
|
89
89
|
warpMode: import('../../../../types').WarpModeEnum;
|
|
90
90
|
dataUrl: string;
|
|
91
91
|
text?: string | undefined;
|
|
@@ -158,6 +158,7 @@ export declare class LottieClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>
|
|
|
158
158
|
animationLoopCount?: number | undefined;
|
|
159
159
|
loopSmoothing?: number | undefined;
|
|
160
160
|
} | undefined;
|
|
161
|
+
customData?: [string, unknown][] | undefined;
|
|
161
162
|
assetsUrl?: string | undefined;
|
|
162
163
|
propertiesUrl?: string | undefined;
|
|
163
164
|
};
|
|
@@ -18,6 +18,11 @@ export declare class ShapeClip extends Clip<ShapeSprite, ShapeStyle> {
|
|
|
18
18
|
shape: string;
|
|
19
19
|
type: string;
|
|
20
20
|
id: string;
|
|
21
|
+
subtitlesOffset: number;
|
|
22
|
+
startTime: number;
|
|
23
|
+
duration: number;
|
|
24
|
+
leftTrim: number;
|
|
25
|
+
rightTrim: number;
|
|
21
26
|
filters: {
|
|
22
27
|
options: {
|
|
23
28
|
lutUrl: string;
|
|
@@ -26,11 +31,6 @@ export declare class ShapeClip extends Clip<ShapeSprite, ShapeStyle> {
|
|
|
26
31
|
sourceId: string;
|
|
27
32
|
}[];
|
|
28
33
|
effects: unknown[];
|
|
29
|
-
subtitlesOffset: number;
|
|
30
|
-
startTime: number;
|
|
31
|
-
duration: number;
|
|
32
|
-
leftTrim: number;
|
|
33
|
-
rightTrim: number;
|
|
34
34
|
warpMode: import('../../../../types').WarpModeEnum;
|
|
35
35
|
text?: string | undefined;
|
|
36
36
|
mediaDataId?: string | undefined;
|
|
@@ -102,6 +102,7 @@ export declare class ShapeClip extends Clip<ShapeSprite, ShapeStyle> {
|
|
|
102
102
|
animationLoopCount?: number | undefined;
|
|
103
103
|
loopSmoothing?: number | undefined;
|
|
104
104
|
} | undefined;
|
|
105
|
+
customData?: [string, unknown][] | undefined;
|
|
105
106
|
};
|
|
106
107
|
static deserialize(payload: object): ShapeClip;
|
|
107
108
|
}
|
|
@@ -16,7 +16,6 @@ export declare class TextClip extends Clip<TextSprite, TextStyle> {
|
|
|
16
16
|
protected setAnimationPropertyValue(property: string, value: any): void;
|
|
17
17
|
protected getAnimationPropertyValue(property: string): number | string;
|
|
18
18
|
protected resetAnimationPropertyValue(property: string): void;
|
|
19
|
-
resetAllAnimationProperties(): void;
|
|
20
19
|
offload(): void;
|
|
21
20
|
clone(): TextClip;
|
|
22
21
|
destroy(): void;
|
|
@@ -24,6 +23,11 @@ export declare class TextClip extends Clip<TextSprite, TextStyle> {
|
|
|
24
23
|
text: string;
|
|
25
24
|
type: string;
|
|
26
25
|
id: string;
|
|
26
|
+
subtitlesOffset: number;
|
|
27
|
+
startTime: number;
|
|
28
|
+
duration: number;
|
|
29
|
+
leftTrim: number;
|
|
30
|
+
rightTrim: number;
|
|
27
31
|
filters: {
|
|
28
32
|
options: {
|
|
29
33
|
lutUrl: string;
|
|
@@ -32,11 +36,6 @@ export declare class TextClip extends Clip<TextSprite, TextStyle> {
|
|
|
32
36
|
sourceId: string;
|
|
33
37
|
}[];
|
|
34
38
|
effects: unknown[];
|
|
35
|
-
subtitlesOffset: number;
|
|
36
|
-
startTime: number;
|
|
37
|
-
duration: number;
|
|
38
|
-
leftTrim: number;
|
|
39
|
-
rightTrim: number;
|
|
40
39
|
warpMode: import('../../../../index').WarpModeEnum;
|
|
41
40
|
mediaDataId?: string | undefined;
|
|
42
41
|
subtitlesId?: string | undefined;
|
|
@@ -107,6 +106,7 @@ export declare class TextClip extends Clip<TextSprite, TextStyle> {
|
|
|
107
106
|
animationLoopCount?: number | undefined;
|
|
108
107
|
loopSmoothing?: number | undefined;
|
|
109
108
|
} | undefined;
|
|
109
|
+
customData?: [string, unknown][] | undefined;
|
|
110
110
|
};
|
|
111
111
|
static deserialize(payload: object): TextClip;
|
|
112
112
|
}
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
1
|
import { TextSprite } from "./TextSprite";
|
|
3
2
|
import { ClipStyle, ClipStyleOptions } from "../../ClipStyle";
|
|
4
|
-
|
|
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;
|
|
@@ -26,7 +20,9 @@ export declare class TextStyle extends ClipStyle<TextSprite> {
|
|
|
26
20
|
fontStyle: TextStyleFontStyle;
|
|
27
21
|
backgroundColor: string | null;
|
|
28
22
|
wordWrapWidth: number | null;
|
|
23
|
+
private isDirty;
|
|
29
24
|
constructor(options: TextClipStyleOptions);
|
|
25
|
+
setDirty(): void;
|
|
30
26
|
setFontSize(fontSize: number): void;
|
|
31
27
|
getFontSize(): number;
|
|
32
28
|
getWordWrapWidth(): number | null;
|
|
@@ -34,7 +30,7 @@ export declare class TextStyle extends ClipStyle<TextSprite> {
|
|
|
34
30
|
setColor(color: string): void;
|
|
35
31
|
getColor(): string;
|
|
36
32
|
setFontWeight(fontWeight: TextStyleFontWeight): void;
|
|
37
|
-
getFontWeight(): "
|
|
33
|
+
getFontWeight(): "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
|
|
38
34
|
setFontFamily(fontFamily: string): void;
|
|
39
35
|
getFontFamily(): string;
|
|
40
36
|
setTextAlign(textAlign: TextStyleAlign): void;
|
|
@@ -54,12 +50,12 @@ export declare class TextStyle extends ClipStyle<TextSprite> {
|
|
|
54
50
|
scale: [number, number];
|
|
55
51
|
zIndex: number;
|
|
56
52
|
relativeCornerRadius: boolean;
|
|
57
|
-
backgroundColor: string | null;
|
|
58
53
|
fontSize: number;
|
|
59
|
-
fontWeight: "
|
|
54
|
+
fontWeight: "normal" | "bold" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
|
|
60
55
|
fontFamily: string;
|
|
61
56
|
textAlign: "left" | "center" | "right" | "justify";
|
|
62
57
|
fontStyle: "normal" | "italic" | "oblique";
|
|
58
|
+
backgroundColor: string | null;
|
|
63
59
|
mediaDataId?: string | undefined;
|
|
64
60
|
width?: number | undefined;
|
|
65
61
|
height?: number | undefined;
|
|
@@ -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(
|
|
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,25 @@ 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>;
|
|
12
|
+
customData: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodUnknown], null>, "many">>;
|
|
10
13
|
}, "strip", z.ZodTypeAny, {
|
|
11
14
|
type: string;
|
|
12
15
|
id: string;
|
|
13
16
|
filename: string;
|
|
14
17
|
permanentUrl?: string | undefined;
|
|
18
|
+
hash?: string | undefined;
|
|
19
|
+
mimeType?: string | undefined;
|
|
20
|
+
customData?: [string, unknown][] | undefined;
|
|
15
21
|
}, {
|
|
16
22
|
type: string;
|
|
17
23
|
id: string;
|
|
18
24
|
filename: string;
|
|
19
25
|
permanentUrl?: string | undefined;
|
|
26
|
+
hash?: string | undefined;
|
|
27
|
+
mimeType?: string | undefined;
|
|
28
|
+
customData?: [string, unknown][] | undefined;
|
|
20
29
|
}>, "many">;
|
|
21
30
|
subtitles: z.ZodArray<z.ZodObject<{
|
|
22
31
|
id: z.ZodString;
|
|
@@ -70,6 +79,9 @@ export declare const LibrarySchema: z.ZodObject<{
|
|
|
70
79
|
id: string;
|
|
71
80
|
filename: string;
|
|
72
81
|
permanentUrl?: string | undefined;
|
|
82
|
+
hash?: string | undefined;
|
|
83
|
+
mimeType?: string | undefined;
|
|
84
|
+
customData?: [string, unknown][] | undefined;
|
|
73
85
|
}[];
|
|
74
86
|
}, {
|
|
75
87
|
subtitles: {
|
|
@@ -87,6 +99,9 @@ export declare const LibrarySchema: z.ZodObject<{
|
|
|
87
99
|
id: string;
|
|
88
100
|
filename: string;
|
|
89
101
|
permanentUrl?: string | undefined;
|
|
102
|
+
hash?: string | undefined;
|
|
103
|
+
mimeType?: string | undefined;
|
|
104
|
+
customData?: [string, unknown][] | undefined;
|
|
90
105
|
}[];
|
|
91
106
|
}>;
|
|
92
107
|
export declare class Library {
|
|
@@ -98,6 +113,7 @@ export declare class Library {
|
|
|
98
113
|
getMediaById(id: string): MediaData | undefined;
|
|
99
114
|
addMedia(file: File | string | Uint8Array, mimeType?: string): Promise<string | null>;
|
|
100
115
|
deleteMedia(id: string): Promise<void>;
|
|
116
|
+
storeAllMedia(): Promise<void>;
|
|
101
117
|
replaceMedia(id: string, file: File | string | Uint8Array, mimeType?: string): Promise<boolean>;
|
|
102
118
|
addSubtitles(subtitles: Subtitles): string;
|
|
103
119
|
removeSubtitles(id: string): void;
|
|
@@ -118,6 +134,9 @@ export declare class Library {
|
|
|
118
134
|
id: string;
|
|
119
135
|
filename: string;
|
|
120
136
|
permanentUrl?: string | undefined;
|
|
137
|
+
hash?: string | undefined;
|
|
138
|
+
mimeType?: string | undefined;
|
|
139
|
+
customData?: [string, unknown][] | undefined;
|
|
121
140
|
}[];
|
|
122
141
|
};
|
|
123
142
|
static deserialize(data: object): Library;
|
|
@@ -6,16 +6,25 @@ 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>;
|
|
11
|
+
customData: z.ZodOptional<z.ZodArray<z.ZodTuple<[z.ZodString, z.ZodUnknown], null>, "many">>;
|
|
9
12
|
}, "strip", z.ZodTypeAny, {
|
|
10
13
|
type: string;
|
|
11
14
|
id: string;
|
|
12
15
|
filename: string;
|
|
13
16
|
permanentUrl?: string | undefined;
|
|
17
|
+
hash?: string | undefined;
|
|
18
|
+
mimeType?: string | undefined;
|
|
19
|
+
customData?: [string, unknown][] | undefined;
|
|
14
20
|
}, {
|
|
15
21
|
type: string;
|
|
16
22
|
id: string;
|
|
17
23
|
filename: string;
|
|
18
24
|
permanentUrl?: string | undefined;
|
|
25
|
+
hash?: string | undefined;
|
|
26
|
+
mimeType?: string | undefined;
|
|
27
|
+
customData?: [string, unknown][] | undefined;
|
|
19
28
|
}>;
|
|
20
29
|
export declare class MediaData {
|
|
21
30
|
private id;
|
|
@@ -29,14 +38,27 @@ export declare class MediaData {
|
|
|
29
38
|
duration?: number;
|
|
30
39
|
blobUrl?: string;
|
|
31
40
|
data?: Uint8Array;
|
|
41
|
+
size?: number;
|
|
32
42
|
metadata?: MediaInfo;
|
|
33
43
|
storePath?: string;
|
|
34
|
-
audioSplit?: string;
|
|
35
44
|
permanentUrl?: string;
|
|
45
|
+
hash?: string;
|
|
46
|
+
mimeType?: string;
|
|
47
|
+
customData?: Map<string, unknown>;
|
|
48
|
+
audioSplit?: string;
|
|
36
49
|
constructor(id?: string);
|
|
37
50
|
init(): Promise<void>;
|
|
38
51
|
destroy(): void;
|
|
39
52
|
getId(): string;
|
|
53
|
+
store(): Promise<void>;
|
|
54
|
+
restore(): Promise<boolean>;
|
|
55
|
+
setCustomData(key: string, value: unknown, overwrite?: boolean): boolean;
|
|
56
|
+
getCustomData(key: string): unknown;
|
|
57
|
+
hasCustomData(key: string): boolean;
|
|
58
|
+
removeCustomData(key: string): boolean;
|
|
59
|
+
clearAllCustomData(): void;
|
|
60
|
+
setAllCustomData(data: Map<string, unknown>): void;
|
|
61
|
+
getAllCustomData(): Map<string, unknown> | undefined;
|
|
40
62
|
readFileIntoBlob(file: File, mimeType?: string): Promise<Blob>;
|
|
41
63
|
checkCompatibilityOrTranscode(filePath: string, blobUrl: string, hasAudio: boolean): Promise<boolean>;
|
|
42
64
|
hookM3U8(file: File | string | Uint8Array, mimeType: string | undefined): Promise<{
|
|
@@ -74,11 +96,16 @@ export declare class MediaData {
|
|
|
74
96
|
}>;
|
|
75
97
|
load(file: File | string | Uint8Array, mimeType?: string): Promise<void>;
|
|
76
98
|
setPermanentUrl(url: string | null): void;
|
|
99
|
+
getHash(): string | undefined;
|
|
100
|
+
private computeHash;
|
|
77
101
|
serialize(): {
|
|
78
102
|
type: string;
|
|
79
103
|
id: string;
|
|
80
104
|
filename: string;
|
|
81
105
|
permanentUrl?: string | undefined;
|
|
106
|
+
hash?: string | undefined;
|
|
107
|
+
mimeType?: string | undefined;
|
|
108
|
+
customData?: [string, unknown][] | undefined;
|
|
82
109
|
};
|
|
83
110
|
static deserialize(data: object): MediaData;
|
|
84
111
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare enum PreferredAcceleration {
|
|
3
|
+
HARDWARE = "prefer-hardware",
|
|
4
|
+
SOFTWARE = "prefer-software"
|
|
5
|
+
}
|
|
6
|
+
export declare const SettingsSchema: z.ZodObject<{
|
|
7
|
+
preferredDecodingAcceleration: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof PreferredAcceleration>>>;
|
|
8
|
+
preferredEncodingAcceleration: z.ZodDefault<z.ZodOptional<z.ZodNativeEnum<typeof PreferredAcceleration>>>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
preferredDecodingAcceleration: PreferredAcceleration;
|
|
11
|
+
preferredEncodingAcceleration: PreferredAcceleration;
|
|
12
|
+
}, {
|
|
13
|
+
preferredDecodingAcceleration?: PreferredAcceleration | undefined;
|
|
14
|
+
preferredEncodingAcceleration?: PreferredAcceleration | undefined;
|
|
15
|
+
}>;
|
|
16
|
+
export declare class Settings {
|
|
17
|
+
private preferredDecodingAcceleration;
|
|
18
|
+
private preferredEncodingAcceleration;
|
|
19
|
+
constructor();
|
|
20
|
+
setPreferredDecodingAcceleration(acceleration: PreferredAcceleration): void;
|
|
21
|
+
getPreferredDecodingAcceleration(): PreferredAcceleration;
|
|
22
|
+
setPreferredEncodingAcceleration(acceleration: PreferredAcceleration): void;
|
|
23
|
+
getPreferredEncodingAcceleration(): PreferredAcceleration;
|
|
24
|
+
serialize(): {
|
|
25
|
+
preferredDecodingAcceleration: PreferredAcceleration;
|
|
26
|
+
preferredEncodingAcceleration: PreferredAcceleration;
|
|
27
|
+
};
|
|
28
|
+
static deserialize(data: object): Settings;
|
|
29
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./Settings";
|
|
@@ -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,33 @@
|
|
|
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
|
+
mediaId: string;
|
|
15
|
+
fileName?: string;
|
|
16
|
+
mimeType?: string;
|
|
17
|
+
type?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare abstract class StorageProviderBase {
|
|
20
|
+
type: StorageProviderTypeEnum;
|
|
21
|
+
constructor(type: StorageProviderTypeEnum);
|
|
22
|
+
abstract init(projectId: string): Promise<void>;
|
|
23
|
+
abstract destroy(): Promise<void>;
|
|
24
|
+
abstract sync(master: StorageProviderBase): Promise<boolean>;
|
|
25
|
+
abstract storeMedia(storageData: StorageMediaData): Promise<StorageStoreResults>;
|
|
26
|
+
abstract hasMedia(mediaHash: string): Promise<boolean>;
|
|
27
|
+
abstract getMedia(mediaHash: string): Promise<StorageMediaData | null>;
|
|
28
|
+
abstract removeMedia(mediaHash: string): Promise<boolean>;
|
|
29
|
+
abstract getMediaHashList(): Promise<string[]>;
|
|
30
|
+
beginBatch(): Promise<void>;
|
|
31
|
+
endBatch(): Promise<void>;
|
|
32
|
+
abstract isActive(): boolean;
|
|
33
|
+
}
|
|
@@ -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
|
+
}
|