@alpha2-sh/editor 0.0.0 → 0.1.0
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/README.md +107 -1
- package/dist/browser/bridge.d.ts +44 -0
- package/dist/browser/bridge.js +2176 -0
- package/dist/browser/extensions-worker-entry.js +3 -0
- package/dist/browser/extensions-worker.d.ts +46 -0
- package/dist/browser/extensions-worker.js +149 -0
- package/dist/browser/hash-worker-entry.d.ts +1 -0
- package/dist/browser/hash-worker-entry.js +3 -0
- package/dist/browser/hash-worker.d.ts +24 -0
- package/dist/browser/hash-worker.js +87 -0
- package/dist/browser/index.d.ts +11 -0
- package/dist/browser/index.js +9 -0
- package/dist/browser/jobs.d.ts +82 -0
- package/dist/browser/jobs.js +291 -0
- package/dist/browser/resources.d.ts +40 -0
- package/dist/browser/resources.js +83 -0
- package/dist/browser/runtime/assets.d.ts +233 -0
- package/dist/browser/runtime/assets.js +633 -0
- package/dist/browser/runtime/audio.d.ts +60 -0
- package/dist/browser/runtime/audio.js +549 -0
- package/dist/browser/runtime/budget.d.ts +11 -0
- package/dist/browser/runtime/budget.js +26 -0
- package/dist/browser/runtime/caption-fonts.d.ts +34 -0
- package/dist/browser/runtime/caption-fonts.js +69 -0
- package/dist/browser/runtime/color.d.ts +7 -0
- package/dist/browser/runtime/color.js +12 -0
- package/dist/browser/runtime/engine.d.ts +91 -0
- package/dist/browser/runtime/engine.js +352 -0
- package/dist/browser/runtime/export-audio.d.ts +23 -0
- package/dist/browser/runtime/export-audio.js +75 -0
- package/dist/browser/runtime/exporter.d.ts +140 -0
- package/dist/browser/runtime/exporter.js +751 -0
- package/dist/browser/runtime/extension-import.d.ts +196 -0
- package/dist/browser/runtime/extension-import.js +521 -0
- package/dist/browser/runtime/fingerprint.d.ts +57 -0
- package/dist/browser/runtime/fingerprint.js +157 -0
- package/dist/browser/runtime/generators.d.ts +188 -0
- package/dist/browser/runtime/generators.js +173 -0
- package/dist/browser/runtime/locks.d.ts +32 -0
- package/dist/browser/runtime/locks.js +86 -0
- package/dist/browser/runtime/output.d.ts +87 -0
- package/dist/browser/runtime/output.js +230 -0
- package/dist/browser/runtime/preview-utils.d.ts +3 -0
- package/dist/browser/runtime/preview-utils.js +49 -0
- package/dist/browser/runtime/proxies.d.ts +72 -0
- package/dist/browser/runtime/proxies.js +369 -0
- package/dist/browser/runtime/proxy-storage.d.ts +59 -0
- package/dist/browser/runtime/proxy-storage.js +119 -0
- package/dist/browser/runtime/sources.d.ts +82 -0
- package/dist/browser/runtime/sources.js +819 -0
- package/dist/browser/runtime/staging.d.ts +10 -0
- package/dist/browser/runtime/staging.js +32 -0
- package/dist/browser/runtime/still.d.ts +21 -0
- package/dist/browser/runtime/still.js +52 -0
- package/dist/browser/runtime/wasm.d.ts +9 -0
- package/dist/browser/runtime/wasm.js +20 -0
- package/dist/browser/types.d.ts +549 -0
- package/dist/browser/types.js +1 -0
- package/dist/browser/worker-entry.d.ts +1 -0
- package/dist/browser/worker-entry.js +2 -0
- package/dist/browser/worker.d.ts +24 -0
- package/dist/browser/worker.js +239 -0
- package/dist/core/captions.d.ts +34 -0
- package/dist/core/captions.js +108 -0
- package/dist/core/clip-time.d.ts +31 -0
- package/dist/core/clip-time.js +125 -0
- package/dist/core/commands.d.ts +413 -0
- package/dist/core/commands.js +1118 -0
- package/dist/core/compositions.d.ts +234 -0
- package/dist/core/compositions.js +851 -0
- package/dist/core/document.d.ts +245 -0
- package/dist/core/document.js +683 -0
- package/dist/core/keyframes.d.ts +82 -0
- package/dist/core/keyframes.js +153 -0
- package/dist/core/presets.d.ts +64 -0
- package/dist/core/presets.js +241 -0
- package/dist/core/session.d.ts +150 -0
- package/dist/core/session.js +541 -0
- package/dist/core/text.d.ts +17 -0
- package/dist/core/text.js +17 -0
- package/dist/core/time.d.ts +19 -0
- package/dist/core/time.js +39 -0
- package/dist/core/timeline-index.d.ts +44 -0
- package/dist/core/timeline-index.js +59 -0
- package/dist/core/transitions.d.ts +20 -0
- package/dist/core/transitions.js +118 -0
- package/dist/core/validated.d.ts +23 -0
- package/dist/core/validated.js +52 -0
- package/dist/index.d.ts +12 -0
- package/dist/index.js +11 -0
- package/dist/native-client/index.d.ts +131 -0
- package/dist/native-client/index.js +354 -0
- package/dist/ports/index.d.ts +146 -0
- package/dist/ports/index.js +1 -0
- package/dist/react/index.d.ts +37 -0
- package/dist/react/index.js +94 -0
- package/package.json +69 -8
- /package/{index.js → dist/browser/extensions-worker-entry.d.ts} +0 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
import type { InputKey } from "./compositions.js";
|
|
2
|
+
import type { Project, Clip, Track, ClipEffect, CaptionCue, Composition, CompositionNode, MediaSource, EffectResource } from "alpha2/project";
|
|
3
|
+
import type { EditorDocument, TrackMetadata, ClipMetadata, AssetDescriptor, Marker, Result, GraphLayout, GraphPosition } from "./document.js";
|
|
4
|
+
/**
|
|
5
|
+
* An edit of an {@link EditorDocument}, run by {@link executeCommand} or
|
|
6
|
+
* `EditorSession.dispatch`. Times are timeline ticks unless a variant says otherwise. Ids that
|
|
7
|
+
* name an entity the document lacks are refused, and so is any change to a locked track.
|
|
8
|
+
*/
|
|
9
|
+
export type Command =
|
|
10
|
+
/**
|
|
11
|
+
* Adds a transition of `duration` ticks between two clips of a track; the incoming clip and
|
|
12
|
+
* those chained after it move earlier to overlap the outgoing one.
|
|
13
|
+
*/
|
|
14
|
+
{
|
|
15
|
+
readonly type: "transition.add";
|
|
16
|
+
readonly trackId: string;
|
|
17
|
+
readonly fromId: string;
|
|
18
|
+
readonly toId: string;
|
|
19
|
+
readonly duration: number;
|
|
20
|
+
readonly effect: ClipEffect;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Gives a transition, named by its instance id, a new duration; the incoming clips move to match.
|
|
24
|
+
*/
|
|
25
|
+
| {
|
|
26
|
+
readonly type: "transition.resize";
|
|
27
|
+
readonly trackId: string;
|
|
28
|
+
readonly instanceId: string;
|
|
29
|
+
readonly duration: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Removes a transition; the incoming clip and its chain move later to where the outgoing clip
|
|
33
|
+
* ends.
|
|
34
|
+
*/
|
|
35
|
+
| {
|
|
36
|
+
readonly type: "transition.remove";
|
|
37
|
+
readonly trackId: string;
|
|
38
|
+
readonly instanceId: string;
|
|
39
|
+
}
|
|
40
|
+
/** Runs `commands` in order as one edit: all apply, or none does. */
|
|
41
|
+
| {
|
|
42
|
+
readonly type: "transaction";
|
|
43
|
+
readonly commands: readonly Command[];
|
|
44
|
+
}
|
|
45
|
+
/** Replaces the project's name, settings or master audio with the patch's fields. */
|
|
46
|
+
| {
|
|
47
|
+
readonly type: "project.update";
|
|
48
|
+
readonly patch: Partial<Pick<Project, "name" | "settings" | "audio">>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Adds a track on top of the others. Like `clip.insert`, each of its clips whose composition
|
|
52
|
+
* something else draws shows its own copy of it.
|
|
53
|
+
*/
|
|
54
|
+
| {
|
|
55
|
+
readonly type: "track.add";
|
|
56
|
+
readonly track: Track;
|
|
57
|
+
} | {
|
|
58
|
+
readonly type: "track.remove";
|
|
59
|
+
readonly id: string;
|
|
60
|
+
}
|
|
61
|
+
/** Puts the tracks in the order `ids` lists them; `ids` must name every track once. */
|
|
62
|
+
| {
|
|
63
|
+
readonly type: "track.reorder";
|
|
64
|
+
readonly ids: readonly string[];
|
|
65
|
+
}
|
|
66
|
+
/** Replaces the track's fields the patch has. */
|
|
67
|
+
| {
|
|
68
|
+
readonly type: "track.update";
|
|
69
|
+
readonly id: string;
|
|
70
|
+
readonly patch: Partial<Pick<Track, "name" | "audio" | "captions" | "transitions">>;
|
|
71
|
+
}
|
|
72
|
+
/** Merges `patch` into the track's editor metadata. Unlocking is allowed on a locked track. */
|
|
73
|
+
| {
|
|
74
|
+
readonly type: "track.metadata";
|
|
75
|
+
readonly id: string;
|
|
76
|
+
readonly patch: TrackMetadata;
|
|
77
|
+
}
|
|
78
|
+
/** Merges `patch` into the clip's editor metadata. */
|
|
79
|
+
| {
|
|
80
|
+
readonly type: "clip.metadata";
|
|
81
|
+
readonly id: string;
|
|
82
|
+
readonly patch: ClipMetadata;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Adds a clip to a track as it is: nothing makes room for it. A clip whose composition something
|
|
86
|
+
* else draws shows its own copy of it (and of the group definitions in it), so a duplicate edits
|
|
87
|
+
* independently of its original. `compositions` are those the clip drew when it was copied: it
|
|
88
|
+
* shows a copy of them, whether or not the document still has them.
|
|
89
|
+
*/
|
|
90
|
+
| {
|
|
91
|
+
readonly type: "clip.insert";
|
|
92
|
+
readonly trackId: string;
|
|
93
|
+
readonly clip: Clip;
|
|
94
|
+
readonly name?: string;
|
|
95
|
+
readonly compositions?: readonly Composition[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Puts a clip down at `at` on a track: `insert` makes room by moving later content (on
|
|
99
|
+
* sync-locked tracks too), `overwrite` replaces what is there, `append` goes after the track's
|
|
100
|
+
* last clip. A clip the new one cuts in two keeps its id on the left; the right part is
|
|
101
|
+
* `splitId`. Like `clip.insert`, a clip whose composition something else draws shows its own copy
|
|
102
|
+
* of it.
|
|
103
|
+
*/
|
|
104
|
+
| {
|
|
105
|
+
readonly type: "clip.place";
|
|
106
|
+
readonly mode: "insert" | "overwrite" | "append";
|
|
107
|
+
readonly trackId: string;
|
|
108
|
+
readonly clip: Clip;
|
|
109
|
+
readonly at: number;
|
|
110
|
+
readonly splitId?: string;
|
|
111
|
+
readonly name?: string;
|
|
112
|
+
}
|
|
113
|
+
/** Shows another part of a clip's source in the same place, `delta` source ticks later. */
|
|
114
|
+
| {
|
|
115
|
+
readonly type: "clip.slip";
|
|
116
|
+
readonly id: string;
|
|
117
|
+
readonly delta: number;
|
|
118
|
+
}
|
|
119
|
+
/** Moves a clip `delta` ticks between its neighbours, which give and take the time. */
|
|
120
|
+
| {
|
|
121
|
+
readonly type: "clip.slide";
|
|
122
|
+
readonly id: string;
|
|
123
|
+
readonly delta: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Gives a clip a new length from where it starts: its speed, for a clip that plays forward or
|
|
127
|
+
* reversed. `ripple` moves what follows (on sync-locked tracks too); `keyframes` keeps or
|
|
128
|
+
* stretches its keyframes, fades, and composition time.
|
|
129
|
+
*/
|
|
130
|
+
| {
|
|
131
|
+
readonly type: "clip.retime";
|
|
132
|
+
readonly id: string;
|
|
133
|
+
readonly duration: number;
|
|
134
|
+
readonly reverse?: boolean;
|
|
135
|
+
readonly ripple?: boolean;
|
|
136
|
+
readonly keyframes?: "keep" | "stretch";
|
|
137
|
+
}
|
|
138
|
+
/** Adds a marker; its id must be new. */
|
|
139
|
+
| {
|
|
140
|
+
readonly type: "marker.add";
|
|
141
|
+
readonly marker: Marker;
|
|
142
|
+
}
|
|
143
|
+
/** Applies `patch` to a marker; a field patched to `undefined` is removed. */
|
|
144
|
+
| {
|
|
145
|
+
readonly type: "marker.update";
|
|
146
|
+
readonly id: string;
|
|
147
|
+
readonly patch: Partial<Omit<Marker, "id">>;
|
|
148
|
+
} | {
|
|
149
|
+
readonly type: "marker.remove";
|
|
150
|
+
readonly id: string;
|
|
151
|
+
}
|
|
152
|
+
/** Moves the cut between two clips that meet, keeping their total length. */
|
|
153
|
+
| {
|
|
154
|
+
readonly type: "clip.roll";
|
|
155
|
+
readonly leftId: string;
|
|
156
|
+
readonly rightId: string;
|
|
157
|
+
readonly at: number;
|
|
158
|
+
}
|
|
159
|
+
/** Moves a clip to start at `at`, onto track `trackId` when given. */
|
|
160
|
+
| {
|
|
161
|
+
readonly type: "clip.move";
|
|
162
|
+
readonly id: string;
|
|
163
|
+
readonly at: number;
|
|
164
|
+
readonly trackId?: string;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Moves several clips as one: only where they all land must be valid, whatever order `moves`
|
|
168
|
+
* lists them in.
|
|
169
|
+
*/
|
|
170
|
+
| {
|
|
171
|
+
readonly type: "clips.move";
|
|
172
|
+
readonly moves: readonly {
|
|
173
|
+
readonly id: string;
|
|
174
|
+
readonly at: number;
|
|
175
|
+
readonly trackId?: string;
|
|
176
|
+
}[];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Moves a clip's `edge` to `at`, showing more or less of its source. `ripple` moves what follows
|
|
180
|
+
* by the same amount (on sync-locked tracks too).
|
|
181
|
+
*/
|
|
182
|
+
| {
|
|
183
|
+
readonly type: "clip.trim";
|
|
184
|
+
readonly id: string;
|
|
185
|
+
readonly edge: "start" | "end";
|
|
186
|
+
readonly at: number;
|
|
187
|
+
readonly ripple?: boolean;
|
|
188
|
+
}
|
|
189
|
+
/** Cuts a clip in two at `at`: the left part keeps its id, the right part is `newId`. */
|
|
190
|
+
| {
|
|
191
|
+
readonly type: "clip.split";
|
|
192
|
+
readonly id: string;
|
|
193
|
+
readonly at: number;
|
|
194
|
+
readonly newId: string;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Removes a clip and its transitions. `ripple` closes the gap by moving what follows (on
|
|
198
|
+
* sync-locked tracks too).
|
|
199
|
+
*/
|
|
200
|
+
| {
|
|
201
|
+
readonly type: "clip.delete";
|
|
202
|
+
readonly id: string;
|
|
203
|
+
readonly ripple?: boolean;
|
|
204
|
+
}
|
|
205
|
+
/** Replaces the clip's fields the patch has. A `cache` of `auto` removes the field. */
|
|
206
|
+
| {
|
|
207
|
+
readonly type: "clip.update";
|
|
208
|
+
readonly id: string;
|
|
209
|
+
readonly patch: Partial<Pick<Clip, "visual" | "audio" | "blend_mode" | "masks" | "matte" | "time_map" | "source_range" | "cache">>;
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Adds an effect on top of clip `id`'s effect stack as `instanceId`. The `effect.*` commands are
|
|
213
|
+
* refused for a clip whose composition is a graph rather than a stack (see `effectStack`).
|
|
214
|
+
*/
|
|
215
|
+
| {
|
|
216
|
+
readonly type: "effect.add";
|
|
217
|
+
readonly id: string;
|
|
218
|
+
readonly instanceId: string;
|
|
219
|
+
readonly effect: ClipEffect;
|
|
220
|
+
}
|
|
221
|
+
/** Replaces an effect of clip `id`'s stack. */
|
|
222
|
+
| {
|
|
223
|
+
readonly type: "effect.update";
|
|
224
|
+
readonly id: string;
|
|
225
|
+
readonly instanceId: string;
|
|
226
|
+
readonly effect: ClipEffect;
|
|
227
|
+
/** Whether the effect is switched off; unchanged when omitted. */
|
|
228
|
+
readonly bypass?: boolean;
|
|
229
|
+
}
|
|
230
|
+
/** Removes an effect from clip `id`'s stack; an empty stack removes the clip's composition. */
|
|
231
|
+
| {
|
|
232
|
+
readonly type: "effect.remove";
|
|
233
|
+
readonly id: string;
|
|
234
|
+
readonly instanceId: string;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Puts clip `id`'s effects in the order `ids` lists them, bottom first; `ids` names each once.
|
|
238
|
+
*/
|
|
239
|
+
| {
|
|
240
|
+
readonly type: "effect.reorder";
|
|
241
|
+
readonly id: string;
|
|
242
|
+
readonly ids: readonly string[];
|
|
243
|
+
}
|
|
244
|
+
/** Gives a clip without one a composition that shows its picture. */
|
|
245
|
+
| {
|
|
246
|
+
readonly type: "graph.create";
|
|
247
|
+
readonly clipId: string;
|
|
248
|
+
/** The new composition's id; a free one based on `<clip>-fx` when omitted. */
|
|
249
|
+
readonly compositionId?: string;
|
|
250
|
+
}
|
|
251
|
+
/** Adds a node to a composition; its id must be new there. */
|
|
252
|
+
| {
|
|
253
|
+
readonly type: "graph.node.add";
|
|
254
|
+
readonly compositionId: string;
|
|
255
|
+
readonly node: CompositionNode;
|
|
256
|
+
/** Where the node editor draws it. */
|
|
257
|
+
readonly position?: GraphPosition;
|
|
258
|
+
}
|
|
259
|
+
/** Replaces a node's operation and bypass; its id stays. */
|
|
260
|
+
| {
|
|
261
|
+
readonly type: "graph.node.update";
|
|
262
|
+
readonly compositionId: string;
|
|
263
|
+
readonly node: CompositionNode;
|
|
264
|
+
}
|
|
265
|
+
/** Removes nodes, disconnecting every input that read them. */
|
|
266
|
+
| {
|
|
267
|
+
readonly type: "graph.node.remove";
|
|
268
|
+
readonly compositionId: string;
|
|
269
|
+
readonly ids: readonly string[];
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Connects node `from`'s picture to input `input` of node `to`; `"layer"` adds a merge layer on
|
|
273
|
+
* top.
|
|
274
|
+
*/
|
|
275
|
+
| {
|
|
276
|
+
readonly type: "graph.connect";
|
|
277
|
+
readonly compositionId: string;
|
|
278
|
+
readonly from: string;
|
|
279
|
+
readonly to: string;
|
|
280
|
+
readonly input: InputKey | "layer";
|
|
281
|
+
}
|
|
282
|
+
/** Disconnects input `input` of node `to`; a merge layer's slot is removed with its wire. */
|
|
283
|
+
| {
|
|
284
|
+
readonly type: "graph.disconnect";
|
|
285
|
+
readonly compositionId: string;
|
|
286
|
+
readonly to: string;
|
|
287
|
+
readonly input: InputKey;
|
|
288
|
+
}
|
|
289
|
+
/** Makes node `nodeId` the composition's output; `null` leaves it without one. */
|
|
290
|
+
| {
|
|
291
|
+
readonly type: "graph.output";
|
|
292
|
+
readonly compositionId: string;
|
|
293
|
+
readonly nodeId: string | null;
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* Folds nodes into a group node that draws a new composition of them; the picture does not
|
|
297
|
+
* change. Ids are free ones based on `group` and `<composition>-group` when omitted.
|
|
298
|
+
*/
|
|
299
|
+
| {
|
|
300
|
+
readonly type: "graph.group";
|
|
301
|
+
readonly compositionId: string;
|
|
302
|
+
readonly ids: readonly string[];
|
|
303
|
+
readonly groupId?: string;
|
|
304
|
+
readonly definitionId?: string;
|
|
305
|
+
/** What the group is called in the node editor. */
|
|
306
|
+
readonly name?: string;
|
|
307
|
+
}
|
|
308
|
+
/** Adds a composition, such as a group definition a macro brings. */
|
|
309
|
+
| {
|
|
310
|
+
readonly type: "composition.add";
|
|
311
|
+
readonly composition: Composition;
|
|
312
|
+
}
|
|
313
|
+
/** Replaces a group node with the nodes it draws; the picture does not change. */
|
|
314
|
+
| {
|
|
315
|
+
readonly type: "graph.ungroup";
|
|
316
|
+
readonly compositionId: string;
|
|
317
|
+
readonly nodeId: string;
|
|
318
|
+
}
|
|
319
|
+
/** Gives a composition another group input, unconnected on every group node that uses it. */
|
|
320
|
+
| {
|
|
321
|
+
readonly type: "graph.port.add";
|
|
322
|
+
readonly compositionId: string;
|
|
323
|
+
readonly name: string;
|
|
324
|
+
}
|
|
325
|
+
/** Exposes a node's effect parameter to the group nodes that use its composition. */
|
|
326
|
+
| {
|
|
327
|
+
readonly type: "graph.control.add";
|
|
328
|
+
readonly compositionId: string;
|
|
329
|
+
readonly control: {
|
|
330
|
+
readonly name: string;
|
|
331
|
+
readonly node: string;
|
|
332
|
+
readonly param: string;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
/** Stops exposing a control, dropping the values group nodes set for it. */
|
|
336
|
+
| {
|
|
337
|
+
readonly type: "graph.control.remove";
|
|
338
|
+
readonly compositionId: string;
|
|
339
|
+
readonly name: string;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Makes a composition a Library item: a composition source that shows it, which clips place like
|
|
343
|
+
* media. It starts with a background to build on.
|
|
344
|
+
*/
|
|
345
|
+
| {
|
|
346
|
+
readonly type: "composition.create";
|
|
347
|
+
readonly compositionId: string;
|
|
348
|
+
readonly sourceId: string;
|
|
349
|
+
readonly name: string;
|
|
350
|
+
}
|
|
351
|
+
/** Moves nodes in the node editor; the picture does not change. */
|
|
352
|
+
| {
|
|
353
|
+
readonly type: "graph.layout";
|
|
354
|
+
readonly compositionId: string;
|
|
355
|
+
readonly positions: Readonly<Record<string, GraphPosition>>;
|
|
356
|
+
}
|
|
357
|
+
/** Adds a cue to a caption track under a new `instanceId`, in its place by time. */
|
|
358
|
+
| {
|
|
359
|
+
readonly type: "cue.add";
|
|
360
|
+
readonly trackId: string;
|
|
361
|
+
readonly instanceId: string;
|
|
362
|
+
readonly cue: CaptionCue;
|
|
363
|
+
}
|
|
364
|
+
/** Replaces the cue `instanceId` names; a cue given another time moves to its place by it. */
|
|
365
|
+
| {
|
|
366
|
+
readonly type: "cue.update";
|
|
367
|
+
readonly trackId: string;
|
|
368
|
+
readonly instanceId: string;
|
|
369
|
+
readonly cue: CaptionCue;
|
|
370
|
+
} | {
|
|
371
|
+
readonly type: "cue.remove";
|
|
372
|
+
readonly trackId: string;
|
|
373
|
+
readonly instanceId: string;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Adds or replaces a bin asset, with the project source or effect resource of the same id when
|
|
377
|
+
* given. `contentRevision` may not go below the replaced asset's.
|
|
378
|
+
*/
|
|
379
|
+
| {
|
|
380
|
+
readonly type: "asset.put";
|
|
381
|
+
readonly asset: AssetDescriptor;
|
|
382
|
+
readonly source?: MediaSource;
|
|
383
|
+
readonly resource?: EffectResource;
|
|
384
|
+
}
|
|
385
|
+
/**
|
|
386
|
+
* Removes a bin asset and its project source or effect resource; a clip still reading it is
|
|
387
|
+
* refused.
|
|
388
|
+
*/
|
|
389
|
+
| {
|
|
390
|
+
readonly type: "asset.remove";
|
|
391
|
+
readonly id: string;
|
|
392
|
+
}
|
|
393
|
+
/** Replaces the document metadata fields the patch has. */
|
|
394
|
+
| {
|
|
395
|
+
readonly type: "metadata.update";
|
|
396
|
+
readonly patch: Partial<Pick<EditorDocument["metadata"], "markers" | "exportRange" | "graphLayout" | "graphNames">>;
|
|
397
|
+
};
|
|
398
|
+
/** The names the node editor shows for group compositions, by composition id. */
|
|
399
|
+
export declare function graphNames(document: EditorDocument): Readonly<Record<string, string>>;
|
|
400
|
+
/** The node editor positions a document stores. */
|
|
401
|
+
export declare function graphLayout(document: EditorDocument): GraphLayout;
|
|
402
|
+
/**
|
|
403
|
+
* Applies `command` to `document` and validates the result. `gesture` checks only what a pointer
|
|
404
|
+
* move can change (see `validateDocumentShape`); the gesture validates in full once, when it
|
|
405
|
+
* commits.
|
|
406
|
+
*
|
|
407
|
+
* Never throws: a refusal is `{ ok: false }` with an `EditorError` (`invalid_command`, `locked`, a
|
|
408
|
+
* validation code, or an edit code from `alpha2/edit`). `document` and `command` are not modified;
|
|
409
|
+
* compositions the edit leaves undrawn are removed from the result.
|
|
410
|
+
*/
|
|
411
|
+
export declare function executeCommand(document: EditorDocument, command: Command, { gesture }?: {
|
|
412
|
+
gesture?: boolean;
|
|
413
|
+
}): Result<EditorDocument>;
|