@codingfactory/mediables-vue 2.8.0 → 2.9.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.
- package/dist/PixiFrameExporter-DGTn9-uZ.cjs +2 -0
- package/dist/{PixiFrameExporter-CqKXaoCX.cjs.map → PixiFrameExporter-DGTn9-uZ.cjs.map} +1 -1
- package/dist/{PixiFrameExporter-BcywK0MP.js → PixiFrameExporter-qCsqARff.js} +60 -59
- package/dist/{PixiFrameExporter-BcywK0MP.js.map → PixiFrameExporter-qCsqARff.js.map} +1 -1
- package/dist/components/video/ui-v2/AssetRail.vue.d.ts +2 -0
- package/dist/components/video/ui-v2/AssetRailItem.vue.d.ts +7 -0
- package/dist/components/video/ui-v2/AudioMixerPanel.vue.d.ts +33 -0
- package/dist/components/video/ui-v2/CaptionSrtPanel.vue.d.ts +9 -0
- package/dist/components/video/ui-v2/DesktopInspectorSections.vue.d.ts +21 -0
- package/dist/components/video/ui-v2/DraftRecoveryBanner.vue.d.ts +12 -0
- package/dist/components/video/ui-v2/KeyframePresetPanel.vue.d.ts +26 -0
- package/dist/components/video/ui-v2/MobileClipSummary.vue.d.ts +4 -0
- package/dist/components/video/ui-v2/MobileToolPicker.vue.d.ts +3 -0
- package/dist/components/video/ui-v2/SplitPanelLayout.vue.d.ts +9 -5
- package/dist/components/video/ui-v2/TimelineTrackHeader.vue.d.ts +2 -0
- package/dist/composables/useClientVideoExport.d.ts +27 -0
- package/dist/composables/useLiveStream.d.ts +2 -2
- package/dist/composables/useRadialMenu.d.ts +1 -1
- package/dist/composables/useVideoEditor.d.ts +119 -7
- package/dist/composables/useVideoFilters.d.ts +4 -4
- package/dist/index-B8iY-eYF.js +33011 -0
- package/dist/index-B8iY-eYF.js.map +1 -0
- package/dist/index-EmUdY4EL.cjs +350 -0
- package/dist/index-EmUdY4EL.cjs.map +1 -0
- package/dist/mediables-vue.cjs +1 -1
- package/dist/mediables-vue.mjs +1 -1
- package/dist/render-page/assets/{index-y90zwXpc.js → index-jZGmiMRr.js} +991 -151
- package/dist/render-page/index.html +1 -1
- package/dist/services/VideoJobClient.d.ts +1 -1
- package/dist/style.css +1 -1
- package/dist/types/api.d.ts +14 -0
- package/dist/types/video.d.ts +164 -5
- package/dist/video/project/audioMixerSchema.d.ts +152 -0
- package/dist/video/project/captionSrt.d.ts +23 -0
- package/dist/video/project/draftRecovery.d.ts +86 -0
- package/dist/video/project/exportPresets.d.ts +172 -0
- package/dist/video/project/index.d.ts +22 -0
- package/dist/video/project/keyframeAutomation.d.ts +91 -0
- package/dist/video/project/mediaSourceAnalysis.d.ts +127 -0
- package/dist/video/project/mediaSourceCache.d.ts +47 -0
- package/dist/video/project/recipeMigration.d.ts +26 -0
- package/dist/video/project/timelineSelection.d.ts +23 -0
- package/dist/video/project/timelineTransactions.d.ts +129 -0
- package/dist/video/project/visualLayerSchema.d.ts +238 -0
- package/dist/video-engine/adapters/AudioManager.d.ts +9 -0
- package/dist/video-engine/adapters/MediablesCompositionAdapter.d.ts +3 -0
- package/dist/video-engine/adapters/TextOverlayManager.d.ts +4 -2
- package/package.json +1 -1
- package/dist/PixiFrameExporter-CqKXaoCX.cjs +0 -2
- package/dist/index-DNo3Kr1t.cjs +0 -342
- package/dist/index-DNo3Kr1t.cjs.map +0 -1
- package/dist/index-DpkdpuMs.js +0 -29327
- package/dist/index-DpkdpuMs.js.map +0 -1
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import type { VideoRecipe } from '@/types/video';
|
|
2
|
+
type VideoRecipeOutput = VideoRecipe['output'];
|
|
3
|
+
export declare const EXPORT_PRESET_IDS: readonly ["mobile-share", "hd-web", "original", "server-master"];
|
|
4
|
+
export type ExportPresetId = typeof EXPORT_PRESET_IDS[number];
|
|
5
|
+
export type ExportRoutePreference = 'client' | 'server' | 'auto';
|
|
6
|
+
export type ExportResolvedRoute = 'client' | 'server';
|
|
7
|
+
export type ExportPresetAdvancedVisibility = 'standard' | 'advanced' | 'hidden';
|
|
8
|
+
export type ExportDeviceKind = 'mobile' | 'desktop';
|
|
9
|
+
export interface ExportEndpointAvailability {
|
|
10
|
+
client: boolean;
|
|
11
|
+
server: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ExportPresetRouteContext {
|
|
14
|
+
durationSeconds: number;
|
|
15
|
+
endpoints: ExportEndpointAvailability;
|
|
16
|
+
}
|
|
17
|
+
export interface ExportPresetRecommendationContext extends ExportPresetRouteContext {
|
|
18
|
+
device: ExportDeviceKind;
|
|
19
|
+
includeAdvanced?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface ExportPresetSettings {
|
|
22
|
+
format: VideoRecipeOutput['format'];
|
|
23
|
+
codec: VideoRecipeOutput['codec'];
|
|
24
|
+
quality: VideoRecipeOutput['quality'];
|
|
25
|
+
fps: VideoRecipeOutput['fps'];
|
|
26
|
+
bitrate?: NonNullable<VideoRecipeOutput['bitrate']>;
|
|
27
|
+
routePreference: ExportRoutePreference;
|
|
28
|
+
maxClientDurationSeconds: number | null;
|
|
29
|
+
mobileSuitable: boolean;
|
|
30
|
+
advancedVisibility: ExportPresetAdvancedVisibility;
|
|
31
|
+
}
|
|
32
|
+
export interface ExportPreset {
|
|
33
|
+
id: ExportPresetId;
|
|
34
|
+
label: string;
|
|
35
|
+
description: string;
|
|
36
|
+
settings: ExportPresetSettings;
|
|
37
|
+
}
|
|
38
|
+
export type ExportPresetReference = ExportPresetId | ExportPreset;
|
|
39
|
+
export declare const EXPORT_PRESETS: readonly [{
|
|
40
|
+
readonly id: "mobile-share";
|
|
41
|
+
readonly label: "Mobile share";
|
|
42
|
+
readonly description: "Fast H.264 MP4 export for short social clips and mobile uploads.";
|
|
43
|
+
readonly settings: {
|
|
44
|
+
readonly format: "mp4";
|
|
45
|
+
readonly codec: "h264";
|
|
46
|
+
readonly quality: "720p";
|
|
47
|
+
readonly fps: 30;
|
|
48
|
+
readonly bitrate: 4500000;
|
|
49
|
+
readonly routePreference: "client";
|
|
50
|
+
readonly maxClientDurationSeconds: 90;
|
|
51
|
+
readonly mobileSuitable: true;
|
|
52
|
+
readonly advancedVisibility: "standard";
|
|
53
|
+
};
|
|
54
|
+
}, {
|
|
55
|
+
readonly id: "hd-web";
|
|
56
|
+
readonly label: "HD web";
|
|
57
|
+
readonly description: "Balanced 1080p H.264 MP4 export for web playback.";
|
|
58
|
+
readonly settings: {
|
|
59
|
+
readonly format: "mp4";
|
|
60
|
+
readonly codec: "h264";
|
|
61
|
+
readonly quality: "1080p";
|
|
62
|
+
readonly fps: 30;
|
|
63
|
+
readonly bitrate: 8000000;
|
|
64
|
+
readonly routePreference: "auto";
|
|
65
|
+
readonly maxClientDurationSeconds: 180;
|
|
66
|
+
readonly mobileSuitable: true;
|
|
67
|
+
readonly advancedVisibility: "standard";
|
|
68
|
+
};
|
|
69
|
+
}, {
|
|
70
|
+
readonly id: "original";
|
|
71
|
+
readonly label: "Original";
|
|
72
|
+
readonly description: "Server-rendered MP4 export that preserves the editor output quality target.";
|
|
73
|
+
readonly settings: {
|
|
74
|
+
readonly format: "mp4";
|
|
75
|
+
readonly codec: "h264";
|
|
76
|
+
readonly quality: "1080p";
|
|
77
|
+
readonly fps: 30;
|
|
78
|
+
readonly routePreference: "server";
|
|
79
|
+
readonly maxClientDurationSeconds: null;
|
|
80
|
+
readonly mobileSuitable: false;
|
|
81
|
+
readonly advancedVisibility: "standard";
|
|
82
|
+
};
|
|
83
|
+
}, {
|
|
84
|
+
readonly id: "server-master";
|
|
85
|
+
readonly label: "Server master";
|
|
86
|
+
readonly description: "High-bitrate master render for archival and downstream transcodes.";
|
|
87
|
+
readonly settings: {
|
|
88
|
+
readonly format: "mov";
|
|
89
|
+
readonly codec: "h265";
|
|
90
|
+
readonly quality: "2160p";
|
|
91
|
+
readonly fps: 60;
|
|
92
|
+
readonly bitrate: 32000000;
|
|
93
|
+
readonly routePreference: "server";
|
|
94
|
+
readonly maxClientDurationSeconds: null;
|
|
95
|
+
readonly mobileSuitable: false;
|
|
96
|
+
readonly advancedVisibility: "advanced";
|
|
97
|
+
};
|
|
98
|
+
}];
|
|
99
|
+
export declare const EXPORT_PRESETS_BY_ID: {
|
|
100
|
+
readonly 'mobile-share': {
|
|
101
|
+
readonly id: "mobile-share";
|
|
102
|
+
readonly label: "Mobile share";
|
|
103
|
+
readonly description: "Fast H.264 MP4 export for short social clips and mobile uploads.";
|
|
104
|
+
readonly settings: {
|
|
105
|
+
readonly format: "mp4";
|
|
106
|
+
readonly codec: "h264";
|
|
107
|
+
readonly quality: "720p";
|
|
108
|
+
readonly fps: 30;
|
|
109
|
+
readonly bitrate: 4500000;
|
|
110
|
+
readonly routePreference: "client";
|
|
111
|
+
readonly maxClientDurationSeconds: 90;
|
|
112
|
+
readonly mobileSuitable: true;
|
|
113
|
+
readonly advancedVisibility: "standard";
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
readonly 'hd-web': {
|
|
117
|
+
readonly id: "hd-web";
|
|
118
|
+
readonly label: "HD web";
|
|
119
|
+
readonly description: "Balanced 1080p H.264 MP4 export for web playback.";
|
|
120
|
+
readonly settings: {
|
|
121
|
+
readonly format: "mp4";
|
|
122
|
+
readonly codec: "h264";
|
|
123
|
+
readonly quality: "1080p";
|
|
124
|
+
readonly fps: 30;
|
|
125
|
+
readonly bitrate: 8000000;
|
|
126
|
+
readonly routePreference: "auto";
|
|
127
|
+
readonly maxClientDurationSeconds: 180;
|
|
128
|
+
readonly mobileSuitable: true;
|
|
129
|
+
readonly advancedVisibility: "standard";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
readonly original: {
|
|
133
|
+
readonly id: "original";
|
|
134
|
+
readonly label: "Original";
|
|
135
|
+
readonly description: "Server-rendered MP4 export that preserves the editor output quality target.";
|
|
136
|
+
readonly settings: {
|
|
137
|
+
readonly format: "mp4";
|
|
138
|
+
readonly codec: "h264";
|
|
139
|
+
readonly quality: "1080p";
|
|
140
|
+
readonly fps: 30;
|
|
141
|
+
readonly routePreference: "server";
|
|
142
|
+
readonly maxClientDurationSeconds: null;
|
|
143
|
+
readonly mobileSuitable: false;
|
|
144
|
+
readonly advancedVisibility: "standard";
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
readonly 'server-master': {
|
|
148
|
+
readonly id: "server-master";
|
|
149
|
+
readonly label: "Server master";
|
|
150
|
+
readonly description: "High-bitrate master render for archival and downstream transcodes.";
|
|
151
|
+
readonly settings: {
|
|
152
|
+
readonly format: "mov";
|
|
153
|
+
readonly codec: "h265";
|
|
154
|
+
readonly quality: "2160p";
|
|
155
|
+
readonly fps: 60;
|
|
156
|
+
readonly bitrate: 32000000;
|
|
157
|
+
readonly routePreference: "server";
|
|
158
|
+
readonly maxClientDurationSeconds: null;
|
|
159
|
+
readonly mobileSuitable: false;
|
|
160
|
+
readonly advancedVisibility: "advanced";
|
|
161
|
+
};
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
export declare function resolveExportPreset(preset: ExportPresetReference): ExportPreset;
|
|
165
|
+
export declare function exportPresetToVideoOutput(preset: ExportPresetReference): VideoRecipeOutput;
|
|
166
|
+
export declare function isExportPresetMobileSafe(preset: ExportPresetReference): boolean;
|
|
167
|
+
export declare function filterMobileSafeExportPresets(presets?: readonly ExportPreset[]): ExportPreset[];
|
|
168
|
+
export declare function isExportPresetClientDurationSafe(preset: ExportPresetReference, durationSeconds: number): boolean;
|
|
169
|
+
export declare function resolveExportRouteForPreset(preset: ExportPresetReference, context: ExportPresetRouteContext): ExportResolvedRoute | null;
|
|
170
|
+
export declare function isExportPresetAvailable(preset: ExportPresetReference, context: ExportPresetRouteContext): boolean;
|
|
171
|
+
export declare function chooseRecommendedExportPreset(context: ExportPresetRecommendationContext): ExportPreset | null;
|
|
172
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { DEFAULT_MEDIA_SOURCE_ID, DEFAULT_VIDEO_TRACK_ID, flattenProjectToVideoRecipe, migrateVideoRecipeToProject, } from './recipeMigration';
|
|
2
|
+
export type { NormalizedVideoProject, } from './recipeMigration';
|
|
3
|
+
export { beginTimelineTransaction, cancelTimelineTransaction, commitTimelineTransaction, createTimelineActionCoalesceKey, createTimelineActionRecord, createTimelineClipTimingMetadata, createTimelineInverseAction, createTimelineTransactionHistory, redoTimelineTransaction, recordTimelineTransactionAction, undoTimelineTransaction, } from './timelineTransactions';
|
|
4
|
+
export type { BeginTimelineTransactionOptions, CancelTimelineTransactionResult, CommitTimelineTransactionOptions, CommitTimelineTransactionResult, RecordTimelineActionOptions, TimelineActionInverseMetadata, TimelineClipTimingChangeMetadata, TimelineClipTimingMetadata, TimelineDeleteInverseMetadata, TimelineDuplicateInverseMetadata, TimelineGeneratedInverseAction, TimelineHistoryEntry, TimelineMetadataRequiredAction, TimelineMoveInverseMetadata, TimelineSpeedInverseMetadata, TimelineSplitInverseMetadata, TimelineStackMoveResult, TimelineTransaction, TimelineTransactionActionRecord, TimelineTransactionHistory, TimelineTransactionalEditAction, TimelineTransactionOperation, TimelineTrimInverseMetadata, } from './timelineTransactions';
|
|
5
|
+
export { clearTimelineSelection, createTimelineSelectionState, getPrimaryTimelineSelectedClipId, getTimelineClipSelectionStatus, getTimelineSelectedClipIds, getTimelineSelectionAnchorId, isTimelineClipPrimarySelected, isTimelineClipSelected, selectTimelineClip, } from './timelineSelection';
|
|
6
|
+
export type { SelectTimelineClipOptions, TimelineClipSelectionStatus, TimelineSelectionMode, TimelineSelectionState, } from './timelineSelection';
|
|
7
|
+
export { MEDIA_SOURCE_CACHE_SCHEMA_VERSION, createFilmstripCacheDescriptor, createMediaSourceCacheDescriptor, createProjectDraftCacheDescriptor, createWaveformCacheDescriptor, getMediaSourceCacheInputMissingFields, hasCompleteMediaSourceCacheInputs, hasMediaSourceCacheLocator, isMediaSourceCacheDescriptor, } from './mediaSourceCache';
|
|
8
|
+
export type { MediaSourceCacheDescriptor, MediaSourceCacheDescriptorOptions, MediaSourceCacheInputField, MediaSourceCacheInvalidationInputs, MediaSourceCacheKind, MediaSourceCacheLocatorKind, MediaSourceRevisionMetadata, } from './mediaSourceCache';
|
|
9
|
+
export { MEDIA_SOURCE_ANALYSIS_SCHEMA_VERSION, MediaSourceAnalysisValidationError, chooseBestWaveformResolution, createMediaSourceAnalysisCacheKey, normalizeFilmstripFrames, normalizeWaveformSamples, validateFilmstripFrames, validateWaveformSamples, } from './mediaSourceAnalysis';
|
|
10
|
+
export type { BaseMediaSourceAnalysisDescriptor, ChooseWaveformResolutionOptions, CreateMediaSourceAnalysisCacheKeyInput, FilmstripAnalysisDescriptor, FilmstripFrameReference, FilmstripFrameReferenceInput, MediaSourceAnalysisCacheInvalidationInput, MediaSourceAnalysisCacheKey, MediaSourceAnalysisCacheMetadataInput, MediaSourceAnalysisCacheSourceInput, MediaSourceAnalysisCacheVariantInput, MediaSourceAnalysisDescriptor, MediaSourceAnalysisKind, MediaSourceAnalysisValidationCode, MediaSourceAnalysisValidationIssue, WaveformAnalysisDescriptor, WaveformChannel, WaveformPeakRmsSample, WaveformPeakRmsSampleInput, WaveformResolutionDescriptor, } from './mediaSourceAnalysis';
|
|
11
|
+
export { DEFAULT_VIDEO_PROJECT_DRAFT_STORAGE_PREFIX, VIDEO_PROJECT_DRAFT_SNAPSHOT_SCHEMA_VERSION, chooseLatestRestorableVideoProjectDraftSnapshot, createVideoProjectDraftSnapshot, createVideoProjectDraftStorageKey, getRestorableVideoProjectDraftSnapshotRecords, isVideoProjectDraftSnapshotRestorable, loadVideoProjectDraftSnapshotRecords, parseStoredVideoProjectDraftSnapshot, parseStoredVideoProjectDraftSnapshotRecords, removeVideoProjectDraftSnapshotRecords, rotateStoredVideoProjectDraftSnapshots, rotateVideoProjectDraftSnapshots, saveVideoProjectDraftSnapshot, selectRestorableVideoProjectDraftsForSurface, serializeVideoProjectDraftSnapshot, } from './draftRecovery';
|
|
12
|
+
export type { CreateVideoProjectDraftSnapshotOptions, StoredVideoProjectDraftSnapshotEntry, VideoProjectDraftDeviceKind, VideoProjectDraftPayload, VideoProjectDraftPayloadKind, VideoProjectDraftRecoveryOptions, VideoProjectDraftRecoverySurface, VideoProjectDraftSaveReason, VideoProjectDraftSnapshot, VideoProjectDraftSnapshotMetadata, VideoProjectDraftSnapshotRecord, VideoProjectDraftSnapshotRotationOptions, VideoProjectDraftSnapshotRotationResult, VideoProjectDraftSnapshotStorageAdapter, VideoProjectDraftStorageResult, VideoProjectDraftTimestampInput, } from './draftRecovery';
|
|
13
|
+
export { AUDIO_MIXER_FADER_MAX_DB, AUDIO_MIXER_FADER_MIN_DB, AUDIO_MIXER_MASTER_BUS_ID, AUDIO_MIXER_MAX_EFFECT_SLOT_COUNT, AUDIO_MIXER_METER_CEILING_DB, AUDIO_MIXER_METER_FLOOR_DB, AUDIO_MIXER_SCHEMA_VERSION, AUDIO_MIXER_UNITY_DB, DEFAULT_AUDIO_MIXER_EFFECT_SLOT_COUNT, clampFaderDb, clampPanValue, computeEffectiveMuteSoloState, createAudioMixerFader, createAudioMixerMeter, createAudioMixerPan, createDefaultAudioMixerCapabilities, createEmptyAudioMixerEffectSlot, dbToLinearVolume, getAudioMixerCapabilitiesForDevice, linearVolumeToDb, normalizeMixerStateFromLegacyAudioTracks, } from './audioMixerSchema';
|
|
14
|
+
export type { AudioMixerCapabilityFlags, AudioMixerCapabilityMatrix, AudioMixerDeviceClass, AudioMixerEffectKind, AudioMixerEffectParameterValue, AudioMixerEffectParameters, AudioMixerEffectSlot, AudioMixerFader, AudioMixerMasterBus, AudioMixerMeterMode, AudioMixerMeterSnapshot, AudioMixerPan, AudioMixerPanMode, AudioMixerSchemaVersion, AudioMixerState, AudioMixerTimelinePlacement, AudioMixerTrack, AudioMixerTrackControls, AudioMixerTrackKind, AudioMixerTrackSource, EffectiveAudioMixerTrackState, LegacyAudioTrackMixerInput, LegacyMasterAudioMixerInput, NormalizeAudioMixerStateOptions, } from './audioMixerSchema';
|
|
15
|
+
export { EXPORT_PRESET_IDS, EXPORT_PRESETS, EXPORT_PRESETS_BY_ID, chooseRecommendedExportPreset, exportPresetToVideoOutput, filterMobileSafeExportPresets, isExportPresetAvailable, isExportPresetClientDurationSafe, isExportPresetMobileSafe, resolveExportPreset, resolveExportRouteForPreset, } from './exportPresets';
|
|
16
|
+
export type { ExportDeviceKind, ExportEndpointAvailability, ExportPreset, ExportPresetAdvancedVisibility, ExportPresetId, ExportPresetRecommendationContext, ExportPresetReference, ExportPresetRouteContext, ExportPresetSettings, ExportResolvedRoute, ExportRoutePreference, } from './exportPresets';
|
|
17
|
+
export { CaptionSrtError, exportCaptionSrt, formatSrtTimestamp, parseCaptionSrt, validateCaptionSrtCues, } from './captionSrt';
|
|
18
|
+
export type { CaptionSrtCue, CaptionSrtErrorCode, CaptionSrtErrorContext, ParseCaptionSrtOptions, } from './captionSrt';
|
|
19
|
+
export { KEYFRAME_AUTOMATION_TARGETS, KEYFRAME_EASINGS, KEYFRAME_PRESET_IDS, KEYFRAME_TARGET_VALUE_RANGES, KeyframeAutomationError, applyKeyframeEasing, createFadeInKeyframePreset, createFadeOutKeyframePreset, createKeyframePreset, createZoomInKeyframePreset, getKeyframeAutomationCapabilities, interpolateKeyframeValue, isKeyframeAutomationTarget, isKeyframeEasing, normalizeKeyframes, sampleKeyframeValue, sortKeyframes, validateKeyframes, } from './keyframeAutomation';
|
|
20
|
+
export type { CreateKeyframePresetOptions, CreateOpacityKeyframePresetOptions, CreateScaleKeyframePresetOptions, KeyframeAutomationCapabilities, KeyframeAutomationEditingMode, KeyframeAutomationPlatform, KeyframeAutomationPoint, KeyframeAutomationPreset, KeyframeAutomationTarget, KeyframeEasing as KeyframeAutomationEasing, KeyframePresetId, KeyframePresetTimingOptions, KeyframeValidationCode, KeyframeValidationIssue, KeyframeValidationOptions, KeyframeValidationResult, KeyframeValueRange, SampleKeyframeValueOptions, } from './keyframeAutomation';
|
|
21
|
+
export { DEFAULT_LAYER_TRANSFORM, DEFAULT_MOBILE_VISUAL_CAPABILITIES, DEFAULT_RICH_TEXT_STYLE, DEFAULT_VISUAL_FEATURE_CAPABILITIES, VisualLayerSchemaError, normalizeCaptionTrack, normalizeLayerKeyframes, normalizeTransitionWindow, normalizeVisualLayer, validateTransitionWindowsDoNotOverlap, } from './visualLayerSchema';
|
|
22
|
+
export type { AdjustmentLayerInput, AdjustmentLayerRecipe, BaseVisualLayerRecipe, BlendMode, CaptionAnimationPreset, CaptionLayerInput, CaptionLayerRecipe, CaptionSegmentRecipe, CaptionSource, CaptionStylePreset, CaptionTrackInput, CaptionTrackRecipe, CaptionWordRecipe, EasingType, ImageLayerInput, ImageLayerRecipe, KeyframeEasing, KeyframeTargetProperty, LayerPoint, LayerTransform, MobileVisualCapabilityFlags, NormalizedTransitionWindow, RichTextStyle, SchemaValidationErrorCode, ShapeLayerInput, ShapeLayerRecipe, StickerLayerInput, StickerLayerRecipe, SvgLayerInput, SvgLayerRecipe, TextAlign, TextLayerInput, TextLayerRecipe, TextWrapMode, TransitionClipBoundary, TransitionParams, TransitionRecipe, TransitionType, VerticalAlign, VisualFeatureCapabilityMatrix, VisualLayerDefaultKey, VisualLayerInput, VisualLayerKeyframe, VisualLayerRecipe, VisualLayerType, } from './visualLayerSchema';
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
export declare const KEYFRAME_AUTOMATION_TARGETS: readonly ["opacity", "scale", "x", "y", "rotation", "audioVolume"];
|
|
2
|
+
export declare const KEYFRAME_EASINGS: readonly ["linear", "ease-in", "ease-out", "ease-in-out"];
|
|
3
|
+
export declare const KEYFRAME_PRESET_IDS: readonly ["fade-in", "fade-out", "zoom-in"];
|
|
4
|
+
export type KeyframeAutomationTarget = typeof KEYFRAME_AUTOMATION_TARGETS[number];
|
|
5
|
+
export type KeyframeEasing = typeof KEYFRAME_EASINGS[number];
|
|
6
|
+
export type KeyframePresetId = typeof KEYFRAME_PRESET_IDS[number];
|
|
7
|
+
export type KeyframeAutomationPlatform = 'mobile' | 'desktop';
|
|
8
|
+
export type KeyframeAutomationEditingMode = 'preset-only' | 'detailed';
|
|
9
|
+
export interface KeyframeAutomationPoint<TTarget extends KeyframeAutomationTarget = KeyframeAutomationTarget> {
|
|
10
|
+
id: string;
|
|
11
|
+
target: TTarget;
|
|
12
|
+
time: number;
|
|
13
|
+
value: number;
|
|
14
|
+
easing: KeyframeEasing;
|
|
15
|
+
}
|
|
16
|
+
export interface KeyframeAutomationPreset<TTarget extends KeyframeAutomationTarget = KeyframeAutomationTarget> {
|
|
17
|
+
id: KeyframePresetId;
|
|
18
|
+
label: string;
|
|
19
|
+
target: TTarget;
|
|
20
|
+
editingMode: 'preset-only';
|
|
21
|
+
keyframes: readonly [
|
|
22
|
+
KeyframeAutomationPoint<TTarget>,
|
|
23
|
+
KeyframeAutomationPoint<TTarget>
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
export interface KeyframeAutomationCapabilities {
|
|
27
|
+
platform: KeyframeAutomationPlatform;
|
|
28
|
+
editingMode: KeyframeAutomationEditingMode;
|
|
29
|
+
canApplyPresets: true;
|
|
30
|
+
canEditKeyframes: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface KeyframeValueRange {
|
|
33
|
+
min?: number;
|
|
34
|
+
max?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface KeyframeValidationOptions {
|
|
37
|
+
target?: KeyframeAutomationTarget;
|
|
38
|
+
minTime?: number;
|
|
39
|
+
maxTime?: number;
|
|
40
|
+
ranges?: Partial<Record<KeyframeAutomationTarget, KeyframeValueRange>>;
|
|
41
|
+
}
|
|
42
|
+
export type KeyframeValidationCode = 'empty-id' | 'invalid-time' | 'invalid-value' | 'invalid-easing' | 'target-mismatch' | 'duplicate-time';
|
|
43
|
+
export interface KeyframeValidationIssue {
|
|
44
|
+
code: KeyframeValidationCode;
|
|
45
|
+
message: string;
|
|
46
|
+
index?: number;
|
|
47
|
+
keyframeId?: string;
|
|
48
|
+
target?: KeyframeAutomationTarget;
|
|
49
|
+
time?: number;
|
|
50
|
+
}
|
|
51
|
+
export interface KeyframeValidationResult {
|
|
52
|
+
valid: boolean;
|
|
53
|
+
issues: readonly KeyframeValidationIssue[];
|
|
54
|
+
}
|
|
55
|
+
export interface SampleKeyframeValueOptions {
|
|
56
|
+
target?: KeyframeAutomationTarget;
|
|
57
|
+
fallbackValue?: number;
|
|
58
|
+
}
|
|
59
|
+
export interface KeyframePresetTimingOptions {
|
|
60
|
+
startTime?: number;
|
|
61
|
+
duration?: number;
|
|
62
|
+
easing?: KeyframeEasing;
|
|
63
|
+
}
|
|
64
|
+
export interface CreateOpacityKeyframePresetOptions extends KeyframePresetTimingOptions {
|
|
65
|
+
fromOpacity?: number;
|
|
66
|
+
toOpacity?: number;
|
|
67
|
+
}
|
|
68
|
+
export interface CreateScaleKeyframePresetOptions extends KeyframePresetTimingOptions {
|
|
69
|
+
fromScale?: number;
|
|
70
|
+
toScale?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface CreateKeyframePresetOptions extends KeyframePresetTimingOptions, CreateOpacityKeyframePresetOptions, CreateScaleKeyframePresetOptions {
|
|
73
|
+
}
|
|
74
|
+
export declare class KeyframeAutomationError extends Error {
|
|
75
|
+
readonly issues: readonly KeyframeValidationIssue[];
|
|
76
|
+
constructor(issues: readonly KeyframeValidationIssue[], message?: string);
|
|
77
|
+
}
|
|
78
|
+
export declare const KEYFRAME_TARGET_VALUE_RANGES: Readonly<Record<KeyframeAutomationTarget, KeyframeValueRange>>;
|
|
79
|
+
export declare function isKeyframeAutomationTarget(value: unknown): value is KeyframeAutomationTarget;
|
|
80
|
+
export declare function isKeyframeEasing(value: unknown): value is KeyframeEasing;
|
|
81
|
+
export declare function getKeyframeAutomationCapabilities(platform: KeyframeAutomationPlatform): KeyframeAutomationCapabilities;
|
|
82
|
+
export declare function sortKeyframes<TPoint extends KeyframeAutomationPoint>(keyframes: readonly TPoint[]): readonly TPoint[];
|
|
83
|
+
export declare function validateKeyframes(keyframes: readonly KeyframeAutomationPoint[], options?: KeyframeValidationOptions): KeyframeValidationResult;
|
|
84
|
+
export declare function normalizeKeyframes<TPoint extends KeyframeAutomationPoint>(keyframes: readonly TPoint[], options?: KeyframeValidationOptions): readonly TPoint[];
|
|
85
|
+
export declare function applyKeyframeEasing(progress: number, easing?: KeyframeEasing): number;
|
|
86
|
+
export declare function interpolateKeyframeValue(fromValue: number, toValue: number, progress: number, easing?: KeyframeEasing): number;
|
|
87
|
+
export declare function sampleKeyframeValue(keyframes: readonly KeyframeAutomationPoint[], time: number, options?: SampleKeyframeValueOptions): number;
|
|
88
|
+
export declare function createFadeInKeyframePreset(options?: CreateOpacityKeyframePresetOptions): KeyframeAutomationPreset<'opacity'>;
|
|
89
|
+
export declare function createFadeOutKeyframePreset(options?: CreateOpacityKeyframePresetOptions): KeyframeAutomationPreset<'opacity'>;
|
|
90
|
+
export declare function createZoomInKeyframePreset(options?: CreateScaleKeyframePresetOptions): KeyframeAutomationPreset<'scale'>;
|
|
91
|
+
export declare function createKeyframePreset(presetId: KeyframePresetId, options?: CreateKeyframePresetOptions): KeyframeAutomationPreset;
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
export declare const MEDIA_SOURCE_ANALYSIS_SCHEMA_VERSION = "media-source-analysis:v1";
|
|
2
|
+
export type MediaSourceAnalysisKind = 'waveform' | 'filmstrip';
|
|
3
|
+
export type WaveformChannel = 'mono' | 'left' | 'right';
|
|
4
|
+
export type MediaSourceAnalysisCacheKey = string;
|
|
5
|
+
export type MediaSourceAnalysisValidationCode = 'invalid-amplitude' | 'invalid-cache-key' | 'invalid-dimension' | 'invalid-duration' | 'invalid-id' | 'invalid-resolution' | 'invalid-rms' | 'invalid-source' | 'invalid-time' | 'invalid-uri' | 'overlapping-sample' | 'duplicate-time' | 'rms-exceeds-peak';
|
|
6
|
+
export interface MediaSourceAnalysisValidationIssue {
|
|
7
|
+
code: MediaSourceAnalysisValidationCode;
|
|
8
|
+
path: string;
|
|
9
|
+
message: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class MediaSourceAnalysisValidationError extends Error {
|
|
12
|
+
readonly issues: readonly MediaSourceAnalysisValidationIssue[];
|
|
13
|
+
constructor(message: string, issues: readonly MediaSourceAnalysisValidationIssue[]);
|
|
14
|
+
}
|
|
15
|
+
export interface WaveformPeakRmsSampleInput {
|
|
16
|
+
time: number;
|
|
17
|
+
duration: number;
|
|
18
|
+
peak: number;
|
|
19
|
+
rms: number;
|
|
20
|
+
channel?: WaveformChannel;
|
|
21
|
+
}
|
|
22
|
+
export interface WaveformPeakRmsSample {
|
|
23
|
+
index: number;
|
|
24
|
+
time: number;
|
|
25
|
+
duration: number;
|
|
26
|
+
endTime: number;
|
|
27
|
+
peak: number;
|
|
28
|
+
rms: number;
|
|
29
|
+
channel: WaveformChannel;
|
|
30
|
+
}
|
|
31
|
+
export interface WaveformResolutionDescriptor {
|
|
32
|
+
id: string;
|
|
33
|
+
samplesPerSecond: number;
|
|
34
|
+
sampleCount?: number;
|
|
35
|
+
duration?: number;
|
|
36
|
+
}
|
|
37
|
+
export interface ChooseWaveformResolutionOptions {
|
|
38
|
+
pixelsPerSample?: number;
|
|
39
|
+
minimumSamplesPerSecond?: number;
|
|
40
|
+
}
|
|
41
|
+
export interface FilmstripFrameReferenceInput {
|
|
42
|
+
time: number;
|
|
43
|
+
uri: string;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
id?: string;
|
|
47
|
+
duration?: number;
|
|
48
|
+
cacheKey?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface FilmstripFrameReference {
|
|
51
|
+
id: string;
|
|
52
|
+
time: number;
|
|
53
|
+
duration: number | null;
|
|
54
|
+
uri: string;
|
|
55
|
+
width: number;
|
|
56
|
+
height: number;
|
|
57
|
+
aspectRatio: number;
|
|
58
|
+
cacheKey: string | null;
|
|
59
|
+
}
|
|
60
|
+
export interface BaseMediaSourceAnalysisDescriptor {
|
|
61
|
+
kind: MediaSourceAnalysisKind;
|
|
62
|
+
schemaVersion: typeof MEDIA_SOURCE_ANALYSIS_SCHEMA_VERSION;
|
|
63
|
+
sourceId: string;
|
|
64
|
+
cacheKey: MediaSourceAnalysisCacheKey;
|
|
65
|
+
duration: number;
|
|
66
|
+
generatedAt: string;
|
|
67
|
+
}
|
|
68
|
+
export interface WaveformAnalysisDescriptor extends BaseMediaSourceAnalysisDescriptor {
|
|
69
|
+
kind: 'waveform';
|
|
70
|
+
channels: readonly WaveformChannel[];
|
|
71
|
+
resolutions: readonly WaveformResolutionDescriptor[];
|
|
72
|
+
}
|
|
73
|
+
export interface FilmstripAnalysisDescriptor extends BaseMediaSourceAnalysisDescriptor {
|
|
74
|
+
kind: 'filmstrip';
|
|
75
|
+
frameCount: number;
|
|
76
|
+
frameWidth: number;
|
|
77
|
+
frameHeight: number;
|
|
78
|
+
intervalSeconds: number | null;
|
|
79
|
+
}
|
|
80
|
+
export type MediaSourceAnalysisDescriptor = WaveformAnalysisDescriptor | FilmstripAnalysisDescriptor;
|
|
81
|
+
export interface MediaSourceAnalysisCacheSourceInput {
|
|
82
|
+
id: string;
|
|
83
|
+
mediaUuid?: string;
|
|
84
|
+
url?: string;
|
|
85
|
+
fingerprint?: string;
|
|
86
|
+
duration?: number | null;
|
|
87
|
+
width?: number | null;
|
|
88
|
+
height?: number | null;
|
|
89
|
+
frameRate?: number | null;
|
|
90
|
+
revision?: string | number | null;
|
|
91
|
+
contentHash?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface MediaSourceAnalysisCacheInvalidationInput {
|
|
94
|
+
duration?: number | null;
|
|
95
|
+
width?: number | null;
|
|
96
|
+
height?: number | null;
|
|
97
|
+
frameRate?: number | null;
|
|
98
|
+
revisionFingerprint?: string | null;
|
|
99
|
+
}
|
|
100
|
+
export interface MediaSourceAnalysisCacheMetadataInput {
|
|
101
|
+
key?: string;
|
|
102
|
+
schemaVersion?: string;
|
|
103
|
+
sourceFingerprint?: string;
|
|
104
|
+
invalidation?: MediaSourceAnalysisCacheInvalidationInput;
|
|
105
|
+
}
|
|
106
|
+
export interface MediaSourceAnalysisCacheVariantInput {
|
|
107
|
+
id?: string;
|
|
108
|
+
resolutionId?: string;
|
|
109
|
+
samplesPerSecond?: number | null;
|
|
110
|
+
frameInterval?: number | null;
|
|
111
|
+
frameWidth?: number | null;
|
|
112
|
+
frameHeight?: number | null;
|
|
113
|
+
channels?: readonly WaveformChannel[];
|
|
114
|
+
}
|
|
115
|
+
export interface CreateMediaSourceAnalysisCacheKeyInput {
|
|
116
|
+
kind: MediaSourceAnalysisKind;
|
|
117
|
+
source: MediaSourceAnalysisCacheSourceInput;
|
|
118
|
+
cache?: MediaSourceAnalysisCacheMetadataInput;
|
|
119
|
+
variant?: MediaSourceAnalysisCacheVariantInput;
|
|
120
|
+
namespace?: string;
|
|
121
|
+
}
|
|
122
|
+
export declare const validateWaveformSamples: (samples: readonly WaveformPeakRmsSampleInput[]) => readonly MediaSourceAnalysisValidationIssue[];
|
|
123
|
+
export declare const normalizeWaveformSamples: (samples: readonly WaveformPeakRmsSampleInput[]) => readonly WaveformPeakRmsSample[];
|
|
124
|
+
export declare const validateFilmstripFrames: (frames: readonly FilmstripFrameReferenceInput[]) => readonly MediaSourceAnalysisValidationIssue[];
|
|
125
|
+
export declare const normalizeFilmstripFrames: (frames: readonly FilmstripFrameReferenceInput[]) => readonly FilmstripFrameReference[];
|
|
126
|
+
export declare const chooseBestWaveformResolution: <Resolution extends WaveformResolutionDescriptor>(resolutions: readonly Resolution[], zoomPixelsPerSecond: number, options?: ChooseWaveformResolutionOptions) => Resolution | null;
|
|
127
|
+
export declare const createMediaSourceAnalysisCacheKey: (input: CreateMediaSourceAnalysisCacheKeyInput) => MediaSourceAnalysisCacheKey;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { TimelineClipSource } from '@/types/video';
|
|
2
|
+
export declare const MEDIA_SOURCE_CACHE_SCHEMA_VERSION = "media-source-cache:v1";
|
|
3
|
+
export type MediaSourceCacheKind = 'filmstrip' | 'waveform' | 'project-draft';
|
|
4
|
+
export type MediaSourceCacheInputField = 'sourceId' | 'sourceLocator' | 'duration' | 'width' | 'height' | 'frameRate';
|
|
5
|
+
export type MediaSourceCacheLocatorKind = 'mediaUuid' | 'url';
|
|
6
|
+
export interface MediaSourceRevisionMetadata {
|
|
7
|
+
revision?: string | number;
|
|
8
|
+
version?: string | number;
|
|
9
|
+
updatedAt?: string;
|
|
10
|
+
etag?: string;
|
|
11
|
+
contentHash?: string;
|
|
12
|
+
checksum?: string;
|
|
13
|
+
fingerprint?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface MediaSourceCacheDescriptorOptions {
|
|
16
|
+
revision?: MediaSourceRevisionMetadata;
|
|
17
|
+
namespace?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface MediaSourceCacheInvalidationInputs {
|
|
20
|
+
duration: number | null;
|
|
21
|
+
width: number | null;
|
|
22
|
+
height: number | null;
|
|
23
|
+
frameRate: number | null;
|
|
24
|
+
revisionFingerprint: string | null;
|
|
25
|
+
}
|
|
26
|
+
export interface MediaSourceCacheDescriptor {
|
|
27
|
+
kind: MediaSourceCacheKind;
|
|
28
|
+
key: string;
|
|
29
|
+
namespace: string;
|
|
30
|
+
schemaVersion: typeof MEDIA_SOURCE_CACHE_SCHEMA_VERSION;
|
|
31
|
+
sourceId: string;
|
|
32
|
+
sourceLocatorKind: MediaSourceCacheLocatorKind;
|
|
33
|
+
sourceFingerprint: string;
|
|
34
|
+
invalidation: MediaSourceCacheInvalidationInputs;
|
|
35
|
+
missingFields: MediaSourceCacheInputField[];
|
|
36
|
+
isPrivateSource: boolean;
|
|
37
|
+
}
|
|
38
|
+
export declare const getMediaSourceCacheInputMissingFields: (source: Partial<TimelineClipSource>) => MediaSourceCacheInputField[];
|
|
39
|
+
export declare const hasMediaSourceCacheLocator: (source: Partial<TimelineClipSource>) => source is Partial<TimelineClipSource> & {
|
|
40
|
+
id: string;
|
|
41
|
+
};
|
|
42
|
+
export declare const hasCompleteMediaSourceCacheInputs: (source: Partial<TimelineClipSource>) => source is TimelineClipSource;
|
|
43
|
+
export declare const createMediaSourceCacheDescriptor: (kind: MediaSourceCacheKind, source: Partial<TimelineClipSource>, options?: MediaSourceCacheDescriptorOptions) => MediaSourceCacheDescriptor | null;
|
|
44
|
+
export declare const createFilmstripCacheDescriptor: (source: Partial<TimelineClipSource>, options?: MediaSourceCacheDescriptorOptions) => MediaSourceCacheDescriptor | null;
|
|
45
|
+
export declare const createWaveformCacheDescriptor: (source: Partial<TimelineClipSource>, options?: MediaSourceCacheDescriptorOptions) => MediaSourceCacheDescriptor | null;
|
|
46
|
+
export declare const createProjectDraftCacheDescriptor: (source: Partial<TimelineClipSource>, options?: MediaSourceCacheDescriptorOptions) => MediaSourceCacheDescriptor | null;
|
|
47
|
+
export declare const isMediaSourceCacheDescriptor: (value: unknown) => value is MediaSourceCacheDescriptor;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AudioSettings, AudioTrackRecipe, AppliedFilter, OutputSettings, TextOverlayRecipe, TimelineClip, TimelineClipSource, TimelineMarker, TimelineSnapSettings, TimelineTrack, TimelineTransitionRecipe, VideoRecipe } from '../../types/video';
|
|
2
|
+
import type { CaptionTrackRecipe, VisualLayerRecipe } from './visualLayerSchema';
|
|
3
|
+
export declare const DEFAULT_VIDEO_TRACK_ID = "default-video-track";
|
|
4
|
+
export declare const DEFAULT_MEDIA_SOURCE_ID = "default-media-source";
|
|
5
|
+
export interface NormalizedVideoProject {
|
|
6
|
+
version: '1.0';
|
|
7
|
+
source: VideoRecipe['source'];
|
|
8
|
+
mediaSources: TimelineClipSource[];
|
|
9
|
+
tracks: TimelineTrack[];
|
|
10
|
+
clips: TimelineClip[];
|
|
11
|
+
markers: TimelineMarker[];
|
|
12
|
+
transitions: TimelineTransitionRecipe[];
|
|
13
|
+
filters: AppliedFilter[];
|
|
14
|
+
audio: AudioSettings;
|
|
15
|
+
output: OutputSettings;
|
|
16
|
+
duration?: number;
|
|
17
|
+
snapSettings?: TimelineSnapSettings;
|
|
18
|
+
textOverlays?: TextOverlayRecipe[];
|
|
19
|
+
captionTracks?: CaptionTrackRecipe[];
|
|
20
|
+
visualLayers?: VisualLayerRecipe[];
|
|
21
|
+
audioTracks?: AudioTrackRecipe[];
|
|
22
|
+
posterFrame?: string;
|
|
23
|
+
metadata?: VideoRecipe['metadata'];
|
|
24
|
+
}
|
|
25
|
+
export declare function migrateVideoRecipeToProject(recipe: VideoRecipe): NormalizedVideoProject;
|
|
26
|
+
export declare function flattenProjectToVideoRecipe(project: NormalizedVideoProject): VideoRecipe;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type TimelineSelectionMode = 'replace' | 'toggle' | 'add' | 'range';
|
|
2
|
+
export interface TimelineSelectionState {
|
|
3
|
+
selectedClipIds: readonly string[];
|
|
4
|
+
primarySelectedClipId: string | null;
|
|
5
|
+
anchorClipId: string | null;
|
|
6
|
+
}
|
|
7
|
+
export interface SelectTimelineClipOptions {
|
|
8
|
+
mode?: TimelineSelectionMode;
|
|
9
|
+
orderedClipIds?: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export interface TimelineClipSelectionStatus {
|
|
12
|
+
selected: boolean;
|
|
13
|
+
primary: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare function createTimelineSelectionState(selectedClipIds?: readonly string[], primarySelectedClipId?: string | null, anchorClipId?: string | null): TimelineSelectionState;
|
|
16
|
+
export declare function selectTimelineClip(state: TimelineSelectionState, clipId: string, options?: SelectTimelineClipOptions): TimelineSelectionState;
|
|
17
|
+
export declare function clearTimelineSelection(): TimelineSelectionState;
|
|
18
|
+
export declare function getTimelineSelectedClipIds(state: TimelineSelectionState): readonly string[];
|
|
19
|
+
export declare function getPrimaryTimelineSelectedClipId(state: TimelineSelectionState): string | null;
|
|
20
|
+
export declare function getTimelineSelectionAnchorId(state: TimelineSelectionState): string | null;
|
|
21
|
+
export declare function isTimelineClipSelected(state: TimelineSelectionState, clipId: string): boolean;
|
|
22
|
+
export declare function isTimelineClipPrimarySelected(state: TimelineSelectionState, clipId: string): boolean;
|
|
23
|
+
export declare function getTimelineClipSelectionStatus(state: TimelineSelectionState, clipId: string): TimelineClipSelectionStatus;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import type { TimelineClip, TimelineEditAction } from '../../types/video';
|
|
2
|
+
export type TimelineTransactionOperation = 'clip.split' | 'clip.delete' | 'clip.duplicate' | 'clip.move' | 'clip.trim' | 'clip.speed';
|
|
3
|
+
export type TimelineTransactionalEditAction = Extract<TimelineEditAction, {
|
|
4
|
+
type: TimelineTransactionOperation;
|
|
5
|
+
}>;
|
|
6
|
+
export type TimelineGeneratedInverseAction = Extract<TimelineEditAction, {
|
|
7
|
+
type: 'clip.duplicate' | 'clip.move' | 'clip.trim' | 'clip.speed';
|
|
8
|
+
}>;
|
|
9
|
+
export type TimelineMetadataRequiredAction = Extract<TimelineEditAction, {
|
|
10
|
+
type: 'clip.split' | 'clip.delete';
|
|
11
|
+
}>;
|
|
12
|
+
export interface TimelineClipTimingMetadata {
|
|
13
|
+
clipId: string;
|
|
14
|
+
timelineStart: number;
|
|
15
|
+
timelineEnd: number;
|
|
16
|
+
sourceIn: number;
|
|
17
|
+
sourceOut: number;
|
|
18
|
+
speed: number;
|
|
19
|
+
}
|
|
20
|
+
export interface TimelineClipTimingChangeMetadata {
|
|
21
|
+
clipId: string;
|
|
22
|
+
before: TimelineClipTimingMetadata;
|
|
23
|
+
after: TimelineClipTimingMetadata;
|
|
24
|
+
}
|
|
25
|
+
export interface TimelineSplitInverseMetadata {
|
|
26
|
+
type: 'clip.split';
|
|
27
|
+
sourceClipBefore: TimelineClip;
|
|
28
|
+
sourceClipAfter: TimelineClip;
|
|
29
|
+
createdClip: TimelineClip;
|
|
30
|
+
sourceClipIndex: number;
|
|
31
|
+
createdClipIndex: number;
|
|
32
|
+
}
|
|
33
|
+
export interface TimelineDeleteInverseMetadata {
|
|
34
|
+
type: 'clip.delete';
|
|
35
|
+
deletedClip: TimelineClip;
|
|
36
|
+
deletedClipIndex: number;
|
|
37
|
+
ripple: boolean;
|
|
38
|
+
affectedClips: readonly TimelineClipTimingChangeMetadata[];
|
|
39
|
+
}
|
|
40
|
+
export interface TimelineDuplicateInverseMetadata {
|
|
41
|
+
type: 'clip.duplicate';
|
|
42
|
+
duplicatedClipId: string;
|
|
43
|
+
duplicatedClipIndex?: number;
|
|
44
|
+
duplicatedClip?: TimelineClip;
|
|
45
|
+
}
|
|
46
|
+
export interface TimelineMoveInverseMetadata {
|
|
47
|
+
type: 'clip.move';
|
|
48
|
+
clipId: string;
|
|
49
|
+
before: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd'>;
|
|
50
|
+
after: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd'>;
|
|
51
|
+
affectedClips: readonly TimelineClipTimingChangeMetadata[];
|
|
52
|
+
}
|
|
53
|
+
export interface TimelineTrimInverseMetadata {
|
|
54
|
+
type: 'clip.trim';
|
|
55
|
+
clipId: string;
|
|
56
|
+
edge: 'start' | 'end';
|
|
57
|
+
before: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd' | 'sourceIn' | 'sourceOut'>;
|
|
58
|
+
after: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd' | 'sourceIn' | 'sourceOut'>;
|
|
59
|
+
affectedClips: readonly TimelineClipTimingChangeMetadata[];
|
|
60
|
+
}
|
|
61
|
+
export interface TimelineSpeedInverseMetadata {
|
|
62
|
+
type: 'clip.speed';
|
|
63
|
+
clipId: string;
|
|
64
|
+
before: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd' | 'sourceIn' | 'sourceOut' | 'speed'>;
|
|
65
|
+
after: Pick<TimelineClipTimingMetadata, 'clipId' | 'timelineStart' | 'timelineEnd' | 'sourceIn' | 'sourceOut' | 'speed'>;
|
|
66
|
+
affectedClips: readonly TimelineClipTimingChangeMetadata[];
|
|
67
|
+
}
|
|
68
|
+
export type TimelineActionInverseMetadata = TimelineSplitInverseMetadata | TimelineDeleteInverseMetadata | TimelineDuplicateInverseMetadata | TimelineMoveInverseMetadata | TimelineTrimInverseMetadata | TimelineSpeedInverseMetadata;
|
|
69
|
+
export interface TimelineTransactionActionRecord {
|
|
70
|
+
action: TimelineTransactionalEditAction;
|
|
71
|
+
inverseAction: TimelineTransactionalEditAction | null;
|
|
72
|
+
inverseMetadata: TimelineActionInverseMetadata;
|
|
73
|
+
coalesceKey: string;
|
|
74
|
+
}
|
|
75
|
+
export interface TimelineTransaction<Metadata> {
|
|
76
|
+
id: string;
|
|
77
|
+
label: string;
|
|
78
|
+
startedAt: number;
|
|
79
|
+
baselineMetadata: Metadata;
|
|
80
|
+
actions: readonly TimelineTransactionActionRecord[];
|
|
81
|
+
}
|
|
82
|
+
export interface TimelineHistoryEntry<Metadata> extends TimelineTransaction<Metadata> {
|
|
83
|
+
committedAt: number;
|
|
84
|
+
committedMetadata: Metadata;
|
|
85
|
+
inverseActions: readonly TimelineTransactionalEditAction[];
|
|
86
|
+
}
|
|
87
|
+
export interface TimelineTransactionHistory<Metadata> {
|
|
88
|
+
undoStack: readonly TimelineHistoryEntry<Metadata>[];
|
|
89
|
+
redoStack: readonly TimelineHistoryEntry<Metadata>[];
|
|
90
|
+
revision: number;
|
|
91
|
+
activeTransaction?: TimelineTransaction<Metadata>;
|
|
92
|
+
}
|
|
93
|
+
export interface BeginTimelineTransactionOptions<Metadata> {
|
|
94
|
+
baselineMetadata: Metadata;
|
|
95
|
+
id?: string;
|
|
96
|
+
label?: string;
|
|
97
|
+
startedAt?: number;
|
|
98
|
+
}
|
|
99
|
+
export interface CommitTimelineTransactionOptions<Metadata> {
|
|
100
|
+
committedMetadata: Metadata;
|
|
101
|
+
committedAt?: number;
|
|
102
|
+
}
|
|
103
|
+
export interface CommitTimelineTransactionResult<Metadata> {
|
|
104
|
+
history: TimelineTransactionHistory<Metadata>;
|
|
105
|
+
entry: TimelineHistoryEntry<Metadata> | null;
|
|
106
|
+
}
|
|
107
|
+
export interface CancelTimelineTransactionResult<Metadata> {
|
|
108
|
+
history: TimelineTransactionHistory<Metadata>;
|
|
109
|
+
restoreMetadata: Metadata | null;
|
|
110
|
+
}
|
|
111
|
+
export interface TimelineStackMoveResult<Metadata> {
|
|
112
|
+
history: TimelineTransactionHistory<Metadata>;
|
|
113
|
+
entry: TimelineHistoryEntry<Metadata> | null;
|
|
114
|
+
}
|
|
115
|
+
export interface RecordTimelineActionOptions {
|
|
116
|
+
coalesce?: boolean;
|
|
117
|
+
}
|
|
118
|
+
export declare function createTimelineTransactionHistory<Metadata>(): TimelineTransactionHistory<Metadata>;
|
|
119
|
+
export declare function beginTimelineTransaction<Metadata>(history: TimelineTransactionHistory<Metadata>, options: BeginTimelineTransactionOptions<Metadata>): TimelineTransactionHistory<Metadata>;
|
|
120
|
+
export declare function recordTimelineTransactionAction<Metadata>(history: TimelineTransactionHistory<Metadata>, actionRecord: TimelineTransactionActionRecord, options?: RecordTimelineActionOptions): TimelineTransactionHistory<Metadata>;
|
|
121
|
+
export declare function commitTimelineTransaction<Metadata>(history: TimelineTransactionHistory<Metadata>, options: CommitTimelineTransactionOptions<Metadata>): CommitTimelineTransactionResult<Metadata>;
|
|
122
|
+
export declare function cancelTimelineTransaction<Metadata>(history: TimelineTransactionHistory<Metadata>): CancelTimelineTransactionResult<Metadata>;
|
|
123
|
+
export declare function undoTimelineTransaction<Metadata>(history: TimelineTransactionHistory<Metadata>): TimelineStackMoveResult<Metadata>;
|
|
124
|
+
export declare function redoTimelineTransaction<Metadata>(history: TimelineTransactionHistory<Metadata>): TimelineStackMoveResult<Metadata>;
|
|
125
|
+
export declare function createTimelineActionRecord(action: TimelineGeneratedInverseAction, metadata?: TimelineActionInverseMetadata): TimelineTransactionActionRecord;
|
|
126
|
+
export declare function createTimelineActionRecord(action: TimelineMetadataRequiredAction, metadata: TimelineActionInverseMetadata): TimelineTransactionActionRecord;
|
|
127
|
+
export declare function createTimelineClipTimingMetadata(clip: TimelineClip): TimelineClipTimingMetadata;
|
|
128
|
+
export declare function createTimelineInverseAction(action: TimelineTransactionalEditAction, metadata: TimelineActionInverseMetadata): TimelineTransactionalEditAction | null;
|
|
129
|
+
export declare function createTimelineActionCoalesceKey(action: TimelineTransactionalEditAction): string;
|