@nodetool-ai/timeline 0.8.11 → 0.8.14
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/.nodetool-build-stamp +1 -1
- package/dist/animation/compile.d.ts +1 -1
- package/dist/animation/compile.d.ts.map +1 -1
- package/dist/animation/compile.js +2 -1
- package/dist/animation/compile.js.map +1 -1
- package/dist/animation/custom.d.ts +3 -1
- package/dist/animation/custom.d.ts.map +1 -1
- package/dist/animation/custom.js +13 -13
- package/dist/animation/custom.js.map +1 -1
- package/dist/audioCrossfade.d.ts +2 -0
- package/dist/audioCrossfade.d.ts.map +1 -1
- package/dist/audioCrossfade.js +8 -3
- package/dist/audioCrossfade.js.map +1 -1
- package/dist/automation.d.ts.map +1 -1
- package/dist/automation.js +28 -26
- package/dist/automation.js.map +1 -1
- package/dist/clipSpeed.js +1 -1
- package/dist/clipSpeed.js.map +1 -1
- package/dist/colorSpaceVersion.d.ts +11 -0
- package/dist/colorSpaceVersion.d.ts.map +1 -0
- package/dist/colorSpaceVersion.js +21 -0
- package/dist/colorSpaceVersion.js.map +1 -0
- package/dist/defaults.d.ts.map +1 -1
- package/dist/defaults.js +7 -1
- package/dist/defaults.js.map +1 -1
- package/dist/effectMasks.d.ts +43 -0
- package/dist/effectMasks.d.ts.map +1 -0
- package/dist/effectMasks.js +170 -0
- package/dist/effectMasks.js.map +1 -0
- package/dist/harmony/expand.d.ts.map +1 -1
- package/dist/harmony/expand.js +19 -4
- package/dist/harmony/expand.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/interchange.d.ts +17 -0
- package/dist/interchange.d.ts.map +1 -1
- package/dist/interchange.js +310 -61
- package/dist/interchange.js.map +1 -1
- package/dist/interchangeImport.d.ts +16 -2
- package/dist/interchangeImport.d.ts.map +1 -1
- package/dist/interchangeImport.js +185 -27
- package/dist/interchangeImport.js.map +1 -1
- package/dist/interchangeMotion.d.ts +49 -0
- package/dist/interchangeMotion.d.ts.map +1 -0
- package/dist/interchangeMotion.js +109 -0
- package/dist/interchangeMotion.js.map +1 -0
- package/dist/interchangeMotionImport.d.ts +84 -0
- package/dist/interchangeMotionImport.d.ts.map +1 -0
- package/dist/interchangeMotionImport.js +204 -0
- package/dist/interchangeMotionImport.js.map +1 -0
- package/dist/keyframes.d.ts +29 -3
- package/dist/keyframes.d.ts.map +1 -1
- package/dist/keyframes.js +93 -30
- package/dist/keyframes.js.map +1 -1
- package/dist/ops/apply.d.ts.map +1 -1
- package/dist/ops/apply.js +140 -0
- package/dist/ops/apply.js.map +1 -1
- package/dist/ops/op.d.ts +3 -2
- package/dist/ops/op.d.ts.map +1 -1
- package/dist/ops/op.js +4 -0
- package/dist/ops/op.js.map +1 -1
- package/dist/ops/parse.d.ts.map +1 -1
- package/dist/ops/parse.js +16 -0
- package/dist/ops/parse.js.map +1 -1
- package/dist/ops/types.d.ts +1 -0
- package/dist/ops/types.d.ts.map +1 -1
- package/dist/paramCurves.d.ts +56 -0
- package/dist/paramCurves.d.ts.map +1 -0
- package/dist/paramCurves.js +183 -0
- package/dist/paramCurves.js.map +1 -0
- package/dist/render/canvas2d.d.ts +2 -27
- package/dist/render/canvas2d.d.ts.map +1 -1
- package/dist/render/canvas2d.js +35 -7
- package/dist/render/canvas2d.js.map +1 -1
- package/dist/render/clipAnalysis.d.ts +20 -0
- package/dist/render/clipAnalysis.d.ts.map +1 -0
- package/dist/render/clipAnalysis.js +92 -0
- package/dist/render/clipAnalysis.js.map +1 -0
- package/dist/render/cpuLegacyEffects.d.ts +2 -1
- package/dist/render/cpuLegacyEffects.d.ts.map +1 -1
- package/dist/render/cpuLegacyEffects.js +100 -30
- package/dist/render/cpuLegacyEffects.js.map +1 -1
- package/dist/render/curveTransfer.d.ts +5 -0
- package/dist/render/curveTransfer.d.ts.map +1 -0
- package/dist/render/curveTransfer.js +37 -0
- package/dist/render/curveTransfer.js.map +1 -0
- package/dist/render/deband.d.ts +4 -0
- package/dist/render/deband.d.ts.map +1 -0
- package/dist/render/deband.js +51 -0
- package/dist/render/deband.js.map +1 -0
- package/dist/render/denoise.d.ts +12 -0
- package/dist/render/denoise.d.ts.map +1 -0
- package/dist/render/denoise.js +173 -0
- package/dist/render/denoise.js.map +1 -0
- package/dist/render/effects.d.ts +16 -5
- package/dist/render/effects.d.ts.map +1 -1
- package/dist/render/effects.js +238 -47
- package/dist/render/effects.js.map +1 -1
- package/dist/render/exposure.d.ts +3 -0
- package/dist/render/exposure.d.ts.map +1 -0
- package/dist/render/exposure.js +20 -0
- package/dist/render/exposure.js.map +1 -0
- package/dist/render/frameCompositor.d.ts +28 -2
- package/dist/render/frameCompositor.d.ts.map +1 -1
- package/dist/render/frameCompositor.js +196 -54
- package/dist/render/frameCompositor.js.map +1 -1
- package/dist/render/headlessRender.d.ts +1 -0
- package/dist/render/headlessRender.d.ts.map +1 -1
- package/dist/render/hueSatCurves.d.ts +11 -0
- package/dist/render/hueSatCurves.d.ts.map +1 -0
- package/dist/render/hueSatCurves.js +55 -0
- package/dist/render/hueSatCurves.js.map +1 -0
- package/dist/render/index.d.ts +3 -0
- package/dist/render/index.d.ts.map +1 -1
- package/dist/render/index.js +3 -0
- package/dist/render/index.js.map +1 -1
- package/dist/render/sceneModel.d.ts +3 -2
- package/dist/render/sceneModel.d.ts.map +1 -1
- package/dist/render/sceneModel.js +24 -7
- package/dist/render/sceneModel.js.map +1 -1
- package/dist/render/secondaryColor.d.ts +12 -0
- package/dist/render/secondaryColor.d.ts.map +1 -0
- package/dist/render/secondaryColor.js +88 -0
- package/dist/render/secondaryColor.js.map +1 -0
- package/dist/render/stabilization.d.ts +29 -0
- package/dist/render/stabilization.d.ts.map +1 -0
- package/dist/render/stabilization.js +185 -0
- package/dist/render/stabilization.js.map +1 -0
- package/dist/render/textLayout.d.ts +4 -2
- package/dist/render/textLayout.d.ts.map +1 -1
- package/dist/render/textLayout.js +5 -3
- package/dist/render/textLayout.js.map +1 -1
- package/dist/render/trackEffects.d.ts.map +1 -1
- package/dist/render/trackEffects.js +8 -1
- package/dist/render/trackEffects.js.map +1 -1
- package/dist/render/vignette.d.ts +7 -0
- package/dist/render/vignette.d.ts.map +1 -0
- package/dist/render/vignette.js +16 -0
- package/dist/render/vignette.js.map +1 -0
- package/dist/scene.d.ts +1 -0
- package/dist/scene.d.ts.map +1 -1
- package/dist/scene.js +1 -0
- package/dist/scene.js.map +1 -1
- package/dist/script.d.ts +4 -2
- package/dist/script.d.ts.map +1 -1
- package/dist/script.js +52 -18
- package/dist/script.js.map +1 -1
- package/dist/shotLink.d.ts +2 -1
- package/dist/shotLink.d.ts.map +1 -1
- package/dist/shotLink.js +10 -1
- package/dist/shotLink.js.map +1 -1
- package/dist/slideEdit.d.ts.map +1 -1
- package/dist/slideEdit.js +65 -28
- package/dist/slideEdit.js.map +1 -1
- package/dist/source-merge.d.ts +1 -0
- package/dist/source-merge.d.ts.map +1 -1
- package/dist/source-merge.js +6 -0
- package/dist/source-merge.js.map +1 -1
- package/dist/splitClip.d.ts.map +1 -1
- package/dist/splitClip.js +22 -9
- package/dist/splitClip.js.map +1 -1
- package/dist/takes.d.ts.map +1 -1
- package/dist/takes.js +39 -20
- package/dist/takes.js.map +1 -1
- package/dist/testing/ops.d.ts.map +1 -1
- package/dist/testing/ops.js +20 -0
- package/dist/testing/ops.js.map +1 -1
- package/dist/timeRemap.d.ts +4 -3
- package/dist/timeRemap.d.ts.map +1 -1
- package/dist/timeRemap.js +9 -4
- package/dist/timeRemap.js.map +1 -1
- package/dist/transcriptOps.d.ts +267 -0
- package/dist/transcriptOps.d.ts.map +1 -0
- package/dist/transcriptOps.js +754 -0
- package/dist/transcriptOps.js.map +1 -0
- package/dist/trimClip.d.ts.map +1 -1
- package/dist/trimClip.js +24 -13
- package/dist/trimClip.js.map +1 -1
- package/dist/types.d.ts +289 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +29 -0
- package/dist/types.js.map +1 -1
- package/package.json +17 -5
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* transcriptOps — the clip↔text projection and the pure edits behind it.
|
|
3
|
+
*
|
|
4
|
+
* Descript's core trick is that the transcript is an editable *index* over the
|
|
5
|
+
* media, not a separate document. Here that means the timeline's **clips are
|
|
6
|
+
* the single source of truth** and the transcript is *projected* from the
|
|
7
|
+
* word-level captions the clips carry. `buildTranscriptDoc` walks the
|
|
8
|
+
* transcript-bearing clips in timeline order and emits word tokens with
|
|
9
|
+
* absolute timings; every text operation maps back to a clip cut / move /
|
|
10
|
+
* relabel and commits through `TimelineStore.setTranscriptAndClips` so one user
|
|
11
|
+
* action lands as one coherent edit (and one undo entry).
|
|
12
|
+
*
|
|
13
|
+
* Word timings are clip-local (relative to `clip.startMs`), so splitting,
|
|
14
|
+
* moving, or re-flowing a clip never rewrites the words — they travel with the
|
|
15
|
+
* clip and stay valid against its new position.
|
|
16
|
+
*
|
|
17
|
+
* Nothing here touches the DOM, the network, or any store — it is trivially
|
|
18
|
+
* unit-testable, mirroring `sceneModel`.
|
|
19
|
+
*/
|
|
20
|
+
import type { CaptionWordKind, ClipStatus, TimelineClip, TranscriptLine } from "./types.js";
|
|
21
|
+
/** Beat length used before a line's voiceover has been generated/probed. */
|
|
22
|
+
export declare const PLACEHOLDER_BEAT_MS = 3000;
|
|
23
|
+
/** How a transcript segment's media was produced. */
|
|
24
|
+
export type TranscriptSegmentKind = "generated" | "imported";
|
|
25
|
+
/** One word of the projected transcript, located on the absolute timeline. */
|
|
26
|
+
interface TranscriptToken {
|
|
27
|
+
/** The media clip this word indexes into (the span a cut would remove). */
|
|
28
|
+
clipId: string;
|
|
29
|
+
/** Index of the word within `clip.caption.words`. */
|
|
30
|
+
wordIndex: number;
|
|
31
|
+
text: string;
|
|
32
|
+
/** Absolute timeline start = `clip.startMs + word.startMs`. */
|
|
33
|
+
startMs: number;
|
|
34
|
+
/** Absolute timeline end = `clip.startMs + word.endMs`. */
|
|
35
|
+
endMs: number;
|
|
36
|
+
kind: CaptionWordKind;
|
|
37
|
+
confidence?: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A paragraph of the transcript: a maximal run of consecutive transcript clips
|
|
41
|
+
* that share a `paragraphId` (so the two halves of an interior word-deletion
|
|
42
|
+
* read as one paragraph, while distinct authored beats stay separate). It is
|
|
43
|
+
* the unit the editor renders as a block and a whole-paragraph delete / reorder
|
|
44
|
+
* operates on; each token still carries its own `clipId` so word edits map to
|
|
45
|
+
* the right media span.
|
|
46
|
+
*/
|
|
47
|
+
export interface TranscriptSegment {
|
|
48
|
+
/**
|
|
49
|
+
* Stable id, unique across the doc. Normally the paragraph key (shared
|
|
50
|
+
* `paragraphId` of its clips); when that same `paragraphId` recurs in a
|
|
51
|
+
* later, non-contiguous group (a differently-paragraphed clip lands between
|
|
52
|
+
* two pieces of the same paragraph), later occurrences get a `#n` suffix so
|
|
53
|
+
* no two segments ever share an id — segment ids back React keys and
|
|
54
|
+
* DOM-ref map keys downstream (see `ScriptLane`).
|
|
55
|
+
*/
|
|
56
|
+
id: string;
|
|
57
|
+
/** Backing clips, in timeline order. A single draft, or 1..n voiced pieces. */
|
|
58
|
+
clipIds: string[];
|
|
59
|
+
kind: TranscriptSegmentKind;
|
|
60
|
+
speaker?: string;
|
|
61
|
+
startMs: number;
|
|
62
|
+
endMs: number;
|
|
63
|
+
/** True when the paragraph is one un-voiced draft beat (no words yet). */
|
|
64
|
+
isDraft: boolean;
|
|
65
|
+
/** For a draft segment, the un-aligned text to show (the TTS prompt). */
|
|
66
|
+
draftText: string;
|
|
67
|
+
/** Generation / transcription status (failed if any piece failed). */
|
|
68
|
+
status: ClipStatus;
|
|
69
|
+
tokens: TranscriptToken[];
|
|
70
|
+
}
|
|
71
|
+
/** The transcript projected from the timeline's clips. */
|
|
72
|
+
export interface TranscriptDoc {
|
|
73
|
+
segments: TranscriptSegment[];
|
|
74
|
+
/** End of the last transcript clip on the timeline. */
|
|
75
|
+
durationMs: number;
|
|
76
|
+
}
|
|
77
|
+
interface ReflowedClips {
|
|
78
|
+
clips: TimelineClip[];
|
|
79
|
+
/** Total timeline length after the edit. */
|
|
80
|
+
durationMs: number;
|
|
81
|
+
}
|
|
82
|
+
/** The clip is a generated voiceover beat (TTS), voiced or still a draft. */
|
|
83
|
+
export declare function isVoiceoverBeat(clip: TimelineClip): boolean;
|
|
84
|
+
/** The clip carries transcribed words. */
|
|
85
|
+
export declare function hasWords(clip: TimelineClip): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* A clip belongs to the transcript when it carries a caption (words, or an
|
|
88
|
+
* imported clip awaiting transcription) or is a voiceover beat awaiting
|
|
89
|
+
* generation. Plain media with no caption (background music, B-roll dragged
|
|
90
|
+
* straight onto a track) is excluded.
|
|
91
|
+
*/
|
|
92
|
+
export declare function isTranscriptClip(clip: TimelineClip): boolean;
|
|
93
|
+
/** Whether a word reads as a filler ("um", "uh", …). */
|
|
94
|
+
export declare function isFillerWord(text: string): boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Project the editable transcript from the timeline's clips. Consecutive clips
|
|
97
|
+
* sharing a `paragraphId` collapse into one paragraph (segment); each word
|
|
98
|
+
* becomes an absolute-timed token tagged with its source clip. The result is
|
|
99
|
+
* the read model the editor renders and the map a click-to-seek / select /
|
|
100
|
+
* delete uses to translate text positions back to the timeline.
|
|
101
|
+
*/
|
|
102
|
+
export declare function buildTranscriptDoc(clips: TimelineClip[]): TranscriptDoc;
|
|
103
|
+
/** End of the last transcript clip — where the next paragraph is appended. */
|
|
104
|
+
export declare function transcriptEndMs(clips: TimelineClip[]): number;
|
|
105
|
+
/**
|
|
106
|
+
* The audio track a new voiceover paragraph lands on: the track already
|
|
107
|
+
* carrying the voiceover (its last transcript audio clip), else an audio track
|
|
108
|
+
* named "Voiceover", else the first audio track. A linked cut puts its shot
|
|
109
|
+
* audio on the first audio track, so "first audio track" alone would drop a
|
|
110
|
+
* recording or a new line among the shots' sound.
|
|
111
|
+
*/
|
|
112
|
+
export declare function voiceoverTrackId(clips: TimelineClip[], tracks: ReadonlyArray<{
|
|
113
|
+
id: string;
|
|
114
|
+
type: string;
|
|
115
|
+
name?: string;
|
|
116
|
+
}>): string | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* Re-lay the transcript after a beat changed length or the paragraphs were
|
|
119
|
+
* reordered. Transcript clips (voiceover beats and imported recordings with
|
|
120
|
+
* captions) form one sequence in timeline order, or in `orderedClipIds` order
|
|
121
|
+
* when given. Each clip keeps the offset it has from the end of the clip
|
|
122
|
+
* before it, so pauses, a recording placed between two beats, and lines parked
|
|
123
|
+
* inside their shots all stay where they are; when a clip grows or shrinks,
|
|
124
|
+
* everything after it moves by the difference. A draft beat with no length
|
|
125
|
+
* takes `PLACEHOLDER_BEAT_MS`. Words are clip-local so they need no rewrite.
|
|
126
|
+
* Clips outside the transcript (B-roll, music, shots) keep their positions.
|
|
127
|
+
*
|
|
128
|
+
* `previousDurations` gives the length a clip had when the current offsets
|
|
129
|
+
* were laid out, for a caller that already wrote the new length (voicing
|
|
130
|
+
* probes the real duration before it re-lays the beats).
|
|
131
|
+
*
|
|
132
|
+
* `durationMs` is the end of the last clip of *any* kind, so imported media
|
|
133
|
+
* extending past the voiceover still counts toward the sequence length.
|
|
134
|
+
*/
|
|
135
|
+
export declare function reflowGenerated(clips: TimelineClip[], orderedClipIds?: string[], previousDurations?: ReadonlyMap<string, number>): ReflowedClips;
|
|
136
|
+
/** A reference to a single transcript word — a selection endpoint. */
|
|
137
|
+
export interface TokenRef {
|
|
138
|
+
clipId: string;
|
|
139
|
+
wordIndex: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Resolve a word selection (two endpoints, in any order) against a projected
|
|
143
|
+
* document to the absolute time span it covers and the tokens within it.
|
|
144
|
+
* Returns null when either endpoint is no longer present (e.g. after an edit).
|
|
145
|
+
*/
|
|
146
|
+
export declare function resolveSelectionRange(doc: TranscriptDoc, anchor: TokenRef, focus: TokenRef): {
|
|
147
|
+
startMs: number;
|
|
148
|
+
endMs: number;
|
|
149
|
+
tokens: TranscriptToken[];
|
|
150
|
+
} | null;
|
|
151
|
+
/**
|
|
152
|
+
* Clips a transcript edit must leave exactly where they are: the ids of clips
|
|
153
|
+
* whose edit unit holds a lock (clip, track, link or group).
|
|
154
|
+
*/
|
|
155
|
+
export interface TranscriptEditLocks {
|
|
156
|
+
lockedClipIds?: ReadonlySet<string>;
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Ripple-delete the absolute time span [startMs, endMs) across every track:
|
|
160
|
+
* clips fully inside are dropped, clips overlapping an edge are trimmed (their
|
|
161
|
+
* words partitioned and the tail's rebased), and everything after shifts left
|
|
162
|
+
* by the span length so the gap closes — the "editing text = editing media"
|
|
163
|
+
* core. B-roll on other tracks ripples too, keeping the composition in sync.
|
|
164
|
+
* A track with a locked clip at or after the cut, or a time-remapped clip over
|
|
165
|
+
* it, stays as it is. Groups shrink to what is left of their window.
|
|
166
|
+
*/
|
|
167
|
+
export declare function rippleDeleteRange(clips: TimelineClip[], startMs: number, endMs: number, locks?: TranscriptEditLocks): ReflowedClips;
|
|
168
|
+
/**
|
|
169
|
+
* Change a single word's text without touching its timing or media — Descript's
|
|
170
|
+
* "correct the transcript without changing the audio": you are fixing the
|
|
171
|
+
* label, not the timestamped media behind it.
|
|
172
|
+
*/
|
|
173
|
+
export declare function relabelWord(clips: TimelineClip[], clipId: string, wordIndex: number, text: string): TimelineClip[];
|
|
174
|
+
/**
|
|
175
|
+
* Ripple-cut every filler word ("um", "uh", …) in one pass. Ranges are removed
|
|
176
|
+
* right-to-left so each deletion leaves the earlier (left) ranges' absolute
|
|
177
|
+
* times valid — the bulk version of {@link rippleDeleteRange}.
|
|
178
|
+
*/
|
|
179
|
+
export declare function removeFillers(clips: TimelineClip[], locks?: TranscriptEditLocks): ReflowedClips;
|
|
180
|
+
/** One transcript word still present in the editor, with its current text. */
|
|
181
|
+
interface SurvivingWord {
|
|
182
|
+
clipId: string;
|
|
183
|
+
wordIndex: number;
|
|
184
|
+
text: string;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* What the editor showed when it was last seeded from the clips. Clips can
|
|
188
|
+
* change while the editor has focus (a split gives new ids, a voicing or
|
|
189
|
+
* transcription rewrites words), and those changes are not in the editor tree.
|
|
190
|
+
* A token or draft missing from this snapshot was never in the editor, so its
|
|
191
|
+
* absence from the edit is not a deletion.
|
|
192
|
+
*/
|
|
193
|
+
export interface SeededTranscript {
|
|
194
|
+
/** {@link seededTokenKey} of every word the editor was seeded with. */
|
|
195
|
+
tokenKeys: ReadonlySet<string>;
|
|
196
|
+
/** Ids of the draft beats the editor was seeded with. */
|
|
197
|
+
draftIds: ReadonlySet<string>;
|
|
198
|
+
}
|
|
199
|
+
/** Snapshot the words and drafts an editor seeded from `clips` shows. */
|
|
200
|
+
export declare function snapshotSeededTranscript(clips: TimelineClip[]): SeededTranscript;
|
|
201
|
+
/**
|
|
202
|
+
* Reconcile a freeform edit of the transcript text back onto the clips. Given
|
|
203
|
+
* the words that survived the edit (each still tagged with its source word and
|
|
204
|
+
* carrying its possibly-edited text), this:
|
|
205
|
+
* 1. relabels surviving words whose text changed (label only — no media move,
|
|
206
|
+
* matching Descript's "fix the transcript without changing the audio"),
|
|
207
|
+
* 2. ripple-cuts the words that were deleted from the text (right-to-left so
|
|
208
|
+
* the earlier ranges stay valid as the later ones are removed).
|
|
209
|
+
* New text typed between words is folded into the adjacent word upstream (so it
|
|
210
|
+
* arrives here as a relabel); authoring brand-new audio stays an explicit
|
|
211
|
+
* "add line" → voice action.
|
|
212
|
+
*
|
|
213
|
+
* With `seededTokenKeys`, only words the editor was seeded with are relabeled
|
|
214
|
+
* or cut; words that appeared or changed since seeding are left alone.
|
|
215
|
+
*/
|
|
216
|
+
export declare function reconcileTranscript(clips: TimelineClip[], survivors: SurvivingWord[], locks?: TranscriptEditLocks, seededTokenKeys?: ReadonlySet<string>): ReflowedClips;
|
|
217
|
+
/** The structured result of reading a freeform edit out of the editor. */
|
|
218
|
+
export interface EditorEdits {
|
|
219
|
+
/** Voiced words still present, with their (possibly edited) text. */
|
|
220
|
+
survivors: SurvivingWord[];
|
|
221
|
+
/** Existing draft beats still present, with their current prompt text. */
|
|
222
|
+
draftUpdates: Array<{
|
|
223
|
+
clipId: string;
|
|
224
|
+
text: string;
|
|
225
|
+
}>;
|
|
226
|
+
/** Text in word-less, draft-less paragraphs — brand-new lines to author. */
|
|
227
|
+
newDraftTexts: string[];
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Apply a whole freeform edit to the clips in one transform: reconcile voiced
|
|
231
|
+
* words (relabel + ripple-cut), update existing draft prompts, drop drafts
|
|
232
|
+
* whose text was deleted (closing only their gaps), and append draft beats for
|
|
233
|
+
* newly-typed lines after the last paragraph. Beats the edit did not add or remove
|
|
234
|
+
* keep their starts and the gaps between them. Returns the same array when
|
|
235
|
+
* nothing changed. With `seeded`, only words and drafts the editor was seeded
|
|
236
|
+
* with can be cut or removed.
|
|
237
|
+
*/
|
|
238
|
+
export declare function applyEditorEdits(clips: TimelineClip[], edits: EditorEdits, audioTrackId: string, locks?: TranscriptEditLocks, seeded?: SeededTranscript): ReflowedClips;
|
|
239
|
+
interface CutResult extends ReflowedClips {
|
|
240
|
+
/** The removed media as standalone, 0-based clips ready to paste elsewhere. */
|
|
241
|
+
extracted: TimelineClip[];
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* Ripple-delete [startMs, endMs) like {@link rippleDeleteRange}, but also return
|
|
245
|
+
* the removed media as a 0-based block of clips — the "cut" half of a move.
|
|
246
|
+
*/
|
|
247
|
+
export declare function cutWordRange(clips: TimelineClip[], startMs: number, endMs: number, locks?: TranscriptEditLocks): CutResult;
|
|
248
|
+
/**
|
|
249
|
+
* Ripple-insert a 0-based `block` of clips at `targetMs`: clips at or after the
|
|
250
|
+
* target shift right by the block length (splitting any clip straddling it),
|
|
251
|
+
* then the block is placed at the target. The paste half of a move.
|
|
252
|
+
*/
|
|
253
|
+
export declare function pasteClipsAt(clips: TimelineClip[], targetMs: number, block: TimelineClip[], locks?: TranscriptEditLocks): ReflowedClips;
|
|
254
|
+
/**
|
|
255
|
+
* One-time, idempotent migration from the legacy transcript model (a
|
|
256
|
+
* `TranscriptLine[]` binding a voiceover audio clip + a separate caption clip)
|
|
257
|
+
* to the clip-sourced model (words carried directly by the voiceover clip).
|
|
258
|
+
*
|
|
259
|
+
* For each line: fold the bound caption clip's words onto the voiceover audio
|
|
260
|
+
* clip and drop the now-redundant caption clip. A line that was typed but never
|
|
261
|
+
* voiced (no audio clip) becomes a draft voiceover beat on `audioTrackId` so
|
|
262
|
+
* its text survives. Run only when `transcript` is non-empty; callers clear the
|
|
263
|
+
* `transcript` field afterwards since clips are now the source of truth.
|
|
264
|
+
*/
|
|
265
|
+
export declare function migrateTranscriptToClips(transcript: TranscriptLine[], clips: TimelineClip[], audioTrackId: string): TimelineClip[];
|
|
266
|
+
export {};
|
|
267
|
+
//# sourceMappingURL=transcriptOps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transcriptOps.d.ts","sourceRoot":"","sources":["../src/transcriptOps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAMH,OAAO,KAAK,EAEV,eAAe,EACf,UAAU,EACV,YAAY,EACZ,cAAc,EACf,MAAM,YAAY,CAAC;AAEpB,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,OAAO,CAAC;AAIxC,qDAAqD;AACrD,MAAM,MAAM,qBAAqB,GAAG,WAAW,GAAG,UAAU,CAAC;AAE7D,8EAA8E;AAC9E,UAAU,eAAe;IACvB,2EAA2E;IAC3E,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,OAAO,EAAE,MAAM,CAAC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