@mengine/medeo-client 2.1.1-dsl.9 → 3.0.1-caption-source.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 +13 -9
- package/dist/{dsl-COyzz7Fp.js → dsl-96AZnd7O.js} +2639 -270
- package/dist/dsl.d.ts +2 -3
- package/dist/dsl.js +2 -3
- package/dist/{index-C5wDKYqC.d.ts → index-C1iiDt_Q.d.ts} +939 -27
- package/dist/{index-DAfOkcnZ.d.ts → index-CSjqNIoR.d.ts} +205 -5
- package/dist/index.d.ts +3 -5
- package/dist/index.js +829 -8
- package/dist/schemas.d.ts +21 -21
- package/dist/schemas.js +57 -21
- package/dist/testing.d.ts +2 -2
- package/dist/testing.js +37 -16
- package/package.json +7 -8
- package/dist/index-CHiPztZr.d.ts +0 -194
- package/dist/legacy.d.ts +0 -1044
- package/dist/legacy.js +0 -4349
- package/dist/shared-iWnU2osE.js +0 -39
- package/dist/storage-BW3tI_ER.js +0 -801
- package/dist/video-draft-types-BnbfWrBx.js +0 -1486
- package/dist/video-draft-types-GqXnsOzA.d.ts +0 -869
|
@@ -1,6 +1,340 @@
|
|
|
1
|
-
import { B as PhonemeSelection, J as SegmentSelection, L as FieldPatch, M as DslMutation, R as MedeoDslSnapshot, T as CaptionStyle, Y as StoredFile, Z as TextEdit, c as VideoDraftInput, h as DslIdFactory, it as Voice, j as DslDiagnostic, o as VideoDraftContent, p as CommitOptions, q as SegmentRange, rt as TrackRole, tt as TimeAnchor, w as CaptionSelection, z as Media } from "./video-draft-types-GqXnsOzA.js";
|
|
2
1
|
import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
|
|
3
2
|
|
|
3
|
+
//#region ../medeo-dsl/src/types.d.ts
|
|
4
|
+
type TrackRole = 'video_clip' | 'speech' | 'caption' | 'bgm';
|
|
5
|
+
type ResourceSystem = 'memota' | 'memota-speech';
|
|
6
|
+
interface Track$1 {
|
|
7
|
+
role: TrackRole;
|
|
8
|
+
hidden?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* How a Clip plays its content: the window it takes from the source, its pace, and whether it
|
|
12
|
+
* fills the Timeline. One value: concurrent edits of the same marker keep one whole marker.
|
|
13
|
+
*/
|
|
14
|
+
interface SeqMarker {
|
|
15
|
+
inMs: number;
|
|
16
|
+
outMs: number;
|
|
17
|
+
rate?: number;
|
|
18
|
+
fillTimeline?: true;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Where a Clip starts: at an absolute time on the Timeline, or following another Clip. No anchor
|
|
22
|
+
* means it plays in Tree order. One value, so concurrent placements keep one whole placement.
|
|
23
|
+
*/
|
|
24
|
+
interface TimeAnchor {
|
|
25
|
+
/** The Timeline (absolute) or another Clip (following). */
|
|
26
|
+
to: string;
|
|
27
|
+
offsetMs: number;
|
|
28
|
+
/** The absolute start recorded by the placement edit; used when the anchor cannot be solved. */
|
|
29
|
+
fallback_abs_ms: number;
|
|
30
|
+
}
|
|
31
|
+
/** A Clip's single-valued relations are fields of its own row: its content and its time anchor. */
|
|
32
|
+
interface Clip {
|
|
33
|
+
seqMarker: SeqMarker;
|
|
34
|
+
volume?: number;
|
|
35
|
+
/** The media or Caption this use plays. */
|
|
36
|
+
source: string;
|
|
37
|
+
anchor?: TimeAnchor;
|
|
38
|
+
}
|
|
39
|
+
interface MediaLocator {
|
|
40
|
+
system: ResourceSystem;
|
|
41
|
+
key: string;
|
|
42
|
+
digest?: string;
|
|
43
|
+
}
|
|
44
|
+
type Media = MediaLocator & ({
|
|
45
|
+
kind: 'video';
|
|
46
|
+
durationMs: number;
|
|
47
|
+
storageKey?: string;
|
|
48
|
+
} | {
|
|
49
|
+
kind: 'audio' | 'voiceover-recording';
|
|
50
|
+
durationMs: number;
|
|
51
|
+
storageKey: string;
|
|
52
|
+
} | {
|
|
53
|
+
kind: 'image';
|
|
54
|
+
storageKey?: string;
|
|
55
|
+
});
|
|
56
|
+
/** One segment of a script: its own text, and the id a Caption or PhoneticScript names it by. */
|
|
57
|
+
interface AudioScriptSegment {
|
|
58
|
+
id: string;
|
|
59
|
+
text: string;
|
|
60
|
+
/**
|
|
61
|
+
* Where these words were spoken in the medium the script was read off, as the transcription
|
|
62
|
+
* file it names gave them (D186). Only a transcript's segments state it, both ends together.
|
|
63
|
+
*/
|
|
64
|
+
startMs?: number;
|
|
65
|
+
endMs?: number;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A script is segmented text: its segments in order (D181). A transcript names the transcription
|
|
69
|
+
* file its words and times were read from (D186); a written script names none.
|
|
70
|
+
*/
|
|
71
|
+
interface AudioScript extends Partial<StoredFile> {
|
|
72
|
+
segments: AudioScriptSegment[];
|
|
73
|
+
defaultLanguage?: string;
|
|
74
|
+
}
|
|
75
|
+
interface CaptionStyle$1 {
|
|
76
|
+
font?: {
|
|
77
|
+
system: 'font-library';
|
|
78
|
+
key: string;
|
|
79
|
+
};
|
|
80
|
+
fontSize?: number;
|
|
81
|
+
fontColor?: string;
|
|
82
|
+
fontWeight?: number;
|
|
83
|
+
entranceAnimation?: string;
|
|
84
|
+
entranceAnimationDurationMs?: number;
|
|
85
|
+
strokeColor?: string;
|
|
86
|
+
strokeWidth?: number;
|
|
87
|
+
/** The caption's center across the frame, from 0 at the left edge to 1 at the right. */
|
|
88
|
+
positionX?: number;
|
|
89
|
+
/** The caption's center down the frame, from 0 at the top edge to 1 at the bottom. */
|
|
90
|
+
positionY?: number;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* What a Caption shows or a PhoneticScript is written for: one segment of a script, or a run inside
|
|
94
|
+
* it (D181). The run's ends are Cursors on that segment's Text, so they follow its edits; without
|
|
95
|
+
* them the whole segment is meant, whatever it comes to say. One value: taken or replaced whole.
|
|
96
|
+
*/
|
|
97
|
+
interface SegmentSelection {
|
|
98
|
+
audioScriptId: string;
|
|
99
|
+
segmentId: string;
|
|
100
|
+
start?: Cursor;
|
|
101
|
+
end?: Cursor;
|
|
102
|
+
}
|
|
103
|
+
type CaptionContent = SegmentSelection;
|
|
104
|
+
/** Words come from a selected run of a script or from the Caption's own text, never both. */
|
|
105
|
+
interface Caption {
|
|
106
|
+
selection?: CaptionContent;
|
|
107
|
+
text?: string;
|
|
108
|
+
style?: CaptionStyle$1;
|
|
109
|
+
}
|
|
110
|
+
/** The segment a PhoneticScript is written for, selected as a Caption selects one, and its pronunciation. */
|
|
111
|
+
interface Phoneme extends SegmentSelection {
|
|
112
|
+
/** What the voice synthesizes for that selection, written in what the voice accepts. */
|
|
113
|
+
phonemeScript?: string;
|
|
114
|
+
}
|
|
115
|
+
/** A file Memota stored from raw content: how a Media File entity names it, and its digest. */
|
|
116
|
+
interface StoredFile {
|
|
117
|
+
system: 'memota';
|
|
118
|
+
key: string;
|
|
119
|
+
storageKey?: string;
|
|
120
|
+
digest: string;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* A variant of an AudioScript: the segment it is written for, plus what to synthesize. It has the Media File
|
|
124
|
+
* trait (D178): its `phonemeScript` is raw content, stored in Memota as a text file whenever it is
|
|
125
|
+
* written, and the file's facts are kept beside it. Without a `phonemeScript` it has no file.
|
|
126
|
+
*/
|
|
127
|
+
interface PhoneticScript extends Partial<StoredFile> {
|
|
128
|
+
phoneme: Phoneme;
|
|
129
|
+
}
|
|
130
|
+
interface Voice {
|
|
131
|
+
system: 'voice-library';
|
|
132
|
+
key: string;
|
|
133
|
+
name?: string;
|
|
134
|
+
}
|
|
135
|
+
/** Table keys carry entity identity; values never duplicate an id or a single-table kind. */
|
|
136
|
+
interface EntityValues {
|
|
137
|
+
'timeline-entities': Record<string, never>;
|
|
138
|
+
'track-entities': Track$1;
|
|
139
|
+
'clip-entities': Clip;
|
|
140
|
+
'media-entities': Media;
|
|
141
|
+
'audio-script-entities': AudioScript;
|
|
142
|
+
'phonetic-script-entities': PhoneticScript;
|
|
143
|
+
'caption-entities': Caption;
|
|
144
|
+
'voice-entities': Voice;
|
|
145
|
+
}
|
|
146
|
+
/** Only relations an entity may hold many of have tables; single-valued ones are fields of their owner. */
|
|
147
|
+
interface RelationValues {
|
|
148
|
+
'voice-timbre-relations': {
|
|
149
|
+
recordingId: string;
|
|
150
|
+
voiceId: string;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* `sourceDigest`: the source's digest when the product was made from it (D177). A product whose
|
|
154
|
+
* source's digest differs now was made from content the source no longer has.
|
|
155
|
+
*/
|
|
156
|
+
'derived-from-relations': {
|
|
157
|
+
entityId: string;
|
|
158
|
+
sourceId: string;
|
|
159
|
+
sourceDigest?: string;
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/** What a create states: a PhoneticScript's phoneme may follow by set-phoneme in the same write. */
|
|
163
|
+
type EntityInput = Omit<EntityValues, 'phonetic-script-entities'> & {
|
|
164
|
+
'phonetic-script-entities': Omit<PhoneticScript, 'phoneme'> & {
|
|
165
|
+
phoneme?: Phoneme;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
type EntityTable = keyof EntityValues;
|
|
169
|
+
type RelationTable = keyof RelationValues;
|
|
170
|
+
type EntityTables = { [K in EntityTable]: Record<string, EntityValues[K]> };
|
|
171
|
+
type RelationTables = { [K in RelationTable]: Record<string, RelationValues[K]> };
|
|
172
|
+
type FieldPatch<T> = { [K in keyof T]?: NonNullable<T[K]> extends object ? FieldPatch<NonNullable<T[K]>> : T[K] | undefined };
|
|
173
|
+
type EntityMutation = { [K in EntityTable]: {
|
|
174
|
+
type: 'create-entity';
|
|
175
|
+
table: K;
|
|
176
|
+
id: string;
|
|
177
|
+
value: EntityInput[K];
|
|
178
|
+
} | {
|
|
179
|
+
type: 'patch-entity';
|
|
180
|
+
table: K;
|
|
181
|
+
id: string;
|
|
182
|
+
patch: FieldPatch<EntityValues[K]>;
|
|
183
|
+
} | {
|
|
184
|
+
type: 'delete-entity';
|
|
185
|
+
table: K;
|
|
186
|
+
id: string;
|
|
187
|
+
} }[EntityTable];
|
|
188
|
+
type RelationMutation = { [K in RelationTable]: {
|
|
189
|
+
type: 'set-relation';
|
|
190
|
+
table: K;
|
|
191
|
+
value: RelationValues[K];
|
|
192
|
+
} | {
|
|
193
|
+
type: 'delete-relation';
|
|
194
|
+
table: K;
|
|
195
|
+
id: string;
|
|
196
|
+
} }[RelationTable];
|
|
197
|
+
type ContainMutation = {
|
|
198
|
+
type: 'insert-node';
|
|
199
|
+
entityId: string;
|
|
200
|
+
parentId?: string;
|
|
201
|
+
index?: number;
|
|
202
|
+
} | {
|
|
203
|
+
type: 'move-node';
|
|
204
|
+
entityId: string;
|
|
205
|
+
parentId?: string;
|
|
206
|
+
index?: number;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'delete-node';
|
|
209
|
+
entityId: string;
|
|
210
|
+
};
|
|
211
|
+
/** A segment, or a run of it in UTF-16 offsets of its current text, as a write states it. */
|
|
212
|
+
interface SegmentRange {
|
|
213
|
+
audioScriptId: string;
|
|
214
|
+
segmentId: string;
|
|
215
|
+
start?: number;
|
|
216
|
+
end?: number;
|
|
217
|
+
}
|
|
218
|
+
interface CaptionSelection extends SegmentRange {
|
|
219
|
+
captionId: string;
|
|
220
|
+
}
|
|
221
|
+
interface PhonemeSelection extends SegmentRange {
|
|
222
|
+
phoneticScriptId: string;
|
|
223
|
+
phonemeScript?: string;
|
|
224
|
+
}
|
|
225
|
+
/** A script's segments are added, moved and removed by id; their text is edited in place. */
|
|
226
|
+
type SegmentMutation = {
|
|
227
|
+
type: 'insert-segment';
|
|
228
|
+
audioScriptId: string;
|
|
229
|
+
segmentId: string;
|
|
230
|
+
index?: number;
|
|
231
|
+
text: string;
|
|
232
|
+
startMs?: number;
|
|
233
|
+
endMs?: number;
|
|
234
|
+
} | {
|
|
235
|
+
type: 'move-segment';
|
|
236
|
+
audioScriptId: string;
|
|
237
|
+
segmentId: string;
|
|
238
|
+
index: number;
|
|
239
|
+
} | {
|
|
240
|
+
type: 'delete-segment';
|
|
241
|
+
audioScriptId: string;
|
|
242
|
+
segmentId: string;
|
|
243
|
+
};
|
|
244
|
+
type TextMutation = {
|
|
245
|
+
type: 'edit-caption-text';
|
|
246
|
+
captionId: string;
|
|
247
|
+
expectedBodyId?: string;
|
|
248
|
+
edits: readonly TextEdit[];
|
|
249
|
+
} | {
|
|
250
|
+
type: 'edit-text';
|
|
251
|
+
audioScriptId: string;
|
|
252
|
+
segmentId: string;
|
|
253
|
+
expectedBodyId?: string;
|
|
254
|
+
edits: readonly TextEdit[];
|
|
255
|
+
} | ({
|
|
256
|
+
type: 'set-caption-content';
|
|
257
|
+
} & CaptionSelection) | ({
|
|
258
|
+
type: 'set-phoneme';
|
|
259
|
+
} & PhonemeSelection);
|
|
260
|
+
type DslMutation = EntityMutation | RelationMutation | ContainMutation | SegmentMutation | TextMutation;
|
|
261
|
+
interface ContainNode {
|
|
262
|
+
treeId: TreeID;
|
|
263
|
+
entityId: string;
|
|
264
|
+
children: ContainNode[];
|
|
265
|
+
}
|
|
266
|
+
interface DslDiagnostic {
|
|
267
|
+
code: string;
|
|
268
|
+
path: string;
|
|
269
|
+
message: string;
|
|
270
|
+
}
|
|
271
|
+
interface TextRun {
|
|
272
|
+
insert: string;
|
|
273
|
+
attributes?: Record<string, unknown>;
|
|
274
|
+
}
|
|
275
|
+
interface RichTextSnapshot {
|
|
276
|
+
bodyId: string;
|
|
277
|
+
plainText: string;
|
|
278
|
+
delta: TextRun[];
|
|
279
|
+
}
|
|
280
|
+
/** Selected text, with its UTF-16 range in the Text it lies in: the segment's, or a Caption's own. */
|
|
281
|
+
interface CaptionText {
|
|
282
|
+
text: string;
|
|
283
|
+
start: number;
|
|
284
|
+
end: number;
|
|
285
|
+
bodyId: string;
|
|
286
|
+
}
|
|
287
|
+
type DeepReadonly<T> = T extends Cursor ? T : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
|
|
288
|
+
type MedeoDslSnapshot = DeepReadonly<EntityTables & RelationTables & {
|
|
289
|
+
'contain-relations': ContainNode[]; /** A Caption's own text by the Caption's id, and each script segment's text by the segment's id. */
|
|
290
|
+
richText: Record<string, RichTextSnapshot>;
|
|
291
|
+
captionText: Record<string, CaptionText>; /** What each PhoneticScript's selection holds now, resolved as a Caption's is. */
|
|
292
|
+
phoneticText: Record<string, CaptionText>;
|
|
293
|
+
diagnostics: DslDiagnostic[];
|
|
294
|
+
}>;
|
|
295
|
+
type TextMark = 'language';
|
|
296
|
+
type TextEdit = {
|
|
297
|
+
type: 'insert';
|
|
298
|
+
at: number;
|
|
299
|
+
text: string;
|
|
300
|
+
} | {
|
|
301
|
+
type: 'delete';
|
|
302
|
+
at: number;
|
|
303
|
+
length: number;
|
|
304
|
+
} | {
|
|
305
|
+
type: 'mark';
|
|
306
|
+
start: number;
|
|
307
|
+
end: number;
|
|
308
|
+
key: TextMark;
|
|
309
|
+
value: string;
|
|
310
|
+
} | {
|
|
311
|
+
type: 'unmark';
|
|
312
|
+
start: number;
|
|
313
|
+
end: number;
|
|
314
|
+
key: TextMark;
|
|
315
|
+
} | {
|
|
316
|
+
type: 'delta';
|
|
317
|
+
delta: TextDelta[];
|
|
318
|
+
};
|
|
319
|
+
type TextDelta = {
|
|
320
|
+
insert: string;
|
|
321
|
+
attributes?: Record<string, string | number | null>;
|
|
322
|
+
} | {
|
|
323
|
+
retain: number;
|
|
324
|
+
attributes?: Record<string, string | number | null>;
|
|
325
|
+
} | {
|
|
326
|
+
delete: number;
|
|
327
|
+
};
|
|
328
|
+
//#endregion
|
|
329
|
+
//#region ../medeo-dsl/src/ids.d.ts
|
|
330
|
+
declare function tupleHash(tuple: readonly string[]): string;
|
|
331
|
+
declare function resourceId(kind: 'media' | 'voice', system: string, key: string): string;
|
|
332
|
+
declare function relationId<K extends RelationTable>(table: K, value: RelationValues[K]): string;
|
|
333
|
+
/** Kinds of id a document mints: its entities', and a script segment's. */
|
|
334
|
+
type EntityIdKind = 'timeline' | 'track' | 'clip' | 'audio-script' | 'segment' | 'phonetic-script' | 'caption';
|
|
335
|
+
type DslIdFactory = (kind: EntityIdKind) => string;
|
|
336
|
+
declare const defaultIdFactory: DslIdFactory;
|
|
337
|
+
//#endregion
|
|
4
338
|
//#region src/dsl/action-context.d.ts
|
|
5
339
|
type ClipPlacement = {
|
|
6
340
|
kind: 'sequential';
|
|
@@ -58,7 +392,19 @@ interface DslClipUpdate {
|
|
|
58
392
|
placement?: ClipPlacement;
|
|
59
393
|
}
|
|
60
394
|
//#endregion
|
|
61
|
-
//#region
|
|
395
|
+
//#region src/dsl/commit-options.d.ts
|
|
396
|
+
/** Self-reported audit author; authorization remains the server's responsibility. */
|
|
397
|
+
interface OpActor {
|
|
398
|
+
user_id: string;
|
|
399
|
+
role: 'user' | 'agent';
|
|
400
|
+
}
|
|
401
|
+
interface CommitOptions {
|
|
402
|
+
/** The server audit view exposes string intents; other JSON values remain in the native message. */
|
|
403
|
+
intent?: unknown;
|
|
404
|
+
actor?: OpActor;
|
|
405
|
+
}
|
|
406
|
+
//#endregion
|
|
407
|
+
//#region ../../node_modules/.pnpm/loro-mirror@2.3.3_patch_hash=a551a0e4aa4f61ec88b0d9e970a183b5ee2955107a2e0bb03b378bc510c2f395_loro-crdt@1.16.4/node_modules/loro-mirror/dist/schema/types.d.ts
|
|
62
408
|
/**
|
|
63
409
|
* Options for schema definitions
|
|
64
410
|
*/
|
|
@@ -464,31 +810,31 @@ declare const medeoDslLoroShape: RootSchemaType<{
|
|
|
464
810
|
'audio-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
|
|
465
811
|
segments: /*elided*/any;
|
|
466
812
|
defaultLanguage: /*elided*/any;
|
|
813
|
+
system: /*elided*/any;
|
|
814
|
+
key: /*elided*/any;
|
|
815
|
+
storageKey: /*elided*/any;
|
|
816
|
+
digest: /*elided*/any;
|
|
467
817
|
}> & {
|
|
468
818
|
options: {};
|
|
469
819
|
} & {
|
|
470
820
|
catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
|
|
471
821
|
segments: /*elided*/any;
|
|
472
822
|
defaultLanguage: /*elided*/any;
|
|
823
|
+
system: /*elided*/any;
|
|
824
|
+
key: /*elided*/any;
|
|
825
|
+
storageKey: /*elided*/any;
|
|
826
|
+
digest: /*elided*/any;
|
|
473
827
|
}, C>;
|
|
474
828
|
}> & {
|
|
475
829
|
options: {};
|
|
476
830
|
};
|
|
477
831
|
'phonetic-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
|
|
478
|
-
|
|
479
|
-
system: /*elided*/any;
|
|
480
|
-
key: /*elided*/any;
|
|
481
|
-
storageKey: /*elided*/any;
|
|
482
|
-
digest: /*elided*/any;
|
|
832
|
+
binding: /*elided*/any;
|
|
483
833
|
}> & {
|
|
484
834
|
options: {};
|
|
485
835
|
} & {
|
|
486
836
|
catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
|
|
487
|
-
|
|
488
|
-
system: /*elided*/any;
|
|
489
|
-
key: /*elided*/any;
|
|
490
|
-
storageKey: /*elided*/any;
|
|
491
|
-
digest: /*elided*/any;
|
|
837
|
+
binding: /*elided*/any;
|
|
492
838
|
}, C>;
|
|
493
839
|
}> & {
|
|
494
840
|
options: {};
|
|
@@ -581,8 +927,9 @@ type ContainDraftNode = Omit<Input['contain-relations'][number], 'id' | 'childre
|
|
|
581
927
|
children: ContainDraftNode[];
|
|
582
928
|
};
|
|
583
929
|
type DraftFields<T> = T extends Cursor ? T : T extends (infer Item)[] ? DraftFields<Item>[] : T extends object ? { [K in keyof T as undefined extends T[K] ? never : K]: DraftFields<T[K]> } & { [K in keyof T as undefined extends T[K] ? K : never]?: DraftFields<T[K]> } : T;
|
|
584
|
-
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'>> & {
|
|
930
|
+
type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations' | 'phonetic-script-entities'>> & {
|
|
585
931
|
'contain-relations': ContainDraftNode[];
|
|
932
|
+
'phonetic-script-entities': Record<string, PhoneticScript>;
|
|
586
933
|
};
|
|
587
934
|
//#endregion
|
|
588
935
|
//#region ../medeo-dsl/src/schema/codec.d.ts
|
|
@@ -606,7 +953,7 @@ declare const captionContentCodec: AtomicCodec<SegmentSelection>;
|
|
|
606
953
|
declare function documentFormat(doc: LoroDoc): 'dsl' | 'legacy' | 'mixed' | 'unknown';
|
|
607
954
|
declare class UnsupportedDocumentFormatError extends Error {
|
|
608
955
|
readonly code = "unsupported_document_format";
|
|
609
|
-
constructor();
|
|
956
|
+
constructor(message?: string);
|
|
610
957
|
}
|
|
611
958
|
/** Run after initial import, before opening an editable handle. Empty new documents still have one Timeline. */
|
|
612
959
|
declare function assertDslDocument(doc: LoroDoc): void;
|
|
@@ -629,8 +976,14 @@ interface DslTransaction {
|
|
|
629
976
|
/** Offsets use the preview after preceding edits. Existing Text identities are checked when supplied. */
|
|
630
977
|
editText(audioScriptId: string, segmentId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
|
|
631
978
|
editCaptionText(captionId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
|
|
632
|
-
/**
|
|
633
|
-
|
|
979
|
+
/**
|
|
980
|
+
* Adds a segment at `index` (the end by default); its id must be new to the script. A transcript's
|
|
981
|
+
* segment states where its words were spoken in the medium, as its transcription file gave them.
|
|
982
|
+
*/
|
|
983
|
+
insertSegment(audioScriptId: string, segmentId: string, text: string, index?: number, time?: {
|
|
984
|
+
startMs: number;
|
|
985
|
+
endMs: number;
|
|
986
|
+
}): void;
|
|
634
987
|
/** `index` is measured after removing the segment. */
|
|
635
988
|
moveSegment(audioScriptId: string, segmentId: string, index: number): void;
|
|
636
989
|
deleteSegment(audioScriptId: string, segmentId: string): void;
|
|
@@ -677,6 +1030,8 @@ declare class MedeoDsl {
|
|
|
677
1030
|
applyMutations(mutations: readonly DslMutation[], audit: DslAudit): void;
|
|
678
1031
|
editText(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
679
1032
|
editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
|
|
1033
|
+
/** Check the session's write capability before an Action starts host-owned resource I/O. */
|
|
1034
|
+
assertWritable(): void;
|
|
680
1035
|
/**
|
|
681
1036
|
* A run inside one segment as native Cursors. Local ranges exclude insertions at their start and
|
|
682
1037
|
* include insertions at their end. K01 remains deferred.
|
|
@@ -684,6 +1039,7 @@ declare class MedeoDsl {
|
|
|
684
1039
|
textRange(scriptId: string, segmentId: string, start: number, end: number): SegmentSelection;
|
|
685
1040
|
dispose(): void;
|
|
686
1041
|
private mutate;
|
|
1042
|
+
private assertReadyToWrite;
|
|
687
1043
|
private notify;
|
|
688
1044
|
private assertActive;
|
|
689
1045
|
}
|
|
@@ -700,7 +1056,7 @@ interface VoiceoverCaptionInput {
|
|
|
700
1056
|
start: number;
|
|
701
1057
|
end: number;
|
|
702
1058
|
};
|
|
703
|
-
style?: CaptionStyle;
|
|
1059
|
+
style?: CaptionStyle$1;
|
|
704
1060
|
}
|
|
705
1061
|
interface ApplyVoiceoverInput {
|
|
706
1062
|
clipId?: string;
|
|
@@ -712,9 +1068,9 @@ interface ApplyVoiceoverInput {
|
|
|
712
1068
|
kind: 'voiceover-recording';
|
|
713
1069
|
};
|
|
714
1070
|
/**
|
|
715
|
-
* What the recording says:
|
|
716
|
-
*
|
|
717
|
-
*
|
|
1071
|
+
* What the recording says: a PhoneticScript it was spoken from, or plain words from an existing
|
|
1072
|
+
* or new AudioScript. Plain words get selection-only PhoneticScripts (D190), one per segment;
|
|
1073
|
+
* no control content, file or digest is invented. Captions keep selecting the base script.
|
|
718
1074
|
*/
|
|
719
1075
|
script: {
|
|
720
1076
|
audioScriptId: string;
|
|
@@ -738,7 +1094,10 @@ interface ApplyVoiceoverInput {
|
|
|
738
1094
|
sourceDigest?: string;
|
|
739
1095
|
volume?: number;
|
|
740
1096
|
voice?: Voice;
|
|
741
|
-
/**
|
|
1097
|
+
/**
|
|
1098
|
+
* Complete generated caption set for this use. It replaces the Caption Clips showing what the
|
|
1099
|
+
* use's current take says: those whose Caption selects it (D183).
|
|
1100
|
+
*/
|
|
742
1101
|
captions: readonly VoiceoverCaptionInput[];
|
|
743
1102
|
}
|
|
744
1103
|
interface VoiceoverResult {
|
|
@@ -794,7 +1153,7 @@ declare class DslEditor {
|
|
|
794
1153
|
start?: never;
|
|
795
1154
|
end?: never;
|
|
796
1155
|
}) & {
|
|
797
|
-
style?: CaptionStyle;
|
|
1156
|
+
style?: CaptionStyle$1;
|
|
798
1157
|
}, options?: CommitOptions): string;
|
|
799
1158
|
/** Show a segment of a script, or a run of it, in place of the Caption's own text. */
|
|
800
1159
|
setCaptionContent(captionId: string, selection: SegmentRange, options?: CommitOptions): void;
|
|
@@ -812,7 +1171,7 @@ declare class DslEditor {
|
|
|
812
1171
|
}, options?: CommitOptions): void;
|
|
813
1172
|
replaceClips(input: ReplaceDslClipsInput, options?: CommitOptions): string[];
|
|
814
1173
|
updateClips(updates: readonly DslClipUpdate[], options?: CommitOptions): void;
|
|
815
|
-
patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle>, options?: CommitOptions): void;
|
|
1174
|
+
patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle$1>, options?: CommitOptions): void;
|
|
816
1175
|
applyVoiceover(input: ApplyVoiceoverInput, options?: CommitOptions): VoiceoverResult;
|
|
817
1176
|
private voiceoverScriptId;
|
|
818
1177
|
/**
|
|
@@ -877,6 +1236,538 @@ declare class DslProjectionError extends Error {
|
|
|
877
1236
|
/** Pure deterministic solve. Constraints only move sequential roots; anchors retain their exact offsets. */
|
|
878
1237
|
declare function resolveDslLayout(snapshot: MedeoDslSnapshot): DslLayout;
|
|
879
1238
|
//#endregion
|
|
1239
|
+
//#region src/dsl/projection/generated/video-draft-idl.d.ts
|
|
1240
|
+
/**
|
|
1241
|
+
* @generated by @mengine/idl-codegen — DO NOT EDIT MANUALLY.
|
|
1242
|
+
*
|
|
1243
|
+
* VideoDraft read-view types extracted from the Smithy IDL
|
|
1244
|
+
* (medeo-v2-design-materials). Re-run `vp run @mengine/idl-codegen#sync`.
|
|
1245
|
+
* Source IDL commit: 902e82e3fec1e94b36e14ef671de91abd210dc86
|
|
1246
|
+
*
|
|
1247
|
+
* WHY EVERY FIELD IS `T | undefined`:
|
|
1248
|
+
* AWS `smithy-typescript-codegen` widens every structure member to
|
|
1249
|
+
* `T | undefined` regardless of the Smithy `@required` trait — it favours
|
|
1250
|
+
* deserialization robustness (a peer may omit a field on the wire) over
|
|
1251
|
+
* encoding requiredness in the static type. So these generated types are NOT
|
|
1252
|
+
* the source of truth for which fields are required: the Smithy `.smithy`
|
|
1253
|
+
* model is. Many fields here (e.g. `VideoClipPart.play_in` / `play_out` /
|
|
1254
|
+
* `volume` / `origin_media_id`) are `@required` in the contract.
|
|
1255
|
+
*
|
|
1256
|
+
* Requiredness is restored by import and write-time validation, not here.
|
|
1257
|
+
* DSL content constraints are owned by medeo-dsl and enforced at the medeo-client
|
|
1258
|
+
* transaction and import boundaries.
|
|
1259
|
+
* Do not assume a
|
|
1260
|
+
* field is optional just because its type is `| undefined`.
|
|
1261
|
+
*/
|
|
1262
|
+
/**
|
|
1263
|
+
* @public
|
|
1264
|
+
* @enum
|
|
1265
|
+
*/
|
|
1266
|
+
declare const PartKind: {
|
|
1267
|
+
readonly BGM: "bgm";
|
|
1268
|
+
readonly CAPTION: "caption";
|
|
1269
|
+
readonly SPEECH: "speech";
|
|
1270
|
+
readonly VIDEO_CLIP: "video_clip";
|
|
1271
|
+
};
|
|
1272
|
+
/**
|
|
1273
|
+
* @public
|
|
1274
|
+
*/
|
|
1275
|
+
type PartKind = (typeof PartKind)[keyof typeof PartKind];
|
|
1276
|
+
/**
|
|
1277
|
+
* @public
|
|
1278
|
+
*/
|
|
1279
|
+
interface VoiceSummary {
|
|
1280
|
+
name: string | undefined;
|
|
1281
|
+
id: string | undefined;
|
|
1282
|
+
}
|
|
1283
|
+
/**
|
|
1284
|
+
* @public
|
|
1285
|
+
*/
|
|
1286
|
+
interface SpeechPart$1 {
|
|
1287
|
+
id: string | undefined;
|
|
1288
|
+
duration_ms: number | undefined;
|
|
1289
|
+
/**
|
|
1290
|
+
* Types of parts that can be contained in tracks
|
|
1291
|
+
* @public
|
|
1292
|
+
*/
|
|
1293
|
+
kind: PartKind | undefined;
|
|
1294
|
+
audio_script: string | undefined;
|
|
1295
|
+
volume: number | undefined;
|
|
1296
|
+
audio_storage_key: string | undefined;
|
|
1297
|
+
origin_speech_id: string | undefined;
|
|
1298
|
+
voice: VoiceSummary | undefined;
|
|
1299
|
+
caption_ids: string[] | undefined;
|
|
1300
|
+
}
|
|
1301
|
+
/**
|
|
1302
|
+
* Caption visual style configuration
|
|
1303
|
+
* @public
|
|
1304
|
+
*/
|
|
1305
|
+
interface CaptionStyle {
|
|
1306
|
+
/**
|
|
1307
|
+
* Font ID referencing a font from the font library. Defaults to system font if not provided
|
|
1308
|
+
* @public
|
|
1309
|
+
*/
|
|
1310
|
+
font_id?: string | undefined;
|
|
1311
|
+
/**
|
|
1312
|
+
* Font size in points
|
|
1313
|
+
* @public
|
|
1314
|
+
*/
|
|
1315
|
+
font_size?: number | undefined;
|
|
1316
|
+
/**
|
|
1317
|
+
* Font color as hex string (e.g. "#FFFFFF")
|
|
1318
|
+
* @public
|
|
1319
|
+
*/
|
|
1320
|
+
font_color?: string | undefined;
|
|
1321
|
+
/**
|
|
1322
|
+
* Numeric font weight, e.g. 400 for regular or 700 for bold
|
|
1323
|
+
* @public
|
|
1324
|
+
*/
|
|
1325
|
+
font_weight?: number | undefined;
|
|
1326
|
+
/**
|
|
1327
|
+
* Caption entrance animation preset ID, e.g. "fade", "slideUp", or "none"
|
|
1328
|
+
* @public
|
|
1329
|
+
*/
|
|
1330
|
+
entrance_animation?: string | undefined;
|
|
1331
|
+
/**
|
|
1332
|
+
* Caption entrance animation duration in milliseconds
|
|
1333
|
+
* @public
|
|
1334
|
+
*/
|
|
1335
|
+
entrance_animation_duration_ms?: number | undefined;
|
|
1336
|
+
/**
|
|
1337
|
+
* Caption outline/stroke color as hex string (e.g. "#000000")
|
|
1338
|
+
* @public
|
|
1339
|
+
*/
|
|
1340
|
+
stroke_color?: string | undefined;
|
|
1341
|
+
/**
|
|
1342
|
+
* Caption outline/stroke width in pixels
|
|
1343
|
+
* @public
|
|
1344
|
+
*/
|
|
1345
|
+
stroke_width?: number | undefined;
|
|
1346
|
+
/**
|
|
1347
|
+
* Caption center X position as a percentage (0.0 to 1.0)
|
|
1348
|
+
* @public
|
|
1349
|
+
*/
|
|
1350
|
+
position_x?: number | undefined;
|
|
1351
|
+
/**
|
|
1352
|
+
* Caption center Y position as a percentage (0.0 to 1.0)
|
|
1353
|
+
* @public
|
|
1354
|
+
*/
|
|
1355
|
+
position_y?: number | undefined;
|
|
1356
|
+
}
|
|
1357
|
+
/**
|
|
1358
|
+
* @public
|
|
1359
|
+
*/
|
|
1360
|
+
interface CaptionPart$1 {
|
|
1361
|
+
id: string | undefined;
|
|
1362
|
+
duration_ms: number | undefined;
|
|
1363
|
+
/**
|
|
1364
|
+
* Types of parts that can be contained in tracks
|
|
1365
|
+
* @public
|
|
1366
|
+
*/
|
|
1367
|
+
kind: PartKind | undefined;
|
|
1368
|
+
speech_part_id: string | undefined;
|
|
1369
|
+
text: string | undefined;
|
|
1370
|
+
start_ms: number | undefined;
|
|
1371
|
+
/**
|
|
1372
|
+
* Caption visual style (font, size, color, weight, animation, outline). Uses default style if not provided
|
|
1373
|
+
* @public
|
|
1374
|
+
*/
|
|
1375
|
+
style?: CaptionStyle | undefined;
|
|
1376
|
+
}
|
|
1377
|
+
/**
|
|
1378
|
+
* @public
|
|
1379
|
+
* @enum
|
|
1380
|
+
*/
|
|
1381
|
+
declare const AspectRatio: {
|
|
1382
|
+
readonly RATIO_16_9: "16:9";
|
|
1383
|
+
readonly RATIO_9_16: "9:16";
|
|
1384
|
+
};
|
|
1385
|
+
/**
|
|
1386
|
+
* @public
|
|
1387
|
+
*/
|
|
1388
|
+
type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
|
|
1389
|
+
/**
|
|
1390
|
+
* @public
|
|
1391
|
+
* @enum
|
|
1392
|
+
*/
|
|
1393
|
+
declare const AssetSource: {
|
|
1394
|
+
readonly AI_IMAGES: "ai_images";
|
|
1395
|
+
readonly AI_VIDEOS: "ai_videos";
|
|
1396
|
+
readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
|
|
1397
|
+
readonly STOCK_VIDEOS: "stock_videos";
|
|
1398
|
+
};
|
|
1399
|
+
/**
|
|
1400
|
+
* @public
|
|
1401
|
+
*/
|
|
1402
|
+
type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
|
|
1403
|
+
/**
|
|
1404
|
+
* An extra aspect ratio variant with independent storage keys for thumbnail,
|
|
1405
|
+
* preview video, and highlight video. Stored inside video_settings JSONB.
|
|
1406
|
+
* @public
|
|
1407
|
+
*/
|
|
1408
|
+
interface RatioVariant {
|
|
1409
|
+
aspect_ratio: string | undefined;
|
|
1410
|
+
thumb_storage_key: string | undefined;
|
|
1411
|
+
video_storage_key: string | undefined;
|
|
1412
|
+
highlight_video_storage_key?: string | undefined;
|
|
1413
|
+
}
|
|
1414
|
+
/**
|
|
1415
|
+
* @public
|
|
1416
|
+
*/
|
|
1417
|
+
interface VideoCreationSettings$1 {
|
|
1418
|
+
voice_id?: string | undefined;
|
|
1419
|
+
duration_ms?: number | undefined;
|
|
1420
|
+
aspect_ratio?: AspectRatio | undefined;
|
|
1421
|
+
video_style_id?: string | undefined;
|
|
1422
|
+
asset_sources?: AssetSource[] | undefined;
|
|
1423
|
+
recipe_id?: string | undefined;
|
|
1424
|
+
enable_high_cost_confirm?: boolean | undefined;
|
|
1425
|
+
user_confirm_cost_threshold?: number | undefined;
|
|
1426
|
+
/**
|
|
1427
|
+
* Extra aspect ratio variants with independent storage keys.
|
|
1428
|
+
* Each variant carries its own thumbnail, preview video, and optional highlight video.
|
|
1429
|
+
* Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
|
|
1430
|
+
* @public
|
|
1431
|
+
*/
|
|
1432
|
+
extra_ratios?: RatioVariant[] | undefined;
|
|
1433
|
+
}
|
|
1434
|
+
/**
|
|
1435
|
+
* @public
|
|
1436
|
+
*/
|
|
1437
|
+
interface TrackItem {
|
|
1438
|
+
abs_time_position: number | undefined;
|
|
1439
|
+
part_id: string | undefined;
|
|
1440
|
+
}
|
|
1441
|
+
/**
|
|
1442
|
+
* @public
|
|
1443
|
+
*/
|
|
1444
|
+
interface Track {
|
|
1445
|
+
id: string | undefined;
|
|
1446
|
+
/**
|
|
1447
|
+
* Types of parts that can be contained in tracks
|
|
1448
|
+
* @public
|
|
1449
|
+
*/
|
|
1450
|
+
parts_kind: PartKind | undefined;
|
|
1451
|
+
is_hidden: boolean | undefined;
|
|
1452
|
+
items: TrackItem[] | undefined;
|
|
1453
|
+
}
|
|
1454
|
+
/**
|
|
1455
|
+
* @public
|
|
1456
|
+
*/
|
|
1457
|
+
interface Attachment {
|
|
1458
|
+
part_id: string | undefined;
|
|
1459
|
+
relative_time_position: number | undefined;
|
|
1460
|
+
}
|
|
1461
|
+
/**
|
|
1462
|
+
* @public
|
|
1463
|
+
*/
|
|
1464
|
+
interface PartAggregation {
|
|
1465
|
+
body_part_id: string | undefined;
|
|
1466
|
+
attachments: Attachment[] | undefined;
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* @public
|
|
1470
|
+
*/
|
|
1471
|
+
interface BgmPart$1 {
|
|
1472
|
+
id: string | undefined;
|
|
1473
|
+
duration_ms: number | undefined;
|
|
1474
|
+
/**
|
|
1475
|
+
* Types of parts that can be contained in tracks
|
|
1476
|
+
* @public
|
|
1477
|
+
*/
|
|
1478
|
+
kind: PartKind | undefined;
|
|
1479
|
+
audio_storage_key: string | undefined;
|
|
1480
|
+
volume: number | undefined;
|
|
1481
|
+
origin_media_id: string | undefined;
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* @public
|
|
1485
|
+
* @enum
|
|
1486
|
+
*/
|
|
1487
|
+
declare const SpeedShiftCategory: {
|
|
1488
|
+
/**
|
|
1489
|
+
* Variable speed controlled by Bezier keyframes
|
|
1490
|
+
*/
|
|
1491
|
+
readonly CURVE: "curve";
|
|
1492
|
+
/**
|
|
1493
|
+
* Constant speed multiplier across the entire clip
|
|
1494
|
+
*/
|
|
1495
|
+
readonly LINEAR: "linear";
|
|
1496
|
+
};
|
|
1497
|
+
/**
|
|
1498
|
+
* @public
|
|
1499
|
+
*/
|
|
1500
|
+
type SpeedShiftCategory = (typeof SpeedShiftCategory)[keyof typeof SpeedShiftCategory];
|
|
1501
|
+
/**
|
|
1502
|
+
* @public
|
|
1503
|
+
*/
|
|
1504
|
+
interface TangentHandle {
|
|
1505
|
+
x: number | undefined;
|
|
1506
|
+
y: number | undefined;
|
|
1507
|
+
}
|
|
1508
|
+
/**
|
|
1509
|
+
* @public
|
|
1510
|
+
*/
|
|
1511
|
+
interface SpeedKeyframe {
|
|
1512
|
+
position: number | undefined;
|
|
1513
|
+
rate: number | undefined;
|
|
1514
|
+
in_tangent?: TangentHandle | undefined;
|
|
1515
|
+
out_tangent?: TangentHandle | undefined;
|
|
1516
|
+
}
|
|
1517
|
+
/**
|
|
1518
|
+
* @public
|
|
1519
|
+
*/
|
|
1520
|
+
interface CurveConfig {
|
|
1521
|
+
keyframes: SpeedKeyframe[] | undefined;
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* @public
|
|
1525
|
+
*/
|
|
1526
|
+
interface LinearConfig {
|
|
1527
|
+
speed: number | undefined;
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* @public
|
|
1531
|
+
*/
|
|
1532
|
+
type SpeedShiftConfigUnion = SpeedShiftConfigUnion.CurveMember | SpeedShiftConfigUnion.LinearMember | SpeedShiftConfigUnion.$UnknownMember;
|
|
1533
|
+
/**
|
|
1534
|
+
* @public
|
|
1535
|
+
*/
|
|
1536
|
+
declare namespace SpeedShiftConfigUnion {
|
|
1537
|
+
interface LinearMember {
|
|
1538
|
+
linear: LinearConfig;
|
|
1539
|
+
curve?: never;
|
|
1540
|
+
$unknown?: never;
|
|
1541
|
+
}
|
|
1542
|
+
interface CurveMember {
|
|
1543
|
+
linear?: never;
|
|
1544
|
+
curve: CurveConfig;
|
|
1545
|
+
$unknown?: never;
|
|
1546
|
+
}
|
|
1547
|
+
/**
|
|
1548
|
+
* @public
|
|
1549
|
+
*/
|
|
1550
|
+
interface $UnknownMember {
|
|
1551
|
+
linear?: never;
|
|
1552
|
+
curve?: never;
|
|
1553
|
+
$unknown: [string, any];
|
|
1554
|
+
}
|
|
1555
|
+
interface Visitor<T> {
|
|
1556
|
+
linear: (value: LinearConfig) => T;
|
|
1557
|
+
curve: (value: CurveConfig) => T;
|
|
1558
|
+
_: (name: string, value: any) => T;
|
|
1559
|
+
}
|
|
1560
|
+
const visit: <T>(value: SpeedShiftConfigUnion, visitor: Visitor<T>) => T;
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* @public
|
|
1564
|
+
*/
|
|
1565
|
+
interface SpeedShift {
|
|
1566
|
+
category: SpeedShiftCategory | undefined;
|
|
1567
|
+
mode: string | undefined;
|
|
1568
|
+
config: SpeedShiftConfigUnion | undefined;
|
|
1569
|
+
}
|
|
1570
|
+
/**
|
|
1571
|
+
* @public
|
|
1572
|
+
*/
|
|
1573
|
+
interface VideoClipPart {
|
|
1574
|
+
id: string | undefined;
|
|
1575
|
+
duration_ms: number | undefined;
|
|
1576
|
+
/**
|
|
1577
|
+
* Types of parts that can be contained in tracks
|
|
1578
|
+
* @public
|
|
1579
|
+
*/
|
|
1580
|
+
kind: PartKind | undefined;
|
|
1581
|
+
play_in: number | undefined;
|
|
1582
|
+
play_out: number | undefined;
|
|
1583
|
+
volume: number | undefined;
|
|
1584
|
+
origin_media_id: string | undefined;
|
|
1585
|
+
speed_shift?: SpeedShift | undefined;
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1588
|
+
* @public
|
|
1589
|
+
*/
|
|
1590
|
+
type PartUnion = PartUnion.BgmMember | PartUnion.CaptionMember | PartUnion.SpeechMember | PartUnion.Video_clipMember | PartUnion.$UnknownMember;
|
|
1591
|
+
/**
|
|
1592
|
+
* @public
|
|
1593
|
+
*/
|
|
1594
|
+
declare namespace PartUnion {
|
|
1595
|
+
interface Video_clipMember {
|
|
1596
|
+
video_clip: VideoClipPart;
|
|
1597
|
+
bgm?: never;
|
|
1598
|
+
speech?: never;
|
|
1599
|
+
caption?: never;
|
|
1600
|
+
$unknown?: never;
|
|
1601
|
+
}
|
|
1602
|
+
interface BgmMember {
|
|
1603
|
+
video_clip?: never;
|
|
1604
|
+
bgm: BgmPart$1;
|
|
1605
|
+
speech?: never;
|
|
1606
|
+
caption?: never;
|
|
1607
|
+
$unknown?: never;
|
|
1608
|
+
}
|
|
1609
|
+
interface SpeechMember {
|
|
1610
|
+
video_clip?: never;
|
|
1611
|
+
bgm?: never;
|
|
1612
|
+
speech: SpeechPart$1;
|
|
1613
|
+
caption?: never;
|
|
1614
|
+
$unknown?: never;
|
|
1615
|
+
}
|
|
1616
|
+
interface CaptionMember {
|
|
1617
|
+
video_clip?: never;
|
|
1618
|
+
bgm?: never;
|
|
1619
|
+
speech?: never;
|
|
1620
|
+
caption: CaptionPart$1;
|
|
1621
|
+
$unknown?: never;
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* @public
|
|
1625
|
+
*/
|
|
1626
|
+
interface $UnknownMember {
|
|
1627
|
+
video_clip?: never;
|
|
1628
|
+
bgm?: never;
|
|
1629
|
+
speech?: never;
|
|
1630
|
+
caption?: never;
|
|
1631
|
+
$unknown: [string, any];
|
|
1632
|
+
}
|
|
1633
|
+
interface Visitor<T> {
|
|
1634
|
+
video_clip: (value: VideoClipPart) => T;
|
|
1635
|
+
bgm: (value: BgmPart$1) => T;
|
|
1636
|
+
speech: (value: SpeechPart$1) => T;
|
|
1637
|
+
caption: (value: CaptionPart$1) => T;
|
|
1638
|
+
_: (name: string, value: any) => T;
|
|
1639
|
+
}
|
|
1640
|
+
const visit: <T>(value: PartUnion, visitor: Visitor<T>) => T;
|
|
1641
|
+
}
|
|
1642
|
+
/**
|
|
1643
|
+
* Timeline configuration for video editing
|
|
1644
|
+
* @public
|
|
1645
|
+
*/
|
|
1646
|
+
interface Timeline {
|
|
1647
|
+
duration_ms: number | undefined;
|
|
1648
|
+
unit_time_ms: number | undefined;
|
|
1649
|
+
}
|
|
1650
|
+
/**
|
|
1651
|
+
* Complete video draft information with timeline and tracks
|
|
1652
|
+
* @public
|
|
1653
|
+
*/
|
|
1654
|
+
interface VideoDraft$1 {
|
|
1655
|
+
id?: string | undefined;
|
|
1656
|
+
project_id: string | undefined;
|
|
1657
|
+
owner_id: string | undefined;
|
|
1658
|
+
/**
|
|
1659
|
+
* for-code-gen: property value may be empty string ("")
|
|
1660
|
+
* @public
|
|
1661
|
+
*/
|
|
1662
|
+
thumbnail_storage_key: string | undefined;
|
|
1663
|
+
/**
|
|
1664
|
+
* Timeline configuration for video editing
|
|
1665
|
+
* @public
|
|
1666
|
+
*/
|
|
1667
|
+
timeline?: Timeline | undefined;
|
|
1668
|
+
video_creation_settings?: VideoCreationSettings$1 | undefined;
|
|
1669
|
+
chat_session_id: string | undefined;
|
|
1670
|
+
main_track?: Track | undefined;
|
|
1671
|
+
above_main_tracks: Track[] | undefined;
|
|
1672
|
+
below_main_tracks: Track[] | undefined;
|
|
1673
|
+
part_aggregations: PartAggregation[] | undefined;
|
|
1674
|
+
part_library: Record<string, PartUnion> | undefined;
|
|
1675
|
+
version: number | undefined;
|
|
1676
|
+
}
|
|
1677
|
+
//#endregion
|
|
1678
|
+
//#region src/dsl/projection/video-draft-types.d.ts
|
|
1679
|
+
type VideoDraftTrack = Track;
|
|
1680
|
+
type VideoDraftTrackItem = TrackItem;
|
|
1681
|
+
type VideoDraftTimeline = Timeline;
|
|
1682
|
+
type VideoDraftCaptionStyle = CaptionStyle;
|
|
1683
|
+
interface CaptionDisplayCue {
|
|
1684
|
+
segmentId: string;
|
|
1685
|
+
text: string;
|
|
1686
|
+
startMs: number;
|
|
1687
|
+
durationMs: number;
|
|
1688
|
+
}
|
|
1689
|
+
type VideoCreationSettings = Omit<VideoCreationSettings$1, 'video_style_id' | 'duration_ms'> & {
|
|
1690
|
+
video_style_id?: string | null;
|
|
1691
|
+
duration_ms?: number | null;
|
|
1692
|
+
};
|
|
1693
|
+
type VideoPart = Omit<VideoClipPart, 'duration_ms'>;
|
|
1694
|
+
type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
|
|
1695
|
+
media_duration_ms?: number;
|
|
1696
|
+
};
|
|
1697
|
+
type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
|
|
1698
|
+
initial_duration_ms?: number;
|
|
1699
|
+
display_cues?: CaptionDisplayCue[];
|
|
1700
|
+
};
|
|
1701
|
+
type BgmPart = Omit<BgmPart$1, 'duration_ms'>;
|
|
1702
|
+
/** Legacy inputs may omit derived durations; output always states the field. */
|
|
1703
|
+
type VideoDraftPartUnion = {
|
|
1704
|
+
video_clip: VideoPart & {
|
|
1705
|
+
duration_ms?: number;
|
|
1706
|
+
};
|
|
1707
|
+
speech?: never;
|
|
1708
|
+
caption?: never;
|
|
1709
|
+
bgm?: never;
|
|
1710
|
+
} | {
|
|
1711
|
+
video_clip?: never;
|
|
1712
|
+
speech: SpeechPart & {
|
|
1713
|
+
duration_ms?: number;
|
|
1714
|
+
};
|
|
1715
|
+
caption?: never;
|
|
1716
|
+
bgm?: never;
|
|
1717
|
+
} | {
|
|
1718
|
+
video_clip?: never;
|
|
1719
|
+
speech?: never;
|
|
1720
|
+
caption: CaptionPart & {
|
|
1721
|
+
duration_ms?: number;
|
|
1722
|
+
};
|
|
1723
|
+
bgm?: never;
|
|
1724
|
+
} | {
|
|
1725
|
+
video_clip?: never;
|
|
1726
|
+
speech?: never;
|
|
1727
|
+
caption?: never;
|
|
1728
|
+
bgm: BgmPart & {
|
|
1729
|
+
duration_ms?: number;
|
|
1730
|
+
};
|
|
1731
|
+
};
|
|
1732
|
+
type VideoDraftContentPartUnion = {
|
|
1733
|
+
video_clip: VideoPart & {
|
|
1734
|
+
duration_ms: number | undefined;
|
|
1735
|
+
};
|
|
1736
|
+
speech?: never;
|
|
1737
|
+
caption?: never;
|
|
1738
|
+
bgm?: never;
|
|
1739
|
+
} | {
|
|
1740
|
+
video_clip?: never;
|
|
1741
|
+
speech: SpeechPart & {
|
|
1742
|
+
duration_ms: number | undefined;
|
|
1743
|
+
};
|
|
1744
|
+
caption?: never;
|
|
1745
|
+
bgm?: never;
|
|
1746
|
+
} | {
|
|
1747
|
+
video_clip?: never;
|
|
1748
|
+
speech?: never;
|
|
1749
|
+
caption: CaptionPart & {
|
|
1750
|
+
duration_ms: number | undefined;
|
|
1751
|
+
};
|
|
1752
|
+
bgm?: never;
|
|
1753
|
+
} | {
|
|
1754
|
+
video_clip?: never;
|
|
1755
|
+
speech?: never;
|
|
1756
|
+
caption?: never;
|
|
1757
|
+
bgm: BgmPart & {
|
|
1758
|
+
duration_ms: number | undefined;
|
|
1759
|
+
};
|
|
1760
|
+
};
|
|
1761
|
+
type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
|
|
1762
|
+
part_library: Record<string, VideoDraftPartUnion> | undefined;
|
|
1763
|
+
video_creation_settings?: VideoCreationSettings;
|
|
1764
|
+
};
|
|
1765
|
+
type VideoDraftContent = Pick<VideoDraft, 'timeline' | 'main_track' | 'above_main_tracks' | 'below_main_tracks' | 'part_aggregations'> & {
|
|
1766
|
+
part_library: Record<string, VideoDraftContentPartUnion> | undefined;
|
|
1767
|
+
};
|
|
1768
|
+
type VideoDraftInput = Pick<VideoDraft, keyof VideoDraftContent>;
|
|
1769
|
+
declare const DEFAULT_UNIT_TIME_MS = 33.333;
|
|
1770
|
+
//#endregion
|
|
880
1771
|
//#region src/dsl/projection/to-video-draft.d.ts
|
|
881
1772
|
interface VideoDraftProjection {
|
|
882
1773
|
content: VideoDraftContent;
|
|
@@ -886,6 +1777,13 @@ interface VideoDraftProjection {
|
|
|
886
1777
|
declare function toVideoDraft(snapshot: MedeoDslSnapshot): VideoDraftProjection;
|
|
887
1778
|
//#endregion
|
|
888
1779
|
//#region src/dsl/projection/audio-scripts.d.ts
|
|
1780
|
+
/** The script a recording says and its phonetic origins; old direct script origins remain readable. */
|
|
1781
|
+
interface SpokenScript {
|
|
1782
|
+
audioScriptId: string;
|
|
1783
|
+
phoneticScriptId?: string;
|
|
1784
|
+
/** Several plain selections of the same script; the singular summary is omitted. */
|
|
1785
|
+
phoneticScriptIds?: string[];
|
|
1786
|
+
}
|
|
889
1787
|
/**
|
|
890
1788
|
* An AudioScript with everything that says or shows it, read from the same snapshot as the
|
|
891
1789
|
* VideoDraft. Speeches and captions come in playback order.
|
|
@@ -896,7 +1794,14 @@ interface AudioScriptView {
|
|
|
896
1794
|
segments: {
|
|
897
1795
|
id: string;
|
|
898
1796
|
text: string;
|
|
899
|
-
language?: string;
|
|
1797
|
+
language?: string; /** A transcript's segment: where its words were spoken in the medium, as its transcription file gave them. */
|
|
1798
|
+
startMs?: number;
|
|
1799
|
+
endMs?: number;
|
|
1800
|
+
/**
|
|
1801
|
+
* Where that falls on the Timeline (D186): through the Clip playing the medium the script was
|
|
1802
|
+
* read off whose window holds `startMs`. Absent when no Clip plays that moment.
|
|
1803
|
+
*/
|
|
1804
|
+
timelineMs?: number;
|
|
900
1805
|
}[];
|
|
901
1806
|
/** Media the script was read off (a transcript), through derived-from. */
|
|
902
1807
|
sourceMediaIds: string[];
|
|
@@ -914,8 +1819,9 @@ interface AudioScriptView {
|
|
|
914
1819
|
/** Speech Clips playing a recording of these words. */
|
|
915
1820
|
speeches: {
|
|
916
1821
|
clipId: string;
|
|
917
|
-
recordingId: string; /**
|
|
918
|
-
phoneticScriptId?: string;
|
|
1822
|
+
recordingId: string; /** Its single phonetic origin; omitted for multiple origins or an old direct script origin. */
|
|
1823
|
+
phoneticScriptId?: string; /** Multiple segment selections used by one recording, without duplicating its Clip. */
|
|
1824
|
+
phoneticScriptIds?: string[];
|
|
919
1825
|
voices: {
|
|
920
1826
|
voiceId: string;
|
|
921
1827
|
key: string;
|
|
@@ -934,6 +1840,12 @@ interface AudioScriptView {
|
|
|
934
1840
|
segment: number;
|
|
935
1841
|
}[];
|
|
936
1842
|
}
|
|
1843
|
+
/**
|
|
1844
|
+
* The scripts a recording says. It follows derived-from from the recording; a PhoneticScript is a
|
|
1845
|
+
* variant, so its words are the base its phoneme names, and derived-from is not followed past it.
|
|
1846
|
+
* When nothing is found that way, a script read off the recording itself is what it says.
|
|
1847
|
+
*/
|
|
1848
|
+
declare function spokenScripts(snapshot: MedeoDslSnapshot, recordingId: string): SpokenScript[];
|
|
937
1849
|
/** Every AudioScript in the document with its PhoneticScripts, the Speech Clips saying it and the Caption Clips showing it. */
|
|
938
1850
|
declare function toAudioScriptViews(snapshot: MedeoDslSnapshot): AudioScriptView[];
|
|
939
1851
|
//#endregion
|
|
@@ -950,4 +1862,4 @@ interface ImportedVideoDraft {
|
|
|
950
1862
|
/** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
|
|
951
1863
|
declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
|
|
952
1864
|
//#endregion
|
|
953
|
-
export {
|
|
1865
|
+
export { MoveDslClipsInput as $, ApplyVoiceoverInput as A, RelationValues as At, InvalidAtomic as B, Track$1 as Bt, DslClipLayout as C, EntityValues as Ct, createInitialMedeoDsl as D, RelationMutation as Dt, DslTrackLayout as E, Media as Et, DslAudit as F, TextEdit as Ft, MedeoDslLoroState as G, isInvalidAtomic as H, Voice as Ht, DslTransaction as I, TextMark as It, OpActor as J, medeoDslLoroShape as K, UnsupportedDocumentFormatError as L, TextMutation as Lt, VoiceoverResult as M, RichTextSnapshot as Mt, CreateMedeoDslOptions as N, StoredFile as Nt, DslEditor as O, RelationTable as Ot, MedeoDsl as P, TextDelta as Pt, DslClipUpdate as Q, assertDslDocument as R, TextRun as Rt, resolveDslLayout as S, EntityTables as St, DslProjectionError as T, MedeoDslSnapshot as Tt, timeAnchorCodec as U, captionContentCodec as V, TrackRole as Vt, MedeoDslDraft as W, AddDslClipsInput as X, AddDslClip as Y, ClipSource as Z, VideoDraftInput as _, DeepReadonly as _t, SpokenScript as a, relationId as at, VideoDraftTrack as b, EntityMutation as bt, VideoDraftProjection as c, AudioScript as ct, DEFAULT_UNIT_TIME_MS as d, CaptionSelection as dt, ReplaceDslClipsInput as et, VideoCreationSettings as f, CaptionStyle$1 as ft, VideoDraftContentPartUnion as g, ContainNode as gt, VideoDraftContent as h, ContainMutation as ht, AudioScriptView as i, defaultIdFactory as it, VoiceoverCaptionInput as j, ResourceSystem as jt, UploadText as k, RelationTables as kt, toVideoDraft as l, Caption as lt, VideoDraftCaptionStyle as m, Clip as mt, ImportedVideoDraft as n, DslIdFactory as nt, spokenScripts as o, resourceId as ot, VideoDraft as p, CaptionText as pt, CommitOptions as q, fromVideoDraft as r, EntityIdKind as rt, toAudioScriptViews as s, tupleHash as st, FromVideoDraftOptions as t, ClipPlacement as tt, CaptionDisplayCue as u, CaptionContent as ut, VideoDraftPartUnion as v, DslDiagnostic as vt, DslLayout as w, FieldPatch as wt, VideoDraftTrackItem as x, EntityTable as xt, VideoDraftTimeline as y, DslMutation as yt, documentFormat as z, TimeAnchor as zt };
|