@nodetool-ai/timeline 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/animation/bakedAnimation.d.ts +84 -0
- package/dist/animation/bakedAnimation.d.ts.map +1 -0
- package/dist/animation/bakedAnimation.js +95 -0
- package/dist/animation/bakedAnimation.js.map +1 -0
- package/dist/animation/beat.d.ts +7 -0
- package/dist/animation/beat.d.ts.map +1 -0
- package/dist/animation/beat.js +36 -0
- package/dist/animation/beat.js.map +1 -0
- package/dist/animation/compile.d.ts +184 -0
- package/dist/animation/compile.d.ts.map +1 -0
- package/dist/animation/compile.js +312 -0
- package/dist/animation/compile.js.map +1 -0
- package/dist/animation/custom.d.ts +183 -0
- package/dist/animation/custom.d.ts.map +1 -0
- package/dist/animation/custom.js +583 -0
- package/dist/animation/custom.js.map +1 -0
- package/dist/animation/easing.d.ts +34 -0
- package/dist/animation/easing.d.ts.map +1 -0
- package/dist/animation/easing.js +332 -0
- package/dist/animation/easing.js.map +1 -0
- package/dist/animation/index.d.ts +20 -0
- package/dist/animation/index.d.ts.map +1 -0
- package/dist/animation/index.js +20 -0
- package/dist/animation/index.js.map +1 -0
- package/dist/animation/links.d.ts +33 -0
- package/dist/animation/links.d.ts.map +1 -0
- package/dist/animation/links.js +126 -0
- package/dist/animation/links.js.map +1 -0
- package/dist/animation/presets.d.ts +86 -0
- package/dist/animation/presets.d.ts.map +1 -0
- package/dist/animation/presets.js +642 -0
- package/dist/animation/presets.js.map +1 -0
- package/dist/animation/sample.d.ts +145 -0
- package/dist/animation/sample.d.ts.map +1 -0
- package/dist/animation/sample.js +390 -0
- package/dist/animation/sample.js.map +1 -0
- package/dist/animation/simplify.d.ts +70 -0
- package/dist/animation/simplify.d.ts.map +1 -0
- package/dist/animation/simplify.js +278 -0
- package/dist/animation/simplify.js.map +1 -0
- package/dist/animation/sourceCurves.d.ts +45 -0
- package/dist/animation/sourceCurves.d.ts.map +1 -0
- package/dist/animation/sourceCurves.js +168 -0
- package/dist/animation/sourceCurves.js.map +1 -0
- package/dist/animation/styleTracks.d.ts +23 -0
- package/dist/animation/styleTracks.d.ts.map +1 -0
- package/dist/animation/styleTracks.js +341 -0
- package/dist/animation/styleTracks.js.map +1 -0
- package/dist/animation/types.d.ts +269 -0
- package/dist/animation/types.d.ts.map +1 -0
- package/dist/animation/types.js +173 -0
- package/dist/animation/types.js.map +1 -0
- package/dist/animation/typewriter.d.ts +8 -0
- package/dist/animation/typewriter.d.ts.map +1 -0
- package/dist/animation/typewriter.js +32 -0
- package/dist/animation/typewriter.js.map +1 -0
- package/dist/audioFade.d.ts +73 -0
- package/dist/audioFade.d.ts.map +1 -0
- package/dist/audioFade.js +134 -0
- package/dist/audioFade.js.map +1 -0
- package/dist/authoredStyles.d.ts +61 -0
- package/dist/authoredStyles.d.ts.map +1 -0
- package/dist/authoredStyles.js +90 -0
- package/dist/authoredStyles.js.map +1 -0
- package/dist/authoring.d.ts +50 -0
- package/dist/authoring.d.ts.map +1 -0
- package/dist/authoring.js +207 -0
- package/dist/authoring.js.map +1 -0
- package/dist/beats.d.ts +103 -0
- package/dist/beats.d.ts.map +1 -0
- package/dist/beats.js +228 -0
- package/dist/beats.js.map +1 -0
- package/dist/clone.d.ts +32 -0
- package/dist/clone.d.ts.map +1 -0
- package/dist/clone.js +53 -0
- package/dist/clone.js.map +1 -0
- package/dist/composition.d.ts +87 -0
- package/dist/composition.d.ts.map +1 -0
- package/dist/composition.js +253 -0
- package/dist/composition.js.map +1 -0
- package/dist/crop.d.ts +48 -0
- package/dist/crop.d.ts.map +1 -0
- package/dist/crop.js +75 -0
- package/dist/crop.js.map +1 -0
- package/dist/defaults.d.ts +142 -0
- package/dist/defaults.d.ts.map +1 -0
- package/dist/defaults.js +335 -0
- package/dist/defaults.js.map +1 -0
- package/dist/dependencyHash.d.ts +14 -0
- package/dist/dependencyHash.d.ts.map +1 -0
- package/dist/dependencyHash.js +19 -0
- package/dist/dependencyHash.js.map +1 -0
- package/dist/dropResolve.d.ts +40 -0
- package/dist/dropResolve.d.ts.map +1 -0
- package/dist/dropResolve.js +137 -0
- package/dist/dropResolve.js.map +1 -0
- package/dist/examples/node.d.ts +11 -0
- package/dist/examples/node.d.ts.map +1 -0
- package/dist/examples/node.js +87 -0
- package/dist/examples/node.js.map +1 -0
- package/dist/extension.d.ts +52 -0
- package/dist/extension.d.ts.map +1 -0
- package/dist/extension.js +269 -0
- package/dist/extension.js.map +1 -0
- package/dist/extensionRequest.d.ts +40 -0
- package/dist/extensionRequest.d.ts.map +1 -0
- package/dist/extensionRequest.js +135 -0
- package/dist/extensionRequest.js.map +1 -0
- package/dist/fill-text.d.ts +30 -0
- package/dist/fill-text.d.ts.map +1 -0
- package/dist/fill-text.js +73 -0
- package/dist/fill-text.js.map +1 -0
- package/dist/fonts/catalog.d.ts +97 -0
- package/dist/fonts/catalog.d.ts.map +1 -0
- package/dist/fonts/catalog.js +276 -0
- package/dist/fonts/catalog.js.map +1 -0
- package/dist/fonts/css.d.ts +24 -0
- package/dist/fonts/css.d.ts.map +1 -0
- package/dist/fonts/css.js +50 -0
- package/dist/fonts/css.js.map +1 -0
- package/dist/fonts/index.d.ts +10 -0
- package/dist/fonts/index.d.ts.map +1 -0
- package/dist/fonts/index.js +10 -0
- package/dist/fonts/index.js.map +1 -0
- package/dist/fonts/register-node.d.ts +45 -0
- package/dist/fonts/register-node.d.ts.map +1 -0
- package/dist/fonts/register-node.js +71 -0
- package/dist/fonts/register-node.js.map +1 -0
- package/dist/generatedMatte.d.ts +86 -0
- package/dist/generatedMatte.d.ts.map +1 -0
- package/dist/generatedMatte.js +152 -0
- package/dist/generatedMatte.js.map +1 -0
- package/dist/generative.d.ts +145 -0
- package/dist/generative.d.ts.map +1 -0
- package/dist/generative.js +396 -0
- package/dist/generative.js.map +1 -0
- package/dist/group.d.ts +47 -0
- package/dist/group.d.ts.map +1 -0
- package/dist/group.js +131 -0
- package/dist/group.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/interchange.d.ts +47 -0
- package/dist/interchange.d.ts.map +1 -0
- package/dist/interchange.js +158 -0
- package/dist/interchange.js.map +1 -0
- package/dist/keyframes.d.ts +44 -0
- package/dist/keyframes.d.ts.map +1 -0
- package/dist/keyframes.js +148 -0
- package/dist/keyframes.js.map +1 -0
- package/dist/lineDelivery.d.ts +108 -0
- package/dist/lineDelivery.d.ts.map +1 -0
- package/dist/lineDelivery.js +154 -0
- package/dist/lineDelivery.js.map +1 -0
- package/dist/linked.d.ts +41 -0
- package/dist/linked.d.ts.map +1 -0
- package/dist/linked.js +166 -0
- package/dist/linked.js.map +1 -0
- package/dist/lipSyncRequest.d.ts +65 -0
- package/dist/lipSyncRequest.d.ts.map +1 -0
- package/dist/lipSyncRequest.js +73 -0
- package/dist/lipSyncRequest.js.map +1 -0
- package/dist/measureClipDurations.d.ts +7 -0
- package/dist/measureClipDurations.d.ts.map +1 -0
- package/dist/measureClipDurations.js +17 -0
- package/dist/measureClipDurations.js.map +1 -0
- package/dist/mediaTrack.d.ts +120 -0
- package/dist/mediaTrack.d.ts.map +1 -0
- package/dist/mediaTrack.js +269 -0
- package/dist/mediaTrack.js.map +1 -0
- package/dist/midi/cacheKey.d.ts +25 -0
- package/dist/midi/cacheKey.d.ts.map +1 -0
- package/dist/midi/cacheKey.js +54 -0
- package/dist/midi/cacheKey.js.map +1 -0
- package/dist/midi/edit.d.ts +48 -0
- package/dist/midi/edit.d.ts.map +1 -0
- package/dist/midi/edit.js +93 -0
- package/dist/midi/edit.js.map +1 -0
- package/dist/midi/engines/bl1.d.ts +29 -0
- package/dist/midi/engines/bl1.d.ts.map +1 -0
- package/dist/midi/engines/bl1.js +128 -0
- package/dist/midi/engines/bl1.js.map +1 -0
- package/dist/midi/engines/dr1.d.ts +28 -0
- package/dist/midi/engines/dr1.d.ts.map +1 -0
- package/dist/midi/engines/dr1.js +101 -0
- package/dist/midi/engines/dr1.js.map +1 -0
- package/dist/midi/engines/dsp.d.ts +126 -0
- package/dist/midi/engines/dsp.d.ts.map +1 -0
- package/dist/midi/engines/dsp.js +371 -0
- package/dist/midi/engines/dsp.js.map +1 -0
- package/dist/midi/engines/index.d.ts +13 -0
- package/dist/midi/engines/index.d.ts.map +1 -0
- package/dist/midi/engines/index.js +13 -0
- package/dist/midi/engines/index.js.map +1 -0
- package/dist/midi/engines/kits.d.ts +12 -0
- package/dist/midi/engines/kits.d.ts.map +1 -0
- package/dist/midi/engines/kits.js +121 -0
- package/dist/midi/engines/kits.js.map +1 -0
- package/dist/midi/engines/wavetables.d.ts +45 -0
- package/dist/midi/engines/wavetables.d.ts.map +1 -0
- package/dist/midi/engines/wavetables.js +334 -0
- package/dist/midi/engines/wavetables.js.map +1 -0
- package/dist/midi/engines/wt1.d.ts +30 -0
- package/dist/midi/engines/wt1.d.ts.map +1 -0
- package/dist/midi/engines/wt1.js +91 -0
- package/dist/midi/engines/wt1.js.map +1 -0
- package/dist/midi/grid.d.ts +51 -0
- package/dist/midi/grid.d.ts.map +1 -0
- package/dist/midi/grid.js +104 -0
- package/dist/midi/grid.js.map +1 -0
- package/dist/midi/index.d.ts +20 -0
- package/dist/midi/index.d.ts.map +1 -0
- package/dist/midi/index.js +20 -0
- package/dist/midi/index.js.map +1 -0
- package/dist/midi/instrument.d.ts +32 -0
- package/dist/midi/instrument.d.ts.map +1 -0
- package/dist/midi/instrument.js +73 -0
- package/dist/midi/instrument.js.map +1 -0
- package/dist/midi/notes.d.ts +46 -0
- package/dist/midi/notes.d.ts.map +1 -0
- package/dist/midi/notes.js +121 -0
- package/dist/midi/notes.js.map +1 -0
- package/dist/midi/notesEdit.d.ts +94 -0
- package/dist/midi/notesEdit.d.ts.map +1 -0
- package/dist/midi/notesEdit.js +159 -0
- package/dist/midi/notesEdit.js.map +1 -0
- package/dist/midi/presets.d.ts +29 -0
- package/dist/midi/presets.d.ts.map +1 -0
- package/dist/midi/presets.js +281 -0
- package/dist/midi/presets.js.map +1 -0
- package/dist/midi/tempo.d.ts +27 -0
- package/dist/midi/tempo.d.ts.map +1 -0
- package/dist/midi/tempo.js +57 -0
- package/dist/midi/tempo.js.map +1 -0
- package/dist/midi/ticks.d.ts +25 -0
- package/dist/midi/ticks.d.ts.map +1 -0
- package/dist/midi/ticks.js +35 -0
- package/dist/midi/ticks.js.map +1 -0
- package/dist/midi/voice.d.ts +148 -0
- package/dist/midi/voice.d.ts.map +1 -0
- package/dist/midi/voice.js +348 -0
- package/dist/midi/voice.js.map +1 -0
- package/dist/midi/wav.d.ts +14 -0
- package/dist/midi/wav.d.ts.map +1 -0
- package/dist/midi/wav.js +51 -0
- package/dist/midi/wav.js.map +1 -0
- package/dist/model3d.d.ts +41 -0
- package/dist/model3d.d.ts.map +1 -0
- package/dist/model3d.js +39 -0
- package/dist/model3d.js.map +1 -0
- package/dist/model3dBake.d.ts +80 -0
- package/dist/model3dBake.d.ts.map +1 -0
- package/dist/model3dBake.js +127 -0
- package/dist/model3dBake.js.map +1 -0
- package/dist/ops/apply.d.ts +32 -0
- package/dist/ops/apply.d.ts.map +1 -0
- package/dist/ops/apply.js +1595 -0
- package/dist/ops/apply.js.map +1 -0
- package/dist/ops/index.d.ts +13 -0
- package/dist/ops/index.d.ts.map +1 -0
- package/dist/ops/index.js +13 -0
- package/dist/ops/index.js.map +1 -0
- package/dist/ops/op.d.ts +407 -0
- package/dist/ops/op.d.ts.map +1 -0
- package/dist/ops/op.js +61 -0
- package/dist/ops/op.js.map +1 -0
- package/dist/ops/serialize.d.ts +77 -0
- package/dist/ops/serialize.d.ts.map +1 -0
- package/dist/ops/serialize.js +81 -0
- package/dist/ops/serialize.js.map +1 -0
- package/dist/ops/types.d.ts +150 -0
- package/dist/ops/types.d.ts.map +1 -0
- package/dist/ops/types.js +12 -0
- package/dist/ops/types.js.map +1 -0
- package/dist/pathSampling.d.ts +51 -0
- package/dist/pathSampling.d.ts.map +1 -0
- package/dist/pathSampling.js +111 -0
- package/dist/pathSampling.js.map +1 -0
- package/dist/placement/index.d.ts +2 -0
- package/dist/placement/index.d.ts.map +1 -0
- package/dist/placement/index.js +2 -0
- package/dist/placement/index.js.map +1 -0
- package/dist/placement/resolveTrackPlacement.d.ts +40 -0
- package/dist/placement/resolveTrackPlacement.d.ts.map +1 -0
- package/dist/placement/resolveTrackPlacement.js +71 -0
- package/dist/placement/resolveTrackPlacement.js.map +1 -0
- package/dist/production.d.ts +99 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +328 -0
- package/dist/production.js.map +1 -0
- package/dist/reassemble.d.ts +68 -0
- package/dist/reassemble.d.ts.map +1 -0
- package/dist/reassemble.js +187 -0
- package/dist/reassemble.js.map +1 -0
- package/dist/recipe.d.ts +24 -0
- package/dist/recipe.d.ts.map +1 -0
- package/dist/recipe.js +89 -0
- package/dist/recipe.js.map +1 -0
- package/dist/recordedVoiceReplacement.d.ts +70 -0
- package/dist/recordedVoiceReplacement.d.ts.map +1 -0
- package/dist/recordedVoiceReplacement.js +82 -0
- package/dist/recordedVoiceReplacement.js.map +1 -0
- package/dist/reframe.d.ts +31 -0
- package/dist/reframe.d.ts.map +1 -0
- package/dist/reframe.js +227 -0
- package/dist/reframe.js.map +1 -0
- package/dist/render/canvas2d.d.ts +419 -0
- package/dist/render/canvas2d.d.ts.map +1 -0
- package/dist/render/canvas2d.js +1392 -0
- package/dist/render/canvas2d.js.map +1 -0
- package/dist/render/color.d.ts +26 -0
- package/dist/render/color.d.ts.map +1 -0
- package/dist/render/color.js +305 -0
- package/dist/render/color.js.map +1 -0
- package/dist/render/cpuLegacyEffects.d.ts +17 -0
- package/dist/render/cpuLegacyEffects.d.ts.map +1 -0
- package/dist/render/cpuLegacyEffects.js +347 -0
- package/dist/render/cpuLegacyEffects.js.map +1 -0
- package/dist/render/cpuVisualEffects.d.ts +13 -0
- package/dist/render/cpuVisualEffects.d.ts.map +1 -0
- package/dist/render/cpuVisualEffects.js +388 -0
- package/dist/render/cpuVisualEffects.js.map +1 -0
- package/dist/render/cubeLut.d.ts +12 -0
- package/dist/render/cubeLut.d.ts.map +1 -0
- package/dist/render/cubeLut.js +81 -0
- package/dist/render/cubeLut.js.map +1 -0
- package/dist/render/curveFitting.d.ts +28 -0
- package/dist/render/curveFitting.d.ts.map +1 -0
- package/dist/render/curveFitting.js +94 -0
- package/dist/render/curveFitting.js.map +1 -0
- package/dist/render/draw.d.ts +265 -0
- package/dist/render/draw.d.ts.map +1 -0
- package/dist/render/draw.js +929 -0
- package/dist/render/draw.js.map +1 -0
- package/dist/render/effects.d.ts +120 -0
- package/dist/render/effects.d.ts.map +1 -0
- package/dist/render/effects.js +804 -0
- package/dist/render/effects.js.map +1 -0
- package/dist/render/frameCompositor.d.ts +502 -0
- package/dist/render/frameCompositor.d.ts.map +1 -0
- package/dist/render/frameCompositor.js +1331 -0
- package/dist/render/frameCompositor.js.map +1 -0
- package/dist/render/index.d.ts +27 -0
- package/dist/render/index.d.ts.map +1 -0
- package/dist/render/index.js +27 -0
- package/dist/render/index.js.map +1 -0
- package/dist/render/layout.d.ts +17 -0
- package/dist/render/layout.d.ts.map +1 -0
- package/dist/render/layout.js +197 -0
- package/dist/render/layout.js.map +1 -0
- package/dist/render/model3dBakeSamples.d.ts +45 -0
- package/dist/render/model3dBakeSamples.d.ts.map +1 -0
- package/dist/render/model3dBakeSamples.js +68 -0
- package/dist/render/model3dBakeSamples.js.map +1 -0
- package/dist/render/motionBlur.d.ts +170 -0
- package/dist/render/motionBlur.d.ts.map +1 -0
- package/dist/render/motionBlur.js +193 -0
- package/dist/render/motionBlur.js.map +1 -0
- package/dist/render/sceneModel.d.ts +577 -0
- package/dist/render/sceneModel.d.ts.map +1 -0
- package/dist/render/sceneModel.js +1460 -0
- package/dist/render/sceneModel.js.map +1 -0
- package/dist/render/shapeGeometry.d.ts +81 -0
- package/dist/render/shapeGeometry.d.ts.map +1 -0
- package/dist/render/shapeGeometry.js +460 -0
- package/dist/render/shapeGeometry.js.map +1 -0
- package/dist/render/spatial.d.ts +9 -0
- package/dist/render/spatial.d.ts.map +1 -0
- package/dist/render/spatial.js +58 -0
- package/dist/render/spatial.js.map +1 -0
- package/dist/render/svgPath.d.ts +80 -0
- package/dist/render/svgPath.d.ts.map +1 -0
- package/dist/render/svgPath.js +199 -0
- package/dist/render/svgPath.js.map +1 -0
- package/dist/render/temporal.d.ts +6 -0
- package/dist/render/temporal.d.ts.map +1 -0
- package/dist/render/temporal.js +74 -0
- package/dist/render/temporal.js.map +1 -0
- package/dist/render/textLayout.d.ts +159 -0
- package/dist/render/textLayout.d.ts.map +1 -0
- package/dist/render/textLayout.js +301 -0
- package/dist/render/textLayout.js.map +1 -0
- package/dist/render/trackEffects.d.ts +23 -0
- package/dist/render/trackEffects.d.ts.map +1 -0
- package/dist/render/trackEffects.js +93 -0
- package/dist/render/trackEffects.js.map +1 -0
- package/dist/render/transform.d.ts +54 -0
- package/dist/render/transform.d.ts.map +1 -0
- package/dist/render/transform.js +222 -0
- package/dist/render/transform.js.map +1 -0
- package/dist/render/transition.d.ts +109 -0
- package/dist/render/transition.d.ts.map +1 -0
- package/dist/render/transition.js +351 -0
- package/dist/render/transition.js.map +1 -0
- package/dist/retarget.d.ts +73 -0
- package/dist/retarget.d.ts.map +1 -0
- package/dist/retarget.js +305 -0
- package/dist/retarget.js.map +1 -0
- package/dist/rippleEdit.d.ts +83 -0
- package/dist/rippleEdit.d.ts.map +1 -0
- package/dist/rippleEdit.js +184 -0
- package/dist/rippleEdit.js.map +1 -0
- package/dist/scene.d.ts +28 -0
- package/dist/scene.d.ts.map +1 -0
- package/dist/scene.js +28 -0
- package/dist/scene.js.map +1 -0
- package/dist/script-link.d.ts +52 -0
- package/dist/script-link.d.ts.map +1 -0
- package/dist/script-link.js +78 -0
- package/dist/script-link.js.map +1 -0
- package/dist/script.d.ts +52 -0
- package/dist/script.d.ts.map +1 -0
- package/dist/script.js +93 -0
- package/dist/script.js.map +1 -0
- package/dist/snap.d.ts +2 -0
- package/dist/snap.d.ts.map +1 -0
- package/dist/snap.js +21 -0
- package/dist/snap.js.map +1 -0
- package/dist/snapping/buildSnapPoints.d.ts +16 -0
- package/dist/snapping/buildSnapPoints.d.ts.map +1 -0
- package/dist/snapping/buildSnapPoints.js +39 -0
- package/dist/snapping/buildSnapPoints.js.map +1 -0
- package/dist/snapping/index.d.ts +3 -0
- package/dist/snapping/index.d.ts.map +1 -0
- package/dist/snapping/index.js +3 -0
- package/dist/snapping/index.js.map +1 -0
- package/dist/snapping/resolveSnap.d.ts +19 -0
- package/dist/snapping/resolveSnap.d.ts.map +1 -0
- package/dist/snapping/resolveSnap.js +39 -0
- package/dist/snapping/resolveSnap.js.map +1 -0
- package/dist/sourceRate.d.ts +12 -0
- package/dist/sourceRate.d.ts.map +1 -0
- package/dist/sourceRate.js +13 -0
- package/dist/sourceRate.js.map +1 -0
- package/dist/spatialVideoRequest.d.ts +91 -0
- package/dist/spatialVideoRequest.d.ts.map +1 -0
- package/dist/spatialVideoRequest.js +175 -0
- package/dist/spatialVideoRequest.js.map +1 -0
- package/dist/splitClip.d.ts +3 -0
- package/dist/splitClip.d.ts.map +1 -0
- package/dist/splitClip.js +190 -0
- package/dist/splitClip.js.map +1 -0
- package/dist/stableSerialize.d.ts +11 -0
- package/dist/stableSerialize.d.ts.map +1 -0
- package/dist/stableSerialize.js +31 -0
- package/dist/stableSerialize.js.map +1 -0
- package/dist/staleSet.d.ts +41 -0
- package/dist/staleSet.d.ts.map +1 -0
- package/dist/staleSet.js +106 -0
- package/dist/staleSet.js.map +1 -0
- package/dist/storyboard.d.ts +221 -0
- package/dist/storyboard.d.ts.map +1 -0
- package/dist/storyboard.js +417 -0
- package/dist/storyboard.js.map +1 -0
- package/dist/subtitles.d.ts +61 -0
- package/dist/subtitles.d.ts.map +1 -0
- package/dist/subtitles.js +92 -0
- package/dist/subtitles.js.map +1 -0
- package/dist/takes.d.ts +76 -0
- package/dist/takes.d.ts.map +1 -0
- package/dist/takes.js +238 -0
- package/dist/takes.js.map +1 -0
- package/dist/timeRemap.d.ts +101 -0
- package/dist/timeRemap.d.ts.map +1 -0
- package/dist/timeRemap.js +183 -0
- package/dist/timeRemap.js.map +1 -0
- package/dist/trackOrder.d.ts +38 -0
- package/dist/trackOrder.d.ts.map +1 -0
- package/dist/trackOrder.js +54 -0
- package/dist/trackOrder.js.map +1 -0
- package/dist/transitionAtCut.d.ts +89 -0
- package/dist/transitionAtCut.d.ts.map +1 -0
- package/dist/transitionAtCut.js +217 -0
- package/dist/transitionAtCut.js.map +1 -0
- package/dist/trimClip.d.ts +13 -0
- package/dist/trimClip.d.ts.map +1 -0
- package/dist/trimClip.js +60 -0
- package/dist/trimClip.js.map +1 -0
- package/dist/types.d.ts +1772 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +84 -0
- package/dist/types.js.map +1 -0
- package/fonts/BebasNeue-Regular.ttf +0 -0
- package/fonts/Inter-ExtraBold.ttf +0 -0
- package/fonts/Inter-Italic-Variable.ttf +0 -0
- package/fonts/Inter-SemiBold.ttf +0 -0
- package/fonts/Inter-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Italic-Variable.ttf +0 -0
- package/fonts/JetBrainsMono-Variable.ttf +0 -0
- package/fonts/Lora-Italic-Variable.ttf +0 -0
- package/fonts/Lora-Variable.ttf +0 -0
- package/fonts/OFL-BebasNeue.txt +93 -0
- package/fonts/OFL-Inter.txt +93 -0
- package/fonts/OFL-JetBrainsMono.txt +93 -0
- package/fonts/OFL-Lora.txt +93 -0
- package/fonts/OFL-PlayfairDisplay.txt +93 -0
- package/fonts/OFL-SpaceGrotesk.txt +93 -0
- package/fonts/PlayfairDisplay-Italic-Variable.ttf +0 -0
- package/fonts/PlayfairDisplay-Variable.ttf +0 -0
- package/fonts/SpaceGrotesk-Variable.ttf +0 -0
- package/package.json +108 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@font-face` rules the browser needs for the bundled corpus.
|
|
3
|
+
*
|
|
4
|
+
* Node hosts register the files with `GlobalFonts.registerFromPath`; a browser
|
|
5
|
+
* has no such call, so the same catalog is rendered as CSS and served from the
|
|
6
|
+
* same files. Generated rather than hand-written for one reason: a face added
|
|
7
|
+
* to the catalog and forgotten in the stylesheet renders as the fallback in
|
|
8
|
+
* the editor and as the real face everywhere else, which is the divergence
|
|
9
|
+
* this whole pipeline exists to remove.
|
|
10
|
+
*
|
|
11
|
+
* Pure string building — no DOM, no fetch — so the generator script, the web
|
|
12
|
+
* bundle and the test that checks the checked-in file all call one function.
|
|
13
|
+
*/
|
|
14
|
+
/** Where the web loads the bundled faces from (`routes/timeline-fonts.ts`). */
|
|
15
|
+
export declare const BUNDLED_FONTS_URL_BASE = "/api/assets/packages/timeline/fonts";
|
|
16
|
+
/**
|
|
17
|
+
* The stylesheet for every bundled face, served under `baseUrl`.
|
|
18
|
+
*
|
|
19
|
+
* `font-display: block` rather than `swap`: a swapped fallback is drawn, and
|
|
20
|
+
* a drawn frame is what a raster caches. Blocking hides the text for the
|
|
21
|
+
* first moments instead of caching the wrong glyphs.
|
|
22
|
+
*/
|
|
23
|
+
export declare function bundledFontFaceCss(baseUrl?: string): string;
|
|
24
|
+
//# sourceMappingURL=css.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.d.ts","sourceRoot":"","sources":["../../src/fonts/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,wCAAwC,CAAC;AAE5E;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,GAAE,MAA+B,GACvC,MAAM,CAyBR"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The `@font-face` rules the browser needs for the bundled corpus.
|
|
3
|
+
*
|
|
4
|
+
* Node hosts register the files with `GlobalFonts.registerFromPath`; a browser
|
|
5
|
+
* has no such call, so the same catalog is rendered as CSS and served from the
|
|
6
|
+
* same files. Generated rather than hand-written for one reason: a face added
|
|
7
|
+
* to the catalog and forgotten in the stylesheet renders as the fallback in
|
|
8
|
+
* the editor and as the real face everywhere else, which is the divergence
|
|
9
|
+
* this whole pipeline exists to remove.
|
|
10
|
+
*
|
|
11
|
+
* Pure string building — no DOM, no fetch — so the generator script, the web
|
|
12
|
+
* bundle and the test that checks the checked-in file all call one function.
|
|
13
|
+
*/
|
|
14
|
+
import { BUNDLED_FONTS } from "./catalog.js";
|
|
15
|
+
/** Where the web loads the bundled faces from (`routes/timeline-fonts.ts`). */
|
|
16
|
+
export const BUNDLED_FONTS_URL_BASE = "/api/assets/packages/timeline/fonts";
|
|
17
|
+
/**
|
|
18
|
+
* The stylesheet for every bundled face, served under `baseUrl`.
|
|
19
|
+
*
|
|
20
|
+
* `font-display: block` rather than `swap`: a swapped fallback is drawn, and
|
|
21
|
+
* a drawn frame is what a raster caches. Blocking hides the text for the
|
|
22
|
+
* first moments instead of caching the wrong glyphs.
|
|
23
|
+
*/
|
|
24
|
+
export function bundledFontFaceCss(baseUrl = BUNDLED_FONTS_URL_BASE) {
|
|
25
|
+
// Trailing slashes are trimmed by walking back from the end rather than with
|
|
26
|
+
// `/\/+$/`: that pattern shares its first character across the quantifier and
|
|
27
|
+
// the anchor, so a base URL of many slashes walks the engine back through
|
|
28
|
+
// what it already read at every start position. CodeQL reads that shape as
|
|
29
|
+
// polynomial backtracking, and there is nothing a regex buys here.
|
|
30
|
+
let end = baseUrl.length;
|
|
31
|
+
while (end > 0 && baseUrl[end - 1] === "/") {
|
|
32
|
+
end--;
|
|
33
|
+
}
|
|
34
|
+
const base = baseUrl.slice(0, end);
|
|
35
|
+
const blocks = BUNDLED_FONTS.map((face) => {
|
|
36
|
+
const [min, max] = face.weights;
|
|
37
|
+
const weight = min === max ? `${min}` : `${min} ${max}`;
|
|
38
|
+
return [
|
|
39
|
+
"@font-face {",
|
|
40
|
+
` font-family: "${face.family}";`,
|
|
41
|
+
` font-style: ${face.style};`,
|
|
42
|
+
` font-weight: ${weight};`,
|
|
43
|
+
" font-display: block;",
|
|
44
|
+
` src: url("${base}/${face.file}") format("truetype");`,
|
|
45
|
+
"}"
|
|
46
|
+
].join("\n");
|
|
47
|
+
});
|
|
48
|
+
return `${blocks.join("\n\n")}\n`;
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=css.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"css.js","sourceRoot":"","sources":["../../src/fonts/css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,sBAAsB,GAAG,qCAAqC,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAO,GAAW,sBAAsB;IAExC,6EAA6E;IAC7E,8EAA8E;IAC9E,0EAA0E;IAC1E,2EAA2E;IAC3E,mEAAmE;IACnE,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IACzB,OAAO,GAAG,GAAG,CAAC,IAAI,OAAO,CAAC,GAAG,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QAC3C,GAAG,EAAE,CAAC;IACR,CAAC;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QAChC,MAAM,MAAM,GAAG,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC;QACxD,OAAO;YACL,cAAc;YACd,mBAAmB,IAAI,CAAC,MAAM,IAAI;YAClC,iBAAiB,IAAI,CAAC,KAAK,GAAG;YAC9B,kBAAkB,MAAM,GAAG;YAC3B,wBAAwB;YACxB,eAAe,IAAI,IAAI,IAAI,CAAC,IAAI,wBAAwB;YACxD,GAAG;SACJ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The font corpus, and everything about it a caller can use without a canvas.
|
|
3
|
+
*
|
|
4
|
+
* `register-node.ts` is deliberately absent: it imports `@napi-rs/canvas`, and
|
|
5
|
+
* the package root has no runtime dependencies (AS2). Node hosts reach it
|
|
6
|
+
* through `@nodetool-ai/timeline/fonts/node`.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./catalog.js";
|
|
9
|
+
export * from "./css.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fonts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The font corpus, and everything about it a caller can use without a canvas.
|
|
3
|
+
*
|
|
4
|
+
* `register-node.ts` is deliberately absent: it imports `@napi-rs/canvas`, and
|
|
5
|
+
* the package root has no runtime dependencies (AS2). Node hosts reach it
|
|
6
|
+
* through `@nodetool-ai/timeline/fonts/node`.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./catalog.js";
|
|
9
|
+
export * from "./css.js";
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fonts/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registering the bundled corpus with `@napi-rs/canvas`, for the two Node
|
|
3
|
+
* hosts that draw text: the server rasterizer
|
|
4
|
+
* (`packages/video-nodes/src/nodes/timeline/rasterizers.ts`) and the agent's
|
|
5
|
+
* frame preview (`packages/agents/src/timeline-preview/rasterize.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Both draw through the same library, so registering the same files makes
|
|
8
|
+
* their glyphs identical rather than merely similar — which is what
|
|
9
|
+
* `packages/agents/tests/timeline-bundled-fonts.test.ts` asserts.
|
|
10
|
+
*
|
|
11
|
+
* Not re-exported from the package root, and not from `./fonts`: the import
|
|
12
|
+
* below is a runtime dependency and the root export has none (AS2). Reach it
|
|
13
|
+
* as `@nodetool-ai/timeline/fonts/node`.
|
|
14
|
+
*/
|
|
15
|
+
/** What one process-wide registration pass did. */
|
|
16
|
+
export interface BundledFontRegistration {
|
|
17
|
+
/** The directory the faces were read from, or null when none was found. */
|
|
18
|
+
dir: string | null;
|
|
19
|
+
/** File names handed to `GlobalFonts.registerFromPath`. */
|
|
20
|
+
registered: string[];
|
|
21
|
+
/** Catalog files the directory did not hold. */
|
|
22
|
+
missing: string[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Where the faces sit, which differs by deployment and is checked rather than
|
|
26
|
+
* assumed:
|
|
27
|
+
*
|
|
28
|
+
* - a checkout or an npm install resolves `packages/timeline/fonts/`, two
|
|
29
|
+
* levels above this module whether it runs from `src/` or `dist/`;
|
|
30
|
+
* - the packaged backend is one flat `server.mjs`, so `import.meta.url` is the
|
|
31
|
+
* bundle root and `bundle-backend.mjs` stages the directory beside it.
|
|
32
|
+
*
|
|
33
|
+
* Null when neither exists, which a caller reports rather than throwing: text
|
|
34
|
+
* still draws, in whatever the host has (F15's old behaviour), and the
|
|
35
|
+
* artifact check is what makes that impossible to ship (C6).
|
|
36
|
+
*/
|
|
37
|
+
export declare function bundledFontsDir(): string | null;
|
|
38
|
+
/**
|
|
39
|
+
* Register every bundled face, once per process. Repeat calls return the first
|
|
40
|
+
* pass's result: a rasterizer is constructed per render and per preview, and
|
|
41
|
+
* re-reading three megabytes of font files per frame would be the cost of
|
|
42
|
+
* calling this from the right place.
|
|
43
|
+
*/
|
|
44
|
+
export declare function registerBundledFonts(): BundledFontRegistration;
|
|
45
|
+
//# sourceMappingURL=register-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-node.d.ts","sourceRoot":"","sources":["../../src/fonts/register-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAQH,mDAAmD;AACnD,MAAM,WAAW,uBAAuB;IACtC,2EAA2E;IAC3E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,gDAAgD;IAChD,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,IAAI,MAAM,GAAG,IAAI,CAM/C;AAID;;;;;GAKG;AACH,wBAAgB,oBAAoB,IAAI,uBAAuB,CAsB9D"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Registering the bundled corpus with `@napi-rs/canvas`, for the two Node
|
|
3
|
+
* hosts that draw text: the server rasterizer
|
|
4
|
+
* (`packages/video-nodes/src/nodes/timeline/rasterizers.ts`) and the agent's
|
|
5
|
+
* frame preview (`packages/agents/src/timeline-preview/rasterize.ts`).
|
|
6
|
+
*
|
|
7
|
+
* Both draw through the same library, so registering the same files makes
|
|
8
|
+
* their glyphs identical rather than merely similar — which is what
|
|
9
|
+
* `packages/agents/tests/timeline-bundled-fonts.test.ts` asserts.
|
|
10
|
+
*
|
|
11
|
+
* Not re-exported from the package root, and not from `./fonts`: the import
|
|
12
|
+
* below is a runtime dependency and the root export has none (AS2). Reach it
|
|
13
|
+
* as `@nodetool-ai/timeline/fonts/node`.
|
|
14
|
+
*/
|
|
15
|
+
import { existsSync } from "node:fs";
|
|
16
|
+
import { fileURLToPath } from "node:url";
|
|
17
|
+
import { GlobalFonts } from "@napi-rs/canvas";
|
|
18
|
+
import { BUNDLED_FONTS } from "./catalog.js";
|
|
19
|
+
/**
|
|
20
|
+
* Where the faces sit, which differs by deployment and is checked rather than
|
|
21
|
+
* assumed:
|
|
22
|
+
*
|
|
23
|
+
* - a checkout or an npm install resolves `packages/timeline/fonts/`, two
|
|
24
|
+
* levels above this module whether it runs from `src/` or `dist/`;
|
|
25
|
+
* - the packaged backend is one flat `server.mjs`, so `import.meta.url` is the
|
|
26
|
+
* bundle root and `bundle-backend.mjs` stages the directory beside it.
|
|
27
|
+
*
|
|
28
|
+
* Null when neither exists, which a caller reports rather than throwing: text
|
|
29
|
+
* still draws, in whatever the host has (F15's old behaviour), and the
|
|
30
|
+
* artifact check is what makes that impossible to ship (C6).
|
|
31
|
+
*/
|
|
32
|
+
export function bundledFontsDir() {
|
|
33
|
+
for (const relative of ["../../fonts/", "fonts/"]) {
|
|
34
|
+
const candidate = fileURLToPath(new URL(relative, import.meta.url));
|
|
35
|
+
if (existsSync(candidate))
|
|
36
|
+
return candidate;
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
let done = null;
|
|
41
|
+
/**
|
|
42
|
+
* Register every bundled face, once per process. Repeat calls return the first
|
|
43
|
+
* pass's result: a rasterizer is constructed per render and per preview, and
|
|
44
|
+
* re-reading three megabytes of font files per frame would be the cost of
|
|
45
|
+
* calling this from the right place.
|
|
46
|
+
*/
|
|
47
|
+
export function registerBundledFonts() {
|
|
48
|
+
if (done !== null)
|
|
49
|
+
return done;
|
|
50
|
+
const dir = bundledFontsDir();
|
|
51
|
+
const registered = [];
|
|
52
|
+
const missing = [];
|
|
53
|
+
for (const face of BUNDLED_FONTS) {
|
|
54
|
+
if (dir === null) {
|
|
55
|
+
missing.push(face.file);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
const path = `${dir}${face.file}`;
|
|
59
|
+
if (!existsSync(path)) {
|
|
60
|
+
missing.push(face.file);
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
// The family name comes from the file's own `name` table, so a face is
|
|
64
|
+
// never registered under a name the catalog invented.
|
|
65
|
+
GlobalFonts.registerFromPath(path);
|
|
66
|
+
registered.push(face.file);
|
|
67
|
+
}
|
|
68
|
+
done = { dir, registered, missing };
|
|
69
|
+
return done;
|
|
70
|
+
}
|
|
71
|
+
//# sourceMappingURL=register-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"register-node.js","sourceRoot":"","sources":["../../src/fonts/register-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAY7C;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eAAe;IAC7B,KAAK,MAAM,QAAQ,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;QAClD,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,QAAQ,EAAE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACpE,IAAI,UAAU,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAC;IAC9C,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,IAAI,IAAI,GAAmC,IAAI,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,UAAU,oBAAoB;IAClC,IAAI,IAAI,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAC/B,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;QACjC,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;YACjB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QACD,MAAM,IAAI,GAAG,GAAG,GAAG,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;QAClC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACtB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QACD,uEAAuE;QACvE,sDAAsD;QACtD,WAAW,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QACnC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7B,CAAC;IACD,IAAI,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;IACpC,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated mattes: a matte cut from a clip's own source and carried on that
|
|
3
|
+
* clip (D2).
|
|
4
|
+
*
|
|
5
|
+
* The two-clip `ClipMatte` names another clip as the keyhole, so keeping the
|
|
6
|
+
* two in step is the caller's problem: every trim, split and move has to move
|
|
7
|
+
* both. A generated matte is an *attribute* of the source clip instead, so it
|
|
8
|
+
* shares the in-point, the speed, the window and the time remap by
|
|
9
|
+
* construction — `splitClip` and `trimClip` copy it across with the rest of the
|
|
10
|
+
* clip and it stays aligned with no work of their own.
|
|
11
|
+
*
|
|
12
|
+
* What can go wrong is therefore not misalignment but staleness: the clip's
|
|
13
|
+
* asset was regenerated under it, or its window now asks for source the
|
|
14
|
+
* generation never covered. {@link isGeneratedMatteStale} is the one place that
|
|
15
|
+
* is decided; the validator (`generated_matte_stale`) and the UI both ask it.
|
|
16
|
+
*
|
|
17
|
+
* Pure functions over one clip. Nothing here reads a document, an asset or a
|
|
18
|
+
* clock.
|
|
19
|
+
*/
|
|
20
|
+
import type { ClipGeneratedMatte, TimelineClip } from "./types.js";
|
|
21
|
+
/** One stored generation of a clip's matte. */
|
|
22
|
+
export type GeneratedMatteVersion = NonNullable<ClipGeneratedMatte["versions"]>[number];
|
|
23
|
+
/**
|
|
24
|
+
* A finished generation, as the job hands it back: the mask asset, the source
|
|
25
|
+
* asset and interval it was cut from, and the knobs it ran with.
|
|
26
|
+
*/
|
|
27
|
+
export interface GeneratedMatteResult {
|
|
28
|
+
assetId: string;
|
|
29
|
+
sourceAssetId: string;
|
|
30
|
+
sourceRange: {
|
|
31
|
+
fromMs: number;
|
|
32
|
+
toMs: number;
|
|
33
|
+
};
|
|
34
|
+
settings: Record<string, number | string | boolean>;
|
|
35
|
+
/** The job that produced it, recorded on the version it replaces. */
|
|
36
|
+
jobId?: string;
|
|
37
|
+
/** ISO timestamp stamped on the version this result displaces. */
|
|
38
|
+
createdAt?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The fields a staleness check reads. Spelled out rather than taking a whole
|
|
42
|
+
* {@link TimelineClip} so the validator can ask it of a document clip parsed by
|
|
43
|
+
* the protocol schema, which is the same shape and a different declaration.
|
|
44
|
+
*/
|
|
45
|
+
export type GeneratedMatteClip = Pick<TimelineClip, "generatedMatte" | "currentAssetId" | "startMs" | "durationMs" | "inPointMs" | "speedMultiplier" | "speedBaked" | "timeRemap">;
|
|
46
|
+
/**
|
|
47
|
+
* The source interval a clip currently shows, in source milliseconds.
|
|
48
|
+
*
|
|
49
|
+
* Without a remap that is the in-point plus the window at the clip's rate. With
|
|
50
|
+
* one the curve names absolute source positions, so the interval is the range
|
|
51
|
+
* the curve covers over the clip — its keyframes plus both ends, which is where
|
|
52
|
+
* a monotone segment's extremes are.
|
|
53
|
+
*/
|
|
54
|
+
export declare function clipSourceWindowMs(clip: GeneratedMatteClip): {
|
|
55
|
+
fromMs: number;
|
|
56
|
+
toMs: number;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* True when the clip's generated matte no longer describes what the clip
|
|
60
|
+
* shows: the source asset was replaced under it, or the window now reaches
|
|
61
|
+
* source the generation never covered.
|
|
62
|
+
*
|
|
63
|
+
* False for a clip with no generated matte at all — there is nothing to be
|
|
64
|
+
* stale — so a caller can ask it of any clip.
|
|
65
|
+
*/
|
|
66
|
+
export declare function isGeneratedMatteStale(clip: GeneratedMatteClip): boolean;
|
|
67
|
+
/**
|
|
68
|
+
* The clip with a finished generation as its matte, the one it replaces pushed
|
|
69
|
+
* onto `versions` newest first — so a regenerate the user dislikes is one
|
|
70
|
+
* {@link selectGeneratedMatteVersion} away from being undone.
|
|
71
|
+
*
|
|
72
|
+
* A result identical to what is already current still records a version: the
|
|
73
|
+
* two runs are distinct events, and the version list is the audit of them.
|
|
74
|
+
*/
|
|
75
|
+
export declare function applyGeneratedMatteResult(clip: TimelineClip, result: GeneratedMatteResult): TimelineClip;
|
|
76
|
+
/**
|
|
77
|
+
* The clip with a stored version made current, the displaced one taking its
|
|
78
|
+
* place in the list. Returns the clip unchanged when it has no generated matte,
|
|
79
|
+
* when the asset is already current, or when no version carries it — selecting
|
|
80
|
+
* a version that is not there is a no-op, not an error, because the list is
|
|
81
|
+
* pruned by whoever owns the assets.
|
|
82
|
+
*/
|
|
83
|
+
export declare function selectGeneratedMatteVersion(clip: TimelineClip, assetId: string): TimelineClip;
|
|
84
|
+
/** The clip with its generated matte removed, versions and all. */
|
|
85
|
+
export declare function clearGeneratedMatte(clip: TimelineClip): TimelineClip;
|
|
86
|
+
//# sourceMappingURL=generatedMatte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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,CACzC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,MAAM,GACd,YAAY,CA0Bd;AAED,mEAAmE;AACnE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY,CAIpE"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated mattes: a matte cut from a clip's own source and carried on that
|
|
3
|
+
* clip (D2).
|
|
4
|
+
*
|
|
5
|
+
* The two-clip `ClipMatte` names another clip as the keyhole, so keeping the
|
|
6
|
+
* two in step is the caller's problem: every trim, split and move has to move
|
|
7
|
+
* both. A generated matte is an *attribute* of the source clip instead, so it
|
|
8
|
+
* shares the in-point, the speed, the window and the time remap by
|
|
9
|
+
* construction — `splitClip` and `trimClip` copy it across with the rest of the
|
|
10
|
+
* clip and it stays aligned with no work of their own.
|
|
11
|
+
*
|
|
12
|
+
* What can go wrong is therefore not misalignment but staleness: the clip's
|
|
13
|
+
* asset was regenerated under it, or its window now asks for source the
|
|
14
|
+
* generation never covered. {@link isGeneratedMatteStale} is the one place that
|
|
15
|
+
* is decided; the validator (`generated_matte_stale`) and the UI both ask it.
|
|
16
|
+
*
|
|
17
|
+
* Pure functions over one clip. Nothing here reads a document, an asset or a
|
|
18
|
+
* clock.
|
|
19
|
+
*/
|
|
20
|
+
import { sourceRate } from "./sourceRate.js";
|
|
21
|
+
import { clipSourceMsAt, hasTimeRemap } from "./timeRemap.js";
|
|
22
|
+
/** Floating-point slack on the window comparison, in source ms (sub-frame). */
|
|
23
|
+
const WINDOW_EPSILON_MS = 1;
|
|
24
|
+
/**
|
|
25
|
+
* The source interval a clip currently shows, in source milliseconds.
|
|
26
|
+
*
|
|
27
|
+
* Without a remap that is the in-point plus the window at the clip's rate. With
|
|
28
|
+
* one the curve names absolute source positions, so the interval is the range
|
|
29
|
+
* the curve covers over the clip — its keyframes plus both ends, which is where
|
|
30
|
+
* a monotone segment's extremes are.
|
|
31
|
+
*/
|
|
32
|
+
export function clipSourceWindowMs(clip) {
|
|
33
|
+
if (hasTimeRemap(clip)) {
|
|
34
|
+
const ends = [
|
|
35
|
+
clipSourceMsAt(clip, clip.startMs),
|
|
36
|
+
clipSourceMsAt(clip, clip.startMs + clip.durationMs)
|
|
37
|
+
];
|
|
38
|
+
for (const kf of clip.timeRemap?.keyframes ?? []) {
|
|
39
|
+
if (kf.t < 0 || kf.t > 1)
|
|
40
|
+
continue;
|
|
41
|
+
ends.push(Math.max(0, kf.sourceMs));
|
|
42
|
+
}
|
|
43
|
+
return { fromMs: Math.min(...ends), toMs: Math.max(...ends) };
|
|
44
|
+
}
|
|
45
|
+
const fromMs = Math.max(0, clip.inPointMs ?? 0);
|
|
46
|
+
return { fromMs, toMs: fromMs + clip.durationMs * sourceRate(clip) };
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* True when the clip's generated matte no longer describes what the clip
|
|
50
|
+
* shows: the source asset was replaced under it, or the window now reaches
|
|
51
|
+
* source the generation never covered.
|
|
52
|
+
*
|
|
53
|
+
* False for a clip with no generated matte at all — there is nothing to be
|
|
54
|
+
* stale — so a caller can ask it of any clip.
|
|
55
|
+
*/
|
|
56
|
+
export function isGeneratedMatteStale(clip) {
|
|
57
|
+
const matte = clip.generatedMatte;
|
|
58
|
+
if (!matte)
|
|
59
|
+
return false;
|
|
60
|
+
if (matte.sourceAssetId !== clip.currentAssetId)
|
|
61
|
+
return true;
|
|
62
|
+
const window = clipSourceWindowMs(clip);
|
|
63
|
+
return (window.fromMs < matte.sourceRange.fromMs - WINDOW_EPSILON_MS ||
|
|
64
|
+
window.toMs > matte.sourceRange.toMs + WINDOW_EPSILON_MS);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* The clip with a finished generation as its matte, the one it replaces pushed
|
|
68
|
+
* onto `versions` newest first — so a regenerate the user dislikes is one
|
|
69
|
+
* {@link selectGeneratedMatteVersion} away from being undone.
|
|
70
|
+
*
|
|
71
|
+
* A result identical to what is already current still records a version: the
|
|
72
|
+
* two runs are distinct events, and the version list is the audit of them.
|
|
73
|
+
*/
|
|
74
|
+
export function applyGeneratedMatteResult(clip, result) {
|
|
75
|
+
const previous = clip.generatedMatte;
|
|
76
|
+
const versions = [];
|
|
77
|
+
if (previous) {
|
|
78
|
+
const displaced = {
|
|
79
|
+
assetId: previous.assetId,
|
|
80
|
+
sourceAssetId: previous.sourceAssetId,
|
|
81
|
+
createdAt: result.createdAt ?? new Date().toISOString(),
|
|
82
|
+
settings: previous.settings
|
|
83
|
+
};
|
|
84
|
+
if (result.jobId !== undefined)
|
|
85
|
+
displaced.jobId = result.jobId;
|
|
86
|
+
versions.push(displaced, ...(previous.versions ?? []));
|
|
87
|
+
}
|
|
88
|
+
const generatedMatte = {
|
|
89
|
+
assetId: result.assetId,
|
|
90
|
+
sourceAssetId: result.sourceAssetId,
|
|
91
|
+
sourceRange: { ...result.sourceRange },
|
|
92
|
+
settings: { ...result.settings },
|
|
93
|
+
status: "ready"
|
|
94
|
+
};
|
|
95
|
+
// The look knobs are the user's, not the generation's: a regenerate at a new
|
|
96
|
+
// resolution keeps the invert, strength and feather they dialled in.
|
|
97
|
+
if (previous?.invert !== undefined)
|
|
98
|
+
generatedMatte.invert = previous.invert;
|
|
99
|
+
if (previous?.strength !== undefined) {
|
|
100
|
+
generatedMatte.strength = previous.strength;
|
|
101
|
+
}
|
|
102
|
+
if (previous?.featherPx !== undefined) {
|
|
103
|
+
generatedMatte.featherPx = previous.featherPx;
|
|
104
|
+
}
|
|
105
|
+
if (versions.length > 0)
|
|
106
|
+
generatedMatte.versions = versions;
|
|
107
|
+
return { ...clip, generatedMatte };
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* The clip with a stored version made current, the displaced one taking its
|
|
111
|
+
* place in the list. Returns the clip unchanged when it has no generated matte,
|
|
112
|
+
* when the asset is already current, or when no version carries it — selecting
|
|
113
|
+
* a version that is not there is a no-op, not an error, because the list is
|
|
114
|
+
* pruned by whoever owns the assets.
|
|
115
|
+
*/
|
|
116
|
+
export function selectGeneratedMatteVersion(clip, assetId) {
|
|
117
|
+
const matte = clip.generatedMatte;
|
|
118
|
+
if (!matte || matte.assetId === assetId)
|
|
119
|
+
return clip;
|
|
120
|
+
const versions = matte.versions ?? [];
|
|
121
|
+
const index = versions.findIndex((v) => v.assetId === assetId);
|
|
122
|
+
if (index === -1)
|
|
123
|
+
return clip;
|
|
124
|
+
const chosen = versions[index];
|
|
125
|
+
const displaced = {
|
|
126
|
+
assetId: matte.assetId,
|
|
127
|
+
sourceAssetId: matte.sourceAssetId,
|
|
128
|
+
createdAt: chosen.createdAt,
|
|
129
|
+
settings: matte.settings
|
|
130
|
+
};
|
|
131
|
+
const rest = [...versions];
|
|
132
|
+
rest.splice(index, 1, displaced);
|
|
133
|
+
return {
|
|
134
|
+
...clip,
|
|
135
|
+
generatedMatte: {
|
|
136
|
+
...matte,
|
|
137
|
+
assetId: chosen.assetId,
|
|
138
|
+
sourceAssetId: chosen.sourceAssetId,
|
|
139
|
+
settings: { ...chosen.settings },
|
|
140
|
+
status: "ready",
|
|
141
|
+
versions: rest
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/** The clip with its generated matte removed, versions and all. */
|
|
146
|
+
export function clearGeneratedMatte(clip) {
|
|
147
|
+
if (!clip.generatedMatte)
|
|
148
|
+
return clip;
|
|
149
|
+
const { generatedMatte: _dropped, ...rest } = clip;
|
|
150
|
+
return rest;
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=generatedMatte.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generatedMatte.js","sourceRoot":"","sources":["../src/generatedMatte.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAwC9D,+EAA+E;AAC/E,MA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AAG,IAAI;QACP,cAAc,EAAE;YACd,GAAG,KAAK;YACR,OAAO,EAAE,MAAM,CAAC,OAAO;YACvB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,QAAQ,EAAE,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE;YAChC,MAAM,EAAE,OAAO;YACf,QAAQ,EAAE,IAAI;SACf;KACF,CAAC;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,mBAAmB,CAAC,IAAkB;IACpD,IAAI,CAAC,IAAI,CAAC,cAAc;QAAE,OAAO,IAAI,CAAC;IACtC,MAAM,EAAE,cAAc,EAAE,QAAQ,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;IACnD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { ClipVersion, MediaTrack, TimelineClip } from "./types.js";
|
|
2
|
+
export interface MediaEditSourceContext {
|
|
3
|
+
readonly sequenceId: string;
|
|
4
|
+
readonly clipId: string;
|
|
5
|
+
readonly sourceAssetId: string;
|
|
6
|
+
readonly sourceTakeId?: string;
|
|
7
|
+
readonly sourceStartMs: number;
|
|
8
|
+
readonly sourceEndMs: number;
|
|
9
|
+
readonly timelineStartMs: number;
|
|
10
|
+
readonly timelineDurationMs: number;
|
|
11
|
+
readonly speedMultiplier: number;
|
|
12
|
+
}
|
|
13
|
+
export declare const MEDIA_EDIT_ACTION: "video_edit";
|
|
14
|
+
export declare const MEDIA_EDIT_MODEL_TASK: "video_to_video";
|
|
15
|
+
export interface MediaEditRequest {
|
|
16
|
+
readonly action: typeof MEDIA_EDIT_ACTION;
|
|
17
|
+
readonly modelTask: typeof MEDIA_EDIT_MODEL_TASK;
|
|
18
|
+
readonly referenceAssetIds?: readonly string[];
|
|
19
|
+
readonly entityIds?: readonly string[];
|
|
20
|
+
readonly sourceContext: MediaEditSourceContext;
|
|
21
|
+
readonly instruction: string;
|
|
22
|
+
readonly provider: string;
|
|
23
|
+
readonly model: string;
|
|
24
|
+
readonly strength?: number;
|
|
25
|
+
readonly resolution?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Preserve legacy take snapshots when the server supplies no resolution. */
|
|
28
|
+
export declare function withResolvedMediaEditReferences(request: MediaEditRequest, value: unknown): MediaEditRequest;
|
|
29
|
+
export interface MediaEditSourceContextInput {
|
|
30
|
+
sequenceId: string;
|
|
31
|
+
clipId: string;
|
|
32
|
+
sourceAssetId: string;
|
|
33
|
+
sourceTakeId?: string;
|
|
34
|
+
sourceStartMs: number;
|
|
35
|
+
sourceEndMs: number;
|
|
36
|
+
timelineStartMs: number;
|
|
37
|
+
timelineDurationMs: number;
|
|
38
|
+
speedMultiplier: number;
|
|
39
|
+
}
|
|
40
|
+
/** Validate a host-neutral source snapshot before a video edit is submitted. */
|
|
41
|
+
export declare function createMediaEditSourceContext(input: MediaEditSourceContextInput): MediaEditSourceContextResult;
|
|
42
|
+
/** The direct-generation payload shared by timeline and storyboard hosts. */
|
|
43
|
+
export declare function mediaEditGenerateMediaData(request: MediaEditRequest): Record<string, unknown>;
|
|
44
|
+
/** Shared provenance payload stored on every host's accepted take record. */
|
|
45
|
+
export declare function mediaEditTakeMetadata(request: MediaEditRequest, requestId: string): NonNullable<ClipVersion["mediaEdit"]>;
|
|
46
|
+
export declare function createMediaEditRequest(input: {
|
|
47
|
+
sourceContext: MediaEditSourceContext;
|
|
48
|
+
instruction: string;
|
|
49
|
+
provider: string;
|
|
50
|
+
model: string;
|
|
51
|
+
strength?: number;
|
|
52
|
+
resolution?: string;
|
|
53
|
+
referenceAssetIds?: readonly string[];
|
|
54
|
+
entityIds?: readonly string[];
|
|
55
|
+
}): MediaEditRequest;
|
|
56
|
+
export interface MediaEditSourceContextError {
|
|
57
|
+
ok: false;
|
|
58
|
+
error: string;
|
|
59
|
+
}
|
|
60
|
+
export interface MediaEditSourceContextSuccess {
|
|
61
|
+
ok: true;
|
|
62
|
+
context: MediaEditSourceContext;
|
|
63
|
+
}
|
|
64
|
+
export type MediaEditSourceContextResult = MediaEditSourceContextSuccess | MediaEditSourceContextError;
|
|
65
|
+
/** Capture the constant-speed playable window before an edit is dispatched. */
|
|
66
|
+
export declare function captureMediaEditSourceContext(sequenceId: string, clip: TimelineClip): MediaEditSourceContextResult;
|
|
67
|
+
/** Capabilities are deliberately provider-independent model registry keys. */
|
|
68
|
+
export type GenerativeCapability = "video.extend" | "video.video_to_video" | "video.inpaint" | "video.object_replace" | "video.mask_input" | "video.reference_image" | "video.first_last_frame";
|
|
69
|
+
export type GenerativeOperation = "extend" | "replace_range" | "remove_object" | "replace_object" | "restyle" | "regenerate";
|
|
70
|
+
export interface GenerativeRange {
|
|
71
|
+
startMs: number;
|
|
72
|
+
endMs: number;
|
|
73
|
+
}
|
|
74
|
+
export interface GenerativeEditInput {
|
|
75
|
+
clip: TimelineClip;
|
|
76
|
+
operation: GenerativeOperation;
|
|
77
|
+
range?: GenerativeRange;
|
|
78
|
+
direction?: "start" | "end";
|
|
79
|
+
durationMs?: number;
|
|
80
|
+
prompt?: string;
|
|
81
|
+
trackId?: string;
|
|
82
|
+
referenceAssetIds?: string[];
|
|
83
|
+
provider?: string;
|
|
84
|
+
model?: string;
|
|
85
|
+
/** The clip's document tracks are passed in so validation stays pure. */
|
|
86
|
+
mediaTracks?: readonly MediaTrack[];
|
|
87
|
+
}
|
|
88
|
+
/** Provider request emitted after editorial validation. */
|
|
89
|
+
export interface GenerativeOperationRequest {
|
|
90
|
+
operation: GenerativeOperation;
|
|
91
|
+
clipId: string;
|
|
92
|
+
sourceAssetId: string;
|
|
93
|
+
requiredCapabilities: readonly GenerativeCapability[];
|
|
94
|
+
optionalCapabilities: readonly GenerativeCapability[];
|
|
95
|
+
range?: GenerativeRange;
|
|
96
|
+
direction?: "start" | "end";
|
|
97
|
+
durationMs?: number;
|
|
98
|
+
prompt?: string;
|
|
99
|
+
trackId?: string;
|
|
100
|
+
referenceAssetIds: readonly string[];
|
|
101
|
+
provider?: string;
|
|
102
|
+
model?: string;
|
|
103
|
+
}
|
|
104
|
+
export interface GenerativePlan {
|
|
105
|
+
ok: true;
|
|
106
|
+
request: GenerativeOperationRequest;
|
|
107
|
+
}
|
|
108
|
+
export interface GenerativePlanError {
|
|
109
|
+
ok: false;
|
|
110
|
+
error: string;
|
|
111
|
+
}
|
|
112
|
+
export type GenerativePlanResult = GenerativePlan | GenerativePlanError;
|
|
113
|
+
/** Validate editorial preconditions and build a provider-agnostic request. */
|
|
114
|
+
export declare function planGenerativeOperation(input: GenerativeEditInput): GenerativePlanResult;
|
|
115
|
+
export interface GenerativeTakeResult {
|
|
116
|
+
assetId: string;
|
|
117
|
+
jobId?: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
dependencyHash?: string;
|
|
120
|
+
workflowUpdatedAt?: string;
|
|
121
|
+
paramOverridesSnapshot?: Record<string, unknown>;
|
|
122
|
+
provider?: string;
|
|
123
|
+
model?: string;
|
|
124
|
+
prompt?: string;
|
|
125
|
+
negativePrompt?: string;
|
|
126
|
+
costCredits?: number;
|
|
127
|
+
durationMs?: number;
|
|
128
|
+
status?: ClipVersion["status"];
|
|
129
|
+
/**
|
|
130
|
+
* A successful generative edit is an audition by default. Set this only
|
|
131
|
+
* after an explicit "Use Take" choice.
|
|
132
|
+
*/
|
|
133
|
+
activate?: boolean;
|
|
134
|
+
mediaEdit?: MediaEditRequest;
|
|
135
|
+
}
|
|
136
|
+
/** The provenance source recorded in the existing ClipVersion/take model. */
|
|
137
|
+
export declare function takeSourceForOperation(operation: GenerativeOperation): NonNullable<ClipVersion["source"]>;
|
|
138
|
+
/**
|
|
139
|
+
* Apply a completed generation as a new take. The spread is intentional: all
|
|
140
|
+
* editorial fields (position, duration, trims, effects, bindings, etc.) stay
|
|
141
|
+
* untouched while only take/asset state changes. A completed take is not made
|
|
142
|
+
* active unless the caller records an explicit selection.
|
|
143
|
+
*/
|
|
144
|
+
export declare function composeGenerativeTakePatch(clip: TimelineClip, operation: GenerativeOperation, result: GenerativeTake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