@pixerate/editor 0.84.0 → 0.85.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.
@@ -92,6 +92,12 @@ declare function videoKeyframeFfmpegExpr(prop: VideoAnimatable | undefined, time
92
92
  */
93
93
 
94
94
  type VideoAssetKind = 'video' | 'audio' | 'image';
95
+ /** A spoken word in an asset's transcript, timed in the source (ms). */
96
+ interface VideoTranscriptWord {
97
+ word: string;
98
+ start: number;
99
+ end: number;
100
+ }
95
101
  /** A piece of source media. The project refers to it by id; `src` is whatever the host can load. */
96
102
  interface VideoAsset {
97
103
  id: string;
@@ -108,6 +114,8 @@ interface VideoAsset {
108
114
  hasAudio?: boolean;
109
115
  /** A still to show for a video where its frames cannot be drawn (SVG renders, thumbnails). */
110
116
  poster?: string;
117
+ /** What is said in it, word by word, timed in the source (see `parseVideoTranscript`). */
118
+ transcript?: VideoTranscriptWord[];
111
119
  }
112
120
  type VideoTrackKind = 'video' | 'audio';
113
121
  interface VideoTrack {
@@ -339,6 +347,7 @@ declare function parseVideoTransform(v: unknown, path: string): VideoTransform |
339
347
  declare function parseVideoClipAnimation(v: unknown, path: string): VideoClipAnimation | undefined;
340
348
  declare function parseVideoGrade(v: unknown, path: string): VideoGrade | undefined;
341
349
  declare function parseVideoTransition(v: unknown, path: string): VideoTransition | undefined;
350
+ declare function parseVideoTranscriptWords(v: unknown, path: string): VideoTranscriptWord[] | undefined;
342
351
  declare function parseVideoAsset(v: unknown, path?: string): VideoAsset;
343
352
  declare function parseVideoClip(v: unknown, path?: string): VideoClip;
344
353
  declare function parseVideoTrack(v: unknown, path?: string): VideoTrack;
@@ -1028,6 +1037,92 @@ declare function videoClipAnimationSpans(clip: VideoClip): {
1028
1037
  */
1029
1038
  declare function videoClipAnimated(clip: VideoClip, project: Pick<VideoProject, 'width' | 'height'>): VideoClip;
1030
1039
 
1040
+ /**
1041
+ * A transcript from text a speech-to-text service or captioning tool wrote: Whisper-style JSON
1042
+ * (`{ segments: [{ words: [{ word, start, end }] }] }` or `{ words: [...] }`, times in seconds, or a
1043
+ * plain `[{ word, start, end }]` array in ms), SubRip (`.srt`) or WebVTT. Captions have no word
1044
+ * timings, so their words are spread evenly across each cue (`approximate: true`). Throws when it
1045
+ * finds no words.
1046
+ */
1047
+ declare function parseVideoTranscript(input: string | unknown): {
1048
+ words: VideoTranscriptWord[];
1049
+ approximate: boolean;
1050
+ };
1051
+ /** A word where it plays on the timeline. */
1052
+ interface VideoTimelineWord {
1053
+ word: string;
1054
+ /** Timeline times (ms). */
1055
+ start: number;
1056
+ end: number;
1057
+ /** The clip that plays it. */
1058
+ clip: string;
1059
+ track: string;
1060
+ /** Its index in the asset's transcript. */
1061
+ index: number;
1062
+ }
1063
+ /**
1064
+ * The track whose words make the timeline transcript: `track` if given, else the first audio track
1065
+ * with a transcribed clip, else the first video track with one. `null` when nothing is transcribed.
1066
+ */
1067
+ declare function videoTranscriptTrack(project: VideoProject, track?: string): string | null;
1068
+ /**
1069
+ * The words the timeline plays on one track, in order: each transcribed media clip's words whose
1070
+ * middle falls inside the stretch of source it plays, moved to timeline time through its in point
1071
+ * and speed and clamped to the clip.
1072
+ */
1073
+ declare function videoTimelineTranscript(project: VideoProject, options?: {
1074
+ track?: string;
1075
+ }): VideoTimelineWord[];
1076
+ /** A stretch of the timeline (ms) and the words in it. */
1077
+ interface VideoTranscriptRange {
1078
+ from: number;
1079
+ to: number;
1080
+ text: string;
1081
+ }
1082
+ /** A word as compared: lower case, without surrounding punctuation. */
1083
+ declare const normalizeVideoWord: (word: string) => string;
1084
+ /** Every place a phrase is said (case and punctuation ignored), as timeline ranges. */
1085
+ declare function findVideoTranscriptText(words: readonly VideoTimelineWord[], query: string): VideoTranscriptRange[];
1086
+ /** Filler words and phrases removed by default. "like" and "so" are left out: too often meant. */
1087
+ declare const VIDEO_DEFAULT_FILLERS: readonly ["um", "umm", "uh", "uhh", "uhm", "erm", "er", "ah", "hmm", "mm", "you know", "i mean"];
1088
+ /** Fillers in the transcript, longest phrase first ("you know" before "you"), as timeline ranges. */
1089
+ declare function findVideoFillers(words: readonly VideoTimelineWord[], fillers?: readonly string[]): VideoTranscriptRange[];
1090
+ interface VideoPauseOptions {
1091
+ /** Shortest gap between words that counts as a pause (ms, default 700). */
1092
+ min?: number;
1093
+ /** Silence to keep next to each word so speech does not sound clipped (ms, default 150). */
1094
+ keep?: number;
1095
+ /** Frame rate to snap the cut inward to (default: none). */
1096
+ fps?: number;
1097
+ }
1098
+ /** Gaps between consecutive words on the same clip longer than `min`, less `keep` either side, as timeline ranges. */
1099
+ declare function findVideoTranscriptPauses(words: readonly VideoTimelineWord[], options?: VideoPauseOptions): VideoTranscriptRange[];
1100
+ /** Ranges sorted and merged where they touch or overlap. */
1101
+ declare function mergeVideoRanges(ranges: readonly {
1102
+ from: number;
1103
+ to: number;
1104
+ }[]): {
1105
+ from: number;
1106
+ to: number;
1107
+ }[];
1108
+ /**
1109
+ * The edits that cut ranges out of the timeline and close them up: one `extract_range` per merged
1110
+ * range, last first, so earlier ranges keep their times. Apply them together as one undo step.
1111
+ */
1112
+ declare function videoRemoveRangesEdits(ranges: readonly {
1113
+ from: number;
1114
+ to: number;
1115
+ }[], tracks?: string[]): VideoEdit[];
1116
+ /** The timeline stretch from word `a` to word `b` (either order), for deleting a selection of words. */
1117
+ declare function videoWordsRange(words: readonly VideoTimelineWord[], a: number, b: number): {
1118
+ from: number;
1119
+ to: number;
1120
+ };
1121
+ /** The edit that attaches a transcript file's text to an asset (see `parseVideoTranscript`). Throws a readable error for text it cannot read. */
1122
+ declare function videoTranscriptEdit(assetId: string, text: string): VideoEdit;
1123
+ /** The word playing at a timeline time, as its index in `words`, or -1. */
1124
+ declare function videoWordAt(words: readonly VideoTimelineWord[], time: number): number;
1125
+
1031
1126
  /** Radius of an iris `progress` (0–1) open: from nothing to the frame's corners. */
1032
1127
  declare const videoIrisRadius: (frame: {
1033
1128
  width: number;
@@ -1426,7 +1521,28 @@ interface VideoEditorToolProviderOptions {
1426
1521
  }
1427
1522
  /** A project as agents see it: settings, assets, and each track's clips in order with their times. */
1428
1523
  declare function describeVideoProject(project: VideoProject): {
1429
- assets: VideoAsset[];
1524
+ assets: ({
1525
+ id: string;
1526
+ kind: VideoAssetKind;
1527
+ src: string;
1528
+ name?: string;
1529
+ duration?: number;
1530
+ width?: number;
1531
+ height?: number;
1532
+ hasAudio?: boolean;
1533
+ poster?: string;
1534
+ } | {
1535
+ transcriptWords: number;
1536
+ id: string;
1537
+ kind: VideoAssetKind;
1538
+ src: string;
1539
+ name?: string;
1540
+ duration?: number;
1541
+ width?: number;
1542
+ height?: number;
1543
+ hasAudio?: boolean;
1544
+ poster?: string;
1545
+ })[];
1430
1546
  tracks: {
1431
1547
  clips: ({
1432
1548
  source?: {
@@ -1655,4 +1771,4 @@ declare function videoKeyframeValueEdit(project: VideoProject, clipId: string, p
1655
1771
  */
1656
1772
  declare function videoKeyframeToggleEdit(project: VideoProject, clipId: string, property: VideoKeyframeProperty, time: number): VideoEdit | null;
1657
1773
 
1658
- export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoSilenceOptions, type VideoSnapOptions, type VideoSvgOptions, type VideoTextClip, type VideoTrack, type VideoTrackKind, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoGaps, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, nextFreeVideoSlot, normalizeVideoGrade, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTrack, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSpeed, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRulerTicks, videoSnapPoints, videoTextStyle, videoTimecodeFrames, videoTitleFrame, videoTrackSyncLocked, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoWaveformPath, videoWipeRect };
1774
+ export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_FILLERS, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPauseOptions, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoSilenceOptions, type VideoSnapOptions, type VideoSvgOptions, type VideoTextClip, type VideoTimelineWord, type VideoTrack, type VideoTrackKind, type VideoTranscriptRange, type VideoTranscriptWord, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoFillers, findVideoGaps, findVideoTranscriptPauses, findVideoTranscriptText, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, mergeVideoRanges, nextFreeVideoSlot, normalizeVideoGrade, normalizeVideoWord, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTrack, parseVideoTranscript, parseVideoTranscriptWords, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSpeed, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRemoveRangesEdits, videoRulerTicks, videoSnapPoints, videoTextStyle, videoTimecodeFrames, videoTimelineTranscript, videoTitleFrame, videoTrackSyncLocked, videoTranscriptEdit, videoTranscriptTrack, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoWaveformPath, videoWipeRect, videoWordAt, videoWordsRange };
@@ -92,6 +92,12 @@ declare function videoKeyframeFfmpegExpr(prop: VideoAnimatable | undefined, time
92
92
  */
93
93
 
94
94
  type VideoAssetKind = 'video' | 'audio' | 'image';
95
+ /** A spoken word in an asset's transcript, timed in the source (ms). */
96
+ interface VideoTranscriptWord {
97
+ word: string;
98
+ start: number;
99
+ end: number;
100
+ }
95
101
  /** A piece of source media. The project refers to it by id; `src` is whatever the host can load. */
96
102
  interface VideoAsset {
97
103
  id: string;
@@ -108,6 +114,8 @@ interface VideoAsset {
108
114
  hasAudio?: boolean;
109
115
  /** A still to show for a video where its frames cannot be drawn (SVG renders, thumbnails). */
110
116
  poster?: string;
117
+ /** What is said in it, word by word, timed in the source (see `parseVideoTranscript`). */
118
+ transcript?: VideoTranscriptWord[];
111
119
  }
112
120
  type VideoTrackKind = 'video' | 'audio';
113
121
  interface VideoTrack {
@@ -339,6 +347,7 @@ declare function parseVideoTransform(v: unknown, path: string): VideoTransform |
339
347
  declare function parseVideoClipAnimation(v: unknown, path: string): VideoClipAnimation | undefined;
340
348
  declare function parseVideoGrade(v: unknown, path: string): VideoGrade | undefined;
341
349
  declare function parseVideoTransition(v: unknown, path: string): VideoTransition | undefined;
350
+ declare function parseVideoTranscriptWords(v: unknown, path: string): VideoTranscriptWord[] | undefined;
342
351
  declare function parseVideoAsset(v: unknown, path?: string): VideoAsset;
343
352
  declare function parseVideoClip(v: unknown, path?: string): VideoClip;
344
353
  declare function parseVideoTrack(v: unknown, path?: string): VideoTrack;
@@ -1028,6 +1037,92 @@ declare function videoClipAnimationSpans(clip: VideoClip): {
1028
1037
  */
1029
1038
  declare function videoClipAnimated(clip: VideoClip, project: Pick<VideoProject, 'width' | 'height'>): VideoClip;
1030
1039
 
1040
+ /**
1041
+ * A transcript from text a speech-to-text service or captioning tool wrote: Whisper-style JSON
1042
+ * (`{ segments: [{ words: [{ word, start, end }] }] }` or `{ words: [...] }`, times in seconds, or a
1043
+ * plain `[{ word, start, end }]` array in ms), SubRip (`.srt`) or WebVTT. Captions have no word
1044
+ * timings, so their words are spread evenly across each cue (`approximate: true`). Throws when it
1045
+ * finds no words.
1046
+ */
1047
+ declare function parseVideoTranscript(input: string | unknown): {
1048
+ words: VideoTranscriptWord[];
1049
+ approximate: boolean;
1050
+ };
1051
+ /** A word where it plays on the timeline. */
1052
+ interface VideoTimelineWord {
1053
+ word: string;
1054
+ /** Timeline times (ms). */
1055
+ start: number;
1056
+ end: number;
1057
+ /** The clip that plays it. */
1058
+ clip: string;
1059
+ track: string;
1060
+ /** Its index in the asset's transcript. */
1061
+ index: number;
1062
+ }
1063
+ /**
1064
+ * The track whose words make the timeline transcript: `track` if given, else the first audio track
1065
+ * with a transcribed clip, else the first video track with one. `null` when nothing is transcribed.
1066
+ */
1067
+ declare function videoTranscriptTrack(project: VideoProject, track?: string): string | null;
1068
+ /**
1069
+ * The words the timeline plays on one track, in order: each transcribed media clip's words whose
1070
+ * middle falls inside the stretch of source it plays, moved to timeline time through its in point
1071
+ * and speed and clamped to the clip.
1072
+ */
1073
+ declare function videoTimelineTranscript(project: VideoProject, options?: {
1074
+ track?: string;
1075
+ }): VideoTimelineWord[];
1076
+ /** A stretch of the timeline (ms) and the words in it. */
1077
+ interface VideoTranscriptRange {
1078
+ from: number;
1079
+ to: number;
1080
+ text: string;
1081
+ }
1082
+ /** A word as compared: lower case, without surrounding punctuation. */
1083
+ declare const normalizeVideoWord: (word: string) => string;
1084
+ /** Every place a phrase is said (case and punctuation ignored), as timeline ranges. */
1085
+ declare function findVideoTranscriptText(words: readonly VideoTimelineWord[], query: string): VideoTranscriptRange[];
1086
+ /** Filler words and phrases removed by default. "like" and "so" are left out: too often meant. */
1087
+ declare const VIDEO_DEFAULT_FILLERS: readonly ["um", "umm", "uh", "uhh", "uhm", "erm", "er", "ah", "hmm", "mm", "you know", "i mean"];
1088
+ /** Fillers in the transcript, longest phrase first ("you know" before "you"), as timeline ranges. */
1089
+ declare function findVideoFillers(words: readonly VideoTimelineWord[], fillers?: readonly string[]): VideoTranscriptRange[];
1090
+ interface VideoPauseOptions {
1091
+ /** Shortest gap between words that counts as a pause (ms, default 700). */
1092
+ min?: number;
1093
+ /** Silence to keep next to each word so speech does not sound clipped (ms, default 150). */
1094
+ keep?: number;
1095
+ /** Frame rate to snap the cut inward to (default: none). */
1096
+ fps?: number;
1097
+ }
1098
+ /** Gaps between consecutive words on the same clip longer than `min`, less `keep` either side, as timeline ranges. */
1099
+ declare function findVideoTranscriptPauses(words: readonly VideoTimelineWord[], options?: VideoPauseOptions): VideoTranscriptRange[];
1100
+ /** Ranges sorted and merged where they touch or overlap. */
1101
+ declare function mergeVideoRanges(ranges: readonly {
1102
+ from: number;
1103
+ to: number;
1104
+ }[]): {
1105
+ from: number;
1106
+ to: number;
1107
+ }[];
1108
+ /**
1109
+ * The edits that cut ranges out of the timeline and close them up: one `extract_range` per merged
1110
+ * range, last first, so earlier ranges keep their times. Apply them together as one undo step.
1111
+ */
1112
+ declare function videoRemoveRangesEdits(ranges: readonly {
1113
+ from: number;
1114
+ to: number;
1115
+ }[], tracks?: string[]): VideoEdit[];
1116
+ /** The timeline stretch from word `a` to word `b` (either order), for deleting a selection of words. */
1117
+ declare function videoWordsRange(words: readonly VideoTimelineWord[], a: number, b: number): {
1118
+ from: number;
1119
+ to: number;
1120
+ };
1121
+ /** The edit that attaches a transcript file's text to an asset (see `parseVideoTranscript`). Throws a readable error for text it cannot read. */
1122
+ declare function videoTranscriptEdit(assetId: string, text: string): VideoEdit;
1123
+ /** The word playing at a timeline time, as its index in `words`, or -1. */
1124
+ declare function videoWordAt(words: readonly VideoTimelineWord[], time: number): number;
1125
+
1031
1126
  /** Radius of an iris `progress` (0–1) open: from nothing to the frame's corners. */
1032
1127
  declare const videoIrisRadius: (frame: {
1033
1128
  width: number;
@@ -1426,7 +1521,28 @@ interface VideoEditorToolProviderOptions {
1426
1521
  }
1427
1522
  /** A project as agents see it: settings, assets, and each track's clips in order with their times. */
1428
1523
  declare function describeVideoProject(project: VideoProject): {
1429
- assets: VideoAsset[];
1524
+ assets: ({
1525
+ id: string;
1526
+ kind: VideoAssetKind;
1527
+ src: string;
1528
+ name?: string;
1529
+ duration?: number;
1530
+ width?: number;
1531
+ height?: number;
1532
+ hasAudio?: boolean;
1533
+ poster?: string;
1534
+ } | {
1535
+ transcriptWords: number;
1536
+ id: string;
1537
+ kind: VideoAssetKind;
1538
+ src: string;
1539
+ name?: string;
1540
+ duration?: number;
1541
+ width?: number;
1542
+ height?: number;
1543
+ hasAudio?: boolean;
1544
+ poster?: string;
1545
+ })[];
1430
1546
  tracks: {
1431
1547
  clips: ({
1432
1548
  source?: {
@@ -1655,4 +1771,4 @@ declare function videoKeyframeValueEdit(project: VideoProject, clipId: string, p
1655
1771
  */
1656
1772
  declare function videoKeyframeToggleEdit(project: VideoProject, clipId: string, property: VideoKeyframeProperty, time: number): VideoEdit | null;
1657
1773
 
1658
- export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoSilenceOptions, type VideoSnapOptions, type VideoSvgOptions, type VideoTextClip, type VideoTrack, type VideoTrackKind, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoGaps, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, nextFreeVideoSlot, normalizeVideoGrade, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTrack, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSpeed, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRulerTicks, videoSnapPoints, videoTextStyle, videoTimecodeFrames, videoTitleFrame, videoTrackSyncLocked, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoWaveformPath, videoWipeRect };
1774
+ export { type CreateVideoProjectOptions, type NewVideoClip, VIDEO_BLEND_MODES, VIDEO_BLEND_MODE_LABELS, VIDEO_CLIP_ANIMATION_DURATION, VIDEO_CLIP_ANIMATION_EFFECTS, VIDEO_CLIP_ANIMATION_LABELS, VIDEO_CLIP_TYPES, VIDEO_DEFAULT_FILLERS, VIDEO_DEFAULT_STILL_DURATION, VIDEO_DEFAULT_TITLE_DURATION, VIDEO_EASE_NAMES, VIDEO_EDIT_OPS, VIDEO_FADE_CURVES, VIDEO_FADE_CURVE_LABELS, VIDEO_FITS, VIDEO_GRADE_CONTROLS, VIDEO_GRADE_PRESETS, VIDEO_GRADE_PRESET_NAMES, VIDEO_ISSUE_CODES, VIDEO_KEYFRAME_LIMITS, VIDEO_KEYFRAME_PROPERTIES, VIDEO_PEAK_BLOCK, VIDEO_PLACEMENT_MODES, VIDEO_TIME_EPSILON, VIDEO_TRANSFORM_PROPERTIES, VIDEO_TRANSITION_LABELS, VIDEO_TRANSITION_TYPES, VIDEO_WIPE_DIRECTIONS, type VideoAnimatable, type VideoAsset, type VideoAssetKind, type VideoAudioLevel, type VideoAudioPeaks, VideoAudioPeaksCache, type VideoAudioPeaksLoader, type VideoAudioSource, type VideoBlendMode, type VideoCanvasContext, type VideoClip, type VideoClipAnimation, type VideoClipAnimationEffect, type VideoClipDragInput, type VideoClipDragMode, type VideoClipDragPlan, type VideoClipLocation, type VideoClipType, type VideoColorClip, type VideoEase, type VideoEdit, type VideoEditOp, type VideoEditOutcome, type VideoEditResult, VideoEditorController, type VideoEditorOptions, type VideoEditorState, type VideoEditorToolProviderOptions, type VideoEdlOptions, type VideoFadeCurve, type VideoFfmpegExport, type VideoFfmpegOptions, type VideoFit, type VideoFrame, type VideoGap, type VideoGrade, type VideoGradeControl, type VideoGradePreset, type VideoGradeStep, type VideoIssue, type VideoIssueCode, type VideoIssueSeverity, type VideoKey, type VideoKeyframeProperty, type VideoKeyframeRow, type VideoKeyframes, type VideoLayer, type VideoLoudnessMeasurement, type VideoLoudnessTarget, type VideoMarker, type VideoMediaClip, type VideoMediaProbe, type VideoPauseOptions, type VideoPlacementMode, VideoPreviewEngine, type VideoPreviewImage, type VideoPreviewMedia, type VideoPreviewOptions, type VideoPreviewSource, type VideoProject, type VideoRect, type VideoRulerTick, type VideoSilenceOptions, type VideoSnapOptions, type VideoSvgOptions, type VideoTextClip, type VideoTimelineWord, type VideoTrack, type VideoTrackKind, type VideoTranscriptRange, type VideoTranscriptWord, type VideoTransform, type VideoTransition, type VideoTransitionType, type VideoWaveformMode, type VideoWipeDirection, allVideoClipIds, applyVideoEdits, applyVideoGrade, buildVideoAudioPeaks, checkVideoProject, createVideoEditorToolProvider, createVideoProject, decodeVideoAudioPeaks, describeVideoProject, drawVideoFrame, ffmpegFilterValue, findVideoAudioSilences, findVideoClip, findVideoFillers, findVideoGaps, findVideoTranscriptPauses, findVideoTranscriptText, formatVideoSeconds, formatVideoTimecode, formatVideoTimecodeFrames, isVideoDropFrameRate, isVideoKeyframes, mergeVideoRanges, nextFreeVideoSlot, normalizeVideoGrade, normalizeVideoWord, parseVideoAnimatable, parseVideoAsset, parseVideoClip, parseVideoClipAnimation, parseVideoGrade, parseVideoKeyframes, parseVideoLoudnessMeasurement, parseVideoMarker, parseVideoProject, parseVideoTrack, parseVideoTranscript, parseVideoTranscriptWords, parseVideoTransform, parseVideoTransition, placeVideoRect, planVideoClipDrag, probeVideoMedia, removeVideoKey, retimeVideoAnimatable, setVideoKey, snapToVideoFrame, snapVideoTime, sortVideoKeys, sortedVideoClips, splitVideoAnimatable, toVideoEdl, toVideoFfmpeg, toVideoLoudnessMeasure, videoAssetDropEdit, videoAssetHasSound, videoAssetKindOf, videoAssetMap, videoAudioLevels, videoAudioPeakRange, videoAudioPeakSpans, videoAudioPeaksDuration, videoClipAfter, videoClipAnimated, videoClipAnimationProperties, videoClipAnimationSpans, videoClipBefore, videoClipEnd, videoClipHandles, videoClipKeyframes, videoClipLabel, videoClipOverhang, videoClipShowsWaveform, videoClipSoundGain, videoClipSourceRange, videoClipSpeed, videoClipTint, videoClipWaveform, videoClipWaveformPath, videoClipsAt, videoContactSheetSvg, videoDragLabel, videoDropTracks, videoEaseBezier, videoEaseProgress, videoFadeCurveGain, videoFrameAt, videoFrameDuration, videoFrameToSvg, videoFrames, videoGradeCssFilter, videoGradeFfmpegFilters, videoGradeGainsFilterId, videoGradePreset, videoGradeStepMatrix, videoGradeStepSvgValues, videoGradeSteps, videoGradeSvgDefs, videoGradeSvgFilter, videoHourFrames, videoIrisRadius, videoIssueKey, videoKeyframeBreakpoints, videoKeyframeFfmpegExpr, videoKeyframeRows, videoKeyframeToggleEdit, videoKeyframeValueEdit, videoKeysOf, videoOverlap, videoPeakDb, videoProjectDuration, videoProjectSvg, videoRemoveRangesEdits, videoRulerTicks, videoSnapPoints, videoTextStyle, videoTimecodeFrames, videoTimelineTranscript, videoTitleFrame, videoTrackSyncLocked, videoTranscriptEdit, videoTranscriptTrack, videoTransformAt, videoTransitionAudioCurve, videoTransitionEase, videoTransitionHasDirection, videoValueAt, videoWaveformPath, videoWipeRect, videoWordAt, videoWordsRange };