@allyhub/sdk 0.1.0-alpha.8 → 0.2.0-next.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.
- package/NOTICE +85 -0
- package/client.d.ts +45 -1
- package/dist/anim.js +2 -75
- package/dist/define.d.ts +10 -4
- package/dist/define.js +2 -95
- package/dist/dom.d.ts +1 -1
- package/dist/dom.js +2 -457
- package/dist/fit.js +2 -60
- package/dist/free.d.ts +18 -0
- package/dist/free.js +2 -0
- package/dist/index.d.ts +28 -13
- package/dist/index.js +2 -11
- package/dist/input.d.ts +306 -0
- package/dist/input.js +2 -0
- package/dist/media.d.ts +3 -6
- package/dist/media.js +2 -27
- package/dist/messages.d.ts +3 -2
- package/dist/messages.js +2 -2
- package/dist/module.d.ts +24 -0
- package/dist/module.js +2 -0
- package/dist/noise.js +2 -233
- package/dist/parts.d.ts +97 -21
- package/dist/parts.js +2 -414
- package/dist/paths.d.ts +1 -1
- package/dist/paths.js +2 -720
- package/dist/phone.d.ts +26 -0
- package/dist/phone.js +2 -0
- package/dist/piece.d.ts +106 -35
- package/dist/piece.js +2 -38
- package/dist/props.d.ts +1 -1
- package/dist/props.js +2 -35
- package/dist/scenery.d.ts +2 -0
- package/dist/scenery.js +2 -0
- package/dist/text.js +2 -38
- package/dist/written.d.ts +12 -0
- package/dist/written.js +2 -0
- package/docs/README.md +18 -0
- package/docs/batches.md +148 -0
- package/docs/contract.md +51 -0
- package/docs/defaults.md +703 -0
- package/docs/docs.md +148 -0
- package/docs/footage.md +249 -0
- package/docs/layers.md +317 -0
- package/docs/modeling.md +143 -0
- package/docs/project.md +265 -0
- package/docs/scenery.md +308 -0
- package/docs/sheets.md +119 -0
- package/docs/slides.md +111 -0
- package/docs/sound.md +170 -0
- package/docs/speech.md +289 -0
- package/docs/video.md +265 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.d.ts +52 -0
- package/node_modules/@allyhub-next/audio/dist/at-cut.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/decode.d.ts +33 -0
- package/node_modules/@allyhub-next/audio/dist/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.d.ts +37 -0
- package/node_modules/@allyhub-next/audio/dist/envelope.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/index.d.ts +17 -0
- package/node_modules/@allyhub-next/audio/dist/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/levels.d.ts +97 -0
- package/node_modules/@allyhub-next/audio/dist/levels.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/master.d.ts +29 -0
- package/node_modules/@allyhub-next/audio/dist/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/music.d.ts +11 -0
- package/node_modules/@allyhub-next/audio/dist/music.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.d.ts +39 -0
- package/node_modules/@allyhub-next/audio/dist/node/decode.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.d.ts +25 -0
- package/node_modules/@allyhub-next/audio/dist/node/ebur128.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/ffmpeg.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.d.ts +8 -0
- package/node_modules/@allyhub-next/audio/dist/node/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.d.ts +18 -0
- package/node_modules/@allyhub-next/audio/dist/node/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/node/master.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.d.ts +60 -0
- package/node_modules/@allyhub-next/audio/dist/node/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.d.ts +31 -0
- package/node_modules/@allyhub-next/audio/dist/node/mix.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/plan.d.ts +143 -0
- package/node_modules/@allyhub-next/audio/dist/plan.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recorded.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.d.ts +47 -0
- package/node_modules/@allyhub-next/audio/dist/recording/bandwidth.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.d.ts +89 -0
- package/node_modules/@allyhub-next/audio/dist/recording/chain.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/dynamics.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fft.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.d.ts +42 -0
- package/node_modules/@allyhub-next/audio/dist/recording/filters.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.d.ts +56 -0
- package/node_modules/@allyhub-next/audio/dist/recording/fit.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/recording/index.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.d.ts +12 -0
- package/node_modules/@allyhub-next/audio/dist/recording/loudness.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.d.ts +67 -0
- package/node_modules/@allyhub-next/audio/dist/recording/measure.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.d.ts +32 -0
- package/node_modules/@allyhub-next/audio/dist/recording/mic.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.d.ts +27 -0
- package/node_modules/@allyhub-next/audio/dist/recording/noise.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.d.ts +64 -0
- package/node_modules/@allyhub-next/audio/dist/recording/presets.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.d.ts +78 -0
- package/node_modules/@allyhub-next/audio/dist/recording/room.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.d.ts +111 -0
- package/node_modules/@allyhub-next/audio/dist/recording/setup.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.d.ts +3 -0
- package/node_modules/@allyhub-next/audio/dist/recording/vec.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/render.d.ts +26 -0
- package/node_modules/@allyhub-next/audio/dist/render.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.d.ts +10 -0
- package/node_modules/@allyhub-next/audio/dist/sfx.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/shape.d.ts +118 -0
- package/node_modules/@allyhub-next/audio/dist/shape.js +2 -0
- package/node_modules/@allyhub-next/audio/dist/voice.d.ts +45 -0
- package/node_modules/@allyhub-next/audio/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/audio/package.json +17 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/data/comments.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.d.ts +10 -0
- package/node_modules/@allyhub-next/formats/dist/data/config.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.d.ts +28 -0
- package/node_modules/@allyhub-next/formats/dist/data/edits.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.d.ts +6 -0
- package/node_modules/@allyhub-next/formats/dist/data/elements.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.d.ts +38 -0
- package/node_modules/@allyhub-next/formats/dist/data/faces.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.d.ts +11 -0
- package/node_modules/@allyhub-next/formats/dist/data/file.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.d.ts +31 -0
- package/node_modules/@allyhub-next/formats/dist/data/gen.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.d.ts +34 -0
- package/node_modules/@allyhub-next/formats/dist/data/messages.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.d.ts +676 -0
- package/node_modules/@allyhub-next/formats/dist/data/reference.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.d.ts +37 -0
- package/node_modules/@allyhub-next/formats/dist/data/script.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.d.ts +214 -0
- package/node_modules/@allyhub-next/formats/dist/data/sheet.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.d.ts +25 -0
- package/node_modules/@allyhub-next/formats/dist/data/words.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/index.d.ts +16 -0
- package/node_modules/@allyhub-next/formats/dist/index.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/items.d.ts +94 -0
- package/node_modules/@allyhub-next/formats/dist/items.js +2 -0
- package/node_modules/@allyhub-next/formats/dist/layout.d.ts +50 -0
- package/node_modules/@allyhub-next/formats/dist/layout.js +5 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.d.ts +301 -0
- package/node_modules/@allyhub-next/formats/dist/schemas.js +2 -0
- package/node_modules/@allyhub-next/formats/package.json +14 -0
- package/node_modules/@allyhub-next/formats/schemas/comments.schema.json +152 -0
- package/node_modules/@allyhub-next/formats/schemas/config.schema.json +43 -0
- package/node_modules/@allyhub-next/formats/schemas/edits.schema.json +112 -0
- package/node_modules/@allyhub-next/formats/schemas/elements.schema.json +33 -0
- package/node_modules/@allyhub-next/formats/schemas/gen.schema.json +97 -0
- package/node_modules/@allyhub-next/formats/schemas/interpretation.schema.json +125 -0
- package/node_modules/@allyhub-next/formats/schemas/items.json +75 -0
- package/node_modules/@allyhub-next/formats/schemas/messages.schema.json +11 -0
- package/node_modules/@allyhub-next/formats/schemas/script.schema.json +162 -0
- package/node_modules/@allyhub-next/formats/schemas/sheet.schema.json +395 -0
- package/node_modules/@allyhub-next/formats/schemas/words.schema.json +63 -0
- package/node_modules/@allyhub-next/protocol/dist/app.d.ts +98 -0
- package/node_modules/@allyhub-next/protocol/dist/app.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.d.ts +116 -0
- package/node_modules/@allyhub-next/protocol/dist/auth.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.d.ts +59 -0
- package/node_modules/@allyhub-next/protocol/dist/cli.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.d.ts +272 -0
- package/node_modules/@allyhub-next/protocol/dist/cloud.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.d.ts +405 -0
- package/node_modules/@allyhub-next/protocol/dist/editor.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/files.d.ts +101 -0
- package/node_modules/@allyhub-next/protocol/dist/files.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/index.d.ts +12 -0
- package/node_modules/@allyhub-next/protocol/dist/index.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.d.ts +83 -0
- package/node_modules/@allyhub-next/protocol/dist/jsonrpc.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.d.ts +53 -0
- package/node_modules/@allyhub-next/protocol/dist/registry.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.d.ts +93 -0
- package/node_modules/@allyhub-next/protocol/dist/runtimes.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.d.ts +67 -0
- package/node_modules/@allyhub-next/protocol/dist/teams.js +2 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.d.ts +345 -0
- package/node_modules/@allyhub-next/protocol/dist/tools.js +2 -0
- package/node_modules/@allyhub-next/protocol/package.json +13 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.d.ts +10 -0
- package/node_modules/@allyhub-next/runtimes/dist/bundled.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.d.ts +15 -0
- package/node_modules/@allyhub-next/runtimes/dist/download.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.d.ts +16 -0
- package/node_modules/@allyhub-next/runtimes/dist/errors.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.d.ts +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/home.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.d.ts +9 -0
- package/node_modules/@allyhub-next/runtimes/dist/index.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.d.ts +6 -0
- package/node_modules/@allyhub-next/runtimes/dist/lock.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.d.ts +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/manifest.js +2 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.d.ts +63 -0
- package/node_modules/@allyhub-next/runtimes/dist/runtimes.js +3 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.d.ts +7 -0
- package/node_modules/@allyhub-next/runtimes/dist/unpack.js +2 -0
- package/node_modules/@allyhub-next/runtimes/manifest.json +395 -0
- package/node_modules/@allyhub-next/runtimes/package.json +14 -0
- package/node_modules/@allyhub-next/runtimes/schemas/runtimes.schema.json +153 -0
- package/node_modules/@allyhub-next/scenery/NOTICE +42 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/aim.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.d.ts +203 -0
- package/node_modules/@allyhub-next/scenery/dist/bake.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.d.ts +150 -0
- package/node_modules/@allyhub-next/scenery/dist/camera.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.d.ts +40 -0
- package/node_modules/@allyhub-next/scenery/dist/curve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/define.d.ts +164 -0
- package/node_modules/@allyhub-next/scenery/dist/define.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.d.ts +64 -0
- package/node_modules/@allyhub-next/scenery/dist/fit.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/glass.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.d.ts +184 -0
- package/node_modules/@allyhub-next/scenery/dist/handheld.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.d.ts +23 -0
- package/node_modules/@allyhub-next/scenery/dist/hull.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/index.d.ts +22 -0
- package/node_modules/@allyhub-next/scenery/dist/index.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/lens.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.d.ts +136 -0
- package/node_modules/@allyhub-next/scenery/dist/moire.js +93 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.d.ts +48 -0
- package/node_modules/@allyhub-next/scenery/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/move.d.ts +260 -0
- package/node_modules/@allyhub-next/scenery/dist/move.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.d.ts +41 -0
- package/node_modules/@allyhub-next/scenery/dist/noise.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.d.ts +34 -0
- package/node_modules/@allyhub-next/scenery/dist/phone.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/report.d.ts +677 -0
- package/node_modules/@allyhub-next/scenery/dist/report.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.d.ts +55 -0
- package/node_modules/@allyhub-next/scenery/dist/screen-focus.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.d.ts +71 -0
- package/node_modules/@allyhub-next/scenery/dist/screen.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.d.ts +82 -0
- package/node_modules/@allyhub-next/scenery/dist/solve.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.d.ts +26 -0
- package/node_modules/@allyhub-next/scenery/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.d.ts +19 -0
- package/node_modules/@allyhub-next/scenery/dist/vec.js +2 -0
- package/node_modules/@allyhub-next/scenery/package.json +13 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.d.ts +164 -0
- package/node_modules/@allyhub-next/video-core/dist/anchors.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.d.ts +148 -0
- package/node_modules/@allyhub-next/video-core/dist/audio-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.d.ts +87 -0
- package/node_modules/@allyhub-next/video-core/dist/backdrop.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.d.ts +122 -0
- package/node_modules/@allyhub-next/video-core/dist/captions.js +11 -0
- package/node_modules/@allyhub-next/video-core/dist/console.d.ts +91 -0
- package/node_modules/@allyhub-next/video-core/dist/console.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.d.ts +98 -0
- package/node_modules/@allyhub-next/video-core/dist/contrast.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/cut-report.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.d.ts +77 -0
- package/node_modules/@allyhub-next/video-core/dist/edit.js +13 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.d.ts +163 -0
- package/node_modules/@allyhub-next/video-core/dist/edits.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/export.d.ts +96 -0
- package/node_modules/@allyhub-next/video-core/dist/export.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.d.ts +965 -0
- package/node_modules/@allyhub-next/video-core/dist/fact.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.d.ts +168 -0
- package/node_modules/@allyhub-next/video-core/dist/footage-motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.d.ts +240 -0
- package/node_modules/@allyhub-next/video-core/dist/formats.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/gen.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/index.d.ts +40 -0
- package/node_modules/@allyhub-next/video-core/dist/index.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/look.d.ts +66 -0
- package/node_modules/@allyhub-next/video-core/dist/look.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.d.ts +34 -0
- package/node_modules/@allyhub-next/video-core/dist/marks.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/matrix.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.d.ts +465 -0
- package/node_modules/@allyhub-next/video-core/dist/measure.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/media.d.ts +226 -0
- package/node_modules/@allyhub-next/video-core/dist/media.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/messages.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.d.ts +56 -0
- package/node_modules/@allyhub-next/video-core/dist/motion.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/music.d.ts +110 -0
- package/node_modules/@allyhub-next/video-core/dist/music.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.d.ts +1146 -0
- package/node_modules/@allyhub-next/video-core/dist/piece.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/placement.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.d.ts +262 -0
- package/node_modules/@allyhub-next/video-core/dist/problem.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.d.ts +49 -0
- package/node_modules/@allyhub-next/video-core/dist/render-types.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.d.ts +352 -0
- package/node_modules/@allyhub-next/video-core/dist/schema.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.d.ts +176 -0
- package/node_modules/@allyhub-next/video-core/dist/script-edit.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/script.d.ts +67 -0
- package/node_modules/@allyhub-next/video-core/dist/script.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.d.ts +214 -0
- package/node_modules/@allyhub-next/video-core/dist/seams.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.d.ts +37 -0
- package/node_modules/@allyhub-next/video-core/dist/slides.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.d.ts +72 -0
- package/node_modules/@allyhub-next/video-core/dist/sound-under.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.d.ts +83 -0
- package/node_modules/@allyhub-next/video-core/dist/speech.js +5 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.d.ts +616 -0
- package/node_modules/@allyhub-next/video-core/dist/timeline.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.d.ts +88 -0
- package/node_modules/@allyhub-next/video-core/dist/timing.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.d.ts +288 -0
- package/node_modules/@allyhub-next/video-core/dist/transcript.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.d.ts +289 -0
- package/node_modules/@allyhub-next/video-core/dist/transition.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.d.ts +175 -0
- package/node_modules/@allyhub-next/video-core/dist/voice.js +2 -0
- package/node_modules/@allyhub-next/video-core/dist/words.d.ts +128 -0
- package/node_modules/@allyhub-next/video-core/dist/words.js +2 -0
- package/node_modules/@allyhub-next/video-core/package.json +14 -0
- package/package.json +52 -41
- package/README.md +0 -17
- package/dist/anim.d.ts.map +0 -1
- package/dist/anim.js.map +0 -1
- package/dist/define.d.ts.map +0 -1
- package/dist/define.js.map +0 -1
- package/dist/dom.d.ts.map +0 -1
- package/dist/dom.js.map +0 -1
- package/dist/fit.d.ts.map +0 -1
- package/dist/fit.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/media.d.ts.map +0 -1
- package/dist/media.js.map +0 -1
- package/dist/messages.d.ts.map +0 -1
- package/dist/messages.js.map +0 -1
- package/dist/noise.d.ts.map +0 -1
- package/dist/noise.js.map +0 -1
- package/dist/parts.d.ts.map +0 -1
- package/dist/parts.js.map +0 -1
- package/dist/paths.d.ts.map +0 -1
- package/dist/paths.js.map +0 -1
- package/dist/piece.d.ts.map +0 -1
- package/dist/piece.js.map +0 -1
- package/dist/props.d.ts.map +0 -1
- package/dist/props.js.map +0 -1
- package/dist/text.d.ts.map +0 -1
- package/dist/text.js.map +0 -1
- /package/{LICENSE → LICENSE.md} +0 -0
package/dist/parts.d.ts
CHANGED
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { type FootageLayer, type FootageOptions, type LayerSpec, type MediaRef, type PartAnchors, type PartSpec, type RoomTone, type SaySpeech, type SoundSpec, type SpeechSpec, type TakeSpeech, type TransitionInput, type WordRef } from "@allyhub/
|
|
2
|
-
|
|
1
|
+
import { type VoiceSetting, type FootageLayer, type FootageOptions, type LayerSpec, type MediaRef, type PartAnchors, type PartSpec, type RoomTone, type SaySpeech, type SoundSpec, type SpeechSpec, type TakeSpeech, type TransitionInput, type VideoSpeech, type WordRef } from "@allyhub-next/video-core";
|
|
2
|
+
import type { Written } from "./written.js";
|
|
3
|
+
import { type VideoItem } from "./piece.js";
|
|
4
|
+
export type { BoxKey, FootageBackground, FootageBox, PerOrient, PunchIn, Pullback, Reframe, FootageLayer, FootageOptions, GraphicLayer, LayerSpec, LayerSpec as Layer, LayerTiming, PartAnchors, PartSpec, Rect, RoomTone, SaySpeech, SoundSpec, SpeechSpec, TakeSpeech, VideoSpeech, Direction, TransitionChannel, TransitionInput, TransitionPicture, TransitionSpec, TransitionType, WordRef, } from "@allyhub-next/video-core";
|
|
3
5
|
export interface PartOptions {
|
|
4
|
-
/** Unique in the output; stable across combos
|
|
6
|
+
/** Unique in the output; stable across combos. */
|
|
5
7
|
key: string;
|
|
8
|
+
/**
|
|
9
|
+
* Its name for people: the timeline's scenes, a note's part. Default
|
|
10
|
+
* its largest text at its still (text every part shows left out).
|
|
11
|
+
*/
|
|
12
|
+
title?: string;
|
|
13
|
+
/**
|
|
14
|
+
* The slot this part fills, when the piece has slots: default its key,
|
|
15
|
+
* when the key is the name of one of the combo's slots.
|
|
16
|
+
*/
|
|
17
|
+
slot?: string;
|
|
6
18
|
/** What the part says: take(file) or say(text). Without it the part is silent. */
|
|
7
19
|
speech?: SpeechSpec;
|
|
8
20
|
/**
|
|
@@ -27,7 +39,7 @@ export interface PartOptions {
|
|
|
27
39
|
* before its end.
|
|
28
40
|
*/
|
|
29
41
|
still?: WordRef | ((dur: number) => number);
|
|
30
|
-
/**
|
|
42
|
+
/** Words for the part beside its key: `allyhub reference compare` matches parts to a reference's sections by them. */
|
|
31
43
|
tags?: string[];
|
|
32
44
|
/**
|
|
33
45
|
* J and L cuts: `before` seconds of the speech play under the previous
|
|
@@ -41,7 +53,8 @@ export interface PartOptions {
|
|
|
41
53
|
* Sound effects: `[{ at: "free", sound: "pop" }, { at: 1.2, sound:
|
|
42
54
|
* whoosh, gainDb: -4 }]`, each at a word reference or seconds, a name of
|
|
43
55
|
* the look's sounds (or the built-in whoosh, tick, pop) or an audio
|
|
44
|
-
* file. Nothing plays unless it is placed.
|
|
56
|
+
* file. Nothing plays unless it is placed. `shape: { filter, eq,
|
|
57
|
+
* compress }` shapes one before it is levelled (as `music`'s).
|
|
45
58
|
*/
|
|
46
59
|
sounds?: SoundSpec[];
|
|
47
60
|
/**
|
|
@@ -65,9 +78,32 @@ export interface PartOptions {
|
|
|
65
78
|
* only: place a sound with `sounds`.
|
|
66
79
|
*/
|
|
67
80
|
transition?: TransitionInput;
|
|
81
|
+
/**
|
|
82
|
+
* How this part's speech was recorded, over the video's `mic`: a
|
|
83
|
+
* setup's name ("studio", "phone", "lav"), its options, or false for the
|
|
84
|
+
* voice as it is.
|
|
85
|
+
*/
|
|
86
|
+
mic?: VoiceSetting;
|
|
87
|
+
/**
|
|
88
|
+
* The part's own grade, an ffmpeg filter chain on its picture before the
|
|
89
|
+
* camera's marks and the video's post: a clip's white balance and
|
|
90
|
+
* exposure (`{ filter: "colortemperature=temperature=4800,eq=brightness=0.03" }`).
|
|
91
|
+
* It is given the picture opaque, as planar RGB, its `t` the film's time.
|
|
92
|
+
*/
|
|
93
|
+
post?: {
|
|
94
|
+
filter: string;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* dB this part's speech is turned up (or down) after it is recorded, as
|
|
98
|
+
* an editor's clip volume: the recording's compressor does not even it
|
|
99
|
+
* out, and its room tone moves with it. From -40 to 24; default 0.
|
|
100
|
+
*/
|
|
101
|
+
speechGainDb?: number;
|
|
68
102
|
}
|
|
69
103
|
/** A part of a video, or a page of a paged output. */
|
|
70
|
-
export
|
|
104
|
+
export type PartFn = (opts: PartOptions) => PartSpec;
|
|
105
|
+
/** part() for the module `at` names: its sounds' paths are from its folder. */
|
|
106
|
+
export declare const partFor: (at: Written) => PartFn;
|
|
71
107
|
/** A take, narrowed with range() or saying(). */
|
|
72
108
|
export interface Take extends TakeSpeech {
|
|
73
109
|
/**
|
|
@@ -83,9 +119,10 @@ export interface Take extends TakeSpeech {
|
|
|
83
119
|
*/
|
|
84
120
|
saying(text: string): Take;
|
|
85
121
|
/**
|
|
86
|
-
* A cut list: a JSON file relative to the
|
|
87
|
-
* removing word ranges, sounds and long pauses;
|
|
88
|
-
* transcript editor writes it.
|
|
122
|
+
* A cut list: a JSON file relative to the file that names it
|
|
123
|
+
* (`./edits/<name>.json`) removing word ranges, sounds and long pauses;
|
|
124
|
+
* the preview's transcript editor writes it. One that is not there is
|
|
125
|
+
* AK-T005 (the take would play uncut): `{ "remove": [] }` removes nothing.
|
|
89
126
|
*/
|
|
90
127
|
edits(path: string): Take;
|
|
91
128
|
/**
|
|
@@ -106,28 +143,65 @@ export interface Take extends TakeSpeech {
|
|
|
106
143
|
* as recorded, `gainDb` sets its gain yourself.
|
|
107
144
|
*/
|
|
108
145
|
roomTone(tone: false | RoomTone): Take;
|
|
146
|
+
/**
|
|
147
|
+
* Plays it `times` as fast, its pitch kept (ffmpeg's atempo in the
|
|
148
|
+
* render, the browser's in the preview): 1.1 is 10 % faster, and its
|
|
149
|
+
* words, the part's length and everything timed by them follow. From
|
|
150
|
+
* 0.5 to 2. The file is not changed. A part showing the take's own
|
|
151
|
+
* picture (footage() without a file) plays at speed 1.
|
|
152
|
+
*/
|
|
153
|
+
speed(times: number): Take;
|
|
154
|
+
}
|
|
155
|
+
export interface TakeFn {
|
|
156
|
+
/**
|
|
157
|
+
* Speech from a recording, audio or video, with its word times beside it
|
|
158
|
+
* (`<name>.words.json`: allyhub words <file> makes it). An import, or
|
|
159
|
+
* a path relative to the module that names it.
|
|
160
|
+
*/
|
|
161
|
+
(file: MediaRef): Take;
|
|
162
|
+
/**
|
|
163
|
+
* A stretch of another video item of the project, a source with a clock
|
|
164
|
+
* of its own: `take(scene).range("@turn", "@press")` with the item's
|
|
165
|
+
* piece imported (`import scene from "../scene/video"`). The part lasts
|
|
166
|
+
* the stretch exactly, hears its sound and says its words; `footage()`
|
|
167
|
+
* draws its picture in sync, from `camera` when it shows a 3D scenery.
|
|
168
|
+
*/
|
|
169
|
+
(video: VideoItem): VideoTake;
|
|
170
|
+
}
|
|
171
|
+
/** take() for the module `at` names: a path is from its folder. */
|
|
172
|
+
export declare function takeFor(at: Written): TakeFn;
|
|
173
|
+
/** A video item as a take, narrowed with range(). */
|
|
174
|
+
export interface VideoTake extends VideoSpeech {
|
|
175
|
+
/**
|
|
176
|
+
* The stretch from `from` to `to`: seconds of its clock, an anchor of
|
|
177
|
+
* one of its parts ("@turn", "@/turn", "@turn+0.2") or a part's key;
|
|
178
|
+
* without `to`, to its end.
|
|
179
|
+
*/
|
|
180
|
+
range(from: number | string, to?: number | string): VideoTake;
|
|
109
181
|
}
|
|
110
|
-
/**
|
|
111
|
-
* Speech from a recording, audio or video, with its word times beside it
|
|
112
|
-
* (`<name>.words.json`: allyhub transcribe <file> makes it). An import, or a
|
|
113
|
-
* path relative to the piece's file.
|
|
114
|
-
*/
|
|
115
|
-
export declare function take(file: MediaRef): Take;
|
|
116
182
|
export interface SayOptions {
|
|
117
183
|
/** The voice tool's voice id. */
|
|
118
184
|
voice?: string;
|
|
119
185
|
/** The voice tool; default tts-elevenlabs-multilingual-v2. */
|
|
120
186
|
tool?: string;
|
|
121
187
|
/**
|
|
122
|
-
* More input for the voice tool, as plain JSON
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
188
|
+
* More input for the voice tool, as plain JSON: the fields its schema
|
|
189
|
+
* takes besides the text and the voice (`allyhub help ai <tool>`
|
|
190
|
+
* lists them; the ElevenLabs voices take `outputFormat`, such as
|
|
191
|
+
* "mp3_44100_128", and nothing else). The server refuses a field the
|
|
192
|
+
* schema does not have. Passed with the text and voice; part of the
|
|
193
|
+
* file's hash, so changing it makes a new file.
|
|
126
194
|
*/
|
|
127
195
|
params?: Record<string, unknown>;
|
|
196
|
+
/**
|
|
197
|
+
* How fast the file plays, its pitch kept, as take(…).speed does: 1.1 is
|
|
198
|
+
* 10 % faster, from 0.5 to 2. AllyHub plays the same file faster; the
|
|
199
|
+
* voice tool is not asked, so it makes no new file.
|
|
200
|
+
*/
|
|
201
|
+
speed?: number;
|
|
128
202
|
}
|
|
129
203
|
/**
|
|
130
|
-
* Text to speech: `allyhub voice
|
|
204
|
+
* Text to speech: `allyhub voice` makes the file
|
|
131
205
|
* (assets/media/gen/say/<hash>) with its words; the check reports a say without
|
|
132
206
|
* one (AK-T002). Text from s(key) is read aloud as the message's `speak`.
|
|
133
207
|
*/
|
|
@@ -136,5 +210,7 @@ export declare function say(text: string, opts?: SayOptions): SaySpeech;
|
|
|
136
210
|
* A video on the part: footage("./broll.mp4", { at: "inbox", dur: 1.5 }).
|
|
137
211
|
* Without a file it is the part's own take, in sync with its speech.
|
|
138
212
|
*/
|
|
139
|
-
export
|
|
213
|
+
export type FootageFn = (file?: MediaRef | VideoItem | FootageOptions, opts?: FootageOptions) => FootageLayer;
|
|
214
|
+
/** footage() for the module `at` names: its paths are from its folder. */
|
|
215
|
+
export declare const footageFor: (at: Written) => FootageFn;
|
|
140
216
|
//# sourceMappingURL=parts.d.ts.map
|
package/dist/parts.js
CHANGED
|
@@ -1,414 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/** A part of a video, or a page of a paged output. */
|
|
3
|
-
export function part(opts) {
|
|
4
|
-
const { key, layers, ...rest } = opts;
|
|
5
|
-
if (typeof key !== "string" || key === "") {
|
|
6
|
-
throw new Error("part: every part needs a key");
|
|
7
|
-
}
|
|
8
|
-
for (const side of ["before", "after"]) {
|
|
9
|
-
const x = opts.overlap?.[side];
|
|
10
|
-
if (x !== undefined && (!Number.isFinite(x) || x < 0 || x > 10)) {
|
|
11
|
-
throw new Error(`part ${key}: overlap.${side} is seconds from 0 to 10, not ${String(x)}`);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
for (const [i, s] of (opts.sounds ?? []).entries()) {
|
|
15
|
-
const ok = typeof s === "object" &&
|
|
16
|
-
(typeof s.at === "string" || typeof s.at === "number") &&
|
|
17
|
-
(typeof s.sound === "string" ||
|
|
18
|
-
(typeof s.sound === "object" && "path" in s.sound));
|
|
19
|
-
if (!ok) {
|
|
20
|
-
throw new Error(`part ${key}: sounds[${String(i)}] is { at, sound, gainDb? }: at a word reference or seconds, sound a name or an audio file`);
|
|
21
|
-
}
|
|
22
|
-
if (s.gainDb !== undefined &&
|
|
23
|
-
(!Number.isFinite(s.gainDb) || s.gainDb < -60 || s.gainDb > 24)) {
|
|
24
|
-
throw new Error(`part ${key}: sounds[${String(i)}].gainDb is dB from -60 to 24, not ${String(s.gainDb)}`);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (opts.anchors !== undefined) {
|
|
28
|
-
const bad = partAnchorsProblem(opts.anchors);
|
|
29
|
-
if (bad !== undefined) {
|
|
30
|
-
throw new Error(`part ${key}: anchors ${bad}`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
if (opts.transition !== undefined) {
|
|
34
|
-
const bad = transitionProblem(opts.transition);
|
|
35
|
-
if (bad !== undefined) {
|
|
36
|
-
throw new Error(`part ${key}: transition ${bad}`);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
return { [PART_BRAND]: true, key, layers: layers ?? [], ...rest };
|
|
40
|
-
}
|
|
41
|
-
function makeTake(spec) {
|
|
42
|
-
const base = { [SPEECH_BRAND]: true, ...spec };
|
|
43
|
-
return {
|
|
44
|
-
...base,
|
|
45
|
-
range(from, to) {
|
|
46
|
-
const { line: _line, from: _f, to: _t, ...rest } = spec;
|
|
47
|
-
return makeTake({ ...rest, from, ...(to === undefined ? {} : { to }) });
|
|
48
|
-
},
|
|
49
|
-
saying(text) {
|
|
50
|
-
const { from: _from, to: _to, ...rest } = spec;
|
|
51
|
-
return makeTake({ ...rest, line: text });
|
|
52
|
-
},
|
|
53
|
-
edits(path) {
|
|
54
|
-
if (typeof path !== "string" || !/\.json$/i.test(path)) {
|
|
55
|
-
throw new Error(`take(…).edits(path): a JSON file relative to the piece, such as "./edits/host.json" (not ${JSON.stringify(path)})`);
|
|
56
|
-
}
|
|
57
|
-
return makeTake({ ...spec, editsFile: path });
|
|
58
|
-
},
|
|
59
|
-
denoise(db = 12) {
|
|
60
|
-
if (!Number.isFinite(db) || db <= 0 || db > 97) {
|
|
61
|
-
throw new Error(`take(…).denoise(db): the noise reduction in dB, over 0 and up to 97 (not ${String(db)})`);
|
|
62
|
-
}
|
|
63
|
-
return makeTake({ ...spec, denoiseDb: db });
|
|
64
|
-
},
|
|
65
|
-
roomTone(tone) {
|
|
66
|
-
if (tone === false)
|
|
67
|
-
return makeTake({ ...spec, room: false });
|
|
68
|
-
const what = "take(…).roomTone(tone): false, or { from, to, match, gainDb, limitDb, fade }";
|
|
69
|
-
if (typeof tone !== "object" || Array.isArray(tone)) {
|
|
70
|
-
throw new Error(`${what} (not ${JSON.stringify(tone)})`);
|
|
71
|
-
}
|
|
72
|
-
const { from, to, match, gainDb, limitDb, fade } = tone;
|
|
73
|
-
const extra = Object.keys(tone).filter((k) => !["from", "to", "match", "gainDb", "limitDb", "fade"].includes(k));
|
|
74
|
-
if (extra.length > 0) {
|
|
75
|
-
throw new Error(`${what}: it has no ${extra.join(", ")}`);
|
|
76
|
-
}
|
|
77
|
-
if (from !== undefined || to !== undefined) {
|
|
78
|
-
if (from === undefined ||
|
|
79
|
-
to === undefined ||
|
|
80
|
-
!Number.isFinite(from) ||
|
|
81
|
-
!Number.isFinite(to) ||
|
|
82
|
-
from < 0 ||
|
|
83
|
-
to - from < 0.05) {
|
|
84
|
-
throw new Error(`${what}: from and to are seconds of the file, both given, at least 0.05 s apart`);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
if (match !== undefined && typeof match !== "boolean") {
|
|
88
|
-
throw new Error(`${what}: match is true or false`);
|
|
89
|
-
}
|
|
90
|
-
if (gainDb !== undefined &&
|
|
91
|
-
(!Number.isFinite(gainDb) || gainDb < -60 || gainDb > 24)) {
|
|
92
|
-
throw new Error(`${what}: gainDb is dB from -60 to 24, not ${String(gainDb)}`);
|
|
93
|
-
}
|
|
94
|
-
if (limitDb !== undefined &&
|
|
95
|
-
(!Number.isFinite(limitDb) || limitDb < 0 || limitDb > 60)) {
|
|
96
|
-
throw new Error(`${what}: limitDb is dB from 0 to 60, not ${String(limitDb)}`);
|
|
97
|
-
}
|
|
98
|
-
if (fade !== undefined &&
|
|
99
|
-
(!Number.isFinite(fade) || fade < 0 || fade > 1)) {
|
|
100
|
-
throw new Error(`${what}: fade is seconds from 0 to 1, not ${String(fade)}`);
|
|
101
|
-
}
|
|
102
|
-
return makeTake({
|
|
103
|
-
...spec,
|
|
104
|
-
room: {
|
|
105
|
-
...(from === undefined || to === undefined ? {} : { from, to }),
|
|
106
|
-
...(match === undefined ? {} : { match }),
|
|
107
|
-
...(gainDb === undefined ? {} : { gainDb }),
|
|
108
|
-
...(limitDb === undefined ? {} : { limitDb }),
|
|
109
|
-
...(fade === undefined ? {} : { fade }),
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
/**
|
|
116
|
-
* Speech from a recording, audio or video, with its word times beside it
|
|
117
|
-
* (`<name>.words.json`: allyhub transcribe <file> makes it). An import, or a
|
|
118
|
-
* path relative to the piece's file.
|
|
119
|
-
*/
|
|
120
|
-
export function take(file) {
|
|
121
|
-
return makeTake({ kind: "take", file });
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* Text to speech: `allyhub voice generate` makes the file
|
|
125
|
-
* (assets/media/gen/say/<hash>) with its words; the check reports a say without
|
|
126
|
-
* one (AK-T002). Text from s(key) is read aloud as the message's `speak`.
|
|
127
|
-
*/
|
|
128
|
-
export function say(text, opts = {}) {
|
|
129
|
-
const params = opts.params;
|
|
130
|
-
if (params !== undefined) {
|
|
131
|
-
if (typeof params !== "object" ||
|
|
132
|
-
params === null ||
|
|
133
|
-
Array.isArray(params)) {
|
|
134
|
-
throw new Error("say() params is not an object: give the voice tool's extra input as { name: value }.");
|
|
135
|
-
}
|
|
136
|
-
const bad = notJson(params, "params");
|
|
137
|
-
if (bad !== undefined) {
|
|
138
|
-
throw new Error(`say() ${bad} is not plain JSON: use strings, finite numbers, booleans, null, arrays and plain objects.`);
|
|
139
|
-
}
|
|
140
|
-
for (const [key, instead] of [
|
|
141
|
-
["text", "say()'s text"],
|
|
142
|
-
["voiceId", "the voice option"],
|
|
143
|
-
]) {
|
|
144
|
-
if (key in params) {
|
|
145
|
-
throw new Error(`say() params.${key} is not allowed: give it as ${instead}.`);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
return {
|
|
150
|
-
[SPEECH_BRAND]: true,
|
|
151
|
-
kind: "say",
|
|
152
|
-
text,
|
|
153
|
-
...(opts.voice === undefined ? {} : { voice: opts.voice }),
|
|
154
|
-
...(opts.tool === undefined ? {} : { tool: opts.tool }),
|
|
155
|
-
...(params && Object.keys(params).length > 0
|
|
156
|
-
? { params: structuredClone(params) }
|
|
157
|
-
: {}),
|
|
158
|
-
};
|
|
159
|
-
}
|
|
160
|
-
const isMediaRef = (v) => typeof v === "string" ||
|
|
161
|
-
(typeof v === "object" && v !== null && (MEDIA_BRAND in v || "sha256" in v));
|
|
162
|
-
const isFraction = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0 && v <= 1;
|
|
163
|
-
/** A point as fractions (0–1), or a thrown error naming the option. */
|
|
164
|
-
function checkPoint(name, p) {
|
|
165
|
-
if (p === undefined)
|
|
166
|
-
return;
|
|
167
|
-
const ok = typeof p === "object" &&
|
|
168
|
-
p !== null &&
|
|
169
|
-
isFraction(p.x) &&
|
|
170
|
-
isFraction(p.y);
|
|
171
|
-
if (!ok) {
|
|
172
|
-
throw new Error(`footage() ${name} ${JSON.stringify(p)} is not a point { x, y } with each from 0 to 1.`);
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
/** Seconds over 0 and up to 5, or a thrown error naming the option. */
|
|
176
|
-
function checkSeconds(name, v) {
|
|
177
|
-
if (v === undefined)
|
|
178
|
-
return;
|
|
179
|
-
if (typeof v !== "number" || !(v > 0) || v > 30) {
|
|
180
|
-
throw new Error(`footage() ${name} ${JSON.stringify(v)} is not seconds over 0 and up to 30.`);
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
function checkEase(name, v) {
|
|
184
|
-
if (v === undefined || EASES.includes(v))
|
|
185
|
-
return;
|
|
186
|
-
throw new Error(`footage() ${name} ${JSON.stringify(v)} is not one of ${EASES.map((e) => `"${e}"`).join(", ")}.`);
|
|
187
|
-
}
|
|
188
|
-
function checkReframe(r) {
|
|
189
|
-
if (r === undefined || r === "face" || r === "center")
|
|
190
|
-
return;
|
|
191
|
-
if (typeof r === "object" && r !== null && "face" in r) {
|
|
192
|
-
const o = r;
|
|
193
|
-
if (o.face !== true) {
|
|
194
|
-
throw new Error(`footage() reframe ${JSON.stringify(r)}: face is true, as in { face: true, faceY: 0.4 }.`);
|
|
195
|
-
}
|
|
196
|
-
if (o.faceY !== undefined && !isFraction(o.faceY)) {
|
|
197
|
-
throw new Error(`footage() reframe faceY ${JSON.stringify(o.faceY)} is not from 0 (the crop's top) to 1 (its bottom); 0.4 is a little above the middle.`);
|
|
198
|
-
}
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
if (typeof r === "object" && r !== null && "x" in r) {
|
|
202
|
-
checkPoint("reframe", r);
|
|
203
|
-
return;
|
|
204
|
-
}
|
|
205
|
-
throw new Error(`footage() reframe ${JSON.stringify(r)} is not "face", { face: true, faceY }, "center" or a point { x, y }.`);
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* A layer's `background`: its numbers in range, and a colour or an image,
|
|
209
|
-
* not both (a colour leaves nothing to blur, dim or desaturate).
|
|
210
|
-
*/
|
|
211
|
-
function checkBackground(b) {
|
|
212
|
-
if (b === undefined)
|
|
213
|
-
return;
|
|
214
|
-
if (typeof b !== "object" || b === null || Array.isArray(b)) {
|
|
215
|
-
throw new Error(`footage() background ${JSON.stringify(b)} is not an object such as { blur: 24 }, { dim: 0.4, desaturate: 1 }, { color: "#101418" } or { image: "./backdrop.jpg" }.`);
|
|
216
|
-
}
|
|
217
|
-
const o = b;
|
|
218
|
-
const known = [
|
|
219
|
-
"blur",
|
|
220
|
-
"dim",
|
|
221
|
-
"desaturate",
|
|
222
|
-
"color",
|
|
223
|
-
"image",
|
|
224
|
-
"feather",
|
|
225
|
-
"shrink",
|
|
226
|
-
];
|
|
227
|
-
const other = Object.keys(o).find((k) => !known.includes(k));
|
|
228
|
-
if (other !== undefined) {
|
|
229
|
-
throw new Error(`footage() background has no option "${other}": it takes ${known.join(", ")}.`);
|
|
230
|
-
}
|
|
231
|
-
const num = (v) => typeof v === "number" && Number.isFinite(v);
|
|
232
|
-
if (o["blur"] !== undefined &&
|
|
233
|
-
!(num(o["blur"]) && o["blur"] >= 0 && o["blur"] <= BACKDROP_BLUR_MAX)) {
|
|
234
|
-
throw new Error(`footage() background blur ${JSON.stringify(o["blur"])} is not a number from 0 to ${String(BACKDROP_BLUR_MAX)}: the blur's standard deviation in px at 1080p (24 is a soft room).`);
|
|
235
|
-
}
|
|
236
|
-
for (const k of ["dim", "desaturate"]) {
|
|
237
|
-
if (o[k] !== undefined && !isFraction(o[k])) {
|
|
238
|
-
throw new Error(`footage() background ${k} ${JSON.stringify(o[k])} is not a number from 0 (as it is) to 1.`);
|
|
239
|
-
}
|
|
240
|
-
}
|
|
241
|
-
if (o["color"] !== undefined &&
|
|
242
|
-
(typeof o["color"] !== "string" || o["color"].trim() === "")) {
|
|
243
|
-
throw new Error(`footage() background color ${JSON.stringify(o["color"])} is not a CSS colour such as "#101418", "var(--ak-color-bg)" or "transparent".`);
|
|
244
|
-
}
|
|
245
|
-
if (o["image"] !== undefined && !isMediaRef(o["image"])) {
|
|
246
|
-
throw new Error(`footage() background image ${JSON.stringify(o["image"])} is not an image: a path relative to the piece, or an imported file.`);
|
|
247
|
-
}
|
|
248
|
-
if (o["color"] !== undefined && o["image"] !== undefined) {
|
|
249
|
-
throw new Error("footage() background takes a color or an image, not both.");
|
|
250
|
-
}
|
|
251
|
-
if (o["color"] !== undefined) {
|
|
252
|
-
const over = ["blur", "dim", "desaturate"].find((k) => o[k] !== undefined);
|
|
253
|
-
if (over !== undefined) {
|
|
254
|
-
throw new Error(`footage() background ${over} does nothing with a color, which replaces the background: leave one out.`);
|
|
255
|
-
}
|
|
256
|
-
}
|
|
257
|
-
if (o["feather"] !== undefined &&
|
|
258
|
-
!(num(o["feather"]) &&
|
|
259
|
-
o["feather"] >= 0 &&
|
|
260
|
-
o["feather"] <= MATTE_FEATHER_MAX)) {
|
|
261
|
-
throw new Error(`footage() background feather ${JSON.stringify(o["feather"])} is not a number from 0 to ${String(MATTE_FEATHER_MAX)}: the softness of the person's edge in px at 1080p (2 by default).`);
|
|
262
|
-
}
|
|
263
|
-
if (o["shrink"] !== undefined &&
|
|
264
|
-
!(num(o["shrink"]) && Math.abs(o["shrink"]) <= MATTE_SHRINK_MAX)) {
|
|
265
|
-
throw new Error(`footage() background shrink ${JSON.stringify(o["shrink"])} is not a number from −${String(MATTE_SHRINK_MAX)} to ${String(MATTE_SHRINK_MAX)}: how far the person's edge is pulled in, px at 1080p (4 by default).`);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* A box, or each box key, lies in the frame: a box is the part of the
|
|
270
|
-
* frame the picture shows in, so one reaching past it would be cut to the
|
|
271
|
-
* frame and a push-in written as a box larger than the frame would not move.
|
|
272
|
-
*/
|
|
273
|
-
function checkBoxes(box) {
|
|
274
|
-
if (box === undefined || box === "full" || !Array.isArray(box))
|
|
275
|
-
return;
|
|
276
|
-
const rects = box.length > 0 && typeof box[0] === "object"
|
|
277
|
-
? box.map((k) => k.box)
|
|
278
|
-
: [box];
|
|
279
|
-
const e = 1e-6;
|
|
280
|
-
for (const r of rects) {
|
|
281
|
-
if (r === "full" || !Array.isArray(r) || r.length !== 4)
|
|
282
|
-
continue;
|
|
283
|
-
const [x, y, w, h] = r;
|
|
284
|
-
if ([x, y, w, h].every((v) => typeof v === "number" && Number.isFinite(v)) &&
|
|
285
|
-
(x ?? 0) >= -e &&
|
|
286
|
-
(y ?? 0) >= -e &&
|
|
287
|
-
(w ?? 0) > 0 &&
|
|
288
|
-
(h ?? 0) > 0 &&
|
|
289
|
-
(x ?? 0) + (w ?? 0) <= 1 + e &&
|
|
290
|
-
(y ?? 0) + (h ?? 0) <= 1 + e) {
|
|
291
|
-
continue;
|
|
292
|
-
}
|
|
293
|
-
throw new Error(`footage() box ${JSON.stringify(r)} is not inside the frame: [x, y, width, height] are fractions of it, with x + width and y + height at most 1. A box is where the picture shows, so it cannot grow past the frame; for a slow push in use punchIn, eased in over its \`in\` seconds centred on \`at\` ({ at: 4, in: 8, until: 8, scale: 1.07, ease: "linear" } pushes in over the first 8 s), and for a slow pull out pullback ({ scale: 1.07, dur: 8 }).`);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
/**
|
|
297
|
-
* The values an option holds: the one value, or a per-frame-shape
|
|
298
|
-
* object's ({ landscape, portrait, square, default }), whose keys are
|
|
299
|
-
* checked.
|
|
300
|
-
*/
|
|
301
|
-
function perOrient(name, v) {
|
|
302
|
-
if (v === undefined)
|
|
303
|
-
return [];
|
|
304
|
-
if (!isPerOrient(v))
|
|
305
|
-
return [v];
|
|
306
|
-
const keys = ORIENT_KEYS;
|
|
307
|
-
const unknown = Object.keys(v).filter((k) => !keys.includes(k));
|
|
308
|
-
if (unknown.length > 0) {
|
|
309
|
-
throw new Error(`footage() ${name} has ${unknown.map((k) => JSON.stringify(k)).join(", ")}, which is not a frame shape: a per-shape ${name} is { ${ORIENT_KEYS.join(", ")} } (each optional; an output takes the one for its orientation, else default).`);
|
|
310
|
-
}
|
|
311
|
-
return Object.values(v).filter((x) => x !== undefined);
|
|
312
|
-
}
|
|
313
|
-
/** A crop is a part of the source: [x, y, width, height] as fractions of it. */
|
|
314
|
-
function checkCrop(crop) {
|
|
315
|
-
const e = 1e-6;
|
|
316
|
-
const r = Array.isArray(crop) ? crop : [];
|
|
317
|
-
const [x, y, w, h] = r;
|
|
318
|
-
if (r.length === 4 &&
|
|
319
|
-
typeof x === "number" &&
|
|
320
|
-
typeof y === "number" &&
|
|
321
|
-
typeof w === "number" &&
|
|
322
|
-
typeof h === "number" &&
|
|
323
|
-
[x, y, w, h].every((v) => Number.isFinite(v)) &&
|
|
324
|
-
x >= -e &&
|
|
325
|
-
y >= -e &&
|
|
326
|
-
w > 0 &&
|
|
327
|
-
h > 0 &&
|
|
328
|
-
x + w <= 1 + e &&
|
|
329
|
-
y + h <= 1 + e) {
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
throw new Error(`footage() crop ${JSON.stringify(crop)} is not a part of the source: [x, y, width, height] are fractions of it, with x + width and y + height at most 1.`);
|
|
333
|
-
}
|
|
334
|
-
/**
|
|
335
|
-
* A video on the part: footage("./broll.mp4", { at: "inbox", dur: 1.5 }).
|
|
336
|
-
* Without a file it is the part's own take, in sync with its speech.
|
|
337
|
-
*/
|
|
338
|
-
export function footage(file, opts = {}) {
|
|
339
|
-
const o = file !== undefined && !isMediaRef(file) ? file : opts;
|
|
340
|
-
if (o.speed !== undefined &&
|
|
341
|
-
(!Number.isFinite(o.speed) || o.speed <= 0 || o.speed > 16)) {
|
|
342
|
-
throw new Error(`footage() speed ${String(o.speed)} is not a number over 0 and up to 16 (1 is normal speed).`);
|
|
343
|
-
}
|
|
344
|
-
if (o.sharpen !== undefined &&
|
|
345
|
-
(!Number.isFinite(o.sharpen) || o.sharpen < 0 || o.sharpen > 1)) {
|
|
346
|
-
throw new Error(`footage() sharpen ${String(o.sharpen)} is not a number from 0 to 1 (0.3 is gentle).`);
|
|
347
|
-
}
|
|
348
|
-
checkReframe(o.reframe);
|
|
349
|
-
if (o.speaker !== undefined &&
|
|
350
|
-
(!Number.isInteger(o.speaker) || o.speaker < 0)) {
|
|
351
|
-
throw new Error(`footage() speaker ${String(o.speaker)} is not a face id (a whole number from 0, as allyhub index lists them).`);
|
|
352
|
-
}
|
|
353
|
-
for (const p of o.punchIn ?? []) {
|
|
354
|
-
const scale = typeof p === "object"
|
|
355
|
-
? p.scale
|
|
356
|
-
: /@(\d*\.\d+)$/.exec(String(p))?.[1] !== undefined
|
|
357
|
-
? Number(/@(\d*\.\d+)$/.exec(String(p))?.[1])
|
|
358
|
-
: undefined;
|
|
359
|
-
if (scale !== undefined && (!(scale > 1) || scale > 3)) {
|
|
360
|
-
throw new Error(`footage() punchIn scale ${String(scale)} is not over 1 and up to 3 (1.12 is a gentle punch-in).`);
|
|
361
|
-
}
|
|
362
|
-
if (typeof p === "object") {
|
|
363
|
-
checkSeconds("punchIn in", p.in);
|
|
364
|
-
checkSeconds("punchIn out", p.out);
|
|
365
|
-
checkEase("punchIn ease", p.ease);
|
|
366
|
-
checkPoint("punchIn center", p.center);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
if (typeof o.pullback === "object") {
|
|
370
|
-
const { scale, dur } = o.pullback;
|
|
371
|
-
if (scale !== undefined && (!(scale > 1) || scale > 3)) {
|
|
372
|
-
throw new Error(`footage() pullback scale ${String(scale)} is not over 1 and up to 3 (1.12 is a gentle pullback).`);
|
|
373
|
-
}
|
|
374
|
-
if (dur !== undefined && (!(dur > 0) || dur > 10)) {
|
|
375
|
-
throw new Error(`footage() pullback dur ${String(dur)} is not seconds over 0 and up to 10.`);
|
|
376
|
-
}
|
|
377
|
-
checkEase("pullback ease", o.pullback.ease);
|
|
378
|
-
checkPoint("pullback center", o.pullback.center);
|
|
379
|
-
}
|
|
380
|
-
if (o.shape !== undefined &&
|
|
381
|
-
o.shape !== "rect" &&
|
|
382
|
-
o.shape !== "circle") {
|
|
383
|
-
throw new Error(`footage() shape ${JSON.stringify(o.shape)} is not "rect" or "circle".`);
|
|
384
|
-
}
|
|
385
|
-
if (o.radius !== undefined &&
|
|
386
|
-
(typeof o.radius !== "number" || !Number.isFinite(o.radius) || o.radius < 0)) {
|
|
387
|
-
throw new Error(`footage() radius ${JSON.stringify(o.radius)} is not a number from 0: the corners' radius, px at 1080p (24 is a soft card corner).`);
|
|
388
|
-
}
|
|
389
|
-
if (o.radius !== undefined && o.radius > 0 && o.shape === "circle") {
|
|
390
|
-
throw new Error('footage(): radius rounds the corners of a rect; shape "circle" has none. Use one of them.');
|
|
391
|
-
}
|
|
392
|
-
const boxes = perOrient("box", o.box);
|
|
393
|
-
for (const b of boxes)
|
|
394
|
-
checkBoxes(b);
|
|
395
|
-
for (const c of perOrient("crop", o.crop))
|
|
396
|
-
checkCrop(c);
|
|
397
|
-
checkBackground(o.background);
|
|
398
|
-
if (boxes.some((b) => Array.isArray(b) && b.length > 0 && typeof b[0] === "object")) {
|
|
399
|
-
if (o.reframe !== undefined ||
|
|
400
|
-
o.punchIn?.length ||
|
|
401
|
-
(o.pullback !== undefined && o.pullback !== false)) {
|
|
402
|
-
throw new Error("footage(): a keyframed box cannot be reframed, punched in or pulled back; use a still box, or keyframes without reframe, punchIn and pullback.");
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
if (file !== undefined && !isMediaRef(file)) {
|
|
406
|
-
return { [LAYER_BRAND]: "footage", ...file };
|
|
407
|
-
}
|
|
408
|
-
return {
|
|
409
|
-
[LAYER_BRAND]: "footage",
|
|
410
|
-
...(file === undefined ? {} : { file }),
|
|
411
|
-
...opts,
|
|
412
|
-
};
|
|
413
|
-
}
|
|
414
|
-
//# sourceMappingURL=parts.js.map
|
|
1
|
+
/*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
|
|
2
|
+
import{shapeProblem as R,voiceProblem as T}from"@allyhub-next/audio";import{BACKDROP_BLUR_MAX as $,EASES as E,LAYER_BRAND as h,MATTE_FEATHER_MAX as S,MATTE_SHRINK_MAX as l,MEDIA_BRAND as _,ORIENT_KEYS as N,PART_BRAND as M,SPEECH_BRAND as g,isPerOrient as Y,notJson as G,partAnchorsProblem as C,speechSpeedProblem as O,transitionProblem as q}from"@allyhub-next/video-core";import{enginePiece as x,isItemPiece as j}from"./piece.js";export const partFor=r=>e=>{const{key:o,layers:n,...i}=e;if(typeof o!="string"||o==="")throw new Error("part: every part needs a key");if(i.title!==void 0&&(typeof i.title!="string"||i.title.trim()===""))throw new Error(`part ${o}: title is a name, not ${JSON.stringify(i.title)}`);for(const a of["before","after"]){const s=e.overlap?.[a];if(s!==void 0&&(!Number.isFinite(s)||s<0||s>10))throw new Error(`part ${o}: overlap.${a} is seconds from 0 to 10, not ${String(s)}`)}for(const[a,s]of(e.sounds??[]).entries()){if(!(typeof s=="object"&&(typeof s.at=="string"||typeof s.at=="number")&&(typeof s.sound=="string"||typeof s.sound=="object"&&"path"in s.sound)))throw new Error(`part ${o}: sounds[${String(a)}] is { at, sound, gainDb? }: at a word reference or seconds, sound a name or an audio file`);if(s.gainDb!==void 0&&(!Number.isFinite(s.gainDb)||s.gainDb<-60||s.gainDb>24))throw new Error(`part ${o}: sounds[${String(a)}].gainDb is dB from -60 to 24, not ${String(s.gainDb)}`);if(s.shape!==void 0){const f=R(s.shape);if(f!==void 0)throw new Error(`part ${o}: sounds[${String(a)}].shape: ${f}`)}}if(e.speechGainDb!==void 0&&(typeof e.speechGainDb!="number"||!Number.isFinite(e.speechGainDb)||e.speechGainDb<-40||e.speechGainDb>24))throw new Error(`part ${o}: speechGainDb is dB from -40 to 24, not ${String(e.speechGainDb)}`);if(e.anchors!==void 0){const a=C(e.anchors);if(a!==void 0)throw new Error(`part ${o}: anchors ${a}`)}if(e.transition!==void 0){const a=q(e.transition);if(a!==void 0)throw new Error(`part ${o}: transition ${a}`)}if(e.mic!==void 0){const a=T(e.mic);if(a!==void 0)throw new Error(`part ${o}: ${a}`)}if(e.post!==void 0){const a=e.post.filter;if(typeof a!="string"||a.trim()==="")throw new Error(`part ${o}: post: post is { filter: an ffmpeg filter chain }`)}const t=e.speech?.kind==="take"||e.speech?.kind==="say"?e.speech.tempo??1:1;if(t!==1&&(n??[]).some(a=>a[h]==="footage"&&a.file===void 0&&a.video===void 0))throw new Error(`part ${o}: footage() shows the part's take, which plays at speed ${String(t)}; a take's picture is drawn only at its own speed. Play the take at speed 1, or show other footage.`);return{[M]:!0,key:o,layers:n??[],...i,base:r.base}};function m(r,...e){const o={...r};for(const n of e)Reflect.deleteProperty(o,n);return o}function A(r,e){const o=i=>A(r,i);return{...{[g]:!0,...e},range(i,t){const a=m(e,"line","from","to");return o({...a,from:i,...t===void 0?{}:{to:t}})},saying(i){return o({...m(e,"from","to"),line:i})},edits(i){if(typeof i!="string"||!/\.json$/i.test(i))throw new Error(`take(…).edits(path): a JSON file relative to the file that names it, such as "./edits/host.json" (not ${JSON.stringify(i)})`);return o({...e,editsFile:i,editsBase:r.base})},speed(i){const t=O(i);if(t!==void 0)throw new Error(`take(…).speed(times): ${t}`);const a=m(e,"tempo");return o(i===1?a:{...a,tempo:i})},denoise(i=12){if(!Number.isFinite(i)||i<=0||i>97)throw new Error(`take(…).denoise(db): the noise reduction in dB, over 0 and up to 97 (not ${String(i)})`);return o({...e,denoiseDb:i})},roomTone(i){if(i===!1)return o({...e,room:!1});const t="take(…).roomTone(tone): false, or { from, to, match, gainDb, limitDb, fade }";if(typeof i!="object"||Array.isArray(i))throw new Error(`${t} (not ${JSON.stringify(i)})`);const{from:a,to:s,match:d,gainDb:f,limitDb:u,fade:c}=i,k=Object.keys(i).filter(P=>!["from","to","match","gainDb","limitDb","fade"].includes(P));if(k.length>0)throw new Error(`${t}: it has no ${k.join(", ")}`);if((a!==void 0||s!==void 0)&&(a===void 0||s===void 0||!Number.isFinite(a)||!Number.isFinite(s)||a<0||s-a<.05))throw new Error(`${t}: from and to are seconds of the file, both given, at least 0.05 s apart`);if(d!==void 0&&typeof d!="boolean")throw new Error(`${t}: match is true or false`);if(f!==void 0&&(!Number.isFinite(f)||f<-60||f>24))throw new Error(`${t}: gainDb is dB from -60 to 24, not ${String(f)}`);if(u!==void 0&&(!Number.isFinite(u)||u<0||u>60))throw new Error(`${t}: limitDb is dB from 0 to 60, not ${String(u)}`);if(c!==void 0&&(!Number.isFinite(c)||c<0||c>1))throw new Error(`${t}: fade is seconds from 0 to 1, not ${String(c)}`);return o({...e,room:{...a===void 0||s===void 0?{}:{from:a,to:s},...d===void 0?{}:{match:d},...f===void 0?{}:{gainDb:f},...u===void 0?{}:{limitDb:u},...c===void 0?{}:{fade:c}}})}}}export function takeFor(r){function e(o){return j(o)?J({kind:"video",piece:x(o)}):A(r,{kind:"take",file:o,...typeof o=="string"?{fileBase:r.base}:{}})}return e}const D=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0||typeof r=="string"&&r.trim()!=="";function J(r){return{[g]:!0,...r,range(e,o){for(const[n,i]of[["from",e],["to",o]])if(i!==void 0&&!D(i))throw new Error(`take(video).range(from, to): ${n} is seconds from 0, an anchor ("@turn") or a part's key (not ${JSON.stringify(i)}).`);if(typeof e=="number"&&typeof o=="number"&&!(o>e))throw new Error(`take(video).range(${String(e)}, ${String(o)}): to comes after from.`);return J({...r,from:e,...o===void 0?{}:{to:o}})}}}export function say(r,e={}){if(e.speed!==void 0){const n=O(e.speed);if(n!==void 0)throw new Error(`say(): ${n}`)}const o=e.params;if(o!==void 0){if(typeof o!="object"||o===null||Array.isArray(o))throw new Error("say() params is not an object: give the voice tool's extra input as { name: value }.");const n=G(o,"params");if(n!==void 0)throw new Error(`say() ${n} is not plain JSON: use strings, finite numbers, booleans, null, arrays and plain objects.`);for(const[i,t]of[["text","say()'s text"],["voiceId","the voice option"]])if(i in o)throw new Error(`say() params.${i} is not allowed: give it as ${t}.`)}return{[g]:!0,kind:"say",text:r,...e.voice===void 0?{}:{voice:e.voice},...e.tool===void 0?{}:{tool:e.tool},...o&&Object.keys(o).length>0?{params:structuredClone(o)}:{},...e.speed===void 0||e.speed===1?{}:{tempo:e.speed}}}const b=r=>typeof r=="string"||typeof r=="object"&&r!==null&&(_ in r||"sha256"in r),p=r=>typeof r=="number"&&Number.isFinite(r)&&r>=0&&r<=1;function w(r,e){if(e===void 0)return;if(!(typeof e=="object"&&e!==null&&p(e.x)&&p(e.y)))throw new Error(`footage() ${r} ${JSON.stringify(e)} is not a point { x, y } with each from 0 to 1.`)}function F(r,e){if(e!==void 0&&(typeof e!="number"||!(e>0)||e>30))throw new Error(`footage() ${r} ${JSON.stringify(e)} is not seconds over 0 and up to 30.`)}function v(r,e){if(!(e===void 0||E.includes(e)))throw new Error(`footage() ${r} ${JSON.stringify(e)} is not one of ${E.map(o=>`"${o}"`).join(", ")}.`)}function H(r){if(!(r===void 0||r==="face"||r==="center")){if(typeof r=="object"&&r!==null&&"face"in r){const e=r;if(e.face!==!0)throw new Error(`footage() reframe ${JSON.stringify(r)}: face is true, as in { face: true, faceY: 0.4 }.`);if(e.faceY!==void 0&&!p(e.faceY))throw new Error(`footage() reframe faceY ${JSON.stringify(e.faceY)} is not from 0 (the crop's top) to 1 (its bottom); 0.4 is a little above the middle.`);return}if(typeof r=="object"&&r!==null&&"x"in r){w("reframe",r);return}throw new Error(`footage() reframe ${JSON.stringify(r)} is not "face", { face: true, faceY }, "center" or a point { x, y }.`)}}function K(r){if(r===void 0)return;if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`footage() background ${JSON.stringify(r)} is not an object such as { blur: 24 }, { dim: 0.4, desaturate: 1 }, { color: "#101418" } or { image: "./backdrop.jpg" }.`);const e=r,o=["blur","dim","desaturate","color","image","feather","shrink"],n=Object.keys(e).find(t=>!o.includes(t));if(n!==void 0)throw new Error(`footage() background has no option "${n}": it takes ${o.join(", ")}.`);const i=t=>typeof t=="number"&&Number.isFinite(t);if(e.blur!==void 0&&!(i(e.blur)&&e.blur>=0&&e.blur<=$))throw new Error(`footage() background blur ${JSON.stringify(e.blur)} is not a number from 0 to ${String($)}: the blur's standard deviation in px at 1080p (24 is a soft room).`);for(const t of["dim","desaturate"])if(e[t]!==void 0&&!p(e[t]))throw new Error(`footage() background ${t} ${JSON.stringify(e[t])} is not a number from 0 (as it is) to 1.`);if(e.color!==void 0&&(typeof e.color!="string"||e.color.trim()===""))throw new Error(`footage() background color ${JSON.stringify(e.color)} is not a CSS colour such as "#101418", "var(--ak-color-bg)" or "transparent".`);if(e.image!==void 0&&!b(e.image))throw new Error(`footage() background image ${JSON.stringify(e.image)} is not an image: a path relative to the piece, or an imported file.`);if(e.color!==void 0&&e.image!==void 0)throw new Error("footage() background takes a color or an image, not both.");if(e.color!==void 0){const t=["blur","dim","desaturate"].find(a=>e[a]!==void 0);if(t!==void 0)throw new Error(`footage() background ${t} does nothing with a color, which replaces the background: leave one out.`)}if(e.feather!==void 0&&!(i(e.feather)&&e.feather>=0&&e.feather<=S))throw new Error(`footage() background feather ${JSON.stringify(e.feather)} is not a number from 0 to ${String(S)}: the softness of the person's edge in px at 1080p (2 by default).`);if(e.shrink!==void 0&&!(i(e.shrink)&&Math.abs(e.shrink)<=l))throw new Error(`footage() background shrink ${JSON.stringify(e.shrink)} is not a number from −${String(l)} to ${String(l)}: how far the person's edge is pulled in, px at 1080p (4 by default).`)}function I(r){if(r===void 0||r==="full"||!Array.isArray(r))return;const e=r.length>0&&typeof r[0]=="object"?r.map(n=>n.box):[r],o=1e-6;for(const n of e){if(n==="full"||!Array.isArray(n)||n.length!==4)continue;const[i,t,a,s]=n;if(!([i,t,a,s].every(d=>typeof d=="number"&&Number.isFinite(d))&&(i??0)>=-o&&(t??0)>=-o&&(a??0)>0&&(s??0)>0&&(i??0)+(a??0)<=1+o&&(t??0)+(s??0)<=1+o))throw new Error(`footage() box ${JSON.stringify(n)} is not inside the frame: [x, y, width, height] are fractions of it, with x + width and y + height at most 1. A box is where the picture shows, so it cannot grow past the frame; for a slow push in use punchIn, eased in over its \`in\` seconds centred on \`at\` ({ at: 4, in: 8, until: 8, scale: 1.07, ease: "linear" } pushes in over the first 8 s), and for a slow pull out pullback ({ scale: 1.07, dur: 8 }).`)}}function y(r,e){if(e===void 0)return[];if(!Y(e))return[e];const o=N,n=Object.keys(e).filter(i=>!o.includes(i));if(n.length>0)throw new Error(`footage() ${r} has ${n.map(i=>JSON.stringify(i)).join(", ")}, which is not a frame shape: a per-shape ${r} is { ${N.join(", ")} } (each optional; an output takes the one for its orientation, else default).`);return Object.values(e).filter(i=>i!==void 0)}function X(r){const o=Array.isArray(r)?r:[],[n,i,t,a]=o;if(!(o.length===4&&typeof n=="number"&&typeof i=="number"&&typeof t=="number"&&typeof a=="number"&&[n,i,t,a].every(s=>Number.isFinite(s))&&n>=-1e-6&&i>=-1e-6&&t>0&&a>0&&n+t<=1+1e-6&&i+a<=1+1e-6))throw new Error(`footage() crop ${JSON.stringify(r)} is not a part of the source: [x, y, width, height] are fractions of it, with x + width and y + height at most 1.`)}function B(r){if(r===void 0)return;const e=r.scale;if(e!==void 0&&!(Number.isFinite(e)&&e>0&&e<=4))throw new Error(`footage() quality.scale ${String(e)} is outside (0, 4]: 0.5 is the fastest, 1 every pixel.`)}function L(r,e){const o=["crop","reframe","speaker","punchIn","sharpen","pullback","background","shape","radius"].filter(n=>e[n]!==void 0);if(o.length>0)throw new Error(`footage() of a video item takes at, until, dur, from, speed, box, fit, audio, gainDb, camera, cameras and quality; not ${o.join(", ")}.`);if(e.from!==void 0&&!D(e.from))throw new Error(`footage() from ${JSON.stringify(e.from)} is seconds from 0, an anchor ("@click") or a part's key of the video.`);if(e.speed!==void 0&&(!Number.isFinite(e.speed)||e.speed<=0||e.speed>16))throw new Error(`footage() speed ${String(e.speed)} is not a number over 0 and up to 16 (1 is normal speed).`);if(e.audio===!0&&e.speed!==void 0&&e.speed!==1)throw new Error("footage() of a video item plays its sound only at its own speed: speed 1, or audio off.");for(const n of y("box",e.box))I(n);return B(e.quality),{[h]:"footage",video:r,...e}}export const footageFor=r=>(e,o={})=>{if(j(e))return L(x(e),o);const n=e!==void 0&&!b(e)?e:o;if(typeof n.from=="string")throw new Error(`footage() from ${JSON.stringify(n.from)}: a file's from is seconds; a reference is a video item's.`);if(B(n.quality),n.speed!==void 0&&(!Number.isFinite(n.speed)||n.speed<=0||n.speed>16))throw new Error(`footage() speed ${String(n.speed)} is not a number over 0 and up to 16 (1 is normal speed).`);if(n.sharpen!==void 0&&(!Number.isFinite(n.sharpen)||n.sharpen<0||n.sharpen>1))throw new Error(`footage() sharpen ${String(n.sharpen)} is not a number from 0 to 1 (0.3 is gentle).`);if(H(n.reframe),n.speaker!==void 0&&(!Number.isInteger(n.speaker)||n.speaker<0))throw new Error(`footage() speaker ${String(n.speaker)} is not a face id (a whole number from 0, as allyhub frames --overlay labels them).`);for(const t of n.punchIn??[]){const a=typeof t=="object"?t.scale:/@(\d*\.\d+)$/.exec(String(t))?.[1]!==void 0?Number(/@(\d*\.\d+)$/.exec(String(t))?.[1]):void 0;if(a!==void 0&&(!(a>1)||a>3))throw new Error(`footage() punchIn scale ${String(a)} is not over 1 and up to 3 (1.12 is a gentle punch-in).`);typeof t=="object"&&(F("punchIn in",t.in),F("punchIn out",t.out),v("punchIn ease",t.ease),w("punchIn center",t.center))}if(typeof n.pullback=="object"){const{scale:t,dur:a}=n.pullback;if(t!==void 0&&(!(t>1)||t>3))throw new Error(`footage() pullback scale ${String(t)} is not over 1 and up to 3 (1.12 is a gentle pullback).`);if(a!==void 0&&(!(a>0)||a>10))throw new Error(`footage() pullback dur ${String(a)} is not seconds over 0 and up to 10.`);v("pullback ease",n.pullback.ease),w("pullback center",n.pullback.center)}if(n.shape!==void 0&&n.shape!=="rect"&&n.shape!=="circle")throw new Error(`footage() shape ${JSON.stringify(n.shape)} is not "rect" or "circle".`);if(n.radius!==void 0&&(typeof n.radius!="number"||!Number.isFinite(n.radius)||n.radius<0))throw new Error(`footage() radius ${JSON.stringify(n.radius)} is not a number from 0: the corners' radius, px at 1080p (24 is a soft card corner).`);if(n.radius!==void 0&&n.radius>0&&n.shape==="circle")throw new Error('footage(): radius rounds the corners of a rect; shape "circle" has none. Use one of them.');const i=y("box",n.box);for(const t of i)I(t);for(const t of y("crop",n.crop))X(t);if(K(n.background),i.some(t=>Array.isArray(t)&&t.length>0&&typeof t[0]=="object")&&(n.reframe!==void 0||n.punchIn?.length||n.pullback!==void 0&&n.pullback!==!1))throw new Error("footage(): a keyframed box cannot be reframed, punched in or pulled back; use a still box, or keyframes without reframe, punchIn and pullback.");return e!==void 0&&!b(e)?{[h]:"footage",...e,base:r.base}:{[h]:"footage",...e===void 0?{}:{file:e},...o,base:r.base}};
|
package/dist/paths.d.ts
CHANGED
|
@@ -61,7 +61,7 @@ export interface DrawOn {
|
|
|
61
61
|
/**
|
|
62
62
|
* The stroke-dash values that show the first `progress` (0–1, clamped) of
|
|
63
63
|
* the path's stroke: 0 shows none of it, 1 all of it. Set them in render
|
|
64
|
-
* from an eased progress: `css(path, drawOn(d, ease.out(progress(t, 0.2, 1))))`.
|
|
64
|
+
* from an eased progress: `css(path, { ...drawOn(d, ease.out(progress(t, 0.2, 1))) })`.
|
|
65
65
|
* The gap is twice the length, so a browser that measures the path a little
|
|
66
66
|
* longer never shows the next dash.
|
|
67
67
|
*/
|