@shotstack/shotstack-studio 1.4.0 → 1.4.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 (53) hide show
  1. package/dist/{src/core/schemas/edit.d.ts → index.d.ts} +5030 -4061
  2. package/package.json +4 -3
  3. package/dist/src/components/canvas/index.d.ts +0 -14
  4. package/dist/src/components/canvas/players/audio-player.d.ts +0 -17
  5. package/dist/src/components/canvas/players/html-player.d.ts +0 -17
  6. package/dist/src/components/canvas/players/image-player.d.ts +0 -15
  7. package/dist/src/components/canvas/players/luma-player.d.ts +0 -18
  8. package/dist/src/components/canvas/players/player.d.ts +0 -76
  9. package/dist/src/components/canvas/players/shape-player.d.ts +0 -15
  10. package/dist/src/components/canvas/players/text-player.d.ts +0 -19
  11. package/dist/src/components/canvas/players/video-player.d.ts +0 -22
  12. package/dist/src/components/canvas/shotstack-canvas.d.ts +0 -25
  13. package/dist/src/components/canvas/system/inspector.d.ts +0 -18
  14. package/dist/src/components/canvas/text/text-cursor.d.ts +0 -47
  15. package/dist/src/components/canvas/text/text-editor.d.ts +0 -43
  16. package/dist/src/components/canvas/text/text-input-handler.d.ts +0 -54
  17. package/dist/src/core/animations/curve-interpolator.d.ts +0 -6
  18. package/dist/src/core/animations/effect-preset-builder.d.ts +0 -18
  19. package/dist/src/core/animations/keyframe-builder.d.ts +0 -12
  20. package/dist/src/core/animations/transition-preset-builder.d.ts +0 -20
  21. package/dist/src/core/commands/add-clip-command.d.ts +0 -14
  22. package/dist/src/core/commands/add-track-command.d.ts +0 -8
  23. package/dist/src/core/commands/delete-clip-command.d.ts +0 -10
  24. package/dist/src/core/commands/delete-track-command.d.ts +0 -9
  25. package/dist/src/core/commands/set-updated-clip-command.d.ts +0 -17
  26. package/dist/src/core/commands/types.d.ts +0 -25
  27. package/dist/src/core/commands/update-text-content-command.d.ts +0 -16
  28. package/dist/src/core/edit.d.ts +0 -52
  29. package/dist/src/core/events/asset-load-tracker.d.ts +0 -16
  30. package/dist/src/core/events/event-emitter.d.ts +0 -10
  31. package/dist/src/core/export/video-exporter.d.ts +0 -17
  32. package/dist/src/core/inputs/controls.d.ts +0 -11
  33. package/dist/src/core/inputs/pointer.d.ts +0 -4
  34. package/dist/src/core/layouts/geometry.d.ts +0 -8
  35. package/dist/src/core/layouts/position-builder.d.ts +0 -8
  36. package/dist/src/core/loaders/asset-loader.d.ts +0 -17
  37. package/dist/src/core/loaders/audio-load-parser.d.ts +0 -11
  38. package/dist/src/core/loaders/font-load-parser.d.ts +0 -13
  39. package/dist/src/core/schemas/asset.d.ts +0 -648
  40. package/dist/src/core/schemas/audio-asset.d.ts +0 -82
  41. package/dist/src/core/schemas/clip.d.ts +0 -1185
  42. package/dist/src/core/schemas/html-asset.d.ts +0 -27
  43. package/dist/src/core/schemas/image-asset.d.ts +0 -57
  44. package/dist/src/core/schemas/keyframe.d.ts +0 -26
  45. package/dist/src/core/schemas/luma-asset.d.ts +0 -13
  46. package/dist/src/core/schemas/shape-asset.d.ts +0 -199
  47. package/dist/src/core/schemas/text-asset.d.ts +0 -155
  48. package/dist/src/core/schemas/track.d.ts +0 -1491
  49. package/dist/src/core/schemas/video-asset.d.ts +0 -126
  50. package/dist/src/core/shared/entity.d.ts +0 -5
  51. package/dist/src/index.d.ts +0 -4
  52. package/dist/src/main.d.ts +0 -1
  53. package/dist/vite.config.d.ts +0 -2
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "cpuccino",
6
6
  "dazzatron"
7
7
  ],
8
- "version": "1.4.0",
8
+ "version": "1.4.1",
9
9
  "description": "A video editing library for creating and editing videos with Shotstack",
10
10
  "type": "module",
11
11
  "main": "dist/shotstack-studio.umd.js",
@@ -28,7 +28,7 @@
28
28
  "url": "https://github.com/shotstack/shotstack-studio-sdk"
29
29
  },
30
30
  "scripts": {
31
- "build": "vite build && tsc --emitDeclarationOnly",
31
+ "build": "vite build",
32
32
  "prepublishOnly": "npm run build"
33
33
  },
34
34
  "peerDependencies": {
@@ -46,7 +46,8 @@
46
46
  "eslint-config-prettier": "^9.1.0",
47
47
  "eslint-plugin-import": "^2.31.0",
48
48
  "typescript": "^5.6.2",
49
- "vite": "^5.4.10"
49
+ "vite": "^5.4.10",
50
+ "vite-plugin-dts": "^4.5.4"
50
51
  },
51
52
  "dependencies": {
52
53
  "howler": "^2.2.4",
@@ -1,14 +0,0 @@
1
- export { Entity } from "@core/shared/entity";
2
- export { Player } from "./players/player";
3
- export { AudioPlayer } from "./players/audio-player";
4
- export { HtmlPlayer } from "./players/html-player";
5
- export { ImagePlayer } from "./players/image-player";
6
- export { LumaPlayer } from "./players/luma-player";
7
- export { ShapePlayer } from "./players/shape-player";
8
- export { TextPlayer } from "./players/text-player";
9
- export { VideoPlayer } from "./players/video-player";
10
- export { TextCursor } from "./text/text-cursor";
11
- export { TextEditor } from "./text/text-editor";
12
- export { TextInputHandler } from "./text/text-input-handler";
13
- export { Edit } from "@core/edit";
14
- export { Inspector } from "./system/inspector";
@@ -1,17 +0,0 @@
1
- import type { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import { Player } from "./player";
5
- export declare class AudioPlayer extends Player {
6
- private audioResource;
7
- private isPlaying;
8
- private volumeKeyframeBuilder;
9
- private syncTimer;
10
- constructor(edit: Edit, clipConfiguration: Clip);
11
- load(): Promise<void>;
12
- update(deltaTime: number, elapsed: number): void;
13
- draw(): void;
14
- dispose(): void;
15
- getSize(): Size;
16
- getVolume(): number;
17
- }
@@ -1,17 +0,0 @@
1
- import { type Size } from "@layouts/geometry";
2
- import { type Clip } from "@schemas/clip";
3
- import type { Edit } from "core/edit";
4
- import { Player } from "./player";
5
- export declare class HtmlPlayer extends Player {
6
- private background;
7
- private text;
8
- constructor(timeline: Edit, clipConfiguration: Clip);
9
- load(): Promise<void>;
10
- update(deltaTime: number, elapsed: number): void;
11
- draw(): void;
12
- dispose(): void;
13
- getSize(): Size;
14
- protected getFitScale(): number;
15
- private parseDocument;
16
- private parseAlignment;
17
- }
@@ -1,15 +0,0 @@
1
- import type { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import { Player } from "./player";
5
- export declare class ImagePlayer extends Player {
6
- private texture;
7
- private sprite;
8
- constructor(timeline: Edit, clipConfiguration: Clip);
9
- load(): Promise<void>;
10
- update(deltaTime: number, elapsed: number): void;
11
- draw(): void;
12
- dispose(): void;
13
- getSize(): Size;
14
- private createCroppedTexture;
15
- }
@@ -1,18 +0,0 @@
1
- import type { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import * as pixi from "pixi.js";
5
- import { Player } from "./player";
6
- export declare class LumaPlayer extends Player {
7
- private texture;
8
- private sprite;
9
- private isPlaying;
10
- constructor(edit: Edit, clipConfiguration: Clip);
11
- load(): Promise<void>;
12
- update(deltaTime: number, elapsed: number): void;
13
- draw(): void;
14
- dispose(): void;
15
- getSize(): Size;
16
- getVolume(): number;
17
- getMask(): pixi.Sprite | null;
18
- }
@@ -1,76 +0,0 @@
1
- import { type Edit } from "@core/edit";
2
- import { type Size, type Vector } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import { Entity } from "../../../core/shared/entity";
5
- /**
6
- * TODO: Move handles on UI level (screen space)
7
- * TODO: Handle overlapping frames - ex: length of a clip is 1.5s but there's an in (1s) and out (1s) transition
8
- * TODO: Scale X and Y needs to be implemented separately for getFitScale cover
9
- * TODO: Move animation effects and transitions out of player
10
- * TODO: On pointer down and custom keyframe, add a keyframe at the current time. Get current and time and push a keyframe into the state, and then reconfigure the keyframes.
11
- * TODO: Move bounding box to a separate entity
12
- */
13
- export declare abstract class Player extends Entity {
14
- private static readonly SnapThreshold;
15
- private static readonly DiscardedFrameCount;
16
- private static readonly ScaleHandleRadius;
17
- private static readonly RotationHandleRadius;
18
- private static readonly RotationHandleOffset;
19
- private static readonly OutlineWidth;
20
- private static readonly MinScale;
21
- private static readonly MaxScale;
22
- layer: number;
23
- shouldDispose: boolean;
24
- protected edit: Edit;
25
- clipConfiguration: Clip;
26
- private positionBuilder;
27
- private offsetXKeyframeBuilder?;
28
- private offsetYKeyframeBuilder?;
29
- private scaleKeyframeBuilder?;
30
- private opacityKeyframeBuilder?;
31
- private rotationKeyframeBuilder?;
32
- private outline;
33
- private topLeftScaleHandle;
34
- private topRightScaleHandle;
35
- private bottomLeftScaleHandle;
36
- private bottomRightScaleHandle;
37
- private rotationHandle;
38
- private isHovering;
39
- private isDragging;
40
- private dragOffset;
41
- private scaleDirection;
42
- private scaleStart;
43
- private scaleOffset;
44
- private isRotating;
45
- private rotationStart;
46
- private rotationOffset;
47
- private initialClipConfiguration;
48
- constructor(edit: Edit, clipConfiguration: Clip);
49
- reconfigureAfterRestore(): void;
50
- protected configureKeyframes(): void;
51
- load(): Promise<void>;
52
- update(_: number, __: number): void;
53
- draw(): void;
54
- dispose(): void;
55
- getStart(): number;
56
- getLength(): number;
57
- getEnd(): number;
58
- getPlaybackTime(): number;
59
- abstract getSize(): Size;
60
- getOpacity(): number;
61
- getPosition(): Vector;
62
- getPivot(): Vector;
63
- protected getFitScale(): number;
64
- getScale(): number;
65
- getRotation(): number;
66
- isActive(): boolean;
67
- shouldDiscardFrame(): boolean;
68
- private onPointerStart;
69
- private onPointerMove;
70
- private onPointerUp;
71
- private onPointerOver;
72
- private onPointerOut;
73
- private clipHasPresets;
74
- private clipHasKeyframes;
75
- private hasStateChanged;
76
- }
@@ -1,15 +0,0 @@
1
- import type { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import { Player } from "./player";
5
- export declare class ShapePlayer extends Player {
6
- private shape;
7
- private shapeBackground;
8
- constructor(timeline: Edit, clipConfiguration: Clip);
9
- load(): Promise<void>;
10
- update(deltaTime: number, elapsed: number): void;
11
- draw(): void;
12
- dispose(): void;
13
- getSize(): Size;
14
- protected getFitScale(): number;
15
- }
@@ -1,19 +0,0 @@
1
- import { Player } from "@canvas/players/player";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- /**
5
- * TextPlayer renders and manages editable text elements in the canvas
6
- */
7
- export declare class TextPlayer extends Player {
8
- private background;
9
- private text;
10
- private textEditor;
11
- load(): Promise<void>;
12
- update(deltaTime: number, elapsed: number): void;
13
- dispose(): void;
14
- getSize(): Size;
15
- protected getFitScale(): number;
16
- private createTextStyle;
17
- private positionText;
18
- updateTextContent(newText: string, initialConfig: Clip): void;
19
- }
@@ -1,22 +0,0 @@
1
- import type { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- import { type Clip } from "@schemas/clip";
4
- import { Player } from "./player";
5
- export declare class VideoPlayer extends Player {
6
- private texture;
7
- private sprite;
8
- private isPlaying;
9
- private volumeKeyframeBuilder;
10
- private syncTimer;
11
- constructor(edit: Edit, clipConfiguration: Clip);
12
- /**
13
- * TODO: Add support for .mov and .webm files
14
- */
15
- load(): Promise<void>;
16
- update(deltaTime: number, elapsed: number): void;
17
- draw(): void;
18
- dispose(): void;
19
- getSize(): Size;
20
- getVolume(): number;
21
- private createCroppedTexture;
22
- }
@@ -1,25 +0,0 @@
1
- import { Edit } from "@core/edit";
2
- import { type Size } from "@layouts/geometry";
3
- export declare class Canvas {
4
- private static extensionsRegistered;
5
- private readonly size;
6
- private readonly edit;
7
- private readonly inspector;
8
- private container?;
9
- private background?;
10
- private minZoom;
11
- private maxZoom;
12
- private currentZoom;
13
- constructor(size: Size, edit: Edit);
14
- load(): Promise<void>;
15
- private setupTouchHandling;
16
- centerEdit(): void;
17
- zoomToFit(): void;
18
- setZoom(zoom: number): void;
19
- private registerExtensions;
20
- private configureApplication;
21
- private onTick;
22
- private configureStage;
23
- private onClick;
24
- dispose(): void;
25
- }
@@ -1,18 +0,0 @@
1
- import { Entity } from "@core/shared/entity";
2
- export declare class Inspector extends Entity {
3
- private static readonly Width;
4
- private static readonly Height;
5
- fps: number;
6
- playbackTime: number;
7
- playbackDuration: number;
8
- isPlaying: boolean;
9
- private background;
10
- private text;
11
- constructor();
12
- load(): Promise<void>;
13
- update(_: number, __: number): void;
14
- draw(): void;
15
- dispose(): void;
16
- private getMemoryInfo;
17
- private bytesToMegabytes;
18
- }
@@ -1,47 +0,0 @@
1
- import { type Clip } from "@schemas/clip";
2
- import * as pixi from "pixi.js";
3
- type TextCursorOptions = {
4
- width?: number;
5
- color?: number;
6
- blinkInterval?: number;
7
- };
8
- export declare class TextCursor {
9
- private static readonly DEFAULT_BLINK_INTERVAL_MS;
10
- private static readonly DEFAULT_CURSOR_WIDTH_PX;
11
- private static readonly DEFAULT_CURSOR_COLOR;
12
- private cursor;
13
- private parent;
14
- private textElement;
15
- private clipConfig;
16
- private textPosition;
17
- private pixelX;
18
- private pixelY;
19
- private currentLine;
20
- private isBlinking;
21
- private blinkInterval;
22
- private blinkIntervalMs;
23
- private width;
24
- private color;
25
- private isVisible;
26
- constructor(parent: pixi.Container, textElement: pixi.Text, clipConfig: Clip, options?: TextCursorOptions);
27
- updatePosition(textPosition: number): void;
28
- setPosition(x: number, y: number): void;
29
- show(): void;
30
- hide(): void;
31
- setVisible(visible: boolean): void;
32
- startBlinking(): void;
33
- stopBlinking(): void;
34
- setBlinkInterval(intervalMs: number): void;
35
- dispose(): void;
36
- private createCursor;
37
- private validateTextPosition;
38
- private calculateAndApplyPixelPosition;
39
- private calculatePixelPositionFromText;
40
- private updateGraphicsPosition;
41
- private startBlinkingAnimation;
42
- private stopBlinkingAnimation;
43
- private measureText;
44
- isInitialized(): boolean;
45
- getState(): object;
46
- }
47
- export {};
@@ -1,43 +0,0 @@
1
- import type { TextPlayer } from "@canvas/players/text-player";
2
- import { type Clip } from "@schemas/clip";
3
- import * as pixi from "pixi.js";
4
- export declare enum HorizontalAlignment {
5
- LEFT = "left",
6
- CENTER = "center",
7
- RIGHT = "right"
8
- }
9
- export declare enum VerticalAlignment {
10
- TOP = "top",
11
- CENTER = "center",
12
- BOTTOM = "bottom"
13
- }
14
- export declare class TextEditor {
15
- private static readonly DOUBLE_CLICK_THRESHOLD_MS;
16
- private static readonly EDITING_BG_PADDING_PX;
17
- private static readonly EDITING_BG_ALPHA;
18
- private static readonly CLICK_HANDLER_DELAY_MS;
19
- private parent;
20
- private targetText;
21
- private clipConfig;
22
- private isEditing;
23
- private lastClickTime;
24
- private editingContainer;
25
- private editableText;
26
- private textCursor;
27
- private textInputHandler;
28
- private outsideClickHandler;
29
- constructor(parent: TextPlayer, targetText: pixi.Text, clipConfig: Clip);
30
- dispose(): void;
31
- private startEditing;
32
- private stopEditing;
33
- private checkForDoubleClick;
34
- private setupOutsideClickHandler;
35
- private createEditingEnvironment;
36
- private setupEditingContainer;
37
- private setupTextInputHandler;
38
- private updateTextAlignment;
39
- private calculateHorizontalPosition;
40
- private calculateVerticalPosition;
41
- private getContainerDimensions;
42
- private getAlignmentSettings;
43
- }
@@ -1,54 +0,0 @@
1
- type TextInputHandlerOptions = {
2
- initialText?: string;
3
- autoFocus?: boolean;
4
- focusDelay?: number;
5
- };
6
- type TextChangeCallback = (text: string, cursorPosition: number) => void;
7
- type KeyboardEventHandlers = {
8
- onTextInput?: TextChangeCallback;
9
- onCursorMove?: (direction: "left" | "right" | "up" | "down", event: KeyboardEvent) => void;
10
- onEnter?: (event: KeyboardEvent) => void;
11
- onEscape?: (event: KeyboardEvent) => void;
12
- onDelete?: (type: "backspace" | "delete", event: KeyboardEvent) => void;
13
- onFocus?: (event: FocusEvent) => void;
14
- onBlur?: (event: FocusEvent) => void;
15
- onTabNavigation?: (direction: "forward" | "backward") => void;
16
- onCustomKey?: (key: string, event: KeyboardEvent) => boolean;
17
- };
18
- export declare class TextInputHandler {
19
- private static readonly DEFAULT_FOCUS_DELAY_MS;
20
- private hiddenInput;
21
- private isFocused;
22
- private focusRetryCount;
23
- private maxFocusRetries;
24
- private focusDelay;
25
- private eventHandlers;
26
- private abortController;
27
- private textChangeCallback;
28
- private lastSyncedText;
29
- private isComposing;
30
- setupInput(initialText: string, options?: TextInputHandlerOptions): void;
31
- updateInputValue(text: string): void;
32
- focusInput(): void;
33
- blurInput(): void;
34
- setSelectionRange(start: number, end: number): void;
35
- getCursorPosition(): number;
36
- getValue(): string;
37
- setTextInputHandler(callback: TextChangeCallback): void;
38
- setEventHandlers(handlers: Partial<KeyboardEventHandlers>): void;
39
- isFocusedInput(): boolean;
40
- dispose(): void;
41
- private createHiddenTextarea;
42
- private setupEventListeners;
43
- private removeAllEventListeners;
44
- private handleTextInput;
45
- private handleKeyDown;
46
- private handleKeyboardShortcuts;
47
- private handleCompositionStart;
48
- private handleCompositionEnd;
49
- private handleFocus;
50
- private handleBlur;
51
- private handlePaste;
52
- private selectAll;
53
- }
54
- export {};
@@ -1,6 +0,0 @@
1
- export declare class CurveInterpolator {
2
- private curves;
3
- constructor();
4
- private initializeCurves;
5
- getValue(from: number, to: number, progress: number, easing?: string): number;
6
- }
@@ -1,18 +0,0 @@
1
- import { type Size } from "../layouts/geometry";
2
- import { type Clip } from "../schemas/clip";
3
- import { type Keyframe } from "../schemas/keyframe";
4
- export type EffectKeyframeSet = {
5
- offsetXKeyframes: Keyframe[];
6
- offsetYKeyframes: Keyframe[];
7
- opacityKeyframes: Keyframe[];
8
- scaleKeyframes: Keyframe[];
9
- rotationKeyframes: Keyframe[];
10
- };
11
- export declare class EffectPresetBuilder {
12
- private clipConfiguration;
13
- constructor(clipConfiguration: Clip);
14
- build(editSize: Size, clipSize: Size): EffectKeyframeSet;
15
- private getPresetName;
16
- private getZoomSpeed;
17
- private getSlideStart;
18
- }
@@ -1,12 +0,0 @@
1
- import { type Keyframe } from "../schemas/keyframe";
2
- export declare class KeyframeBuilder {
3
- private readonly property;
4
- private readonly length;
5
- private readonly cubicBuilder;
6
- constructor(value: Keyframe[] | number, length: number, initialValue?: number);
7
- getValue(time: number): number;
8
- private createKeyframes;
9
- private createNormalizedKeyframes;
10
- private validateKeyframes;
11
- private insertFillerKeyframes;
12
- }
@@ -1,20 +0,0 @@
1
- import { type Clip } from "../schemas/clip";
2
- import { type Keyframe } from "../schemas/keyframe";
3
- export type TransitionKeyframeSet = {
4
- offsetXKeyframes: Keyframe[];
5
- offsetYKeyframes: Keyframe[];
6
- opacityKeyframes: Keyframe[];
7
- scaleKeyframes: Keyframe[];
8
- rotationKeyframes: Keyframe[];
9
- };
10
- export declare class TransitionPresetBuilder {
11
- private clipConfiguration;
12
- constructor(clipConfiguration: Clip);
13
- build(): TransitionKeyframeSet;
14
- private buildInPreset;
15
- private buildOutPreset;
16
- private getInPresetName;
17
- private getOutPresetName;
18
- private getInPresetLength;
19
- private getOutPresetLength;
20
- }
@@ -1,14 +0,0 @@
1
- import { ClipSchema } from "@schemas/clip";
2
- import type { z } from "zod";
3
- import type { EditCommand, CommandContext } from "./types";
4
- type ClipType = z.infer<typeof ClipSchema>;
5
- export declare class AddClipCommand implements EditCommand {
6
- private trackIdx;
7
- private clip;
8
- name: string;
9
- private addedPlayer?;
10
- constructor(trackIdx: number, clip: ClipType);
11
- execute(context?: CommandContext): Promise<void>;
12
- undo(context?: CommandContext): Promise<void>;
13
- }
14
- export {};
@@ -1,8 +0,0 @@
1
- import type { EditCommand, CommandContext } from "./types";
2
- export declare class AddTrackCommand implements EditCommand {
3
- private trackIdx;
4
- name: string;
5
- constructor(trackIdx: number);
6
- execute(context?: CommandContext): void;
7
- undo(context?: CommandContext): void;
8
- }
@@ -1,10 +0,0 @@
1
- import type { EditCommand, CommandContext } from "./types";
2
- export declare class DeleteClipCommand implements EditCommand {
3
- private trackIdx;
4
- private clipIdx;
5
- name: string;
6
- private deletedClip?;
7
- constructor(trackIdx: number, clipIdx: number);
8
- execute(context?: CommandContext): void;
9
- undo(context?: CommandContext): void;
10
- }
@@ -1,9 +0,0 @@
1
- import type { EditCommand, CommandContext } from "./types";
2
- export declare class DeleteTrackCommand implements EditCommand {
3
- private trackIdx;
4
- name: string;
5
- private deletedClips;
6
- constructor(trackIdx: number);
7
- execute(context?: CommandContext): void;
8
- undo(context?: CommandContext): Promise<void>;
9
- }
@@ -1,17 +0,0 @@
1
- import type { Player } from "@canvas/players/player";
2
- import { ClipSchema } from "@schemas/clip";
3
- import { z } from "zod";
4
- import type { EditCommand, CommandContext } from "./types";
5
- type ClipType = z.infer<typeof ClipSchema>;
6
- export declare class SetUpdatedClipCommand implements EditCommand {
7
- private clip;
8
- private initialClipConfig;
9
- private finalClipConfig;
10
- name: string;
11
- private storedInitialConfig;
12
- private storedFinalConfig;
13
- constructor(clip: Player, initialClipConfig: ClipType | null, finalClipConfig: ClipType | null);
14
- execute(context?: CommandContext): void;
15
- undo(context?: CommandContext): void;
16
- }
17
- export {};
@@ -1,25 +0,0 @@
1
- import type { Player } from "@canvas/players/player";
2
- import type { ClipSchema } from "@schemas/clip";
3
- import type { Container } from "pixi.js";
4
- import type { z } from "zod";
5
- type ClipType = z.infer<typeof ClipSchema>;
6
- export type EditCommand = {
7
- execute(context?: CommandContext): void | Promise<void>;
8
- undo?(context?: CommandContext): void | Promise<void>;
9
- readonly name: string;
10
- };
11
- export type CommandContext = {
12
- getClips(): Player[];
13
- getTracks(): Player[][];
14
- getContainer(): Container;
15
- addPlayer(trackIdx: number, player: Player): Promise<void>;
16
- createPlayerFromAssetType(clipConfiguration: ClipType): Player;
17
- queueDisposeClip(player: Player): void;
18
- disposeClips(): void;
19
- undeleteClip(trackIdx: number, clip: Player): void;
20
- setUpdatedClip(clip: Player): void;
21
- restoreClipConfiguration(clip: Player, previousConfig: ClipType): void;
22
- updateDuration(): void;
23
- emitEvent(name: string, data: unknown): void;
24
- };
25
- export {};
@@ -1,16 +0,0 @@
1
- import type { Player } from "@canvas/players/player";
2
- import type { ClipSchema } from "@schemas/clip";
3
- import type { z } from "zod";
4
- import type { EditCommand, CommandContext } from "./types";
5
- type ClipType = z.infer<typeof ClipSchema>;
6
- export declare class UpdateTextContentCommand implements EditCommand {
7
- private clip;
8
- private newText;
9
- private initialConfig;
10
- name: string;
11
- private previousText;
12
- constructor(clip: Player, newText: string, initialConfig: ClipType);
13
- execute(context?: CommandContext): void;
14
- undo(context?: CommandContext): void;
15
- }
16
- export {};
@@ -1,52 +0,0 @@
1
- import { EventEmitter } from "@core/events/event-emitter";
2
- import { Entity } from "@core/shared/entity";
3
- import type { Size } from "@layouts/geometry";
4
- import { AssetLoader } from "@loaders/asset-loader";
5
- import { ClipSchema } from "@schemas/clip";
6
- import { EditSchema } from "@schemas/edit";
7
- import { TrackSchema } from "@schemas/track";
8
- import { z } from "zod";
9
- type EditType = z.infer<typeof EditSchema>;
10
- type ClipType = z.infer<typeof ClipSchema>;
11
- type TrackType = z.infer<typeof TrackSchema>;
12
- export declare class Edit extends Entity {
13
- private static readonly ZIndexPadding;
14
- assetLoader: AssetLoader;
15
- events: EventEmitter;
16
- private edit;
17
- private tracks;
18
- private clipsToDispose;
19
- private clips;
20
- private commandHistory;
21
- private commandIndex;
22
- playbackTime: number;
23
- totalDuration: number;
24
- constructor(size: Size, backgroundColor?: string);
25
- load(): Promise<void>;
26
- play(): void;
27
- pause(): void;
28
- seek(target: number): void;
29
- stop(): void;
30
- loadEdit(edit: EditType): Promise<void>;
31
- getEdit(): EditType;
32
- addClip(trackIdx: number, clip: ClipType): void;
33
- getClip(trackIdx: number, clipIdx: number): ClipType | null;
34
- deleteClip(trackIdx: number, clipIdx: number): void;
35
- addTrack(trackIdx: number, track: TrackType): void;
36
- getTrack(trackIdx: number): TrackType | null;
37
- deleteTrack(trackIdx: number): void;
38
- getTotalDuration(): number;
39
- undo(): void;
40
- redo(): void;
41
- private executeCommand;
42
- private createCommandContext;
43
- private queueDisposeClip;
44
- protected disposeClips(): void;
45
- private disposeClip;
46
- private unloadClipAssets;
47
- protected clearClips(): void;
48
- private updateTotalDuration;
49
- private createPlayerFromAssetType;
50
- private addPlayer;
51
- }
52
- export {};