@rendley/sdk 1.12.10 → 1.12.12
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 +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/modules/clip/Clip.d.ts +310 -308
- package/dist/modules/clip/ClipStyle.d.ts +3 -3
- package/dist/modules/clip/clips/audio/AudioClip.d.ts +2 -1
- package/dist/modules/clip/clips/gif/GifClip.d.ts +2 -1
- package/dist/modules/clip/clips/image/ImageClip.d.ts +2 -1
- package/dist/modules/clip/clips/shape/ShapeStyle.d.ts +4 -4
- package/dist/modules/clip/clips/svg/SvgClip.d.ts +2 -2
- package/dist/modules/clip/clips/text/TextStyle.d.ts +4 -4
- package/dist/modules/clip/clips/video/VideoClip.d.ts +2 -2
- package/dist/modules/library/Library.d.ts +7 -1
- package/dist/modules/renderer/Renderer.d.ts +4 -1
- package/dist/modules/renderer/index.d.ts +0 -1
- package/dist/modules/undo/UndoManager.d.ts +5 -0
- package/dist/types/clip.types.d.ts +6 -0
- package/package.json +1 -1
- package/dist/modules/renderer/types/Renderer.types.d.ts +0 -14
|
@@ -28,9 +28,9 @@ export declare const ClipStyleSchema: z.ZodObject<{
|
|
|
28
28
|
cornerRadius: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
29
29
|
relativeCornerRadius: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
30
30
|
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
scale: [number, number];
|
|
31
32
|
alpha: number;
|
|
32
33
|
rotation: number;
|
|
33
|
-
scale: [number, number];
|
|
34
34
|
clipId: string;
|
|
35
35
|
position: [number, number];
|
|
36
36
|
crop: [number, number, number, number];
|
|
@@ -41,9 +41,9 @@ export declare const ClipStyleSchema: z.ZodObject<{
|
|
|
41
41
|
height?: number | undefined;
|
|
42
42
|
cornerRadius?: [number, number, number, number] | undefined;
|
|
43
43
|
}, {
|
|
44
|
+
scale: [number, number];
|
|
44
45
|
alpha: number;
|
|
45
46
|
rotation: number;
|
|
46
|
-
scale: [number, number];
|
|
47
47
|
clipId: string;
|
|
48
48
|
position: [number, number];
|
|
49
49
|
zIndex: number;
|
|
@@ -141,9 +141,9 @@ export declare class ClipStyle<T extends PIXI.Sprite = PIXI.Sprite> {
|
|
|
141
141
|
protected emitUpdateEvent(property: string, value: unknown): boolean;
|
|
142
142
|
destroy(): void;
|
|
143
143
|
serialize(): {
|
|
144
|
+
scale: [number, number];
|
|
144
145
|
alpha: number;
|
|
145
146
|
rotation: number;
|
|
146
|
-
scale: [number, number];
|
|
147
147
|
clipId: string;
|
|
148
148
|
position: [number, number];
|
|
149
149
|
crop: [number, number, number, number];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReplaceMediaOptions } from '../../../../index';
|
|
1
2
|
import { FadeCurveEnum } from '../../../../types';
|
|
2
3
|
import { Clip, ClipOptions } from "../../Clip";
|
|
3
4
|
export interface AudioClipOptions extends ClipOptions {
|
|
@@ -34,7 +35,7 @@ export declare class AudioClip extends Clip {
|
|
|
34
35
|
private getGlobalTimeToClipTime;
|
|
35
36
|
getIsProcessing(): boolean;
|
|
36
37
|
discardProcessing(): void;
|
|
37
|
-
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
38
|
+
updateMediaData(newMediaId?: string, _?: ReplaceMediaOptions): Promise<boolean>;
|
|
38
39
|
preload(currentTime: number): void;
|
|
39
40
|
addActionToQueue(action: string, params?: object): void;
|
|
40
41
|
processNextQueue(): void;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as PIXI from "pixi.js";
|
|
2
|
+
import { ReplaceMediaOptions } from '../../../../index';
|
|
2
3
|
import { Clip, ClipOptions } from "../../Clip";
|
|
3
4
|
import { ClipStyle } from "../../ClipStyle";
|
|
4
5
|
export interface GifClipOptions extends ClipOptions<ClipStyle> {
|
|
@@ -13,7 +14,7 @@ export declare class GifClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
|
|
|
13
14
|
constructor(options: GifClipOptions);
|
|
14
15
|
init(layerId: string): Promise<void>;
|
|
15
16
|
private getGlobalTimeToClipTime;
|
|
16
|
-
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
17
|
+
updateMediaData(newMediaId?: string, options?: ReplaceMediaOptions): Promise<boolean>;
|
|
17
18
|
preload(currentTime: number): void;
|
|
18
19
|
private play;
|
|
19
20
|
private pause;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as PIXI from "pixi.js";
|
|
2
|
+
import { ReplaceMediaOptions } from '../../../../index';
|
|
2
3
|
import { Clip, ClipOptions } from "../../Clip";
|
|
3
4
|
import { ClipStyle } from "../../ClipStyle";
|
|
4
5
|
export interface ImageClipOptions extends ClipOptions<ClipStyle> {
|
|
@@ -7,7 +8,7 @@ export interface ImageClipOptions extends ClipOptions<ClipStyle> {
|
|
|
7
8
|
export declare class ImageClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
|
|
8
9
|
constructor(options: ImageClipOptions);
|
|
9
10
|
init(layerId: string): Promise<void>;
|
|
10
|
-
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
11
|
+
updateMediaData(newMediaId?: string, options?: ReplaceMediaOptions): Promise<boolean>;
|
|
11
12
|
preload(currentTime: number): void;
|
|
12
13
|
updateVisibility(currentTime: number): void;
|
|
13
14
|
update(currentTime: number): void;
|
|
@@ -16,10 +16,10 @@ interface ShapeClipStyleOptions extends ClipStyleOptions {
|
|
|
16
16
|
outerRadius?: number;
|
|
17
17
|
}
|
|
18
18
|
export declare const ShapeStyleSchema: z.ZodObject<{
|
|
19
|
+
scale: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
19
20
|
width: z.ZodOptional<z.ZodNumber>;
|
|
20
21
|
alpha: z.ZodNumber;
|
|
21
22
|
rotation: z.ZodNumber;
|
|
22
|
-
scale: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
23
23
|
height: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
clipId: z.ZodString;
|
|
25
25
|
mediaDataId: z.ZodOptional<z.ZodString>;
|
|
@@ -41,9 +41,9 @@ export declare const ShapeStyleSchema: z.ZodObject<{
|
|
|
41
41
|
outerRadius: z.ZodOptional<z.ZodNumber>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
43
|
shape: ShapeTypeEnum;
|
|
44
|
+
scale: [number, number];
|
|
44
45
|
alpha: number;
|
|
45
46
|
rotation: number;
|
|
46
|
-
scale: [number, number];
|
|
47
47
|
clipId: string;
|
|
48
48
|
position: [number, number];
|
|
49
49
|
crop: [number, number, number, number];
|
|
@@ -64,9 +64,9 @@ export declare const ShapeStyleSchema: z.ZodObject<{
|
|
|
64
64
|
innerRadius?: number | undefined;
|
|
65
65
|
outerRadius?: number | undefined;
|
|
66
66
|
}, {
|
|
67
|
+
scale: [number, number];
|
|
67
68
|
alpha: number;
|
|
68
69
|
rotation: number;
|
|
69
|
-
scale: [number, number];
|
|
70
70
|
clipId: string;
|
|
71
71
|
position: [number, number];
|
|
72
72
|
zIndex: number;
|
|
@@ -126,9 +126,9 @@ export declare class ShapeStyle extends ClipStyle<ShapeSprite> {
|
|
|
126
126
|
update(container: ShapeSprite, redraw?: boolean): void;
|
|
127
127
|
serialize(): {
|
|
128
128
|
shape: ShapeTypeEnum;
|
|
129
|
+
scale: [number, number];
|
|
129
130
|
alpha: number;
|
|
130
131
|
rotation: number;
|
|
131
|
-
scale: [number, number];
|
|
132
132
|
clipId: string;
|
|
133
133
|
position: [number, number];
|
|
134
134
|
crop: [number, number, number, number];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as PIXI from "pixi.js";
|
|
2
|
-
import { ClipStyle } from '../../../../index';
|
|
2
|
+
import { ClipStyle, ReplaceMediaOptions } from '../../../../index';
|
|
3
3
|
import { Clip, ClipOptions } from "../../Clip";
|
|
4
4
|
export interface SvgClipOptions extends ClipOptions<ClipStyle> {
|
|
5
5
|
mediaDataId: string;
|
|
@@ -15,7 +15,7 @@ export declare class SvgClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
|
|
|
15
15
|
updateVisibility(currentTime: number): void;
|
|
16
16
|
private updateTexture;
|
|
17
17
|
update(currentTime: number): void;
|
|
18
|
-
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
18
|
+
updateMediaData(newMediaId?: string, options?: ReplaceMediaOptions): Promise<boolean>;
|
|
19
19
|
clone(): SvgClip;
|
|
20
20
|
destroy(): void;
|
|
21
21
|
serialize(): {
|
|
@@ -16,10 +16,10 @@ interface TextClipStyleOptions extends ClipStyleOptions {
|
|
|
16
16
|
padding?: number[];
|
|
17
17
|
}
|
|
18
18
|
export declare const TextStyleSchema: z.ZodObject<{
|
|
19
|
+
scale: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
19
20
|
width: z.ZodOptional<z.ZodNumber>;
|
|
20
21
|
alpha: z.ZodNumber;
|
|
21
22
|
rotation: z.ZodNumber;
|
|
22
|
-
scale: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
|
|
23
23
|
height: z.ZodOptional<z.ZodNumber>;
|
|
24
24
|
clipId: z.ZodString;
|
|
25
25
|
mediaDataId: z.ZodOptional<z.ZodString>;
|
|
@@ -40,10 +40,10 @@ export declare const TextStyleSchema: z.ZodObject<{
|
|
|
40
40
|
wordWrapWidth: z.ZodDefault<z.ZodNullable<z.ZodNumber>>;
|
|
41
41
|
padding: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
42
42
|
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
scale: [number, number];
|
|
43
44
|
color: string;
|
|
44
45
|
alpha: number;
|
|
45
46
|
rotation: number;
|
|
46
|
-
scale: [number, number];
|
|
47
47
|
padding: number[];
|
|
48
48
|
clipId: string;
|
|
49
49
|
position: [number, number];
|
|
@@ -64,10 +64,10 @@ export declare const TextStyleSchema: z.ZodObject<{
|
|
|
64
64
|
mediaDataId?: string | undefined;
|
|
65
65
|
cornerRadius?: [number, number, number, number] | undefined;
|
|
66
66
|
}, {
|
|
67
|
+
scale: [number, number];
|
|
67
68
|
color: string;
|
|
68
69
|
alpha: number;
|
|
69
70
|
rotation: number;
|
|
70
|
-
scale: [number, number];
|
|
71
71
|
clipId: string;
|
|
72
72
|
position: [number, number];
|
|
73
73
|
zIndex: number;
|
|
@@ -130,10 +130,10 @@ export declare class TextStyle extends ClipStyle<TextSprite> {
|
|
|
130
130
|
getPadding(): number[];
|
|
131
131
|
update(container: TextSprite): void;
|
|
132
132
|
serialize(): {
|
|
133
|
+
scale: [number, number];
|
|
133
134
|
color: string;
|
|
134
135
|
alpha: number;
|
|
135
136
|
rotation: number;
|
|
136
|
-
scale: [number, number];
|
|
137
137
|
padding: number[];
|
|
138
138
|
clipId: string;
|
|
139
139
|
position: [number, number];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as PIXI from "pixi.js";
|
|
2
2
|
import { ExportOptions } from '../../../../Engine';
|
|
3
|
-
import { AudioClip, FilmStripStateEnum, IFilmstripData } from '../../../../index';
|
|
3
|
+
import { AudioClip, FilmStripStateEnum, IFilmstripData, ReplaceMediaOptions } from '../../../../index';
|
|
4
4
|
import { FadeCurveEnum } from '../../../../types';
|
|
5
5
|
import { Clip, ClipOptions } from "../../Clip";
|
|
6
6
|
import { ClipStyle } from "../../ClipStyle";
|
|
@@ -54,7 +54,7 @@ export declare class VideoClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>
|
|
|
54
54
|
private getGlobalTimeToClipTime;
|
|
55
55
|
getIsProcessing(): boolean;
|
|
56
56
|
discardProcessing(): void;
|
|
57
|
-
updateMediaData(newMediaId?: string): Promise<boolean>;
|
|
57
|
+
updateMediaData(newMediaId?: string, options?: ReplaceMediaOptions): Promise<boolean>;
|
|
58
58
|
preload(currentTime: number): void;
|
|
59
59
|
private addActionToQueue;
|
|
60
60
|
private processNextQueue;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { FitStyleEnum } from '../../index';
|
|
2
3
|
import { EffectData, EffectDataOptions } from "./EffectData";
|
|
3
4
|
import { FilterData, FilterDataOptions } from "./FilterData";
|
|
4
5
|
import { MediaData } from "./MediaData";
|
|
5
6
|
import { Subtitles } from "./Subtitles";
|
|
6
7
|
import { TransitionData, TransitionDataOptions } from "./TransitionData";
|
|
7
8
|
import { MediaInfo } from "../ffmpeg/types/FFmpeg.types";
|
|
9
|
+
export interface ReplaceMediaOptions {
|
|
10
|
+
mimeType?: string;
|
|
11
|
+
imageFitStyle?: FitStyleEnum;
|
|
12
|
+
toCropImage?: boolean;
|
|
13
|
+
}
|
|
8
14
|
export interface MissingAssetInfo {
|
|
9
15
|
id: string;
|
|
10
16
|
provider: string;
|
|
@@ -446,7 +452,7 @@ export declare class Library {
|
|
|
446
452
|
* the process, it logs the error. Finally, it ends the batch operation.
|
|
447
453
|
*/
|
|
448
454
|
syncAllMedia(): Promise<void>;
|
|
449
|
-
replaceMedia(id: string, file: File | string | Uint8Array,
|
|
455
|
+
replaceMedia(id: string, file: File | string | Uint8Array, replaceOptions?: ReplaceMediaOptions): Promise<boolean>;
|
|
450
456
|
replaceSerializedMedia(data: any): Promise<boolean>;
|
|
451
457
|
probeMediaData(file: File | string | Uint8Array): Promise<MediaInfo | null>;
|
|
452
458
|
extractAudioFromMedia(mediaId: string, audioTrackIndex?: number): Promise<string | null>;
|
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import { ExportOptions, ExportResult } from
|
|
1
|
+
import { ExportOptions, ExportResult } from '../../index';
|
|
2
2
|
export declare class Renderer {
|
|
3
3
|
private rendering;
|
|
4
4
|
private isBackgrounded;
|
|
5
5
|
private isCanceled;
|
|
6
6
|
private watermarkSprite;
|
|
7
7
|
private audioWorker;
|
|
8
|
+
private originalWidth;
|
|
9
|
+
private originalHeight;
|
|
10
|
+
private originalResolution;
|
|
8
11
|
constructor();
|
|
9
12
|
destroy(): void;
|
|
10
13
|
private visibilityChangeHandler;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { UndoActionEnum, UndoActionMappings, UndoGroup, UndoRecord } from "./UndoManager.types";
|
|
3
|
+
export declare const UNDO_MANAGER_SCHEMA_VERSION = 1;
|
|
3
4
|
export declare const UndoRecordSchema: z.ZodObject<{
|
|
4
5
|
action: z.ZodNativeEnum<typeof UndoActionEnum>;
|
|
5
6
|
data: z.ZodType<Required<any>, z.ZodTypeDef, Required<any>>;
|
|
@@ -36,6 +37,7 @@ export declare const UndoGroupSchema: z.ZodObject<{
|
|
|
36
37
|
}[];
|
|
37
38
|
}>;
|
|
38
39
|
export declare const UndoManagerSchema: z.ZodObject<{
|
|
40
|
+
version: z.ZodDefault<z.ZodNumber>;
|
|
39
41
|
undoHistory: z.ZodArray<z.ZodObject<{
|
|
40
42
|
name: z.ZodString;
|
|
41
43
|
records: z.ZodArray<z.ZodObject<{
|
|
@@ -89,6 +91,7 @@ export declare const UndoManagerSchema: z.ZodObject<{
|
|
|
89
91
|
isEnabled: z.ZodBoolean;
|
|
90
92
|
maxUndoHistory: z.ZodNumber;
|
|
91
93
|
}, "strip", z.ZodTypeAny, {
|
|
94
|
+
version: number;
|
|
92
95
|
undoHistory: {
|
|
93
96
|
name: string;
|
|
94
97
|
records: {
|
|
@@ -122,6 +125,7 @@ export declare const UndoManagerSchema: z.ZodObject<{
|
|
|
122
125
|
}[];
|
|
123
126
|
isEnabled: boolean;
|
|
124
127
|
maxUndoHistory: number;
|
|
128
|
+
version?: number | undefined;
|
|
125
129
|
}>;
|
|
126
130
|
export declare class UndoManager {
|
|
127
131
|
private undoHistory;
|
|
@@ -157,6 +161,7 @@ export declare class UndoManager {
|
|
|
157
161
|
destroy(): void;
|
|
158
162
|
processUndoRedo(undoRecord: UndoRecord, redoGroup: UndoGroup): Promise<void>;
|
|
159
163
|
serialize(): {
|
|
164
|
+
version: number;
|
|
160
165
|
undoHistory: {
|
|
161
166
|
name: string;
|
|
162
167
|
records: {
|
|
@@ -51,3 +51,9 @@ export declare enum FadeCurveEnum {
|
|
|
51
51
|
SQUARE_QUARTER_SINE = "qsin2",// squared quarter sine
|
|
52
52
|
SQUARE_HALF_SINE = "hsin2"
|
|
53
53
|
}
|
|
54
|
+
export declare enum FitStyleEnum {
|
|
55
|
+
ORIGINAL = "original",// Don't inherit source size
|
|
56
|
+
MATCH_SCALE = "scale",// Inherit target scale
|
|
57
|
+
OUTSIDE = "outside",// Touch edges from outside, source size >= target size
|
|
58
|
+
INSIDE = "inside"
|
|
59
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export declare enum ExportVideoType {
|
|
2
|
-
VIDEO_ONLY = "video_only",
|
|
3
|
-
AUDIO_ONLY = "audio_only",
|
|
4
|
-
VIDEO_AUDIO = "video_audio"
|
|
5
|
-
}
|
|
6
|
-
export interface ExportResult {
|
|
7
|
-
blob: Blob;
|
|
8
|
-
extension: "aac" | "ogg" | "mp4" | "webm";
|
|
9
|
-
}
|
|
10
|
-
export interface ExportOptions {
|
|
11
|
-
type?: ExportVideoType;
|
|
12
|
-
from?: number;
|
|
13
|
-
to?: number;
|
|
14
|
-
}
|