@mengine/medeo-client 2.0.1-alpha.22 → 2.0.1-alpha.24
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/{document-BB8U25jt.js → document-Ct11SMBS.js} +290 -336
- package/dist/{index-C0uUWqkz.d.ts → index-CcIoMxs1.d.ts} +12 -17
- package/dist/index.d.ts +35 -27
- package/dist/index.js +218 -377
- package/dist/testing.d.ts +1 -1
- package/dist/testing.js +1 -1
- package/package.json +4 -4
|
@@ -1019,6 +1019,11 @@ declare function fromVideoDocument(document: VideoDocument, options?: SolveVideo
|
|
|
1019
1019
|
*/
|
|
1020
1020
|
declare function buildInitialVideoDocument(): VideoDocument;
|
|
1021
1021
|
//#endregion
|
|
1022
|
+
//#region ../medeo-dsl/src/sandbox.d.ts
|
|
1023
|
+
/** Kinds a script can author. */
|
|
1024
|
+
type EntityKind = 'timeline' | 'track' | 'clip' | 'sequence-marker' | 'video' | 'audio' | 'voiceover-recording' | 'image' | 'voice' | 'audio-script' | 'phonetic-script' | 'caption';
|
|
1025
|
+
type RelationKind = 'contain' | 'marker' | 'clip-anchor' | 'voice-timbre' | 'caption-alignment' | 'derived-from';
|
|
1026
|
+
//#endregion
|
|
1022
1027
|
//#region ../medeo-dsl/src/ids.d.ts
|
|
1023
1028
|
declare const entityIdBrand: unique symbol;
|
|
1024
1029
|
declare const relationIdBrand: unique symbol;
|
|
@@ -1037,23 +1042,13 @@ type JsonObject = {
|
|
|
1037
1042
|
};
|
|
1038
1043
|
//#endregion
|
|
1039
1044
|
//#region ../medeo-dsl/src/entities.d.ts
|
|
1040
|
-
type
|
|
1045
|
+
type StoredEntityKind = EntityKind | 'asset';
|
|
1041
1046
|
declare const extensionEntityKindBrand: unique symbol;
|
|
1042
1047
|
type ExtensionEntityKind = string & {
|
|
1043
1048
|
readonly [extensionEntityKindBrand]: 'ExtensionEntityKind';
|
|
1044
1049
|
};
|
|
1045
1050
|
/** Extensions require explicit branding so removed or reserved domain kinds cannot reappear accidentally. */
|
|
1046
|
-
type
|
|
1047
|
-
interface SequenceRange<Point = unknown> {
|
|
1048
|
-
readonly start: Point;
|
|
1049
|
-
readonly end: Point;
|
|
1050
|
-
}
|
|
1051
|
-
type SequenceDuration<Span = unknown> = {
|
|
1052
|
-
readonly mode: 'from-source';
|
|
1053
|
-
} | {
|
|
1054
|
-
readonly mode: 'fixed';
|
|
1055
|
-
readonly value: Span;
|
|
1056
|
-
};
|
|
1051
|
+
type AnyEntityKind = StoredEntityKind | ExtensionEntityKind;
|
|
1057
1052
|
interface ScriptTextSegment {
|
|
1058
1053
|
readonly segmentId: string;
|
|
1059
1054
|
readonly text: string;
|
|
@@ -1104,8 +1099,8 @@ type CaptionSegmentSelection = JsonObject & {
|
|
|
1104
1099
|
};
|
|
1105
1100
|
//#endregion
|
|
1106
1101
|
//#region ../medeo-dsl/src/relations.d.ts
|
|
1107
|
-
type
|
|
1108
|
-
type
|
|
1102
|
+
type StoredRelationKind = RelationKind | 'from-asset' | 'to-asset';
|
|
1103
|
+
type AnyRelationKind = StoredRelationKind | (string & {});
|
|
1109
1104
|
type RelationTrace = JsonObject;
|
|
1110
1105
|
/**
|
|
1111
1106
|
* Authoritative persisted relation value.
|
|
@@ -1114,7 +1109,7 @@ type RelationTrace = JsonObject;
|
|
|
1114
1109
|
* storage adapters must preserve the submitted positions; kinds whose
|
|
1115
1110
|
* semantics are unordered simply do not interpret those positions.
|
|
1116
1111
|
*/
|
|
1117
|
-
interface RelationRow<K extends
|
|
1112
|
+
interface RelationRow<K extends AnyRelationKind = AnyRelationKind, Metadata extends JsonObject = JsonObject> {
|
|
1118
1113
|
readonly relationId: RelationId;
|
|
1119
1114
|
readonly endpoint0EntityId: EntityId;
|
|
1120
1115
|
readonly endpoint1EntityId: EntityId;
|
|
@@ -1125,7 +1120,7 @@ interface RelationRow<K extends RelationKind = RelationKind, Metadata extends Js
|
|
|
1125
1120
|
//#endregion
|
|
1126
1121
|
//#region ../medeo-dsl/src/rows.d.ts
|
|
1127
1122
|
/** One persisted first-class entity. Its owned fields live directly in payload. */
|
|
1128
|
-
interface EntityRow<K extends
|
|
1123
|
+
interface EntityRow<K extends AnyEntityKind = AnyEntityKind> {
|
|
1129
1124
|
readonly entityId: EntityId;
|
|
1130
1125
|
readonly entityKind: K;
|
|
1131
1126
|
readonly payload: JsonObject;
|
|
@@ -1870,4 +1865,4 @@ declare const videoDocumentSchema: z.ZodObject<{
|
|
|
1870
1865
|
}, z.core.$loose>]>>>;
|
|
1871
1866
|
}, z.core.$loose>;
|
|
1872
1867
|
//#endregion
|
|
1873
|
-
export {
|
|
1868
|
+
export { derivePositionFromAbs as $, assertValidVideoDocument as A, VideoDraftContent as At, EntityRow as B, Track$1 as Bt, isImplementedSemanticOpKind as C, TrackItem as Ct, PartIdFactory as D, VideoDocumentValidationIssue as Dt, ValidationError as E, VideoDocument as Et, ResolvedEntityTrack as F, CaptionPart$1 as Ft, VoiceDescriptor as G, CaptionSegmentSelection as H, resolveEntityTimelineLayout as I, CaptionStyle as It, EntityId as J, JsonObject as K, projectEntityTimeline as L, PartAggregation as Lt, EntityTimelineTrackRole as M, effectiveVideoClipDurationMs as Mt, ResolvedEntityClipPlacement as N, speedOf as Nt, generatePartId as O, VideoDocumentValidationIssueCode as Ot, ResolvedEntityTimelineLayout as P, Attachment as Pt, buildSpeechHostMap as Q, EntityTimelineProjectionError as R, SpeedShift as Rt, SemanticOpKind as S, Track as St, SnapshotReadable as T, VideoClipPart as Tt, CaptionStyleFields as U, RelationRow as V, TrackItem$1 as Vt, ScriptTextSegment as W, DerivedItemPosition as X, buildInitialVideoDocument as Y, SpeechHostMap as Z, SemanticOpName as _, DEFAULT_UNIT_TIME_MS as _t, PlainMemoryAdapter as a, ensureLaneTrack as at, ImplementedSemanticOpKind as b, SpeechPart as bt, MirrorVideoDocumentAdapter as c, solveVideoDocument as ct, createMirrorVideoDocumentAdapter as d, VideoDocumentDraft as dt, fromVideoDocument as et, CommitOptions as f, VideoDocumentMirrorSchema as ft, SemanticOpInput as g, CaptionPart as gt, SemanticEditor as h, CaptionDisplayCue as ht, JournalEntry as i, SolvedVideoDocument as it, validateVideoDocument as j, VideoDraftPartUnion as jt, VideoDocumentValidationError as k, VideoDraft as kt, MirrorVideoDocumentOptions as l, TrackDraft as lt, SemanticDocumentAdapter as m, BgmPart as mt, videoDocumentSchema as n, LANE_KINDS_IN_STACK_ORDER as nt, PlainMemoryAdapterOptions as o, findLaneTrack as ot, OpActor as p, videoDocumentMirrorSchema as pt, JsonValue as q, readVideoDocumentFromDraft as r, LaneKind as rt, createPlainMemoryAdapter as s, laneTrackId as st, partUnionSchema as t, toVideoDocument as tt, createMirrorVideoDocument as u, TrackItemDraft as ut, TransactAudit as v, PartKind as vt, SchemaValidator as w, TrackItemTimePosition as wt, PlannedSemanticOpKind as x, Timeline as xt, IMPLEMENTED_SEMANTIC_OP_KINDS as y, PartUnion as yt, EntityRelationRows as z, Timeline$1 as zt };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as index_d_exports } from "./index-CMa6ZCtX.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as derivePositionFromAbs, A as assertValidVideoDocument, At as VideoDraftContent, B as EntityRow, Bt as Track$1, C as isImplementedSemanticOpKind, Ct as TrackItem, D as PartIdFactory, Dt as VideoDocumentValidationIssue, E as ValidationError, Et as VideoDocument, F as ResolvedEntityTrack, Ft as CaptionPart$1, G as VoiceDescriptor, H as CaptionSegmentSelection, I as resolveEntityTimelineLayout, It as CaptionStyle, J as EntityId, K as JsonObject, L as projectEntityTimeline, Lt as PartAggregation, M as EntityTimelineTrackRole, Mt as effectiveVideoClipDurationMs, N as ResolvedEntityClipPlacement, Nt as speedOf, O as generatePartId, Ot as VideoDocumentValidationIssueCode, P as ResolvedEntityTimelineLayout, Pt as Attachment, Q as buildSpeechHostMap, R as EntityTimelineProjectionError, Rt as SpeedShift, S as SemanticOpKind, St as Track, T as SnapshotReadable, Tt as VideoClipPart, U as CaptionStyleFields, V as RelationRow, Vt as TrackItem$1, W as ScriptTextSegment, X as DerivedItemPosition, Y as buildInitialVideoDocument, Z as SpeechHostMap, _ as SemanticOpName, _t as DEFAULT_UNIT_TIME_MS, a as PlainMemoryAdapter, at as ensureLaneTrack, b as ImplementedSemanticOpKind, bt as SpeechPart, c as MirrorVideoDocumentAdapter, ct as solveVideoDocument, d as createMirrorVideoDocumentAdapter, dt as VideoDocumentDraft, et as fromVideoDocument, f as CommitOptions, ft as VideoDocumentMirrorSchema, g as SemanticOpInput, gt as CaptionPart, h as SemanticEditor, ht as CaptionDisplayCue, i as JournalEntry, it as SolvedVideoDocument, j as validateVideoDocument, jt as VideoDraftPartUnion, k as VideoDocumentValidationError, kt as VideoDraft, l as MirrorVideoDocumentOptions, lt as TrackDraft, m as SemanticDocumentAdapter, mt as BgmPart, n as videoDocumentSchema, nt as LANE_KINDS_IN_STACK_ORDER, o as PlainMemoryAdapterOptions, ot as findLaneTrack, p as OpActor, pt as videoDocumentMirrorSchema, q as JsonValue, r as readVideoDocumentFromDraft, rt as LaneKind, s as createPlainMemoryAdapter, st as laneTrackId, t as partUnionSchema, tt as toVideoDocument, u as createMirrorVideoDocument, ut as TrackItemDraft, v as TransactAudit, vt as PartKind, w as SchemaValidator, wt as TrackItemTimePosition, x as PlannedSemanticOpKind, xt as Timeline, y as IMPLEMENTED_SEMANTIC_OP_KINDS, yt as PartUnion, z as EntityRelationRows, zt as Timeline$1 } from "./index-CcIoMxs1.js";
|
|
3
3
|
import { LoroDoc, PeerID } from "loro-crdt";
|
|
4
4
|
import { DocState } from "@mengine/sync";
|
|
5
5
|
import { BaseDocStorage, Connection, DocDiff, DocPushReceipt, DocSnapshotRecord, DocStorage, DocStorageOptions, DocUpdate, DocUpdateRecord } from "@mengine/storage";
|
|
@@ -291,7 +291,7 @@ interface AudioMediaAssetFact {
|
|
|
291
291
|
interface VoiceoverMediaAssetFact {
|
|
292
292
|
/** Stable external speech result id, independent of the placed Clip id. */
|
|
293
293
|
readonly assetId: string;
|
|
294
|
-
readonly kind: 'voiceover';
|
|
294
|
+
readonly kind: 'voiceover-recording';
|
|
295
295
|
readonly durationMs: number;
|
|
296
296
|
readonly storageKey: string;
|
|
297
297
|
/**
|
|
@@ -305,22 +305,23 @@ interface VoiceoverMediaAssetFact {
|
|
|
305
305
|
}
|
|
306
306
|
/** Facts resolved from media storage. A trim window never substitutes for intrinsic duration. */
|
|
307
307
|
type MediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact | AudioMediaAssetFact | VoiceoverMediaAssetFact;
|
|
308
|
+
/** Where a Clip starts: in flow by order, or at a stated start on its Track or inside its host. */
|
|
308
309
|
type ClipPlacement = {
|
|
309
310
|
readonly kind: 'sequential';
|
|
310
311
|
readonly order: number;
|
|
311
312
|
} | {
|
|
312
313
|
readonly kind: 'absolute';
|
|
313
|
-
readonly
|
|
314
|
+
readonly startMs: number;
|
|
314
315
|
} | {
|
|
315
316
|
readonly kind: 'anchored';
|
|
316
317
|
readonly hostClipEntityId: string;
|
|
317
|
-
readonly
|
|
318
|
+
readonly startMs: number;
|
|
318
319
|
};
|
|
319
320
|
interface InsertPlacedClipInput {
|
|
320
321
|
readonly trackEntityId: string;
|
|
321
322
|
readonly contentEntityId: string;
|
|
322
|
-
readonly
|
|
323
|
-
readonly
|
|
323
|
+
readonly inMs: number;
|
|
324
|
+
readonly outMs: number;
|
|
324
325
|
readonly placement: ClipPlacement;
|
|
325
326
|
readonly clipPayload?: JsonObject;
|
|
326
327
|
/** Stable caller-owned placement identity, when one already exists outside the graph. */
|
|
@@ -374,31 +375,34 @@ type VoiceoverTakeInput = {
|
|
|
374
375
|
} & ({
|
|
375
376
|
readonly placement: ClipPlacement;
|
|
376
377
|
readonly hostClipEntityId?: never;
|
|
377
|
-
readonly
|
|
378
|
+
readonly startMs?: never;
|
|
378
379
|
} | {
|
|
379
380
|
readonly placement?: never;
|
|
380
381
|
readonly hostClipEntityId: string;
|
|
381
|
-
readonly
|
|
382
|
+
readonly startMs: number;
|
|
382
383
|
});
|
|
383
384
|
type VisualMediaAssetFact = ImageMediaAssetFact | VideoMediaAssetFact;
|
|
384
385
|
interface InsertMediaClipInput {
|
|
385
386
|
readonly timelineEntityId: string;
|
|
386
387
|
readonly clipEntityId?: string;
|
|
387
388
|
readonly media: VisualMediaAssetFact;
|
|
388
|
-
/**
|
|
389
|
-
readonly
|
|
389
|
+
/** Window on the source, whole milliseconds. An Image uses it as its finite display span. */
|
|
390
|
+
readonly inMs: number;
|
|
391
|
+
readonly outMs: number;
|
|
390
392
|
readonly placement: ClipPlacement;
|
|
391
393
|
readonly volume?: number;
|
|
392
394
|
}
|
|
393
395
|
interface ReplaceMediaClipInput {
|
|
394
396
|
readonly clipEntityId: string;
|
|
395
397
|
readonly media: VisualMediaAssetFact;
|
|
396
|
-
readonly
|
|
398
|
+
readonly inMs: number;
|
|
399
|
+
readonly outMs: number;
|
|
397
400
|
}
|
|
398
401
|
interface ReplacementMediaClipInput {
|
|
399
402
|
readonly clipEntityId?: string;
|
|
400
403
|
readonly media: VisualMediaAssetFact;
|
|
401
|
-
readonly
|
|
404
|
+
readonly inMs: number;
|
|
405
|
+
readonly outMs: number;
|
|
402
406
|
readonly volume?: number;
|
|
403
407
|
}
|
|
404
408
|
type MediaClipInsertion = {
|
|
@@ -435,11 +439,13 @@ interface LinearClipSpeed {
|
|
|
435
439
|
}
|
|
436
440
|
interface SetClipSpeedInput {
|
|
437
441
|
readonly clipEntityId: string;
|
|
438
|
-
|
|
442
|
+
/** Linear speed; null restores the source's own pace. */
|
|
443
|
+
readonly rate: number | null;
|
|
439
444
|
}
|
|
440
445
|
interface TrimClipInput {
|
|
441
446
|
readonly clipEntityId: string;
|
|
442
|
-
readonly
|
|
447
|
+
readonly inMs: number;
|
|
448
|
+
readonly outMs: number;
|
|
443
449
|
}
|
|
444
450
|
interface VoiceoverTakeResult {
|
|
445
451
|
readonly voiceoverClipEntityId: string;
|
|
@@ -497,19 +503,21 @@ interface InsertClipInput {
|
|
|
497
503
|
readonly trackEntityId: string;
|
|
498
504
|
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
499
505
|
readonly contentEntityId: string;
|
|
500
|
-
readonly
|
|
501
|
-
readonly
|
|
502
|
-
readonly
|
|
506
|
+
readonly inMs: number;
|
|
507
|
+
readonly outMs: number;
|
|
508
|
+
readonly startMs?: number;
|
|
509
|
+
/** Where among its Track's Clips it lands; appended when omitted. */
|
|
510
|
+
readonly order?: number;
|
|
503
511
|
readonly clipPayload?: JsonObject;
|
|
504
512
|
}
|
|
505
513
|
interface UpdateClipMarkerInput {
|
|
506
514
|
readonly clipEntityId: string;
|
|
507
|
-
readonly
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
readonly
|
|
511
|
-
/** Passing `undefined` explicitly removes the optional
|
|
512
|
-
readonly
|
|
515
|
+
readonly inMs?: number;
|
|
516
|
+
readonly outMs?: number;
|
|
517
|
+
/** Passing `undefined` explicitly removes the optional start. */
|
|
518
|
+
readonly startMs?: number | undefined;
|
|
519
|
+
/** Passing `undefined` explicitly removes the optional rate. */
|
|
520
|
+
readonly rate?: number | undefined;
|
|
513
521
|
}
|
|
514
522
|
interface MoveClipInput {
|
|
515
523
|
readonly clipEntityId: string;
|
|
@@ -519,10 +527,10 @@ interface ReplaceClipContentInput {
|
|
|
519
527
|
readonly clipEntityId: string;
|
|
520
528
|
/** Existing Sequence media Entity id. Asset ids and URLs are not content ids. */
|
|
521
529
|
readonly contentEntityId: string;
|
|
522
|
-
readonly
|
|
523
|
-
readonly
|
|
524
|
-
readonly
|
|
525
|
-
readonly
|
|
530
|
+
readonly inMs: number;
|
|
531
|
+
readonly outMs: number;
|
|
532
|
+
readonly startMs?: number;
|
|
533
|
+
readonly rate?: number;
|
|
526
534
|
}
|
|
527
535
|
interface DeleteClipInput {
|
|
528
536
|
readonly clipEntityId: string;
|