import { BlendModeEnum, FadeCurveEnum, WrapModeEnum } from '../../types'; import { PropertyKeyframe } from "../animation/PropertyAnimator.types"; import { AnimationTypeEnum, ShapeBezierNode, ShapePoint } from "../clip"; import { ShapeTypeEnum } from "../clip/clips/shape/types/Shape.types"; import { TextBlock } from "../library"; import { HighlightAnimationEnum } from "../subtitles"; import { AnimationData } from '../../utils/animation/animation'; /** * Enumerates every undoable action currently emitted by the SDK. * * The enum value is the serialized action id persisted in undo stacks and used by the undo manager's dispatch logic. */ export declare enum UndoActionEnum { MEDIA_ADD = "media-add", MEDIA_REMOVE = "media-remove", MEDIA_REPLACE = "media-replace", LAYER_ADD = "layer-add", LAYER_REMOVE = "layer-remove", CLIP_ADD = "clip-add", CLIP_REMOVE = "clip-remove", CLIP_START_TIME = "clip-start-time", CLIP_RIGHT_TRIM = "clip-right-trim", CLIP_LEFT_TRIM = "clip-left-trim", CLIP_MOVE_TO_LAYER = "clip-move-to-layer", CLIP_SUBTITLES_SETTINGS = "clip-subtitles-settings", CLIP_ANIMATION_SET = "clip-animation-set", CLIP_ANIMATION_SET_DURATION = "clip-animation-set-duration", CLIP_ANIMATION_SET_LOOP_SMOOTHING = "clip-animation-set-loop-smoothing", CLIP_WRAP_MODE = "clip-wrap-mode", CLIP_BLEND_MODE = "clip-blend-mode", CLIP_MEDIA_VOLUME = "clip-media-volume", CLIP_MEDIA_MUTE = "clip-media-mute", CLIP_MEDIA_FADE_IN_DURATION = "clip-media-fade-in-volume", CLIP_MEDIA_FADE_OUT_DURATION = "clip-media-fade-out-volume", CLIP_MEDIA_FADE_IN_CURVE = "clip-media-fade-in-curve", CLIP_MEDIA_FADE_OUT_CURVE = "clip-media-fade-out-curve", CLIP_MEDIA_SPEED = "clip-media-speed", CLIP_MEDIA_PERSERVE_PITCH = "clip-media-pitch", CLIP_STYLE_POSITION = "clip-style-position", CLIP_STYLE_SCALE = "clip-style-scale", CLIP_STYLE_ROTATION = "clip-style-rotation", CLIP_STYLE_ALPHA = "clip-style-alpha", CLIP_STYLE_CORNER_RADIUS = "clip-style-corner-radius", CLIP_STYLE_CROP = "clip-style-crop", CLIP_TEXT_TEXT = "clip-text-text", CLIP_TEXT_COLOR = "clip-text-color", CLIP_TEXT_FONT_SIZE = "clip-text-font-size", CLIP_TEXT_FONT_WEIGHT = "clip-text-font-weight", CLIP_TEXT_FONT_FAMILY = "clip-text-font-family", CLIP_TEXT_TEXT_ALIGN = "clip-text-text-align", CLIP_TEXT_FONT_STYLE = "clip-text-font-style", CLIP_TEXT_BACKGROUND_COLOR = "clip-text-background-color", CLIP_TEXT_WORD_WRAP_WIDTH = "clip-text-word-wrap-width", CLIP_TEXT_STROKE_COLOR = "clip-text-stroke-color", CLIP_TEXT_STROKE_THICKNESS = "clip-text-stroke-thickness", CLIP_TEXT_PADDING = "clip-text-padding", CLIP_TEXT_LINE_HEIGHT = "clip-text-line-height", CLIP_TEXT_LETTER_SPACING = "clip-text-letter-spacing", CLIP_TEXT_DROP_SHADOW = "clip-text-drop-shadow", CLIP_TEXT_DROP_SHADOW_COLOR = "clip-text-drop-shadow-color", CLIP_TEXT_DROP_SHADOW_BLUR = "clip-text-drop-shadow-blur", CLIP_TEXT_DROP_SHADOW_ALPHA = "clip-text-drop-shadow-alpha", CLIP_TEXT_DROP_SHADOW_DISTANCE = "clip-text-drop-shadow-distance", CLIP_TEXT_DROP_SHADOW_ANGLE = "clip-text-drop-shadow-angle", CLIP_HTML_TEXT = "clip-html-text", CLIP_HTML_STYLE = "clip-html-style", CLIP_LOTTIE_PROPERTY = "clip-lottie-property", CLIP_SHAPE_SHAPE = "clip-shape-shape", CLIP_SHAPE_HAS_FILL = "clip-shape-has-fill", CLIP_SHAPE_FILL_COLOR = "clip-shape-fill-color", CLIP_SHAPE_STROKE_COLOR = "clip-shape-stroke-color", CLIP_SHAPE_STROKE_WIDTH = "clip-shape-stroke-width", CLIP_SHAPE_STROKE_ALPHA = "clip-shape-stroke-alpha", CLIP_SHAPE_RECT_RADIUS = "clip-shape-rect-radius", CLIP_SHAPE_NR_POINTS = "clip-shape-nr-points", CLIP_SHAPE_INNER_RADIUS = "clip-shape-inner-radius", CLIP_SHAPE_OUTER_RADIUS = "clip-shape-outer-radius", CLIP_SHAPE_POINTS = "clip-shape-points", CLIP_SHAPE_CONTROL_POINTS = "clip-shape-control-points", TRANSITION_ADD = "transition-add", TRANSITION_REMOVE = "transition-remove", TRANSITION_DURATION_IN = "transition-duration-in", TRANSITION_DURATION_OUT = "transition-duration-out", FILTER_ADD = "filter-add", FILTER_REMOVE = "filter-remove", FILTER_INTENSITY = "filter-intensity", EFFECT_ADD = "effect-add", EFFECT_REMOVE = "effect-remove", EFFECT_PROPERTY_CHANGE = "effect-property-changed", SUBTITLES_TEXT_MODE = "subtitles-text-mode", SUBTITLES_MAIN_TEXT_STYLE = "subtitles-main-text-style", SUBTITLES_HIGHLIGHT_TEXT_STYLE = "subtitles-highlighted-text-style", SUBTITLES_HIGHLIGHT_ANIMATION = "subtitles-highlight-animation", SUBTITLES_POSITION = "subtitles-position", SUBTITLES_SCALE = "subtitles-scale", LIBRARY_SUBTITLES_ADD = "library-subtitles-add", LIBRARY_SUBTITLES_REMOVE = "library-subtitles-remove", LIBRARY_SUBTITLES_ADD_BLOCK = "library-subtitles-add-block", LIBRARY_SUBTITLES_REMOVE_BLOCK = "library-subtitles-remove-block", LIBRARY_SUBTITLES_UPDATE_BLOCK = "library-subtitles-update-block", LIBRARY_SUBTITLES_SET_BLOCKS = "library-subtitles-set-blocks", KEYFRAME_ADD = "keyframe-add", KEYFRAME_REMOVE = "keyframe-remove", KEYFRAME_UPDATE = "keyframe-update", KEYFRAME_MOVE = "keyframe-move", KEYFRAME_TRACK_ADD = "keyframe-track-add", KEYFRAME_TRACK_REMOVE = "keyframe-track-remove", DISPLAY_BACKGROUND_COLOR = "display-background-color", DISPLAY_RESOLUTION = "display-resolution" } /** * Payload map describing the data shape carried by each undo action type. * * Consumers typically access this indirectly through undo manager helpers rather than indexing it manually. */ export type UndoActionMappings = { [UndoActionEnum.MEDIA_ADD]: { mediaDataId: string; }; [UndoActionEnum.MEDIA_REMOVE]: { mediaDataId: string; data: any; }; [UndoActionEnum.MEDIA_REPLACE]: { mediaDataId: string; prevMediaData: any; }; [UndoActionEnum.LAYER_ADD]: { layerId: string; }; [UndoActionEnum.LAYER_REMOVE]: { layerId: string; data: any; layerIndex: number; }; [UndoActionEnum.CLIP_ADD]: { clipId: string; }; [UndoActionEnum.CLIP_REMOVE]: { clipId: string; layerId: string; data: any; }; [UndoActionEnum.CLIP_START_TIME]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_RIGHT_TRIM]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_LEFT_TRIM]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_MOVE_TO_LAYER]: { clipId: string; fromLayerId: string; toLayerId: string; }; [UndoActionEnum.CLIP_SUBTITLES_SETTINGS]: { clipId: string; prevSubtitlesId: string | undefined; prevOffset: number; subtitlesId: string | undefined; offset: number; }; [UndoActionEnum.CLIP_WRAP_MODE]: { clipId: string; wrapMode: WrapModeEnum; }; [UndoActionEnum.CLIP_BLEND_MODE]: { clipId: string; blendMode: BlendModeEnum; }; [UndoActionEnum.CLIP_MEDIA_VOLUME]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_MEDIA_MUTE]: { clipId: string; value: boolean; }; [UndoActionEnum.CLIP_MEDIA_FADE_IN_DURATION]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_MEDIA_FADE_OUT_DURATION]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_MEDIA_FADE_IN_CURVE]: { clipId: string; value: FadeCurveEnum; }; [UndoActionEnum.CLIP_MEDIA_FADE_OUT_CURVE]: { clipId: string; value: FadeCurveEnum; }; [UndoActionEnum.CLIP_MEDIA_SPEED]: { clipId: string; value: number; startTime: number; leftTrim: number; rightTrim: number; }; [UndoActionEnum.CLIP_MEDIA_PERSERVE_PITCH]: { clipId: string; value: boolean; }; [UndoActionEnum.CLIP_STYLE_POSITION]: { clipId: string; value: [number, number]; }; [UndoActionEnum.CLIP_STYLE_SCALE]: { clipId: string; value: [number, number]; }; [UndoActionEnum.CLIP_STYLE_ROTATION]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_STYLE_ALPHA]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_STYLE_CORNER_RADIUS]: { clipId: string; cornerRadius: number[]; relative: boolean; }; [UndoActionEnum.CLIP_STYLE_CROP]: { clipId: string; value: number[]; }; [UndoActionEnum.CLIP_TEXT_TEXT]: { clipId: string; prevText: string; text: string; }; [UndoActionEnum.CLIP_TEXT_COLOR]: { clipId: string; prevColor: string; color: string; }; [UndoActionEnum.CLIP_TEXT_FONT_SIZE]: { clipId: string; prevFontSize: number; fontSize: number; }; [UndoActionEnum.CLIP_TEXT_FONT_WEIGHT]: { clipId: string; prevFontWeight: string; fontWeight: string; }; [UndoActionEnum.CLIP_TEXT_FONT_FAMILY]: { clipId: string; prevFontFamily: string; fontFamily: string; }; [UndoActionEnum.CLIP_TEXT_TEXT_ALIGN]: { clipId: string; prevTextAlign: string; textAlign: string; }; [UndoActionEnum.CLIP_TEXT_FONT_STYLE]: { clipId: string; prevFontStyle: string; fontStyle: string; }; [UndoActionEnum.CLIP_TEXT_BACKGROUND_COLOR]: { clipId: string; prevBackgroundColor: string | null; backgroundColor: string | null; }; [UndoActionEnum.CLIP_TEXT_WORD_WRAP_WIDTH]: { clipId: string; prevWordWrapWidth: number | null; wordWrapWidth: number | null; }; [UndoActionEnum.CLIP_TEXT_STROKE_COLOR]: { clipId: string; prevStrokeColor: string; strokeColor: string; }; [UndoActionEnum.CLIP_TEXT_STROKE_THICKNESS]: { clipId: string; prevStrokeThickness: number; strokeThickness: number; }; [UndoActionEnum.CLIP_TEXT_PADDING]: { clipId: string; prevPadding: number | number[]; padding: number | number[]; }; [UndoActionEnum.CLIP_TEXT_LINE_HEIGHT]: { clipId: string; prevLineHeight: number; lineHeight: number; }; [UndoActionEnum.CLIP_TEXT_LETTER_SPACING]: { clipId: string; prevLetterSpacing: number; letterSpacing: number; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW]: { clipId: string; prevDropShadow: boolean; dropShadow: boolean; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW_ALPHA]: { clipId: string; prevDropShadowAlpha: number; dropShadowAlpha: number; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW_ANGLE]: { clipId: string; prevDropShadowAngle: number; dropShadowAngle: number; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW_BLUR]: { clipId: string; prevDropShadowBlur: number; dropShadowBlur: number; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW_COLOR]: { clipId: string; prevDropShadowColor: string; dropShadowColor: string; }; [UndoActionEnum.CLIP_TEXT_DROP_SHADOW_DISTANCE]: { clipId: string; prevDropShadowDistance: number; dropShadowDistance: number; }; [UndoActionEnum.CLIP_HTML_TEXT]: { clipId: string; prevText: string; text: string; }; [UndoActionEnum.CLIP_HTML_STYLE]: { clipId: string; prevStyle: any; style: any; }; [UndoActionEnum.CLIP_LOTTIE_PROPERTY]: { clipId: string; property: string; prevValue: any; value: any; }; [UndoActionEnum.CLIP_SHAPE_SHAPE]: { clipId: string; value: ShapeTypeEnum; }; [UndoActionEnum.CLIP_SHAPE_HAS_FILL]: { clipId: string; value: boolean; }; [UndoActionEnum.CLIP_SHAPE_FILL_COLOR]: { clipId: string; value: string; }; [UndoActionEnum.CLIP_SHAPE_STROKE_COLOR]: { clipId: string; value: string; }; [UndoActionEnum.CLIP_SHAPE_STROKE_WIDTH]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_STROKE_ALPHA]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_RECT_RADIUS]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_NR_POINTS]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_INNER_RADIUS]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_OUTER_RADIUS]: { clipId: string; value: number; }; [UndoActionEnum.CLIP_SHAPE_POINTS]: { clipId: string; value: (ShapePoint | null)[]; }; [UndoActionEnum.CLIP_SHAPE_CONTROL_POINTS]: { clipId: string; value: (ShapeBezierNode | null)[]; }; [UndoActionEnum.CLIP_ANIMATION_SET]: { clipId: string; animationData: AnimationData | undefined; duration: number; type: AnimationTypeEnum; }; [UndoActionEnum.CLIP_ANIMATION_SET_DURATION]: { clipId: string; type: AnimationTypeEnum; duration: number; }; [UndoActionEnum.CLIP_ANIMATION_SET_LOOP_SMOOTHING]: { clipId: string; smoothing: number; }; [UndoActionEnum.TRANSITION_ADD]: { layerId: string; transition: any; prevTransitions: any[]; }; [UndoActionEnum.TRANSITION_REMOVE]: { layerId: string; transition: any; }; [UndoActionEnum.TRANSITION_DURATION_IN]: { layerId: string; id: string; value: number; }; [UndoActionEnum.TRANSITION_DURATION_OUT]: { layerId: string; id: string; value: number; }; [UndoActionEnum.FILTER_ADD]: { clipId: string; filter: any; prevFilters: any[]; }; [UndoActionEnum.FILTER_REMOVE]: { clipId: string; filter: any; }; [UndoActionEnum.FILTER_INTENSITY]: { clipId: string; id: string; value: number; }; [UndoActionEnum.EFFECT_ADD]: { clipId: string; effect: any; prevEffects: any[]; }; [UndoActionEnum.EFFECT_REMOVE]: { clipId: string; effect: any; }; [UndoActionEnum.EFFECT_PROPERTY_CHANGE]: { clipId: string; id: string; property: string; value: any; }; [UndoActionEnum.SUBTITLES_TEXT_MODE]: { prevTextMode: string; textMode: string; }; [UndoActionEnum.SUBTITLES_MAIN_TEXT_STYLE]: { prevMainTextStyle: any; mainTextStyle: any; }; [UndoActionEnum.SUBTITLES_HIGHLIGHT_TEXT_STYLE]: { prevHighlightTextStyle: any; highlightTextStyle: any; }; [UndoActionEnum.SUBTITLES_HIGHLIGHT_ANIMATION]: { prevAnimation: HighlightAnimationEnum; prevSpeed: number; animation: HighlightAnimationEnum; speed: number; }; [UndoActionEnum.SUBTITLES_POSITION]: { prevPosition: number[]; position: number[]; }; [UndoActionEnum.SUBTITLES_SCALE]: { prevScale: number; scale: number; }; [UndoActionEnum.LIBRARY_SUBTITLES_ADD]: { subtitlesId: string; }; [UndoActionEnum.LIBRARY_SUBTITLES_REMOVE]: { subtitlesId: string; subtitles: any; }; [UndoActionEnum.LIBRARY_SUBTITLES_ADD_BLOCK]: { subtitlesId: string; index: number; }; [UndoActionEnum.LIBRARY_SUBTITLES_REMOVE_BLOCK]: { subtitlesId: string; index: number; textBlock: TextBlock; }; [UndoActionEnum.LIBRARY_SUBTITLES_UPDATE_BLOCK]: { subtitlesId: string; index: number; prevTextBlock: TextBlock; }; [UndoActionEnum.LIBRARY_SUBTITLES_SET_BLOCKS]: { subtitlesId: string; prevTextBlocks: TextBlock[]; }; [UndoActionEnum.KEYFRAME_ADD]: { clipId: string; property: string; keyframe: PropertyKeyframe; }; [UndoActionEnum.KEYFRAME_REMOVE]: { clipId: string; property: string; keyframe: PropertyKeyframe; }; [UndoActionEnum.KEYFRAME_UPDATE]: { clipId: string; property: string; time: number; prev: Partial; next: Partial; }; [UndoActionEnum.KEYFRAME_MOVE]: { clipId: string; property: string; oldTime: number; newTime: number; }; [UndoActionEnum.KEYFRAME_TRACK_ADD]: { clipId: string; property: string; }; [UndoActionEnum.KEYFRAME_TRACK_REMOVE]: { clipId: string; property: string; keyframes: PropertyKeyframe[]; }; [UndoActionEnum.DISPLAY_BACKGROUND_COLOR]: { prevBackgroundColor: string; backgroundColor: string; }; [UndoActionEnum.DISPLAY_RESOLUTION]: { prevResolution: [number, number]; resolution: [number, number]; }; }; /** * Single undo stack record containing an action identifier and its payload. */ export declare class UndoRecord { action: UndoActionEnum; data: any; /** * Creates an undo record. * * @param action Undo action identifier. * @param data Serialized payload associated with the action. */ constructor(action: UndoActionEnum, data: any); } /** * Named collection of undo records that should be undone/redone as one logical operation. */ export declare class UndoGroup { records: UndoRecord[]; name: string; /** * Creates an undo group container. * * @param name Human-readable label describing the grouped operation. */ constructor(name: string); }