@mengine/medeo-client 2.1.1-dsl.9 → 3.0.1-dsl.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.
@@ -1,869 +0,0 @@
1
- import { Cursor, TreeID } from "loro-crdt";
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
- /** A script is segmented text: its segments in order (D181). */
62
- interface AudioScript {
63
- segments: AudioScriptSegment[];
64
- defaultLanguage?: string;
65
- }
66
- interface CaptionStyle$1 {
67
- font?: {
68
- system: 'font-library';
69
- key: string;
70
- };
71
- fontSize?: number;
72
- fontColor?: string;
73
- fontWeight?: number;
74
- entranceAnimation?: string;
75
- entranceAnimationDurationMs?: number;
76
- strokeColor?: string;
77
- strokeWidth?: number;
78
- positionX?: number;
79
- positionY?: number;
80
- }
81
- /**
82
- * What a Caption shows or a PhoneticScript is written for: one segment of a script, or a run inside
83
- * it (D181). The run's ends are Cursors on that segment's Text, so they follow its edits; without
84
- * them the whole segment is meant, whatever it comes to say. One value: taken or replaced whole.
85
- */
86
- interface SegmentSelection {
87
- audioScriptId: string;
88
- segmentId: string;
89
- start?: Cursor;
90
- end?: Cursor;
91
- }
92
- type CaptionContent = SegmentSelection;
93
- /** Words come from a selected run of a script or from the Caption's own text, never both. */
94
- interface Caption {
95
- selection?: CaptionContent;
96
- text?: string;
97
- style?: CaptionStyle$1;
98
- }
99
- /** The segment a PhoneticScript is written for, selected as a Caption selects one, and its pronunciation. */
100
- interface Phoneme extends SegmentSelection {
101
- /** What the voice synthesizes for that selection, written in what the voice accepts. */
102
- phonemeScript?: string;
103
- }
104
- /** A file Memota stored from raw content: how a Media File entity names it, and its digest. */
105
- interface StoredFile {
106
- system: 'memota';
107
- key: string;
108
- storageKey?: string;
109
- digest: string;
110
- }
111
- /**
112
- * A variant of an AudioScript: the segment it is written for, plus what to synthesize. It has the Media File
113
- * trait (D178): its `phonemeScript` is raw content, stored in Memota as a text file whenever it is
114
- * written, and the file's facts are kept beside it. Without a `phonemeScript` it has no file.
115
- */
116
- interface PhoneticScript extends Partial<StoredFile> {
117
- phoneme: Phoneme;
118
- }
119
- interface Voice {
120
- system: 'voice-library';
121
- key: string;
122
- name?: string;
123
- }
124
- /** Table keys carry entity identity; values never duplicate an id or a single-table kind. */
125
- interface EntityValues {
126
- 'timeline-entities': Record<string, never>;
127
- 'track-entities': Track$1;
128
- 'clip-entities': Clip;
129
- 'media-entities': Media;
130
- 'audio-script-entities': AudioScript;
131
- 'phonetic-script-entities': PhoneticScript;
132
- 'caption-entities': Caption;
133
- 'voice-entities': Voice;
134
- }
135
- /** Only relations an entity may hold many of have tables; single-valued ones are fields of their owner. */
136
- interface RelationValues {
137
- 'voice-timbre-relations': {
138
- recordingId: string;
139
- voiceId: string;
140
- };
141
- /**
142
- * `sourceDigest`: the source's digest when the product was made from it (D177). A product whose
143
- * source's digest differs now was made from content the source no longer has.
144
- */
145
- 'derived-from-relations': {
146
- entityId: string;
147
- sourceId: string;
148
- sourceDigest?: string;
149
- };
150
- }
151
- /** What a create states: a PhoneticScript's phoneme may follow by set-phoneme in the same write. */
152
- type EntityInput = Omit<EntityValues, 'phonetic-script-entities'> & {
153
- 'phonetic-script-entities': Omit<PhoneticScript, 'phoneme'> & {
154
- phoneme?: Phoneme;
155
- };
156
- };
157
- type EntityTable = keyof EntityValues;
158
- type RelationTable = keyof RelationValues;
159
- type EntityTables = { [K in EntityTable]: Record<string, EntityValues[K]> };
160
- type RelationTables = { [K in RelationTable]: Record<string, RelationValues[K]> };
161
- type FieldPatch<T> = { [K in keyof T]?: NonNullable<T[K]> extends object ? FieldPatch<NonNullable<T[K]>> : T[K] | undefined };
162
- type EntityMutation = { [K in EntityTable]: {
163
- type: 'create-entity';
164
- table: K;
165
- id: string;
166
- value: EntityInput[K];
167
- } | {
168
- type: 'patch-entity';
169
- table: K;
170
- id: string;
171
- patch: FieldPatch<EntityValues[K]>;
172
- } | {
173
- type: 'delete-entity';
174
- table: K;
175
- id: string;
176
- } }[EntityTable];
177
- type RelationMutation = { [K in RelationTable]: {
178
- type: 'set-relation';
179
- table: K;
180
- value: RelationValues[K];
181
- } | {
182
- type: 'delete-relation';
183
- table: K;
184
- id: string;
185
- } }[RelationTable];
186
- type ContainMutation = {
187
- type: 'insert-node';
188
- entityId: string;
189
- parentId?: string;
190
- index?: number;
191
- } | {
192
- type: 'move-node';
193
- entityId: string;
194
- parentId?: string;
195
- index?: number;
196
- } | {
197
- type: 'delete-node';
198
- entityId: string;
199
- };
200
- /** A segment, or a run of it in UTF-16 offsets of its current text, as a write states it. */
201
- interface SegmentRange {
202
- audioScriptId: string;
203
- segmentId: string;
204
- start?: number;
205
- end?: number;
206
- }
207
- interface CaptionSelection extends SegmentRange {
208
- captionId: string;
209
- }
210
- interface PhonemeSelection extends SegmentRange {
211
- phoneticScriptId: string;
212
- phonemeScript?: string;
213
- }
214
- /** A script's segments are added, moved and removed by id; their text is edited in place. */
215
- type SegmentMutation = {
216
- type: 'insert-segment';
217
- audioScriptId: string;
218
- segmentId: string;
219
- index?: number;
220
- text: string;
221
- } | {
222
- type: 'move-segment';
223
- audioScriptId: string;
224
- segmentId: string;
225
- index: number;
226
- } | {
227
- type: 'delete-segment';
228
- audioScriptId: string;
229
- segmentId: string;
230
- };
231
- type TextMutation = {
232
- type: 'edit-caption-text';
233
- captionId: string;
234
- expectedBodyId?: string;
235
- edits: readonly TextEdit[];
236
- } | {
237
- type: 'edit-text';
238
- audioScriptId: string;
239
- segmentId: string;
240
- expectedBodyId?: string;
241
- edits: readonly TextEdit[];
242
- } | ({
243
- type: 'set-caption-content';
244
- } & CaptionSelection) | ({
245
- type: 'set-phoneme';
246
- } & PhonemeSelection);
247
- type DslMutation = EntityMutation | RelationMutation | ContainMutation | SegmentMutation | TextMutation;
248
- interface ContainNode {
249
- treeId: TreeID;
250
- entityId: string;
251
- children: ContainNode[];
252
- }
253
- interface DslDiagnostic {
254
- code: string;
255
- path: string;
256
- message: string;
257
- }
258
- interface TextRun {
259
- insert: string;
260
- attributes?: Record<string, unknown>;
261
- }
262
- interface RichTextSnapshot {
263
- bodyId: string;
264
- plainText: string;
265
- delta: TextRun[];
266
- }
267
- /** Selected text, with its UTF-16 range in the Text it lies in: the segment's, or a Caption's own. */
268
- interface CaptionText {
269
- text: string;
270
- start: number;
271
- end: number;
272
- bodyId: string;
273
- }
274
- type DeepReadonly<T> = T extends Cursor ? T : T extends object ? { readonly [K in keyof T]: DeepReadonly<T[K]> } : T;
275
- type MedeoDslSnapshot = DeepReadonly<EntityTables & RelationTables & {
276
- 'contain-relations': ContainNode[]; /** A Caption's own text by the Caption's id, and each script segment's text by the segment's id. */
277
- richText: Record<string, RichTextSnapshot>;
278
- captionText: Record<string, CaptionText>; /** What each PhoneticScript's selection holds now, resolved as a Caption's is. */
279
- phoneticText: Record<string, CaptionText>;
280
- diagnostics: DslDiagnostic[];
281
- }>;
282
- type TextMark = 'language';
283
- type TextEdit = {
284
- type: 'insert';
285
- at: number;
286
- text: string;
287
- } | {
288
- type: 'delete';
289
- at: number;
290
- length: number;
291
- } | {
292
- type: 'mark';
293
- start: number;
294
- end: number;
295
- key: TextMark;
296
- value: string;
297
- } | {
298
- type: 'unmark';
299
- start: number;
300
- end: number;
301
- key: TextMark;
302
- } | {
303
- type: 'delta';
304
- delta: TextDelta[];
305
- };
306
- type TextDelta = {
307
- insert: string;
308
- attributes?: Record<string, string | number | null>;
309
- } | {
310
- retain: number;
311
- attributes?: Record<string, string | number | null>;
312
- } | {
313
- delete: number;
314
- };
315
- //#endregion
316
- //#region ../medeo-dsl/src/ids.d.ts
317
- declare function tupleHash(tuple: readonly string[]): string;
318
- declare function resourceId(kind: 'media' | 'voice', system: string, key: string): string;
319
- declare function relationId<K extends RelationTable>(table: K, value: RelationValues[K]): string;
320
- /** Kinds of id a document mints: its entities', and a script segment's. */
321
- type EntityIdKind = 'timeline' | 'track' | 'clip' | 'audio-script' | 'segment' | 'phonetic-script' | 'caption';
322
- type DslIdFactory = (kind: EntityIdKind) => string;
323
- declare const defaultIdFactory: DslIdFactory;
324
- //#endregion
325
- //#region src/dsl/commit-options.d.ts
326
- /** Self-reported audit author; authorization remains the server's responsibility. */
327
- interface OpActor {
328
- user_id: string;
329
- role: 'user' | 'agent';
330
- }
331
- interface CommitOptions {
332
- /** The server audit view exposes string intents; other JSON values remain in the native message. */
333
- intent?: unknown;
334
- actor?: OpActor;
335
- }
336
- //#endregion
337
- //#region src/dsl/projection/generated/video-draft-idl.d.ts
338
- /**
339
- * @generated by @mengine/idl-codegen — DO NOT EDIT MANUALLY.
340
- *
341
- * VideoDraft read-view types extracted from the Smithy IDL
342
- * (medeo-v2-design-materials). Re-run `vp run @mengine/idl-codegen#sync`.
343
- * Source IDL commit: 902e82e3fec1e94b36e14ef671de91abd210dc86
344
- *
345
- * WHY EVERY FIELD IS `T | undefined`:
346
- * AWS `smithy-typescript-codegen` widens every structure member to
347
- * `T | undefined` regardless of the Smithy `@required` trait — it favours
348
- * deserialization robustness (a peer may omit a field on the wire) over
349
- * encoding requiredness in the static type. So these generated types are NOT
350
- * the source of truth for which fields are required: the Smithy `.smithy`
351
- * model is. Many fields here (e.g. `VideoClipPart.play_in` / `play_out` /
352
- * `volume` / `origin_media_id`) are `@required` in the contract.
353
- *
354
- * Requiredness is restored by import and write-time validation, not here.
355
- * DSL content constraints are owned by medeo-dsl and enforced at the medeo-client
356
- * transaction and import boundaries.
357
- * Do not assume a
358
- * field is optional just because its type is `| undefined`.
359
- */
360
- /**
361
- * @public
362
- * @enum
363
- */
364
- declare const PartKind: {
365
- readonly BGM: "bgm";
366
- readonly CAPTION: "caption";
367
- readonly SPEECH: "speech";
368
- readonly VIDEO_CLIP: "video_clip";
369
- };
370
- /**
371
- * @public
372
- */
373
- type PartKind = (typeof PartKind)[keyof typeof PartKind];
374
- /**
375
- * @public
376
- */
377
- interface VoiceSummary {
378
- name: string | undefined;
379
- id: string | undefined;
380
- }
381
- /**
382
- * @public
383
- */
384
- interface SpeechPart$1 {
385
- id: string | undefined;
386
- duration_ms: number | undefined;
387
- /**
388
- * Types of parts that can be contained in tracks
389
- * @public
390
- */
391
- kind: PartKind | undefined;
392
- audio_script: string | undefined;
393
- volume: number | undefined;
394
- audio_storage_key: string | undefined;
395
- origin_speech_id: string | undefined;
396
- voice: VoiceSummary | undefined;
397
- caption_ids: string[] | undefined;
398
- }
399
- /**
400
- * Caption visual style configuration
401
- * @public
402
- */
403
- interface CaptionStyle {
404
- /**
405
- * Font ID referencing a font from the font library. Defaults to system font if not provided
406
- * @public
407
- */
408
- font_id?: string | undefined;
409
- /**
410
- * Font size in points
411
- * @public
412
- */
413
- font_size?: number | undefined;
414
- /**
415
- * Font color as hex string (e.g. "#FFFFFF")
416
- * @public
417
- */
418
- font_color?: string | undefined;
419
- /**
420
- * Numeric font weight, e.g. 400 for regular or 700 for bold
421
- * @public
422
- */
423
- font_weight?: number | undefined;
424
- /**
425
- * Caption entrance animation preset ID, e.g. "fade", "slideUp", or "none"
426
- * @public
427
- */
428
- entrance_animation?: string | undefined;
429
- /**
430
- * Caption entrance animation duration in milliseconds
431
- * @public
432
- */
433
- entrance_animation_duration_ms?: number | undefined;
434
- /**
435
- * Caption outline/stroke color as hex string (e.g. "#000000")
436
- * @public
437
- */
438
- stroke_color?: string | undefined;
439
- /**
440
- * Caption outline/stroke width in pixels
441
- * @public
442
- */
443
- stroke_width?: number | undefined;
444
- /**
445
- * Caption center X position as a percentage (0.0 to 1.0)
446
- * @public
447
- */
448
- position_x?: number | undefined;
449
- /**
450
- * Caption center Y position as a percentage (0.0 to 1.0)
451
- * @public
452
- */
453
- position_y?: number | undefined;
454
- }
455
- /**
456
- * @public
457
- */
458
- interface CaptionPart$1 {
459
- id: string | undefined;
460
- duration_ms: number | undefined;
461
- /**
462
- * Types of parts that can be contained in tracks
463
- * @public
464
- */
465
- kind: PartKind | undefined;
466
- speech_part_id: string | undefined;
467
- text: string | undefined;
468
- start_ms: number | undefined;
469
- /**
470
- * Caption visual style (font, size, color, weight, animation, outline). Uses default style if not provided
471
- * @public
472
- */
473
- style?: CaptionStyle | undefined;
474
- }
475
- /**
476
- * @public
477
- * @enum
478
- */
479
- declare const AspectRatio: {
480
- readonly RATIO_16_9: "16:9";
481
- readonly RATIO_9_16: "9:16";
482
- };
483
- /**
484
- * @public
485
- */
486
- type AspectRatio = (typeof AspectRatio)[keyof typeof AspectRatio];
487
- /**
488
- * @public
489
- * @enum
490
- */
491
- declare const AssetSource: {
492
- readonly AI_IMAGES: "ai_images";
493
- readonly AI_VIDEOS: "ai_videos";
494
- readonly MY_UPLOADED_ASSETS: "my_uploaded_assets";
495
- readonly STOCK_VIDEOS: "stock_videos";
496
- };
497
- /**
498
- * @public
499
- */
500
- type AssetSource = (typeof AssetSource)[keyof typeof AssetSource];
501
- /**
502
- * An extra aspect ratio variant with independent storage keys for thumbnail,
503
- * preview video, and highlight video. Stored inside video_settings JSONB.
504
- * @public
505
- */
506
- interface RatioVariant {
507
- aspect_ratio: string | undefined;
508
- thumb_storage_key: string | undefined;
509
- video_storage_key: string | undefined;
510
- highlight_video_storage_key?: string | undefined;
511
- }
512
- /**
513
- * @public
514
- */
515
- interface VideoCreationSettings$1 {
516
- voice_id?: string | undefined;
517
- duration_ms?: number | undefined;
518
- aspect_ratio?: AspectRatio | undefined;
519
- video_style_id?: string | undefined;
520
- asset_sources?: AssetSource[] | undefined;
521
- recipe_id?: string | undefined;
522
- enable_high_cost_confirm?: boolean | undefined;
523
- user_confirm_cost_threshold?: number | undefined;
524
- /**
525
- * Extra aspect ratio variants with independent storage keys.
526
- * Each variant carries its own thumbnail, preview video, and optional highlight video.
527
- * Used when a recipe supports multiple aspect ratios (e.g. both 16:9 and 9:16).
528
- * @public
529
- */
530
- extra_ratios?: RatioVariant[] | undefined;
531
- }
532
- /**
533
- * @public
534
- */
535
- interface TrackItem {
536
- abs_time_position: number | undefined;
537
- part_id: string | undefined;
538
- }
539
- /**
540
- * @public
541
- */
542
- interface Track {
543
- id: string | undefined;
544
- /**
545
- * Types of parts that can be contained in tracks
546
- * @public
547
- */
548
- parts_kind: PartKind | undefined;
549
- is_hidden: boolean | undefined;
550
- items: TrackItem[] | undefined;
551
- }
552
- /**
553
- * @public
554
- */
555
- interface Attachment {
556
- part_id: string | undefined;
557
- relative_time_position: number | undefined;
558
- }
559
- /**
560
- * @public
561
- */
562
- interface PartAggregation {
563
- body_part_id: string | undefined;
564
- attachments: Attachment[] | undefined;
565
- }
566
- /**
567
- * @public
568
- */
569
- interface BgmPart$1 {
570
- id: string | undefined;
571
- duration_ms: number | undefined;
572
- /**
573
- * Types of parts that can be contained in tracks
574
- * @public
575
- */
576
- kind: PartKind | undefined;
577
- audio_storage_key: string | undefined;
578
- volume: number | undefined;
579
- origin_media_id: string | undefined;
580
- }
581
- /**
582
- * @public
583
- * @enum
584
- */
585
- declare const SpeedShiftCategory: {
586
- /**
587
- * Variable speed controlled by Bezier keyframes
588
- */
589
- readonly CURVE: "curve";
590
- /**
591
- * Constant speed multiplier across the entire clip
592
- */
593
- readonly LINEAR: "linear";
594
- };
595
- /**
596
- * @public
597
- */
598
- type SpeedShiftCategory = (typeof SpeedShiftCategory)[keyof typeof SpeedShiftCategory];
599
- /**
600
- * @public
601
- */
602
- interface TangentHandle {
603
- x: number | undefined;
604
- y: number | undefined;
605
- }
606
- /**
607
- * @public
608
- */
609
- interface SpeedKeyframe {
610
- position: number | undefined;
611
- rate: number | undefined;
612
- in_tangent?: TangentHandle | undefined;
613
- out_tangent?: TangentHandle | undefined;
614
- }
615
- /**
616
- * @public
617
- */
618
- interface CurveConfig {
619
- keyframes: SpeedKeyframe[] | undefined;
620
- }
621
- /**
622
- * @public
623
- */
624
- interface LinearConfig {
625
- speed: number | undefined;
626
- }
627
- /**
628
- * @public
629
- */
630
- type SpeedShiftConfigUnion = SpeedShiftConfigUnion.CurveMember | SpeedShiftConfigUnion.LinearMember | SpeedShiftConfigUnion.$UnknownMember;
631
- /**
632
- * @public
633
- */
634
- declare namespace SpeedShiftConfigUnion {
635
- interface LinearMember {
636
- linear: LinearConfig;
637
- curve?: never;
638
- $unknown?: never;
639
- }
640
- interface CurveMember {
641
- linear?: never;
642
- curve: CurveConfig;
643
- $unknown?: never;
644
- }
645
- /**
646
- * @public
647
- */
648
- interface $UnknownMember {
649
- linear?: never;
650
- curve?: never;
651
- $unknown: [string, any];
652
- }
653
- interface Visitor<T> {
654
- linear: (value: LinearConfig) => T;
655
- curve: (value: CurveConfig) => T;
656
- _: (name: string, value: any) => T;
657
- }
658
- const visit: <T>(value: SpeedShiftConfigUnion, visitor: Visitor<T>) => T;
659
- }
660
- /**
661
- * @public
662
- */
663
- interface SpeedShift {
664
- category: SpeedShiftCategory | undefined;
665
- mode: string | undefined;
666
- config: SpeedShiftConfigUnion | undefined;
667
- }
668
- /**
669
- * @public
670
- */
671
- interface VideoClipPart {
672
- id: string | undefined;
673
- duration_ms: number | undefined;
674
- /**
675
- * Types of parts that can be contained in tracks
676
- * @public
677
- */
678
- kind: PartKind | undefined;
679
- play_in: number | undefined;
680
- play_out: number | undefined;
681
- volume: number | undefined;
682
- origin_media_id: string | undefined;
683
- speed_shift?: SpeedShift | undefined;
684
- }
685
- /**
686
- * @public
687
- */
688
- type PartUnion = PartUnion.BgmMember | PartUnion.CaptionMember | PartUnion.SpeechMember | PartUnion.Video_clipMember | PartUnion.$UnknownMember;
689
- /**
690
- * @public
691
- */
692
- declare namespace PartUnion {
693
- interface Video_clipMember {
694
- video_clip: VideoClipPart;
695
- bgm?: never;
696
- speech?: never;
697
- caption?: never;
698
- $unknown?: never;
699
- }
700
- interface BgmMember {
701
- video_clip?: never;
702
- bgm: BgmPart$1;
703
- speech?: never;
704
- caption?: never;
705
- $unknown?: never;
706
- }
707
- interface SpeechMember {
708
- video_clip?: never;
709
- bgm?: never;
710
- speech: SpeechPart$1;
711
- caption?: never;
712
- $unknown?: never;
713
- }
714
- interface CaptionMember {
715
- video_clip?: never;
716
- bgm?: never;
717
- speech?: never;
718
- caption: CaptionPart$1;
719
- $unknown?: never;
720
- }
721
- /**
722
- * @public
723
- */
724
- interface $UnknownMember {
725
- video_clip?: never;
726
- bgm?: never;
727
- speech?: never;
728
- caption?: never;
729
- $unknown: [string, any];
730
- }
731
- interface Visitor<T> {
732
- video_clip: (value: VideoClipPart) => T;
733
- bgm: (value: BgmPart$1) => T;
734
- speech: (value: SpeechPart$1) => T;
735
- caption: (value: CaptionPart$1) => T;
736
- _: (name: string, value: any) => T;
737
- }
738
- const visit: <T>(value: PartUnion, visitor: Visitor<T>) => T;
739
- }
740
- /**
741
- * Timeline configuration for video editing
742
- * @public
743
- */
744
- interface Timeline {
745
- duration_ms: number | undefined;
746
- unit_time_ms: number | undefined;
747
- }
748
- /**
749
- * Complete video draft information with timeline and tracks
750
- * @public
751
- */
752
- interface VideoDraft$1 {
753
- id?: string | undefined;
754
- project_id: string | undefined;
755
- owner_id: string | undefined;
756
- /**
757
- * for-code-gen: property value may be empty string ("")
758
- * @public
759
- */
760
- thumbnail_storage_key: string | undefined;
761
- /**
762
- * Timeline configuration for video editing
763
- * @public
764
- */
765
- timeline?: Timeline | undefined;
766
- video_creation_settings?: VideoCreationSettings$1 | undefined;
767
- chat_session_id: string | undefined;
768
- main_track?: Track | undefined;
769
- above_main_tracks: Track[] | undefined;
770
- below_main_tracks: Track[] | undefined;
771
- part_aggregations: PartAggregation[] | undefined;
772
- part_library: Record<string, PartUnion> | undefined;
773
- version: number | undefined;
774
- }
775
- //#endregion
776
- //#region src/dsl/projection/video-draft-types.d.ts
777
- type VideoDraftTrack = Track;
778
- type VideoDraftTrackItem = TrackItem;
779
- type VideoDraftTimeline = Timeline;
780
- type VideoDraftCaptionStyle = CaptionStyle;
781
- interface CaptionDisplayCue {
782
- segmentId: string;
783
- text: string;
784
- startMs: number;
785
- durationMs: number;
786
- }
787
- type VideoCreationSettings = Omit<VideoCreationSettings$1, 'video_style_id' | 'duration_ms'> & {
788
- video_style_id?: string | null;
789
- duration_ms?: number | null;
790
- };
791
- type VideoPart = Omit<VideoClipPart, 'duration_ms'>;
792
- type SpeechPart = Omit<SpeechPart$1, 'duration_ms'> & {
793
- media_duration_ms?: number;
794
- };
795
- type CaptionPart = Omit<CaptionPart$1, 'duration_ms'> & {
796
- initial_duration_ms?: number;
797
- display_cues?: CaptionDisplayCue[];
798
- };
799
- type BgmPart = Omit<BgmPart$1, 'duration_ms'>;
800
- /** Legacy inputs may omit derived durations; output always states the field. */
801
- type VideoDraftPartUnion = {
802
- video_clip: VideoPart & {
803
- duration_ms?: number;
804
- };
805
- speech?: never;
806
- caption?: never;
807
- bgm?: never;
808
- } | {
809
- video_clip?: never;
810
- speech: SpeechPart & {
811
- duration_ms?: number;
812
- };
813
- caption?: never;
814
- bgm?: never;
815
- } | {
816
- video_clip?: never;
817
- speech?: never;
818
- caption: CaptionPart & {
819
- duration_ms?: number;
820
- };
821
- bgm?: never;
822
- } | {
823
- video_clip?: never;
824
- speech?: never;
825
- caption?: never;
826
- bgm: BgmPart & {
827
- duration_ms?: number;
828
- };
829
- };
830
- type VideoDraftContentPartUnion = {
831
- video_clip: VideoPart & {
832
- duration_ms: number | undefined;
833
- };
834
- speech?: never;
835
- caption?: never;
836
- bgm?: never;
837
- } | {
838
- video_clip?: never;
839
- speech: SpeechPart & {
840
- duration_ms: number | undefined;
841
- };
842
- caption?: never;
843
- bgm?: never;
844
- } | {
845
- video_clip?: never;
846
- speech?: never;
847
- caption: CaptionPart & {
848
- duration_ms: number | undefined;
849
- };
850
- bgm?: never;
851
- } | {
852
- video_clip?: never;
853
- speech?: never;
854
- caption?: never;
855
- bgm: BgmPart & {
856
- duration_ms: number | undefined;
857
- };
858
- };
859
- type VideoDraft = Omit<VideoDraft$1, 'part_library' | 'video_creation_settings'> & {
860
- part_library: Record<string, VideoDraftPartUnion> | undefined;
861
- video_creation_settings?: VideoCreationSettings;
862
- };
863
- type VideoDraftContent = Pick<VideoDraft, 'timeline' | 'main_track' | 'above_main_tracks' | 'below_main_tracks' | 'part_aggregations'> & {
864
- part_library: Record<string, VideoDraftContentPartUnion> | undefined;
865
- };
866
- type VideoDraftInput = Pick<VideoDraft, keyof VideoDraftContent>;
867
- declare const DEFAULT_UNIT_TIME_MS = 33.333;
868
- //#endregion
869
- export { TextMutation as $, DeepReadonly as A, PhonemeSelection as B, CaptionContent as C, Clip as D, CaptionText as E, EntityTables as F, ResourceSystem as G, RelationTable as H, EntityValues as I, SegmentSelection as J, RichTextSnapshot as K, FieldPatch as L, DslMutation as M, EntityMutation as N, ContainMutation as O, EntityTable as P, TextMark as Q, MedeoDslSnapshot as R, Caption as S, CaptionStyle$1 as T, RelationTables as U, RelationMutation as V, RelationValues as W, TextDelta as X, StoredFile as Y, TextEdit as Z, defaultIdFactory as _, VideoDraftCaptionStyle as a, tupleHash as b, VideoDraftInput as c, VideoDraftTrack as d, TextRun as et, VideoDraftTrackItem as f, EntityIdKind as g, DslIdFactory as h, VideoDraft as i, Voice as it, DslDiagnostic as j, ContainNode as k, VideoDraftPartUnion as l, OpActor as m, DEFAULT_UNIT_TIME_MS as n, Track$1 as nt, VideoDraftContent as o, CommitOptions as p, SegmentRange as q, VideoCreationSettings as r, TrackRole as rt, VideoDraftContentPartUnion as s, CaptionDisplayCue as t, TimeAnchor as tt, VideoDraftTimeline as u, relationId as v, CaptionSelection as w, AudioScript as x, resourceId as y, Media as z };