@rendley/sdk 1.0.1

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 (80) hide show
  1. package/LICENSE +48 -0
  2. package/README.md +40 -0
  3. package/dist/Engine.d.ts +118 -0
  4. package/dist/config/config.d.ts +6 -0
  5. package/dist/index.cjs +1 -0
  6. package/dist/index.d.ts +6 -0
  7. package/dist/index.js +1 -0
  8. package/dist/libs/ffmpeg/classes.d.ts +201 -0
  9. package/dist/libs/ffmpeg/config.d.ts +2 -0
  10. package/dist/libs/ffmpeg/const.d.ts +37 -0
  11. package/dist/libs/ffmpeg/empty.d.mts +3 -0
  12. package/dist/libs/ffmpeg/errors.d.ts +4 -0
  13. package/dist/libs/ffmpeg/fetchFile.d.ts +1 -0
  14. package/dist/libs/ffmpeg/index.d.ts +1 -0
  15. package/dist/libs/ffmpeg/types.d.ts +175 -0
  16. package/dist/libs/ffmpeg/utils.d.ts +4 -0
  17. package/dist/libs/ffmpeg/worker.d.ts +10 -0
  18. package/dist/modules/clip/Clip.d.ts +206 -0
  19. package/dist/modules/clip/ClipStyle.d.ts +92 -0
  20. package/dist/modules/clip/clips/audio/AudioClip.d.ts +36 -0
  21. package/dist/modules/clip/clips/gif/GifClip.d.ts +27 -0
  22. package/dist/modules/clip/clips/image/ImageClip.d.ts +16 -0
  23. package/dist/modules/clip/clips/index.d.ts +4 -0
  24. package/dist/modules/clip/clips/shape/ShapeClip.d.ts +43 -0
  25. package/dist/modules/clip/clips/shape/ShapeSprite.d.ts +9 -0
  26. package/dist/modules/clip/clips/shape/ShapeStyle.d.ts +27 -0
  27. package/dist/modules/clip/clips/text/TextClip.d.ts +42 -0
  28. package/dist/modules/clip/clips/text/TextSprite.d.ts +7 -0
  29. package/dist/modules/clip/clips/text/TextStyle.d.ts +69 -0
  30. package/dist/modules/clip/clips/video/VideoClip.d.ts +48 -0
  31. package/dist/modules/clip/index.d.ts +2 -0
  32. package/dist/modules/clip/utils/generateRawData.d.ts +1 -0
  33. package/dist/modules/display/Display.d.ts +42 -0
  34. package/dist/modules/display/index.d.ts +1 -0
  35. package/dist/modules/display/renderer/PixiRenderer.d.ts +16 -0
  36. package/dist/modules/display/utils/WebCodecsVideoFrameResource.d.ts +7 -0
  37. package/dist/modules/display/utils/registerSelectionEvents.d.ts +12 -0
  38. package/dist/modules/event-emitter/EventEmitter.d.ts +4 -0
  39. package/dist/modules/event-emitter/index.d.ts +2 -0
  40. package/dist/modules/event-emitter/types/EventEmitter.types.d.ts +179 -0
  41. package/dist/modules/ffmpeg/FFmpeg.d.ts +11 -0
  42. package/dist/modules/ffmpeg/types/FFmpeg.types.d.ts +32 -0
  43. package/dist/modules/filter/Effect.d.ts +36 -0
  44. package/dist/modules/filter/Filter.d.ts +52 -0
  45. package/dist/modules/filter/effects/OldFilmEffect.d.ts +2 -0
  46. package/dist/modules/filter/effects/WaveEffect.d.ts +2 -0
  47. package/dist/modules/filter/filters/VintageFilter.d.ts +2 -0
  48. package/dist/modules/filter/index.d.ts +2 -0
  49. package/dist/modules/filter/utils/removeShaderNameLine.d.ts +1 -0
  50. package/dist/modules/font-registry/FontRegistry.d.ts +22 -0
  51. package/dist/modules/font-registry/index.d.ts +1 -0
  52. package/dist/modules/layer/Layer.d.ts +278 -0
  53. package/dist/modules/layer/index.d.ts +1 -0
  54. package/dist/modules/library/Library.d.ts +117 -0
  55. package/dist/modules/library/MediaData.d.ts +50 -0
  56. package/dist/modules/library/Subtitles.d.ts +71 -0
  57. package/dist/modules/library/index.d.ts +1 -0
  58. package/dist/modules/library/types/MediaData.types.d.ts +7 -0
  59. package/dist/modules/subtitleManager/SubtitleManager.d.ts +9 -0
  60. package/dist/modules/subtitleManager/index.d.ts +1 -0
  61. package/dist/modules/timeline/Timeline.d.ts +372 -0
  62. package/dist/modules/timeline/index.d.ts +1 -0
  63. package/dist/modules/transition/Transition.d.ts +76 -0
  64. package/dist/modules/transition/index.d.ts +1 -0
  65. package/dist/types/clip.types.d.ts +18 -0
  66. package/dist/types/index.d.ts +1 -0
  67. package/dist/utils/browser/getIosVersion.d.ts +1 -0
  68. package/dist/utils/browser/isIos.d.ts +1 -0
  69. package/dist/utils/browser/isIosSafari.d.ts +1 -0
  70. package/dist/utils/color/getSolidColorFromGradient.d.ts +1 -0
  71. package/dist/utils/color/parseGradient.d.ts +7 -0
  72. package/dist/utils/core/emitEvent.d.ts +4 -0
  73. package/dist/utils/file/fileToArrayBuffer.d.ts +1 -0
  74. package/dist/utils/file/getFilenameFromResponse.d.ts +1 -0
  75. package/dist/utils/file/toBlobURL.d.ts +1 -0
  76. package/dist/utils/log.d.ts +7 -0
  77. package/dist/utils/math/calculateFitScale.d.ts +1 -0
  78. package/dist/utils/math/clampValue.d.ts +1 -0
  79. package/dist/utils/texture/createGradientTexture.d.ts +2 -0
  80. package/package.json +75 -0
@@ -0,0 +1,92 @@
1
+ import * as PIXI from 'pixi.js';
2
+ import { z } from 'zod';
3
+ export interface ClipStyleOptions {
4
+ clipId: string;
5
+ mediaDataId?: string;
6
+ alpha?: number;
7
+ rotation?: number;
8
+ position?: [number, number];
9
+ scale?: [number, number];
10
+ zIndex?: number;
11
+ width?: number;
12
+ height?: number;
13
+ }
14
+ export declare const schema: z.ZodObject<{
15
+ name: z.ZodString;
16
+ clipId: z.ZodString;
17
+ mediaDataId: z.ZodOptional<z.ZodString>;
18
+ alpha: z.ZodNumber;
19
+ rotation: z.ZodNumber;
20
+ position: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
21
+ scale: z.ZodTuple<[z.ZodNumber, z.ZodNumber], null>;
22
+ zIndex: z.ZodNumber;
23
+ width: z.ZodOptional<z.ZodNumber>;
24
+ height: z.ZodOptional<z.ZodNumber>;
25
+ }, "strip", z.ZodTypeAny, {
26
+ name: string;
27
+ clipId: string;
28
+ alpha: number;
29
+ rotation: number;
30
+ position: [number, number];
31
+ scale: [number, number];
32
+ zIndex: number;
33
+ mediaDataId?: string | undefined;
34
+ width?: number | undefined;
35
+ height?: number | undefined;
36
+ }, {
37
+ name: string;
38
+ clipId: string;
39
+ alpha: number;
40
+ rotation: number;
41
+ position: [number, number];
42
+ scale: [number, number];
43
+ zIndex: number;
44
+ mediaDataId?: string | undefined;
45
+ width?: number | undefined;
46
+ height?: number | undefined;
47
+ }>;
48
+ export declare class ClipStyle<T extends PIXI.Sprite = PIXI.Sprite> {
49
+ protected alpha: number;
50
+ protected rotation: number;
51
+ protected position: [number, number];
52
+ protected zIndex: number;
53
+ protected width: number;
54
+ protected height: number;
55
+ protected scale: [number, number];
56
+ protected sprite: T | null;
57
+ private clipId;
58
+ private mediaDataId;
59
+ constructor(options: ClipStyleOptions);
60
+ private positionToCenter;
61
+ private scaleDownToFit;
62
+ setScale(scaleX: number, scaleY: number): void;
63
+ getScale(): [number, number];
64
+ setWidth(width: number): void;
65
+ setHeight(height: number): void;
66
+ getWidth(): number;
67
+ getHeight(): number;
68
+ setAlpha(alpha: number): void;
69
+ getAlpha(): number;
70
+ setRotation(rotation: number): void;
71
+ getRotation(): number;
72
+ setPosition(x: number, y: number): void;
73
+ getPosition(): [number, number];
74
+ setZIndex(zIndex: number): void;
75
+ getZIndex(): number;
76
+ load(sprite: T): void;
77
+ update(sprite: T): void;
78
+ protected emitUpdateEvent(property: string, value: unknown): boolean;
79
+ serialize(): {
80
+ name: string;
81
+ clipId: string;
82
+ alpha: number;
83
+ rotation: number;
84
+ position: [number, number];
85
+ scale: [number, number];
86
+ zIndex: number;
87
+ mediaDataId?: string | undefined;
88
+ width?: number | undefined;
89
+ height?: number | undefined;
90
+ };
91
+ static deserialize(payload: object): ClipStyle<PIXI.Sprite>;
92
+ }
@@ -0,0 +1,36 @@
1
+ import { Clip, ClipOptions } from '../../Clip';
2
+ export interface AudioClipOptions extends ClipOptions {
3
+ mediaDataId: string;
4
+ }
5
+ export declare class AudioClip extends Clip {
6
+ audioElement: HTMLAudioElement;
7
+ isPlaying: boolean;
8
+ private actions;
9
+ private isProcessing;
10
+ private lastUpdateTime;
11
+ private lastStartTime;
12
+ private lastLeftTrim;
13
+ private lastRightTrim;
14
+ constructor(options: AudioClipOptions);
15
+ init(layerId: string): void;
16
+ private getGlobalTimeToClipTime;
17
+ getIsProcessing(): boolean;
18
+ preload(currentTime: number): void;
19
+ addActionToQueue(action: string, params?: object): void;
20
+ processNextQueue(): void;
21
+ private seekedCallback;
22
+ private playingCallback;
23
+ private pausedCallback;
24
+ private endedCallback;
25
+ private errorCallback;
26
+ private audioLoadedCallback;
27
+ private play;
28
+ private pause;
29
+ private seek;
30
+ onPlay(currentTime: number): Promise<void>;
31
+ onPause(currentTime: number): Promise<void>;
32
+ destroy(): void;
33
+ update(currentTime: number): void;
34
+ offload(): void;
35
+ clone(): Clip<import("pixi.js").Sprite, import("../../ClipStyle").ClipStyle<import("pixi.js").Sprite>>;
36
+ }
@@ -0,0 +1,27 @@
1
+ import * as PIXI from 'pixi.js';
2
+ import { Clip, ClipOptions } from '../../Clip';
3
+ import { ClipStyle } from '../../ClipStyle';
4
+ export interface GifClipOptions extends ClipOptions<ClipStyle> {
5
+ mediaDataId: string;
6
+ }
7
+ export declare class GifClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
8
+ private lastUpdateTime;
9
+ private lastStartTime;
10
+ private lastLeftTrim;
11
+ private lastRightTrim;
12
+ private gifAnimator;
13
+ constructor(options: GifClipOptions);
14
+ init(layerId: string): void;
15
+ private getGlobalTimeToClipTime;
16
+ preload(currentTime: number): void;
17
+ private play;
18
+ private pause;
19
+ private seek;
20
+ onPlay(currentTime: number): Promise<void>;
21
+ onPause(currentTime: number): Promise<void>;
22
+ updateVisibility(currentTime: number): void;
23
+ update(currentTime: number): void;
24
+ offload(): void;
25
+ clone(): Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>;
26
+ destroy(): void;
27
+ }
@@ -0,0 +1,16 @@
1
+ import * as PIXI from 'pixi.js';
2
+ import { Clip, ClipOptions } from '../../Clip';
3
+ import { ClipStyle } from '../../ClipStyle';
4
+ export interface ImageClipOptions extends ClipOptions<ClipStyle> {
5
+ mediaDataId: string;
6
+ }
7
+ export declare class ImageClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
8
+ constructor(options: ImageClipOptions);
9
+ init(layerId: string): void;
10
+ preload(currentTime: number): void;
11
+ updateVisibility(currentTime: number): void;
12
+ update(currentTime: number): void;
13
+ offload(): void;
14
+ clone(): Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>;
15
+ destroy(): void;
16
+ }
@@ -0,0 +1,4 @@
1
+ export * from './audio/AudioClip';
2
+ export * from './image/ImageClip';
3
+ export * from './video/VideoClip';
4
+ export * from './text/TextClip';
@@ -0,0 +1,43 @@
1
+ import { ShapeSprite } from './ShapeSprite';
2
+ import { ShapeStyle } from './ShapeStyle';
3
+ import { Clip, ClipOptions } from '../../Clip';
4
+ export interface ShapeClipOptions extends ClipOptions<ShapeStyle> {
5
+ shape: string;
6
+ }
7
+ export declare class ShapeClip extends Clip<ShapeSprite, ShapeStyle> {
8
+ shape: string;
9
+ constructor(options: ShapeClipOptions);
10
+ private initGraphics;
11
+ preload(currentTime: number): void;
12
+ updateVisibility(currentTime: number): void;
13
+ update(currentTime: number): void;
14
+ offload(): void;
15
+ clone(): ShapeClip;
16
+ destroy(): void;
17
+ serialize(): {
18
+ name: string;
19
+ type: string;
20
+ id: string;
21
+ shape: string;
22
+ duration: number;
23
+ filters: {
24
+ name: string;
25
+ options: {
26
+ lutUrl: string;
27
+ };
28
+ id: string;
29
+ sourceId: string;
30
+ }[];
31
+ effects: unknown[];
32
+ subtitlesOffset: number;
33
+ startTime: number;
34
+ leftTrim: number;
35
+ rightTrim: number;
36
+ warpMode: import("../../../..").WarmModeEnum;
37
+ text?: string | undefined;
38
+ style?: unknown;
39
+ mediaDataId?: string | undefined;
40
+ subtitlesId?: string | undefined;
41
+ };
42
+ static deserialize(payload: object): ShapeClip;
43
+ }
@@ -0,0 +1,9 @@
1
+ import * as PIXI from 'pixi.js';
2
+ export declare class ShapeSprite extends PIXI.Sprite {
3
+ graphics: PIXI.Graphics;
4
+ constructor();
5
+ drawRect(width: number, height: number, color: string): void;
6
+ drawCircle(width: number, height: number, color: string): void;
7
+ drawTriangle(width: number, height: number, color: string): void;
8
+ destroy(): void;
9
+ }
@@ -0,0 +1,27 @@
1
+ import { ShapeSprite } from './ShapeSprite';
2
+ import { ClipStyle, ClipStyleOptions } from '../../ClipStyle';
3
+ interface ShapeClipStyleOptions extends ClipStyleOptions {
4
+ color?: string;
5
+ }
6
+ export declare class ShapeStyle extends ClipStyle<ShapeSprite> {
7
+ color: string;
8
+ constructor(options: ShapeClipStyleOptions);
9
+ setColor(color: string): void;
10
+ getColor(): string;
11
+ update(container: ShapeSprite): void;
12
+ serialize(): {
13
+ name: string;
14
+ color: string;
15
+ clipId: string;
16
+ alpha: number;
17
+ rotation: number;
18
+ position: [number, number];
19
+ scale: [number, number];
20
+ zIndex: number;
21
+ width?: number | undefined;
22
+ height?: number | undefined;
23
+ mediaDataId?: string | undefined;
24
+ };
25
+ static deserialize(payload: object): ShapeStyle;
26
+ }
27
+ export {};
@@ -0,0 +1,42 @@
1
+ import { TextSprite } from './TextSprite';
2
+ import { TextStyle } from './TextStyle';
3
+ import { Clip, ClipOptions } from '../../Clip';
4
+ export interface TextClipOptions extends ClipOptions<TextStyle> {
5
+ text?: string;
6
+ }
7
+ export declare class TextClip extends Clip<TextSprite, TextStyle> {
8
+ text: string;
9
+ constructor(options: TextClipOptions);
10
+ getText(): string;
11
+ setText(text?: string): void;
12
+ seek(currentTime: number): void;
13
+ preload(currentTime: number): void;
14
+ update(currentTime: number): void;
15
+ offload(): void;
16
+ clone(): TextClip;
17
+ serialize(): {
18
+ name: string;
19
+ text: string;
20
+ type: string;
21
+ id: string;
22
+ duration: number;
23
+ filters: {
24
+ name: string;
25
+ options: {
26
+ lutUrl: string;
27
+ };
28
+ id: string;
29
+ sourceId: string;
30
+ }[];
31
+ effects: unknown[];
32
+ subtitlesOffset: number;
33
+ startTime: number;
34
+ leftTrim: number;
35
+ rightTrim: number;
36
+ warpMode: import('../../../../index').WarmModeEnum;
37
+ style?: unknown;
38
+ mediaDataId?: string | undefined;
39
+ subtitlesId?: string | undefined;
40
+ };
41
+ static deserialize(payload: object): TextClip;
42
+ }
@@ -0,0 +1,7 @@
1
+ import * as PIXI from 'pixi.js';
2
+ export declare class TextSprite extends PIXI.Sprite {
3
+ text: PIXI.Text;
4
+ background: PIXI.Sprite;
5
+ constructor();
6
+ setBackgroundColor(color: string | null): void;
7
+ }
@@ -0,0 +1,69 @@
1
+ import { z } from 'zod';
2
+ import { TextSprite } from './TextSprite';
3
+ 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>;
10
+ interface TextClipStyleOptions extends ClipStyleOptions {
11
+ fontSize?: number;
12
+ color?: string;
13
+ fontWeight?: TextStyleFontWeight;
14
+ fontFamily?: string;
15
+ textAlign?: TextStyleAlign;
16
+ fontStyle?: TextStyleFontStyle;
17
+ backgroundColor?: string | null;
18
+ wordWrapWidth?: number | null;
19
+ }
20
+ export declare class TextStyle extends ClipStyle<TextSprite> {
21
+ fontSize: number;
22
+ color: string;
23
+ fontWeight: TextStyleFontWeight;
24
+ fontFamily: string;
25
+ textAlign: TextStyleAlign;
26
+ fontStyle: TextStyleFontStyle;
27
+ backgroundColor: string | null;
28
+ wordWrapWidth: number | null;
29
+ constructor(options: TextClipStyleOptions);
30
+ setFontSize(fontSize: number): void;
31
+ getFontSize(): number;
32
+ getWordWrapWidth(): number | null;
33
+ setWordWrapWidth(wordWrapWidth: number | null): void;
34
+ setColor(color: string): void;
35
+ getColor(): string;
36
+ setFontWeight(fontWeight: TextStyleFontWeight): void;
37
+ getFontWeight(): "bold" | "normal" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
38
+ setFontFamily(fontFamily: string): void;
39
+ getFontFamily(): string;
40
+ setTextAlign(textAlign: TextStyleAlign): void;
41
+ getTextAlign(): "left" | "center" | "right" | "justify";
42
+ setFontStyle(fontStyle: TextStyleFontStyle): void;
43
+ getFontStyle(): "normal" | "italic" | "oblique";
44
+ setBackgroundColor(backgroundColor: string | null): void;
45
+ getBackgroundColor(): string | null;
46
+ setRotation(rotation: number): void;
47
+ update(container: TextSprite): void;
48
+ serialize(): {
49
+ name: string;
50
+ backgroundColor: string | null;
51
+ color: string;
52
+ clipId: string;
53
+ alpha: number;
54
+ rotation: number;
55
+ position: [number, number];
56
+ scale: [number, number];
57
+ zIndex: number;
58
+ fontSize: number;
59
+ fontWeight: "bold" | "normal" | "bolder" | "lighter" | "100" | "200" | "300" | "400" | "500" | "600" | "700" | "800" | "900";
60
+ fontFamily: string;
61
+ textAlign: "left" | "center" | "right" | "justify";
62
+ fontStyle: "normal" | "italic" | "oblique";
63
+ width?: number | undefined;
64
+ height?: number | undefined;
65
+ mediaDataId?: string | undefined;
66
+ };
67
+ static deserialize(payload: object): TextStyle;
68
+ }
69
+ export {};
@@ -0,0 +1,48 @@
1
+ import * as PIXI from 'pixi.js';
2
+ import { Clip, ClipOptions } from '../../Clip';
3
+ import { ClipStyle } from '../../ClipStyle';
4
+ export interface VideoClipOptions extends ClipOptions<ClipStyle> {
5
+ mediaDataId: string;
6
+ }
7
+ export declare class VideoClip extends Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>> {
8
+ videoElement: HTMLVideoElement;
9
+ audioElement: HTMLAudioElement | undefined;
10
+ isPlaying: boolean;
11
+ private actions;
12
+ private isProcessing;
13
+ private lastUpdateTime;
14
+ private lastStartTime;
15
+ private lastLeftTrim;
16
+ private lastRightTrim;
17
+ private decoder;
18
+ private frameQueue;
19
+ private isRendering;
20
+ constructor(options: VideoClipOptions);
21
+ init(layerId: string): void;
22
+ private getGlobalTimeToClipTime;
23
+ getIsProcessing(): boolean;
24
+ preload(currentTime: number): void;
25
+ addActionToQueue(action: string, params?: object): void;
26
+ processNextQueue(): void;
27
+ private seekedCallback;
28
+ private playingCallback;
29
+ private pausedCallback;
30
+ private endedCallback;
31
+ private errorCallback;
32
+ private videoLoadedCallback;
33
+ private play;
34
+ private pause;
35
+ private renderSeek;
36
+ private seek;
37
+ renderVideoFrameOutputCallback(frame: VideoFrame): void;
38
+ getNextRenderPacket(): Promise<void>;
39
+ searchRenderFrame(videoTime: number): Promise<VideoFrame | null>;
40
+ onRenderStart(): Promise<void>;
41
+ onRenderDone(canceled: boolean): Promise<void>;
42
+ onPlay(currentTime: number): Promise<void>;
43
+ onPause(currentTime: number): Promise<void>;
44
+ updateVisibility(currentTime: number): void;
45
+ update(currentTime: number): void;
46
+ offload(): void;
47
+ clone(): Clip<PIXI.Sprite, ClipStyle<PIXI.Sprite>>;
48
+ }
@@ -0,0 +1,2 @@
1
+ export * from './clips';
2
+ export * from './Clip';
@@ -0,0 +1 @@
1
+ export declare function generateRawData(width: number, height: number, randomize?: boolean): Uint8ClampedArray;
@@ -0,0 +1,42 @@
1
+ import { z } from 'zod';
2
+ import { PixiRenderer, PixiRendererInitOptions } from './renderer/PixiRenderer';
3
+ export declare const DisplaySchema: z.ZodObject<{
4
+ width: z.ZodNumber;
5
+ height: z.ZodNumber;
6
+ backgroundColor: z.ZodString;
7
+ }, "strip", z.ZodTypeAny, {
8
+ width: number;
9
+ backgroundColor: string;
10
+ height: number;
11
+ }, {
12
+ width: number;
13
+ backgroundColor: string;
14
+ height: number;
15
+ }>;
16
+ export type DisplayOptions = Partial<Omit<PixiRendererInitOptions, 'view'>>;
17
+ export declare class Display {
18
+ private width;
19
+ private height;
20
+ private backgroundColor;
21
+ renderer: PixiRenderer;
22
+ private static instance;
23
+ constructor(options: DisplayOptions);
24
+ static getInstance(options?: DisplayOptions): Display;
25
+ init(canvas: HTMLCanvasElement): void;
26
+ updateInstance(options: DisplayOptions): void;
27
+ getWidth(): number;
28
+ getHeight(): number;
29
+ getResolution(): [number, number];
30
+ getBackgroundColor(): string;
31
+ setBackgroundColor(color: string): void;
32
+ setResolution(width: number, height: number): void;
33
+ getClipIdByCursorPosition(cursorX: number, cursorY: number): string | null;
34
+ private hitTest;
35
+ destroy(): void;
36
+ serialize(): {
37
+ width: number;
38
+ backgroundColor: string;
39
+ height: number;
40
+ };
41
+ static deserialize(data: object): Display;
42
+ }
@@ -0,0 +1 @@
1
+ export * from './Display';
@@ -0,0 +1,16 @@
1
+ import * as PIXI from 'pixi.js';
2
+ export interface PixiRendererInitOptions {
3
+ width: number;
4
+ height: number;
5
+ backgroundColor: string;
6
+ view: HTMLCanvasElement;
7
+ }
8
+ export declare class PixiRenderer {
9
+ app: PIXI.Application | null;
10
+ stage: PIXI.Container | null;
11
+ constructor();
12
+ init(options: PixiRendererInitOptions): void;
13
+ render(): void;
14
+ resize(width: number, height: number): void;
15
+ destroy(): void;
16
+ }
@@ -0,0 +1,7 @@
1
+ import * as PIXI from 'pixi.js';
2
+ declare class WebCodecsVideoFrameResource extends PIXI.Resource {
3
+ private frame;
4
+ upload(renderer: PIXI.Renderer, baseTexture: PIXI.BaseTexture<PIXI.Resource, PIXI.IAutoDetectOptions>): boolean;
5
+ updateFrame(frame: VideoFrame): void;
6
+ }
7
+ export { WebCodecsVideoFrameResource };
@@ -0,0 +1,12 @@
1
+ import * as PIXI from 'pixi.js';
2
+ interface Point {
3
+ x: number;
4
+ y: number;
5
+ }
6
+ interface RegisterSelectionListeners {
7
+ onSelectionStart: (point: Point) => void;
8
+ onSelectionMove: (point: Point) => void;
9
+ onSelectionEnd: (clipIds: string[], point: Point) => void;
10
+ }
11
+ export declare function registerSelectionEvents(app: PIXI.Application, listeners: RegisterSelectionListeners): void;
12
+ export {};
@@ -0,0 +1,4 @@
1
+ import EventEmitter3 from 'eventemitter3';
2
+ import { EventEmitterValidEventTypes } from './types/EventEmitter.types';
3
+ export declare class EventEmitter extends EventEmitter3<EventEmitterValidEventTypes> {
4
+ }
@@ -0,0 +1,2 @@
1
+ export * from './EventEmitter';
2
+ export * from './types/EventEmitter.types';