@mengine/medeo-client 2.1.1-dsl.1 → 2.1.1-dsl.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/dsl.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as Track, A as ContainNode, B as Media, C as Caption, D as CaptionText, E as CaptionStyle, F as EntityTable, G as ResourceSystem, H as RelationTable, I as EntityTables, J as TextEdit, K as RichTextSnapshot, L as EntityValues, M as DslDiagnostic, N as DslMutation, O as Clip, P as EntityMutation, Q as TimeAnchor, R as FieldPatch, S as AudioScript, T as CaptionSelection, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextMutation, Y as TextMark, Z as TextRun, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TrackRole, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, j as DeepReadonly, k as ContainMutation, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, o as VideoDraftContent, p as CommitOptions, q as TextDelta, r as VideoCreationSettings, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as Voice, u as VideoDraftTimeline, v as relationId, w as CaptionContent, x as Asset, y as resourceId, z as MedeoDslSnapshot } from "./video-draft-types-c_shaRyq.js";
2
- import { A as AddDslClip, C as MedeoDslDraft, D as captionContentCodec, E as InvalidAtomic, F as ReplaceDslClipsInput, I as ClipPlacement, M as ClipSource, N as DslClipUpdate, O as isInvalidAtomic, P as MoveDslClipsInput, S as documentFormat, T as medeoDslLoroShape, _ as MedeoDsl, a as toVideoDraft, b as UnsupportedDocumentFormatError, c as DslLayout, d as createInitialMedeoDsl, f as DslEditor, g as CreateMedeoDslOptions, h as VoiceoverResult, i as VideoDraftProjection, j as AddDslClipsInput, k as timeAnchorCodec, l as DslProjectionError, m as VoiceoverCaptionInput, n as ImportedVideoDraft, o as resolveDslLayout, p as ApplyVoiceoverInput, r as fromVideoDraft, s as DslClipLayout, t as FromVideoDraftOptions, u as DslTrackLayout, v as DslAudit, w as MedeoDslLoroState, x as assertDslDocument, y as DslTransaction } from "./index-Cu7SdKN5.js";
3
- export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type Asset, type AudioScript, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toVideoDraft, tupleHash };
1
+ import { $ as TextMutation, A as DeepReadonly, C as CaptionContent, D as Clip, E as CaptionText, F as EntityTables, G as ResourceSystem, H as RelationTable, I as EntityValues, K as RichTextSnapshot, L as FieldPatch, M as DslMutation, N as EntityMutation, O as ContainMutation, P as EntityTable, Q as TextMark, R as MedeoDslSnapshot, S as Caption, T as CaptionStyle, U as RelationTables, V as RelationMutation, W as RelationValues, X as TextDelta, Y as StoredFile, Z as TextEdit, _ as defaultIdFactory, a as VideoDraftCaptionStyle, b as tupleHash, c as VideoDraftInput, d as VideoDraftTrack, et as TextRun, f as VideoDraftTrackItem, g as EntityIdKind, h as DslIdFactory, i as VideoDraft, it as Voice, j as DslDiagnostic, k as ContainNode, l as VideoDraftPartUnion, m as OpActor, n as DEFAULT_UNIT_TIME_MS, nt as Track, o as VideoDraftContent, p as CommitOptions, r as VideoCreationSettings, rt as TrackRole, s as VideoDraftContentPartUnion, t as CaptionDisplayCue, tt as TimeAnchor, u as VideoDraftTimeline, v as relationId, w as CaptionSelection, x as AudioScript, y as resourceId, z as Media } from "./video-draft-types-GqXnsOzA.js";
2
+ import { A as MedeoDslDraft, C as UnsupportedDocumentFormatError, D as captionContentCodec, E as InvalidAtomic, F as ClipSource, I as DslClipUpdate, L as MoveDslClipsInput, M as medeoDslLoroShape, N as AddDslClip, O as isInvalidAtomic, P as AddDslClipsInput, R as ReplaceDslClipsInput, S as DslTransaction, T as documentFormat, _ as VoiceoverCaptionInput, a as toAudioScriptViews, b as MedeoDsl, c as resolveDslLayout, d as DslProjectionError, f as DslTrackLayout, g as ApplyVoiceoverInput, h as UploadText, i as AudioScriptView, j as MedeoDslLoroState, k as timeAnchorCodec, l as DslClipLayout, m as DslEditor, n as ImportedVideoDraft, o as VideoDraftProjection, p as createInitialMedeoDsl, r as fromVideoDraft, s as toVideoDraft, t as FromVideoDraftOptions, u as DslLayout, v as VoiceoverResult, w as assertDslDocument, x as DslAudit, y as CreateMedeoDslOptions, z as ClipPlacement } from "./index-C5wDKYqC.js";
3
+ export { type AddDslClip, type AddDslClipsInput, type ApplyVoiceoverInput, type AudioScript, type AudioScriptView, type Caption, type CaptionContent, type CaptionDisplayCue, type CaptionSelection, type CaptionStyle, type CaptionText, type Clip, type ClipPlacement, type ClipSource, type CommitOptions, type ContainMutation, type ContainNode, type CreateMedeoDslOptions, DEFAULT_UNIT_TIME_MS, type DeepReadonly, type DslAudit, type DslClipLayout, type DslClipUpdate, type DslDiagnostic, DslEditor, type DslIdFactory, type DslLayout, type DslMutation, DslProjectionError, type DslTrackLayout, type DslTransaction, type EntityIdKind, type EntityMutation, type EntityTable, type EntityTables, type EntityValues, type FieldPatch, type FromVideoDraftOptions, type ImportedVideoDraft, type InvalidAtomic, MedeoDsl, type MedeoDslDraft, type MedeoDslLoroState, type MedeoDslSnapshot, type Media, type MoveDslClipsInput, type OpActor, type RelationMutation, type RelationTable, type RelationTables, type RelationValues, type ReplaceDslClipsInput, type ResourceSystem, type RichTextSnapshot, type StoredFile, type TextDelta, type TextEdit, type TextMark, type TextMutation, type TextRun, type TimeAnchor, type Track, type TrackRole, UnsupportedDocumentFormatError, type UploadText, type VideoCreationSettings, type VideoDraft, type VideoDraftCaptionStyle, type VideoDraftContent, type VideoDraftContentPartUnion, type VideoDraftInput, type VideoDraftPartUnion, type VideoDraftProjection, type VideoDraftTimeline, type VideoDraftTrack, type VideoDraftTrackItem, type Voice, type VoiceoverCaptionInput, type VoiceoverResult, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
package/dist/dsl.js CHANGED
@@ -1,3 +1,3 @@
1
- import { a as documentFormat, c as isInvalidAtomic, ct as relationId, i as assertDslDocument, l as timeAnchorCodec, lt as resourceId, o as medeoDslLoroShape, r as UnsupportedDocumentFormatError, s as captionContentCodec, st as defaultIdFactory, t as DEFAULT_UNIT_TIME_MS, ut as tupleHash } from "./video-draft-types-TXRv3wS6.js";
2
- import { a as MedeoDsl, i as DslEditor, n as toVideoDraft, o as resolveDslLayout, r as createInitialMedeoDsl, s as DslProjectionError, t as fromVideoDraft } from "./dsl-EV6kCdr6.js";
3
- export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toVideoDraft, tupleHash };
1
+ import { _t as tupleHash, a as documentFormat, c as isInvalidAtomic, gt as resourceId, ht as relationId, i as assertDslDocument, mt as defaultIdFactory, o as medeoDslLoroShape, r as UnsupportedDocumentFormatError, s as captionContentCodec, t as DEFAULT_UNIT_TIME_MS, u as timeAnchorCodec } from "./video-draft-types-BnbfWrBx.js";
2
+ import { a as DslEditor, c as DslProjectionError, i as createInitialMedeoDsl, n as toVideoDraft, o as MedeoDsl, r as toAudioScriptViews, s as resolveDslLayout, t as fromVideoDraft } from "./dsl-COyzz7Fp.js";
3
+ export { DEFAULT_UNIT_TIME_MS, DslEditor, DslProjectionError, MedeoDsl, UnsupportedDocumentFormatError, assertDslDocument, captionContentCodec, createInitialMedeoDsl, defaultIdFactory, documentFormat, fromVideoDraft, isInvalidAtomic, medeoDslLoroShape, relationId, resolveDslLayout, resourceId, timeAnchorCodec, toAudioScriptViews, toVideoDraft, tupleHash };
@@ -1,4 +1,4 @@
1
- import { B as Media, E as CaptionStyle, J as TextEdit, M as DslDiagnostic, N as DslMutation, Q as TimeAnchor, R as FieldPatch, T as CaptionSelection, c as VideoDraftInput, et as TrackRole, h as DslIdFactory, o as VideoDraftContent, p as CommitOptions, tt as Voice, w as CaptionContent, z as MedeoDslSnapshot } from "./video-draft-types-c_shaRyq.js";
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
2
  import { ContainerType, Cursor, LoroDoc, PeerID, TreeID } from "loro-crdt";
3
3
 
4
4
  //#region src/dsl/action-context.d.ts
@@ -394,22 +394,12 @@ type InferBooleanType<S extends SchemaType> = S extends {
394
394
  transform: TransformDefinition<infer _C, infer D>;
395
395
  } ? WithOptionality<D, S> : WithOptionality<boolean, S>;
396
396
  //#endregion
397
- //#region ../medeo-dsl/src/schema/codec.d.ts
398
- interface InvalidAtomic {
399
- invalid: true;
400
- raw: string;
401
- reason: string;
402
- }
403
- declare function isInvalidAtomic(value: unknown): value is InvalidAtomic;
404
- interface AtomicCodec<T> {
405
- encode(value: T | InvalidAtomic): string;
406
- decode(raw: string): T | InvalidAtomic;
407
- }
408
- declare const timeAnchorCodec: AtomicCodec<TimeAnchor>;
409
- declare const captionContentCodec: AtomicCodec<CaptionContent>;
410
- //#endregion
411
397
  //#region ../medeo-dsl/src/schema/loro-shape.d.ts
412
- /** Only direct children inherit mergeable identity. Body and ordinary entity rows keep normal identities. */
398
+ /**
399
+ * Only direct children inherit mergeable identity. Text and ordinary entity rows keep normal
400
+ * identities, so deleting a row also drops what a peer wrote into it concurrently: a relation an
401
+ * entity holds at most one of is a field of that row and never outlives it.
402
+ */
413
403
  declare const medeoDslLoroShape: RootSchemaType<{
414
404
  'timeline-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{}> & {
415
405
  options: {};
@@ -434,12 +424,16 @@ declare const medeoDslLoroShape: RootSchemaType<{
434
424
  'clip-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
435
425
  seqMarker: /*elided*/any;
436
426
  volume: /*elided*/any;
427
+ source: /*elided*/any;
428
+ anchor: /*elided*/any;
437
429
  }> & {
438
430
  options: {};
439
431
  } & {
440
432
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
441
433
  seqMarker: /*elided*/any;
442
434
  volume: /*elided*/any;
435
+ source: /*elided*/any;
436
+ anchor: /*elided*/any;
443
437
  }, C>;
444
438
  }> & {
445
439
  options: {};
@@ -468,19 +462,39 @@ declare const medeoDslLoroShape: RootSchemaType<{
468
462
  };
469
463
  };
470
464
  'audio-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
471
- body: /*elided*/any;
465
+ segments: /*elided*/any;
472
466
  defaultLanguage: /*elided*/any;
473
467
  }> & {
474
468
  options: {};
475
469
  } & {
476
470
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
477
- body: /*elided*/any;
471
+ segments: /*elided*/any;
478
472
  defaultLanguage: /*elided*/any;
479
473
  }, C>;
480
474
  }> & {
481
475
  options: {};
482
476
  };
477
+ 'phonetic-script-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
478
+ phoneme: /*elided*/any;
479
+ system: /*elided*/any;
480
+ key: /*elided*/any;
481
+ storageKey: /*elided*/any;
482
+ digest: /*elided*/any;
483
+ }> & {
484
+ options: {};
485
+ } & {
486
+ catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
487
+ phoneme: /*elided*/any;
488
+ system: /*elided*/any;
489
+ key: /*elided*/any;
490
+ storageKey: /*elided*/any;
491
+ digest: /*elided*/any;
492
+ }, C>;
493
+ }> & {
494
+ options: {};
495
+ };
483
496
  'caption-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
497
+ selection: /*elided*/any;
484
498
  text: /*elided*/any;
485
499
  style: /*elided*/any;
486
500
  }> & {
@@ -489,6 +503,7 @@ declare const medeoDslLoroShape: RootSchemaType<{
489
503
  };
490
504
  } & {
491
505
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
506
+ selection: /*elided*/any;
492
507
  text: /*elided*/any;
493
508
  style: /*elided*/any;
494
509
  }, C>;
@@ -512,29 +527,10 @@ declare const medeoDslLoroShape: RootSchemaType<{
512
527
  readonly mergeableMapChildContainers: true;
513
528
  };
514
529
  };
515
- 'asset-entities': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
516
- system: /*elided*/any;
517
- key: /*elided*/any;
518
- storageKey: /*elided*/any;
519
- digest: /*elided*/any;
520
- }> & {
521
- options: {};
522
- } & {
523
- catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
524
- system: /*elided*/any;
525
- key: /*elided*/any;
526
- storageKey: /*elided*/any;
527
- digest: /*elided*/any;
528
- }, C>;
529
- }> & {
530
- options: {
531
- readonly mergeableMapChildContainers: true;
532
- };
533
- };
534
530
  'contain-relations': LoroTreeSchema<{
535
531
  entityId: /*elided*/any;
536
532
  }>;
537
- 'clip-source-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
533
+ 'voice-timbre-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
538
534
  options: {};
539
535
  } & {
540
536
  transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
@@ -557,129 +553,23 @@ declare const medeoDslLoroShape: RootSchemaType<{
557
553
  readonly mergeableMapChildContainers: true;
558
554
  };
559
555
  };
560
- 'time-anchor-relations': LoroMapSchemaWithCatchall<{}, StringSchemaType<string> & {
561
- options: {};
562
- transform: TransformDefinition<string, TimeAnchor | InvalidAtomic>;
563
- }> & {
564
- options: {};
565
- };
566
- 'caption-content-relations': LoroMapSchemaWithCatchall<{}, StringSchemaType<string> & {
567
- options: {};
568
- transform: TransformDefinition<string, CaptionContent | InvalidAtomic>;
569
- }> & {
570
- options: {};
571
- };
572
- 'caption-alignment-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
573
- captionId: /*elided*/any;
574
- mediaId: /*elided*/any;
575
- startMs: /*elided*/any;
576
- endMs: /*elided*/any;
556
+ 'derived-from-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<{
557
+ entityId: /*elided*/any;
558
+ sourceId: /*elided*/any;
559
+ sourceDigest: /*elided*/any;
577
560
  }> & {
578
561
  options: {};
579
562
  } & {
580
563
  catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<{
581
- captionId: /*elided*/any;
582
- mediaId: /*elided*/any;
583
- startMs: /*elided*/any;
584
- endMs: /*elided*/any;
564
+ entityId: /*elided*/any;
565
+ sourceId: /*elided*/any;
566
+ sourceDigest: /*elided*/any;
585
567
  }, C>;
586
568
  }> & {
587
569
  options: {
588
570
  readonly mergeableMapChildContainers: true;
589
571
  };
590
572
  };
591
- 'voice-timbre-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
592
- options: {};
593
- } & {
594
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
595
- options: {};
596
- transform: TransformDefinition<string, D>;
597
- };
598
- }>> & {
599
- options: {};
600
- } & {
601
- catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<Record<string, StringSchemaType<string> & {
602
- options: {};
603
- } & {
604
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
605
- options: {};
606
- transform: TransformDefinition<string, D>;
607
- };
608
- }>, C>;
609
- }> & {
610
- options: {
611
- readonly mergeableMapChildContainers: true;
612
- };
613
- };
614
- 'derived-from-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
615
- options: {};
616
- } & {
617
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
618
- options: {};
619
- transform: TransformDefinition<string, D>;
620
- };
621
- }>> & {
622
- options: {};
623
- } & {
624
- catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<Record<string, StringSchemaType<string> & {
625
- options: {};
626
- } & {
627
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
628
- options: {};
629
- transform: TransformDefinition<string, D>;
630
- };
631
- }>, C>;
632
- }> & {
633
- options: {
634
- readonly mergeableMapChildContainers: true;
635
- };
636
- };
637
- 'from-asset-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
638
- options: {};
639
- } & {
640
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
641
- options: {};
642
- transform: TransformDefinition<string, D>;
643
- };
644
- }>> & {
645
- options: {};
646
- } & {
647
- catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<Record<string, StringSchemaType<string> & {
648
- options: {};
649
- } & {
650
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
651
- options: {};
652
- transform: TransformDefinition<string, D>;
653
- };
654
- }>, C>;
655
- }> & {
656
- options: {
657
- readonly mergeableMapChildContainers: true;
658
- };
659
- };
660
- 'to-asset-relations': LoroMapSchemaWithCatchall<{}, LoroMapSchema<Record<string, StringSchemaType<string> & {
661
- options: {};
662
- } & {
663
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
664
- options: {};
665
- transform: TransformDefinition<string, D>;
666
- };
667
- }>> & {
668
- options: {};
669
- } & {
670
- catchall: <C extends SchemaType>(catchallSchema: C) => LoroMapSchemaWithCatchall<Record<string, StringSchemaType<string> & {
671
- options: {};
672
- } & {
673
- transform: <D>(def: TransformDefinition<string, D>) => StringSchemaType<string> & {
674
- options: {};
675
- transform: TransformDefinition<string, D>;
676
- };
677
- }>, C>;
678
- }> & {
679
- options: {
680
- readonly mergeableMapChildContainers: true;
681
- };
682
- };
683
573
  }> & {
684
574
  options: {};
685
575
  };
@@ -695,6 +585,22 @@ type MedeoDslDraft = DraftFields<Omit<Input, 'contain-relations'>> & {
695
585
  'contain-relations': ContainDraftNode[];
696
586
  };
697
587
  //#endregion
588
+ //#region ../medeo-dsl/src/schema/codec.d.ts
589
+ interface InvalidAtomic {
590
+ invalid: true;
591
+ raw: string;
592
+ reason: string;
593
+ }
594
+ declare function isInvalidAtomic(value: unknown): value is InvalidAtomic;
595
+ interface AtomicCodec<T> {
596
+ encode(value: T | InvalidAtomic): string;
597
+ decode(raw: string): T | InvalidAtomic;
598
+ }
599
+ /** A Clip's time anchor; the Clip holding it is the anchored end. */
600
+ declare const timeAnchorCodec: AtomicCodec<TimeAnchor>;
601
+ /** A Caption's selection. */
602
+ declare const captionContentCodec: AtomicCodec<SegmentSelection>;
603
+ //#endregion
698
604
  //#region ../medeo-dsl/src/schema/document-format.d.ts
699
605
  /** Format discrimination does not register containers or alter the document. */
700
606
  declare function documentFormat(doc: LoroDoc): 'dsl' | 'legacy' | 'mixed' | 'unknown';
@@ -721,10 +627,17 @@ interface DslTransaction {
721
627
  readonly draft: MedeoDslDraft;
722
628
  applyMutations(mutations: readonly DslMutation[]): void;
723
629
  /** Offsets use the preview after preceding edits. Existing Text identities are checked when supplied. */
724
- editText(audioScriptId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
725
- /** Creates real Cursors during application; pending ranges are not exposed as draft Cursor objects. */
630
+ editText(audioScriptId: string, segmentId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
726
631
  editCaptionText(captionId: string, edits: readonly TextEdit[], expectedBodyId?: string): void;
632
+ /** Adds a segment at `index` (the end by default); its id must be new to the script. */
633
+ insertSegment(audioScriptId: string, segmentId: string, text: string, index?: number): void;
634
+ /** `index` is measured after removing the segment. */
635
+ moveSegment(audioScriptId: string, segmentId: string, index: number): void;
636
+ deleteSegment(audioScriptId: string, segmentId: string): void;
637
+ /** Creates real Cursors during application; pending ranges are not exposed as draft Cursor objects. */
727
638
  setCaptionContent(selection: CaptionSelection): void;
639
+ /** Writes a PhoneticScript's phoneme, its run turned into Cursors like a Caption's. */
640
+ setPhoneme(selection: PhonemeSelection): void;
728
641
  }
729
642
  //#endregion
730
643
  //#region src/dsl/document/medeo-dsl.d.ts
@@ -762,10 +675,13 @@ declare class MedeoDsl {
762
675
  transact(edit: (tx: DslTransaction) => void, audit: DslAudit): void;
763
676
  /** Preferred vocabulary for ordinary entity/relation/Tree edits and serializable native commands. */
764
677
  applyMutations(mutations: readonly DslMutation[], audit: DslAudit): void;
765
- editText(scriptId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
678
+ editText(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
766
679
  editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], audit: DslAudit): void;
767
- /** Local ranges exclude insertions at their start and include insertions at their end. K01 remains deferred. */
768
- textRange(scriptId: string, start: number, end: number): Omit<CaptionContent, 'captionId'>;
680
+ /**
681
+ * A run inside one segment as native Cursors. Local ranges exclude insertions at their start and
682
+ * include insertions at their end. K01 remains deferred.
683
+ */
684
+ textRange(scriptId: string, segmentId: string, start: number, end: number): SegmentSelection;
769
685
  dispose(): void;
770
686
  private mutate;
771
687
  private notify;
@@ -777,8 +693,10 @@ interface VoiceoverCaptionInput {
777
693
  clipId?: string;
778
694
  startMs: number;
779
695
  durationMs: number;
780
- /** UTF-16 selection in the supplied AudioScript; timing remains a separate fact. */
781
- range: {
696
+ /** The segment of the voiceover's script it shows, by index; timing remains a separate fact. */
697
+ segment: number;
698
+ /** A UTF-16 run inside that segment; without one the whole segment shows. */
699
+ range?: {
782
700
  start: number;
783
701
  end: number;
784
702
  };
@@ -793,15 +711,31 @@ interface ApplyVoiceoverInput {
793
711
  }> & {
794
712
  kind: 'voiceover-recording';
795
713
  };
714
+ /**
715
+ * What the recording says: an existing AudioScript, a new one of these `segments`, or a
716
+ * PhoneticScript it was spoken from. A recording spoken from a PhoneticScript is derived-from it,
717
+ * and its captions select segments of that variant's base script.
718
+ */
796
719
  script: {
797
720
  audioScriptId: string;
798
- body?: never;
721
+ segments?: never;
722
+ phoneticScriptId?: never;
799
723
  } | {
800
- body: string;
724
+ segments: string[];
801
725
  audioScriptId?: never;
726
+ phoneticScriptId?: never;
802
727
  defaultLanguage?: string;
728
+ } | {
729
+ phoneticScriptId: string;
730
+ audioScriptId?: never;
731
+ segments?: never;
803
732
  };
804
733
  placement: ClipPlacement;
734
+ /**
735
+ * The digest of what the recording was synthesized from (D177): the PhoneticScript as it was
736
+ * read for synthesis. Absent, the source's digest as this voiceover leaves it is recorded.
737
+ */
738
+ sourceDigest?: string;
805
739
  volume?: number;
806
740
  voice?: Voice;
807
741
  /** Complete generated caption set for this use. Other uses of the recording are untouched. */
@@ -811,16 +745,24 @@ interface VoiceoverResult {
811
745
  clipId: string;
812
746
  mediaId: string;
813
747
  audioScriptId: string;
748
+ /** Ids of a new script's segments, in order; empty when the script already exists. */
749
+ segmentIds: string[];
814
750
  captionClipIds: string[];
815
751
  captionIds: string[];
816
752
  }
817
753
  //#endregion
818
754
  //#region src/dsl/dsl-editor.d.ts
755
+ /**
756
+ * Stores raw content in Memota as a text file and returns the file's facts. The host owns the
757
+ * store; an entity with the Media File trait keeps the facts beside the content (D178).
758
+ */
759
+ type UploadText = (text: string) => Promise<StoredFile>;
819
760
  /** Business edits write DSL facts in one audited transaction; layout is derived on read. */
820
761
  declare class DslEditor {
821
762
  readonly dsl: MedeoDsl;
822
763
  private readonly idFactory;
823
- constructor(dsl: MedeoDsl, idFactory?: DslIdFactory);
764
+ private readonly uploadText?;
765
+ constructor(dsl: MedeoDsl, idFactory?: DslIdFactory, uploadText?: UploadText | undefined);
824
766
  createTrack(role: TrackRole, options?: CommitOptions): string;
825
767
  registerMedia(media: Media, options?: CommitOptions): string;
826
768
  addClips(input: AddDslClipsInput, options?: CommitOptions): string[];
@@ -834,22 +776,28 @@ declare class DslEditor {
834
776
  rate: number;
835
777
  } | undefined, options?: CommitOptions): void;
836
778
  setClipVolume(clipId: string, volume: number | undefined, options?: CommitOptions): void;
837
- createAudioScript(body: string, defaultLanguage?: string, options?: CommitOptions): string;
838
- editAudioScript(scriptId: string, expectedBodyId: string, edits: readonly TextEdit[], options?: CommitOptions): void;
839
- createCaption(input: ({
840
- audioScriptId: string;
841
- start: number;
842
- end: number;
779
+ /** A script of these segments, in order; each segment gets its own id. */
780
+ createAudioScript(segments: readonly string[], defaultLanguage?: string, options?: CommitOptions): string;
781
+ editAudioScript(scriptId: string, segmentId: string, expectedBodyId: string, edits: readonly TextEdit[], options?: CommitOptions): void;
782
+ /** Adds a segment at `index`, the end by default, and returns its id. */
783
+ insertScriptSegment(scriptId: string, text: string, index?: number, options?: CommitOptions): string;
784
+ /** `index` is measured after removing the segment. */
785
+ moveScriptSegment(scriptId: string, segmentId: string, index: number, options?: CommitOptions): void;
786
+ /** Captions and PhoneticScripts selecting the segment keep their selection, which then shows nothing (D72). */
787
+ deleteScriptSegment(scriptId: string, segmentId: string, options?: CommitOptions): void;
788
+ createCaption(input: ((SegmentRange & {
843
789
  text?: never;
844
- } | {
790
+ }) | {
845
791
  text: string;
846
792
  audioScriptId?: never;
793
+ segmentId?: never;
847
794
  start?: never;
848
795
  end?: never;
849
796
  }) & {
850
797
  style?: CaptionStyle;
851
798
  }, options?: CommitOptions): string;
852
- setCaptionContent(captionId: string, audioScriptId: string, start: number, end: number, options?: CommitOptions): void;
799
+ /** Show a segment of a script, or a run of it, in place of the Caption's own text. */
800
+ setCaptionContent(captionId: string, selection: SegmentRange, options?: CommitOptions): void;
853
801
  setCaptionText(captionId: string, text: string, options?: CommitOptions): void;
854
802
  editCaptionText(captionId: string, expectedBodyId: string, edits: readonly TextEdit[], options?: CommitOptions): void;
855
803
  moveTrack(trackId: string, index: number, options?: CommitOptions): void;
@@ -866,6 +814,19 @@ declare class DslEditor {
866
814
  updateClips(updates: readonly DslClipUpdate[], options?: CommitOptions): void;
867
815
  patchCaptionStyle(captionIds: readonly string[], patch: FieldPatch<CaptionStyle>, options?: CommitOptions): void;
868
816
  applyVoiceover(input: ApplyVoiceoverInput, options?: CommitOptions): VoiceoverResult;
817
+ private voiceoverScriptId;
818
+ /**
819
+ * Write a PhoneticScript: create one for a segment of a script, or a run of it, or, given
820
+ * `phoneticScriptId`, replace its selection and what to synthesize together (D181). A
821
+ * `phonemeScript` is stored as a Memota text file first, and the file's facts are written with
822
+ * it; an unchanged one keeps its file. Recordings already spoken from it keep their derived-from.
823
+ */
824
+ setPhoneticScript(input: SegmentRange & {
825
+ phoneticScriptId?: string;
826
+ phonemeScript?: string;
827
+ }, options?: CommitOptions): Promise<string>;
828
+ /** The file holding `text`: the one the PhoneticScript keeps while its text is unchanged, else a new upload. */
829
+ private fileFor;
869
830
  setBgm(input: ClipSource & {
870
831
  trackId: string;
871
832
  clipId?: string;
@@ -924,6 +885,58 @@ interface VideoDraftProjection {
924
885
  /** A content read view, not an archive of authoring identities, rich-text marks or provenance. */
925
886
  declare function toVideoDraft(snapshot: MedeoDslSnapshot): VideoDraftProjection;
926
887
  //#endregion
888
+ //#region src/dsl/projection/audio-scripts.d.ts
889
+ /**
890
+ * An AudioScript with everything that says or shows it, read from the same snapshot as the
891
+ * VideoDraft. Speeches and captions come in playback order.
892
+ */
893
+ interface AudioScriptView {
894
+ id: string;
895
+ /** Its segments, in order. */
896
+ segments: {
897
+ id: string;
898
+ text: string;
899
+ language?: string;
900
+ }[];
901
+ /** Media the script was read off (a transcript), through derived-from. */
902
+ sourceMediaIds: string[];
903
+ /**
904
+ * Its variants written for synthesis: the segment each is for (by index, absent once that
905
+ * segment is gone), what its selection holds, what to synthesize, and its file's digest.
906
+ */
907
+ phoneticScripts: {
908
+ id: string;
909
+ segment?: number;
910
+ text?: string;
911
+ phonemeScript?: string;
912
+ digest?: string;
913
+ }[];
914
+ /** Speech Clips playing a recording of these words. */
915
+ speeches: {
916
+ clipId: string;
917
+ recordingId: string; /** The PhoneticScript the recording was spoken from; absent when it derives from the script directly. */
918
+ phoneticScriptId?: string;
919
+ voices: {
920
+ voiceId: string;
921
+ key: string;
922
+ name?: string;
923
+ }[];
924
+ /**
925
+ * Whether the recording was synthesized from its source as it is now: the digest its
926
+ * derived-from records equals the source's digest (D177). Absent when either has none.
927
+ */
928
+ applied?: boolean;
929
+ }[];
930
+ /** Caption Clips showing one of its segments. A Caption with its own text shows none. */
931
+ captions: {
932
+ clipId: string;
933
+ captionId: string;
934
+ segment: number;
935
+ }[];
936
+ }
937
+ /** Every AudioScript in the document with its PhoneticScripts, the Speech Clips saying it and the Caption Clips showing it. */
938
+ declare function toAudioScriptViews(snapshot: MedeoDslSnapshot): AudioScriptView[];
939
+ //#endregion
927
940
  //#region src/dsl/projection/from-video-draft.d.ts
928
941
  interface FromVideoDraftOptions extends CreateMedeoDslOptions {
929
942
  /** Complete physical media facts, keyed by their external system/key; no IO runs in the converter. */
@@ -937,4 +950,4 @@ interface ImportedVideoDraft {
937
950
  /** One-time import into a newly owned document; never reverse-diff a live collaborative document. */
938
951
  declare function fromVideoDraft(input: VideoDraftInput, options: FromVideoDraftOptions): ImportedVideoDraft;
939
952
  //#endregion
940
- export { AddDslClip as A, MedeoDslDraft as C, captionContentCodec as D, InvalidAtomic as E, ReplaceDslClipsInput as F, ClipPlacement as I, ClipSource as M, DslClipUpdate as N, isInvalidAtomic as O, MoveDslClipsInput as P, documentFormat as S, medeoDslLoroShape as T, MedeoDsl as _, toVideoDraft as a, UnsupportedDocumentFormatError as b, DslLayout as c, createInitialMedeoDsl as d, DslEditor as f, CreateMedeoDslOptions as g, VoiceoverResult as h, VideoDraftProjection as i, AddDslClipsInput as j, timeAnchorCodec as k, DslProjectionError as l, VoiceoverCaptionInput as m, ImportedVideoDraft as n, resolveDslLayout as o, ApplyVoiceoverInput as p, fromVideoDraft as r, DslClipLayout as s, FromVideoDraftOptions as t, DslTrackLayout as u, DslAudit as v, MedeoDslLoroState as w, assertDslDocument as x, DslTransaction as y };
953
+ export { MedeoDslDraft as A, UnsupportedDocumentFormatError as C, captionContentCodec as D, InvalidAtomic as E, ClipSource as F, DslClipUpdate as I, MoveDslClipsInput as L, medeoDslLoroShape as M, AddDslClip as N, isInvalidAtomic as O, AddDslClipsInput as P, ReplaceDslClipsInput as R, DslTransaction as S, documentFormat as T, VoiceoverCaptionInput as _, toAudioScriptViews as a, MedeoDsl as b, resolveDslLayout as c, DslProjectionError as d, DslTrackLayout as f, ApplyVoiceoverInput as g, UploadText as h, AudioScriptView as i, MedeoDslLoroState as j, timeAnchorCodec as k, DslClipLayout as l, DslEditor as m, ImportedVideoDraft as n, VideoDraftProjection as o, createInitialMedeoDsl as p, fromVideoDraft as r, toVideoDraft as s, FromVideoDraftOptions as t, DslLayout as u, VoiceoverResult as v, assertDslDocument as w, DslAudit as x, CreateMedeoDslOptions as y, ClipPlacement as z };