@open-take/compositor 0.5.3 → 0.6.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/dist/cdp-CzT5BKNY.js +3 -0
- package/dist/cdp-QXbQfXna.js +373 -0
- package/dist/cdp-QXbQfXna.js.map +1 -0
- package/dist/index.d.ts +4327 -195
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +26282 -160
- package/dist/index.js.map +1 -1
- package/dist/server-841PMF2H.js +163 -0
- package/dist/server-841PMF2H.js.map +1 -0
- package/dist/server-C2aVv4-t.js +3 -0
- package/kit/audio.mjs +2366 -0
- package/kit/camera.js +587 -0
- package/kit/cursor.js +264 -0
- package/kit/cut.js +427 -0
- package/kit/draw.js +346 -0
- package/kit/look.js +589 -0
- package/kit/map.js +170 -0
- package/kit/media.js +3568 -0
- package/kit/motion.js +1115 -0
- package/kit/seams.js +1006 -0
- package/kit/stage.js +923 -0
- package/kit/time.js +812 -0
- package/kit/world.js +1072 -0
- package/package.json +7 -3
- package/src/ffmpeg.ts +63 -0
- package/src/film/beats.ts +1285 -0
- package/src/film/carry.ts +221 -0
- package/src/film/changes.ts +330 -0
- package/src/film/check.ts +996 -0
- package/src/film/clock.ts +2530 -0
- package/src/film/components-probe.ts +809 -0
- package/src/film/components.ts +1566 -0
- package/src/film/frames.ts +389 -0
- package/src/film/gallery.ts +3276 -0
- package/src/film/kit.ts +515 -0
- package/src/film/layout.ts +701 -0
- package/src/film/listen.ts +1979 -0
- package/src/film/look.ts +3829 -0
- package/src/film/materials.ts +976 -0
- package/src/film/moving.ts +248 -0
- package/src/film/part-files.ts +729 -0
- package/src/film/picture.ts +74 -0
- package/src/film/probe-text.ts +843 -0
- package/src/film/probe.ts +3456 -0
- package/src/film/provenance.ts +596 -0
- package/src/film/render.ts +2447 -0
- package/src/film/report.ts +1631 -0
- package/src/film/sheet.ts +156 -0
- package/src/film/study-declared.ts +123 -0
- package/src/film/study-picture.ts +791 -0
- package/src/film/study-sound.ts +416 -0
- package/src/film/study.ts +864 -0
- package/src/film/tuning.ts +155 -0
- package/src/film/viewer.ts +174 -0
- package/src/html/cdp.ts +575 -0
- package/src/html/server.ts +208 -0
- package/src/index.ts +202 -0
- package/src/launch-render.ts +3 -2
- package/src/math.ts +3 -3
- package/src/mjpeg-matroska.ts +228 -0
- package/src/render.ts +6 -4
- package/src/state-diff.ts +215 -0
- package/src/state-index.ts +99 -0
- package/src/types.ts +59 -1
- package/starter/PLAN.md +84 -0
- package/starter/START.md +460 -0
- package/starter/lib/anim.js +760 -0
- package/starter/lib/devices.js +1402 -0
- package/starter/lib/handoff.js +421 -0
- package/starter/lib/hud.js +1879 -0
- package/starter/lib/measure.mjs +154 -0
- package/starter/lib/moves.js +1095 -0
- package/starter/lib/palette.mjs +803 -0
- package/starter/lib/physics-seeds.mjs +198 -0
- package/starter/lib/physics.js +738 -0
- package/starter/lib/sampler.mjs +242 -0
- package/starter/lib/solid.js +727 -0
- package/starter/lib/space.js +1227 -0
- package/starter/lib/swarm.js +1398 -0
- package/starter/reference/motion.md +276 -0
- package/starter/reference/structure.md +466 -0
- package/starter/reference/travel/motion.md +433 -0
- package/starter/reference/travel/sound.md +241 -0
- package/starter/reference/travel/structure.md +518 -0
- package/starter/samples/NOTICE.txt +55 -0
- package/starter/samples/celli/celli_24_1.opus +0 -0
- package/starter/samples/celli/celli_24_3.opus +0 -0
- package/starter/samples/celli/celli_28_1.opus +0 -0
- package/starter/samples/celli/celli_28_3.opus +0 -0
- package/starter/samples/celli/celli_31_1.opus +0 -0
- package/starter/samples/celli/celli_31_3.opus +0 -0
- package/starter/samples/celli/celli_35_1.opus +0 -0
- package/starter/samples/celli/celli_35_3.opus +0 -0
- package/starter/samples/celli/celli_38_1.opus +0 -0
- package/starter/samples/celli/celli_38_3.opus +0 -0
- package/starter/samples/celli/celli_41_1.opus +0 -0
- package/starter/samples/celli/celli_41_3.opus +0 -0
- package/starter/samples/celli/celli_45_1.opus +0 -0
- package/starter/samples/celli/celli_45_3.opus +0 -0
- package/starter/samples/celli/celli_48_1.opus +0 -0
- package/starter/samples/celli/celli_48_3.opus +0 -0
- package/starter/samples/celli/celli_52_1.opus +0 -0
- package/starter/samples/celli/celli_52_3.opus +0 -0
- package/starter/samples/celli/celli_55_1.opus +0 -0
- package/starter/samples/celli/celli_55_3.opus +0 -0
- package/starter/samples/celli/celli_59_1.opus +0 -0
- package/starter/samples/celli/celli_59_3.opus +0 -0
- package/starter/samples/celli/celli_62_1.opus +0 -0
- package/starter/samples/celli/celli_62_3.opus +0 -0
- package/starter/samples/celli/celli_65_1.opus +0 -0
- package/starter/samples/celli/celli_65_3.opus +0 -0
- package/starter/samples/crash/crash_f_1.flac +0 -0
- package/starter/samples/crash/crash_fff_1.flac +0 -0
- package/starter/samples/ebass/ebass_0_x.flac +0 -0
- package/starter/samples/ebass/ebass_10_x.flac +0 -0
- package/starter/samples/ebass/ebass_11_x.flac +0 -0
- package/starter/samples/ebass/ebass_1_x.flac +0 -0
- package/starter/samples/ebass/ebass_2_x.flac +0 -0
- package/starter/samples/ebass/ebass_3_x.flac +0 -0
- package/starter/samples/ebass/ebass_4_x.flac +0 -0
- package/starter/samples/ebass/ebass_5_x.flac +0 -0
- package/starter/samples/ebass/ebass_6_x.flac +0 -0
- package/starter/samples/ebass/ebass_7_x.flac +0 -0
- package/starter/samples/ebass/ebass_8_x.flac +0 -0
- package/starter/samples/ebass/ebass_9_x.flac +0 -0
- package/starter/samples/ek_clap/ek_clap_1_1.flac +0 -0
- package/starter/samples/ek_hat/ek_hat_1_1.flac +0 -0
- package/starter/samples/ek_hat/ek_hat_1_2.flac +0 -0
- package/starter/samples/ek_kick/ek_kick_1_1.flac +0 -0
- package/starter/samples/ek_kick/ek_kick_1_2.flac +0 -0
- package/starter/samples/glock/glock_67_x.flac +0 -0
- package/starter/samples/glock/glock_72_x.flac +0 -0
- package/starter/samples/glock/glock_79_x.flac +0 -0
- package/starter/samples/glock/glock_84_x.flac +0 -0
- package/starter/samples/glock/glock_91_x.flac +0 -0
- package/starter/samples/glock/glock_96_x.flac +0 -0
- package/starter/samples/harp/harp_101_f.opus +0 -0
- package/starter/samples/harp/harp_28_f.opus +0 -0
- package/starter/samples/harp/harp_31_mp.opus +0 -0
- package/starter/samples/harp/harp_35_mf.opus +0 -0
- package/starter/samples/harp/harp_38_mf.opus +0 -0
- package/starter/samples/harp/harp_41_mf.opus +0 -0
- package/starter/samples/harp/harp_45_mf.opus +0 -0
- package/starter/samples/harp/harp_48_mf.opus +0 -0
- package/starter/samples/harp/harp_52_mf.opus +0 -0
- package/starter/samples/harp/harp_55_mf.opus +0 -0
- package/starter/samples/harp/harp_59_mf.opus +0 -0
- package/starter/samples/harp/harp_62_mf.opus +0 -0
- package/starter/samples/harp/harp_65_mf.opus +0 -0
- package/starter/samples/harp/harp_69_mf.opus +0 -0
- package/starter/samples/harp/harp_72_mf.opus +0 -0
- package/starter/samples/harp/harp_76_mf.opus +0 -0
- package/starter/samples/harp/harp_79_mf.opus +0 -0
- package/starter/samples/harp/harp_83_mf.opus +0 -0
- package/starter/samples/harp/harp_86_mf.opus +0 -0
- package/starter/samples/harp/harp_89_mf.opus +0 -0
- package/starter/samples/harp/harp_93_mf.opus +0 -0
- package/starter/samples/harp/harp_95_mf.opus +0 -0
- package/starter/samples/harp/harp_98_f.opus +0 -0
- package/starter/samples/manifest.json +2951 -0
- package/starter/samples/marimba/marimba_29_x.flac +0 -0
- package/starter/samples/marimba/marimba_36_x.flac +0 -0
- package/starter/samples/marimba/marimba_43_x.flac +0 -0
- package/starter/samples/marimba/marimba_47_x.flac +0 -0
- package/starter/samples/marimba/marimba_53_x.flac +0 -0
- package/starter/samples/marimba/marimba_60_x.flac +0 -0
- package/starter/samples/marimba/marimba_67_x.flac +0 -0
- package/starter/samples/marimba/marimba_71_x.flac +0 -0
- package/starter/samples/marimba/marimba_77_x.flac +0 -0
- package/starter/samples/marimba/marimba_84_x.flac +0 -0
- package/starter/samples/piano/piano_102_12.opus +0 -0
- package/starter/samples/piano/piano_102_16.opus +0 -0
- package/starter/samples/piano/piano_102_4.opus +0 -0
- package/starter/samples/piano/piano_102_8.opus +0 -0
- package/starter/samples/piano/piano_105_12.opus +0 -0
- package/starter/samples/piano/piano_105_16.opus +0 -0
- package/starter/samples/piano/piano_105_4.opus +0 -0
- package/starter/samples/piano/piano_105_8.opus +0 -0
- package/starter/samples/piano/piano_108_12.opus +0 -0
- package/starter/samples/piano/piano_108_16.opus +0 -0
- package/starter/samples/piano/piano_108_4.opus +0 -0
- package/starter/samples/piano/piano_108_8.opus +0 -0
- package/starter/samples/piano/piano_21_12.opus +0 -0
- package/starter/samples/piano/piano_21_16.opus +0 -0
- package/starter/samples/piano/piano_21_4.opus +0 -0
- package/starter/samples/piano/piano_21_8.opus +0 -0
- package/starter/samples/piano/piano_24_12.opus +0 -0
- package/starter/samples/piano/piano_24_16.opus +0 -0
- package/starter/samples/piano/piano_24_4.opus +0 -0
- package/starter/samples/piano/piano_24_8.opus +0 -0
- package/starter/samples/piano/piano_27_12.opus +0 -0
- package/starter/samples/piano/piano_27_16.opus +0 -0
- package/starter/samples/piano/piano_27_4.opus +0 -0
- package/starter/samples/piano/piano_27_8.opus +0 -0
- package/starter/samples/piano/piano_30_12.opus +0 -0
- package/starter/samples/piano/piano_30_16.opus +0 -0
- package/starter/samples/piano/piano_30_4.opus +0 -0
- package/starter/samples/piano/piano_30_8.opus +0 -0
- package/starter/samples/piano/piano_33_12.opus +0 -0
- package/starter/samples/piano/piano_33_16.opus +0 -0
- package/starter/samples/piano/piano_33_4.opus +0 -0
- package/starter/samples/piano/piano_33_8.opus +0 -0
- package/starter/samples/piano/piano_36_12.opus +0 -0
- package/starter/samples/piano/piano_36_16.opus +0 -0
- package/starter/samples/piano/piano_36_4.opus +0 -0
- package/starter/samples/piano/piano_36_8.opus +0 -0
- package/starter/samples/piano/piano_39_12.opus +0 -0
- package/starter/samples/piano/piano_39_16.opus +0 -0
- package/starter/samples/piano/piano_39_4.opus +0 -0
- package/starter/samples/piano/piano_39_8.opus +0 -0
- package/starter/samples/piano/piano_42_12.opus +0 -0
- package/starter/samples/piano/piano_42_16.opus +0 -0
- package/starter/samples/piano/piano_42_4.opus +0 -0
- package/starter/samples/piano/piano_42_8.opus +0 -0
- package/starter/samples/piano/piano_45_12.opus +0 -0
- package/starter/samples/piano/piano_45_16.opus +0 -0
- package/starter/samples/piano/piano_45_4.opus +0 -0
- package/starter/samples/piano/piano_45_8.opus +0 -0
- package/starter/samples/piano/piano_48_12.opus +0 -0
- package/starter/samples/piano/piano_48_16.opus +0 -0
- package/starter/samples/piano/piano_48_4.opus +0 -0
- package/starter/samples/piano/piano_48_8.opus +0 -0
- package/starter/samples/piano/piano_51_12.opus +0 -0
- package/starter/samples/piano/piano_51_16.opus +0 -0
- package/starter/samples/piano/piano_51_4.opus +0 -0
- package/starter/samples/piano/piano_51_8.opus +0 -0
- package/starter/samples/piano/piano_54_12.opus +0 -0
- package/starter/samples/piano/piano_54_16.opus +0 -0
- package/starter/samples/piano/piano_54_4.opus +0 -0
- package/starter/samples/piano/piano_54_8.opus +0 -0
- package/starter/samples/piano/piano_57_12.opus +0 -0
- package/starter/samples/piano/piano_57_16.opus +0 -0
- package/starter/samples/piano/piano_57_4.opus +0 -0
- package/starter/samples/piano/piano_57_8.opus +0 -0
- package/starter/samples/piano/piano_60_12.opus +0 -0
- package/starter/samples/piano/piano_60_16.opus +0 -0
- package/starter/samples/piano/piano_60_4.opus +0 -0
- package/starter/samples/piano/piano_60_8.opus +0 -0
- package/starter/samples/piano/piano_63_12.opus +0 -0
- package/starter/samples/piano/piano_63_16.opus +0 -0
- package/starter/samples/piano/piano_63_4.opus +0 -0
- package/starter/samples/piano/piano_63_8.opus +0 -0
- package/starter/samples/piano/piano_66_12.opus +0 -0
- package/starter/samples/piano/piano_66_16.opus +0 -0
- package/starter/samples/piano/piano_66_4.opus +0 -0
- package/starter/samples/piano/piano_66_8.opus +0 -0
- package/starter/samples/piano/piano_69_12.opus +0 -0
- package/starter/samples/piano/piano_69_16.opus +0 -0
- package/starter/samples/piano/piano_69_4.opus +0 -0
- package/starter/samples/piano/piano_69_8.opus +0 -0
- package/starter/samples/piano/piano_72_12.opus +0 -0
- package/starter/samples/piano/piano_72_16.opus +0 -0
- package/starter/samples/piano/piano_72_4.opus +0 -0
- package/starter/samples/piano/piano_72_8.opus +0 -0
- package/starter/samples/piano/piano_75_12.opus +0 -0
- package/starter/samples/piano/piano_75_16.opus +0 -0
- package/starter/samples/piano/piano_75_4.opus +0 -0
- package/starter/samples/piano/piano_75_8.opus +0 -0
- package/starter/samples/piano/piano_78_12.opus +0 -0
- package/starter/samples/piano/piano_78_16.opus +0 -0
- package/starter/samples/piano/piano_78_4.opus +0 -0
- package/starter/samples/piano/piano_78_8.opus +0 -0
- package/starter/samples/piano/piano_81_12.opus +0 -0
- package/starter/samples/piano/piano_81_16.opus +0 -0
- package/starter/samples/piano/piano_81_4.opus +0 -0
- package/starter/samples/piano/piano_81_8.opus +0 -0
- package/starter/samples/piano/piano_84_12.opus +0 -0
- package/starter/samples/piano/piano_84_16.opus +0 -0
- package/starter/samples/piano/piano_84_4.opus +0 -0
- package/starter/samples/piano/piano_84_8.opus +0 -0
- package/starter/samples/piano/piano_87_12.opus +0 -0
- package/starter/samples/piano/piano_87_16.opus +0 -0
- package/starter/samples/piano/piano_87_4.opus +0 -0
- package/starter/samples/piano/piano_87_8.opus +0 -0
- package/starter/samples/piano/piano_90_12.opus +0 -0
- package/starter/samples/piano/piano_90_16.opus +0 -0
- package/starter/samples/piano/piano_90_4.opus +0 -0
- package/starter/samples/piano/piano_90_8.opus +0 -0
- package/starter/samples/piano/piano_93_12.opus +0 -0
- package/starter/samples/piano/piano_93_16.opus +0 -0
- package/starter/samples/piano/piano_93_4.opus +0 -0
- package/starter/samples/piano/piano_93_8.opus +0 -0
- package/starter/samples/piano/piano_96_12.opus +0 -0
- package/starter/samples/piano/piano_96_16.opus +0 -0
- package/starter/samples/piano/piano_96_4.opus +0 -0
- package/starter/samples/piano/piano_96_8.opus +0 -0
- package/starter/samples/piano/piano_99_12.opus +0 -0
- package/starter/samples/piano/piano_99_16.opus +0 -0
- package/starter/samples/piano/piano_99_4.opus +0 -0
- package/starter/samples/piano/piano_99_8.opus +0 -0
- package/starter/samples/piano/piano_rel_102_x.opus +0 -0
- package/starter/samples/piano/piano_rel_105_x.opus +0 -0
- package/starter/samples/piano/piano_rel_108_x.opus +0 -0
- package/starter/samples/piano/piano_rel_21_x.opus +0 -0
- package/starter/samples/piano/piano_rel_24_x.opus +0 -0
- package/starter/samples/piano/piano_rel_27_x.opus +0 -0
- package/starter/samples/piano/piano_rel_30_x.opus +0 -0
- package/starter/samples/piano/piano_rel_33_x.opus +0 -0
- package/starter/samples/piano/piano_rel_36_x.opus +0 -0
- package/starter/samples/piano/piano_rel_39_x.opus +0 -0
- package/starter/samples/piano/piano_rel_42_x.opus +0 -0
- package/starter/samples/piano/piano_rel_45_x.opus +0 -0
- package/starter/samples/piano/piano_rel_48_x.opus +0 -0
- package/starter/samples/piano/piano_rel_51_x.opus +0 -0
- package/starter/samples/piano/piano_rel_54_x.opus +0 -0
- package/starter/samples/piano/piano_rel_57_x.opus +0 -0
- package/starter/samples/piano/piano_rel_60_x.opus +0 -0
- package/starter/samples/piano/piano_rel_63_x.opus +0 -0
- package/starter/samples/piano/piano_rel_66_x.opus +0 -0
- package/starter/samples/piano/piano_rel_69_x.opus +0 -0
- package/starter/samples/piano/piano_rel_72_x.opus +0 -0
- package/starter/samples/piano/piano_rel_75_x.opus +0 -0
- package/starter/samples/piano/piano_rel_78_x.opus +0 -0
- package/starter/samples/piano/piano_rel_81_x.opus +0 -0
- package/starter/samples/piano/piano_rel_84_x.opus +0 -0
- package/starter/samples/piano/piano_rel_87_x.opus +0 -0
- package/starter/samples/piano/piano_rel_90_x.opus +0 -0
- package/starter/samples/piano/piano_rel_93_x.opus +0 -0
- package/starter/samples/piano/piano_rel_96_x.opus +0 -0
- package/starter/samples/piano/piano_rel_99_x.opus +0 -0
- package/starter/samples/pizz/pizz_24_2.flac +0 -0
- package/starter/samples/pizz/pizz_28_2.flac +0 -0
- package/starter/samples/pizz/pizz_31_2.flac +0 -0
- package/starter/samples/pizz/pizz_35_2.flac +0 -0
- package/starter/samples/pizz/pizz_38_2.flac +0 -0
- package/starter/samples/pizz/pizz_41_2.flac +0 -0
- package/starter/samples/pizz/pizz_45_2.flac +0 -0
- package/starter/samples/pizz/pizz_48_2.flac +0 -0
- package/starter/samples/pizz/pizz_52_2.flac +0 -0
- package/starter/samples/pizz/pizz_57_2.flac +0 -0
- package/starter/samples/pizz/pizz_60_2.flac +0 -0
- package/starter/samples/pizz/pizz_64_2.flac +0 -0
- package/starter/samples/pizz/pizz_67_2.flac +0 -0
- package/starter/samples/pizz/pizz_71_2.flac +0 -0
- package/starter/samples/pizz/pizz_74_2.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_2_1.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_2_2.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_6_1.flac +0 -0
- package/starter/samples/pk_hat/pk_hat_6_2.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_3_1.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_3_2.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_7_1.flac +0 -0
- package/starter/samples/pk_kick/pk_kick_7_2.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_3_1.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_3_2.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_6_1.flac +0 -0
- package/starter/samples/pk_ohat/pk_ohat_6_2.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_2_1.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_2_2.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_5_1.flac +0 -0
- package/starter/samples/pk_rim/pk_rim_5_2.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_3_1.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_3_2.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_7_1.flac +0 -0
- package/starter/samples/pk_snare/pk_snare_7_2.flac +0 -0
- package/starter/samples/shaker/shaker_1_1.flac +0 -0
- package/starter/samples/shaker/shaker_2_1.flac +0 -0
- package/starter/samples/snap/snap_r_1.flac +0 -0
- package/starter/samples/snap/snap_r_2.flac +0 -0
- package/starter/samples/snap/snap_r_3.flac +0 -0
- package/starter/samples/snap/snap_r_4.flac +0 -0
- package/starter/samples/snap/snap_r_5.flac +0 -0
- package/starter/samples/snap/snap_r_6.flac +0 -0
- package/starter/samples/tom/tom_3_1.flac +0 -0
- package/starter/samples/tom/tom_3_2.flac +0 -0
- package/starter/samples/tom/tom_4_1.flac +0 -0
- package/starter/samples/tom/tom_4_2.flac +0 -0
- package/starter/samples/vibes/vibes_41_1.opus +0 -0
- package/starter/samples/vibes/vibes_41_2.opus +0 -0
- package/starter/samples/vibes/vibes_45_1.opus +0 -0
- package/starter/samples/vibes/vibes_45_2.opus +0 -0
- package/starter/samples/vibes/vibes_48_1.opus +0 -0
- package/starter/samples/vibes/vibes_48_2.opus +0 -0
- package/starter/samples/vibes/vibes_52_1.opus +0 -0
- package/starter/samples/vibes/vibes_52_2.opus +0 -0
- package/starter/samples/vibes/vibes_55_1.opus +0 -0
- package/starter/samples/vibes/vibes_55_2.opus +0 -0
- package/starter/samples/vibes/vibes_59_1.opus +0 -0
- package/starter/samples/vibes/vibes_59_2.opus +0 -0
- package/starter/samples/vibes/vibes_62_1.opus +0 -0
- package/starter/samples/vibes/vibes_62_2.opus +0 -0
- package/starter/samples/vibes/vibes_65_1.opus +0 -0
- package/starter/samples/vibes/vibes_65_2.opus +0 -0
- package/starter/samples/vibes/vibes_69_1.opus +0 -0
- package/starter/samples/vibes/vibes_69_2.opus +0 -0
- package/starter/samples/vibes/vibes_72_1.opus +0 -0
- package/starter/samples/vibes/vibes_72_2.opus +0 -0
- package/starter/samples/vibes/vibes_76_1.opus +0 -0
- package/starter/samples/vibes/vibes_76_2.opus +0 -0
- package/starter/samples/violas/violas_36_1.opus +0 -0
- package/starter/samples/violas/violas_36_2.opus +0 -0
- package/starter/samples/violas/violas_38_1.opus +0 -0
- package/starter/samples/violas/violas_38_2.opus +0 -0
- package/starter/samples/violas/violas_40_1.opus +0 -0
- package/starter/samples/violas/violas_40_2.opus +0 -0
- package/starter/samples/violas/violas_43_1.opus +0 -0
- package/starter/samples/violas/violas_43_2.opus +0 -0
- package/starter/samples/violas/violas_47_1.opus +0 -0
- package/starter/samples/violas/violas_47_2.opus +0 -0
- package/starter/samples/violas/violas_50_1.opus +0 -0
- package/starter/samples/violas/violas_50_2.opus +0 -0
- package/starter/samples/violas/violas_53_1.opus +0 -0
- package/starter/samples/violas/violas_53_2.opus +0 -0
- package/starter/samples/violas/violas_57_1.opus +0 -0
- package/starter/samples/violas/violas_57_2.opus +0 -0
- package/starter/samples/violas/violas_60_1.opus +0 -0
- package/starter/samples/violas/violas_60_2.opus +0 -0
- package/starter/samples/violas/violas_64_1.opus +0 -0
- package/starter/samples/violas/violas_64_2.opus +0 -0
- package/starter/samples/violas/violas_67_1.opus +0 -0
- package/starter/samples/violas/violas_67_2.opus +0 -0
- package/starter/samples/violas/violas_71_1.opus +0 -0
- package/starter/samples/violas/violas_71_2.opus +0 -0
- package/starter/samples/violas/violas_74_1.opus +0 -0
- package/starter/samples/violas/violas_74_2.opus +0 -0
- package/starter/samples/violins/violins_43_1.opus +0 -0
- package/starter/samples/violins/violins_43_2.opus +0 -0
- package/starter/samples/violins/violins_45_1.opus +0 -0
- package/starter/samples/violins/violins_45_2.opus +0 -0
- package/starter/samples/violins/violins_47_1.opus +0 -0
- package/starter/samples/violins/violins_47_2.opus +0 -0
- package/starter/samples/violins/violins_50_1.opus +0 -0
- package/starter/samples/violins/violins_50_2.opus +0 -0
- package/starter/samples/violins/violins_54_1.opus +0 -0
- package/starter/samples/violins/violins_54_2.opus +0 -0
- package/starter/samples/violins/violins_57_1.opus +0 -0
- package/starter/samples/violins/violins_57_2.opus +0 -0
- package/starter/samples/violins/violins_60_1.opus +0 -0
- package/starter/samples/violins/violins_60_2.opus +0 -0
- package/starter/samples/violins/violins_64_1.opus +0 -0
- package/starter/samples/violins/violins_64_2.opus +0 -0
- package/starter/samples/violins/violins_67_1.opus +0 -0
- package/starter/samples/violins/violins_67_2.opus +0 -0
- package/starter/samples/violins/violins_71_1.opus +0 -0
- package/starter/samples/violins/violins_71_2.opus +0 -0
- package/starter/samples/violins/violins_74_1.opus +0 -0
- package/starter/samples/violins/violins_74_2.opus +0 -0
- package/starter/samples/woodblock/woodblock_f_1.flac +0 -0
- package/starter/samples/woodblock/woodblock_f_2.flac +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -50,6 +50,35 @@ type CaptureEventBase = {
|
|
|
50
50
|
* branch is skipped (the director can't tell nav from popover on bbox alone —
|
|
51
51
|
* it says so in the beat's `reason`). */
|
|
52
52
|
changeCoverage?: number;
|
|
53
|
+
/** DOM STATES (opt-in `--states`): id of the state captured AFTER this
|
|
54
|
+
* action settled — `<take>.take/states/<state>/` holds its `state.html` +
|
|
55
|
+
* `index.json` (the page's live structure at that moment). Absent when the
|
|
56
|
+
* take was made without states. */
|
|
57
|
+
state?: string;
|
|
58
|
+
/** DOM STATES: the element id (in the state captured BEFORE this action,
|
|
59
|
+
* i.e. the previous event's `state`, or `s0`) whose box best matched this
|
|
60
|
+
* action's `box` (IoU ≥ 0.5) — the control that was acted on, addressable
|
|
61
|
+
* in that state's `index.json` / `data-ot-id`. Absent when no element
|
|
62
|
+
* matched or the event carries no box. */
|
|
63
|
+
target?: string;
|
|
64
|
+
/** CAPTURE-DERIVED (frame-diff pass): when the action's RESULT showed in the
|
|
65
|
+
* recording, on the capture timeline (ms) — the input time is `tMs`, and a
|
|
66
|
+
* result can come a second or more after it. `atMs`: the first frame where
|
|
67
|
+
* at least half of what finally changed in the dominant changed region has
|
|
68
|
+
* changed; `doneMs`: the first frame from which that region stays as it
|
|
69
|
+
* ends up. `box` is that region (viewport CSS px). Read off the encoded
|
|
70
|
+
* frames, so only as fine as what the screencast delivered. Absent when
|
|
71
|
+
* nothing measurable changed before the next action. */
|
|
72
|
+
result?: {
|
|
73
|
+
atMs: number;
|
|
74
|
+
doneMs: number;
|
|
75
|
+
box: BBox;
|
|
76
|
+
};
|
|
77
|
+
/** CAPTURE-DERIVED (settle probe): capture-timeline ms when the page's DOM,
|
|
78
|
+
* requests and timers last went quiet after this action — an estimate from
|
|
79
|
+
* page STRUCTURE (it cannot see paints inside a canvas or video). Absent
|
|
80
|
+
* when the probe saw no activity after the input, or was not running. */
|
|
81
|
+
settledMs?: number;
|
|
53
82
|
};
|
|
54
83
|
/** A click (or a type's focus-click): an instantaneous action at a point. */
|
|
55
84
|
type CaptureClick = CaptureEventBase & {
|
|
@@ -234,6 +263,48 @@ type CaptureLog = {
|
|
|
234
263
|
* beat's payoff had appeared, and `settleMs` is doing the whole job alone.
|
|
235
264
|
* Absent on an ordinary DOM app. */
|
|
236
265
|
paintedFrac?: number;
|
|
266
|
+
/** DOM STATES (opt-in `--states`): the page's UI structure saved at every
|
|
267
|
+
* settled moment — `s0` after the warmup, then one after each plan step's
|
|
268
|
+
* final hold. `dir` is relative to the take's working dir (`states`); each
|
|
269
|
+
* item has `states/<id>/state.html` (a self-contained, script-inert copy of
|
|
270
|
+
* the live page), `index.json` (`DomStateIndex`: url, viewport, scroll, the
|
|
271
|
+
* visible elements with boxes, the major layers) and `live.png` (the 1×
|
|
272
|
+
* reference screenshot). `fidelity` scores the state's re-render against
|
|
273
|
+
* that reference — `ok: false` means the film must use the video for this
|
|
274
|
+
* moment. Absent when the take was made without states. */
|
|
275
|
+
states?: {
|
|
276
|
+
dir: string;
|
|
277
|
+
items: {
|
|
278
|
+
id: string;
|
|
279
|
+
/** capture timeline ms when it was taken */
|
|
280
|
+
tMs: number;
|
|
281
|
+
/** plan step index it follows (absent for s0) */
|
|
282
|
+
step?: number;
|
|
283
|
+
fidelity?: {
|
|
284
|
+
psnr: number;
|
|
285
|
+
diffFrac: number;
|
|
286
|
+
ok: boolean;
|
|
287
|
+
};
|
|
288
|
+
/** CAPTURE-DERIVED (frame-diff pass): how the recording's frame at
|
|
289
|
+
* `tMs` lines up with this state's reference screenshot (`live.png`).
|
|
290
|
+
* `dx`,`dy`: where the state's content sits in the recording, CSS px
|
|
291
|
+
* (state point p shows at p + (dx, dy)); `meanDiff`: the mean grey
|
|
292
|
+
* difference (0..255) left at that shift, `diffFrac` the share of
|
|
293
|
+
* pixels still differing by more than 48 grey levels — compression
|
|
294
|
+
* and text antialiasing alone stay under that. Absent when it could
|
|
295
|
+
* not be measured. */
|
|
296
|
+
seam?: {
|
|
297
|
+
dx: number;
|
|
298
|
+
dy: number;
|
|
299
|
+
meanDiff: number;
|
|
300
|
+
diffFrac: number;
|
|
301
|
+
};
|
|
302
|
+
/** the page was still moving at this moment (it never went quiet, and
|
|
303
|
+
* its pixels moved): nothing was saved — reading a still of a moving
|
|
304
|
+
* page would stall the app being filmed, and misrepresent the moment */
|
|
305
|
+
moving?: true;
|
|
306
|
+
}[];
|
|
307
|
+
};
|
|
237
308
|
};
|
|
238
309
|
type ZoomDecision = {
|
|
239
310
|
/** selective: not every action zooms. Edit this to tune/remove. */
|
|
@@ -506,223 +577,4194 @@ type CameraConfig = {
|
|
|
506
577
|
* to tune by eye on real captures (frame-diff pass populates the input). */
|
|
507
578
|
pullOutCoverage: number;
|
|
508
579
|
};
|
|
509
|
-
declare const DEFAULT_CAMERA: CameraConfig;
|
|
510
|
-
type TakeComposition = {
|
|
511
|
-
output: {
|
|
580
|
+
declare const DEFAULT_CAMERA: CameraConfig;
|
|
581
|
+
type TakeComposition = {
|
|
582
|
+
output: {
|
|
583
|
+
width: number;
|
|
584
|
+
height: number;
|
|
585
|
+
fps: number;
|
|
586
|
+
};
|
|
587
|
+
source: {
|
|
588
|
+
videoUrl: string;
|
|
589
|
+
/** stage size the source video is DRAWN at (capture viewport CSS px) —
|
|
590
|
+
* the coordinate space of every event/bbox below. A Retina capture's
|
|
591
|
+
* file is denser (viewport × captureScale); the scene stretches it to
|
|
592
|
+
* this size, so the extra pixels only sharpen sampling under zoom. */
|
|
593
|
+
videoWidth: number;
|
|
594
|
+
videoHeight: number;
|
|
595
|
+
viewport: {
|
|
596
|
+
w: number;
|
|
597
|
+
h: number;
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
framing: FramingConfig;
|
|
601
|
+
cursor: CursorConfig;
|
|
602
|
+
/** camera motion blur; absent ⇒ off (renders exactly as before). */
|
|
603
|
+
motionBlur?: MotionBlurConfig;
|
|
604
|
+
/** cursor start, video-px */
|
|
605
|
+
start: Pt;
|
|
606
|
+
events: CompEvent[];
|
|
607
|
+
durationMs: number;
|
|
608
|
+
/** Head trim (ms of the composition timeline cut from the delivered mp4).
|
|
609
|
+
* Capture starts at navigation, so the first frames show the app before it
|
|
610
|
+
* painted (plus any cold-cache font swap) — trim them here instead of
|
|
611
|
+
* post-processing with ffmpeg, so the refine loop keeps applying to the file
|
|
612
|
+
* actually shipped. Event tMs values stay on the untrimmed timeline (the
|
|
613
|
+
* capture is the ground truth); only the delivered head moves. 0/absent =
|
|
614
|
+
* no trim. */
|
|
615
|
+
startMs?: number;
|
|
616
|
+
/** Viewer-facing captions, drawn bottom-center in SCREEN space (outside the
|
|
617
|
+
* camera — legible at any zoom) on EVERY render including the master.
|
|
618
|
+
* Persisted and hand-editable like any composition field; times are on the
|
|
619
|
+
* untrimmed composition timeline (same convention as zoom.inAtMs — a
|
|
620
|
+
* caption entirely inside the startMs head trim is never seen, and the
|
|
621
|
+
* validator says so). Seeded from the plan steps' `caption` fields by
|
|
622
|
+
* planComposition. */
|
|
623
|
+
captions?: Caption[];
|
|
624
|
+
/** optional opening title card over the establishing hold (see TitleCard) */
|
|
625
|
+
titleCard?: TitleCard;
|
|
626
|
+
/** render-time review decoration (badges/watermark/label); never persisted
|
|
627
|
+
* (render strips exactly this field — `captions` above deliberately IS
|
|
628
|
+
* persisted; it is content, not review scaffolding) */
|
|
629
|
+
review?: ReviewDecor;
|
|
630
|
+
};
|
|
631
|
+
/** True when motion blur is configured to actually do something — whether the
|
|
632
|
+
* delivery encode folds in the tmix shutter average (render.ts deliverMp4;
|
|
633
|
+
* OFF skips tmix but still runs the same single delivery encode). */
|
|
634
|
+
declare function motionBlurActive(mb: MotionBlurConfig | undefined): mb is MotionBlurConfig;
|
|
635
|
+
declare const DEFAULT_FRAMING: FramingConfig;
|
|
636
|
+
declare const DEFAULT_MOTION_BLUR: MotionBlurConfig;
|
|
637
|
+
declare const DEFAULT_CURSOR: CursorConfig; //#endregion
|
|
638
|
+
//#region src/validate.d.ts
|
|
639
|
+
|
|
640
|
+
//# sourceMappingURL=types.d.ts.map
|
|
641
|
+
type CompositionIssue = {
|
|
642
|
+
severity: "error" | "warn";
|
|
643
|
+
/** dotted/indexed field path, e.g. "events[3].zoom.scale" */
|
|
644
|
+
path: string;
|
|
645
|
+
message: string;
|
|
646
|
+
/** a concrete suggested correction the agent can apply */
|
|
647
|
+
fix?: string;
|
|
648
|
+
};
|
|
649
|
+
type ValidateOpts = {
|
|
650
|
+
/** soft ceiling on zoom scale — above it the pixels visibly soften (warn).
|
|
651
|
+
* Default 2.5 (the planner caps auto-zoom at 1.5; manual edits get headroom). */
|
|
652
|
+
maxScale?: number;
|
|
653
|
+
/** the ground-truth capture log. When given, action `tMs` is checked against
|
|
654
|
+
* it (capture-lock). Omit to skip that check. */
|
|
655
|
+
captureLog?: CaptureLog;
|
|
656
|
+
};
|
|
657
|
+
declare function validateComposition(comp: TakeComposition, opts?: ValidateOpts): CompositionIssue[];
|
|
658
|
+
/** Format issues for a human/agent log. Errors first. */
|
|
659
|
+
declare function formatIssues(issues: CompositionIssue[]): string;
|
|
660
|
+
|
|
661
|
+
//#endregion
|
|
662
|
+
//#region src/audit-cursor.d.ts
|
|
663
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
664
|
+
type AuditCursorOpts = {
|
|
665
|
+
/** ms after a beat's landing to sample (clamped inside the beat's hold) */
|
|
666
|
+
sampleAfterMs?: number;
|
|
667
|
+
/** max tolerated tip error, VIEWPORT px (default 6; good takes median 0.21) */
|
|
668
|
+
tolPx?: number;
|
|
669
|
+
};
|
|
670
|
+
type AuditRow = {
|
|
671
|
+
/** event index */
|
|
672
|
+
beat: number;
|
|
673
|
+
/** sample instant in the DELIVERED video (startMs head trim applied), s */
|
|
674
|
+
tSec: number;
|
|
675
|
+
/** expected cursor-tip position in the finished frame, output px */
|
|
676
|
+
expect: Pt;
|
|
677
|
+
/** best-match tip position, output px (absent when unverifiable) */
|
|
678
|
+
found?: Pt;
|
|
679
|
+
/** tip error in viewport px (output-px error / camera scale) */
|
|
680
|
+
errViewportPx?: number;
|
|
681
|
+
/** masked NCC score of the best match */
|
|
682
|
+
ncc?: number;
|
|
683
|
+
/** the expected tip is not in the delivered frame — unverifiable, never an error */
|
|
684
|
+
offscreen?: boolean;
|
|
685
|
+
};
|
|
686
|
+
type PredictedTip = {
|
|
687
|
+
/** event index */
|
|
688
|
+
beat: number;
|
|
689
|
+
/** sample instant on the composition (capture) timeline, ms */
|
|
690
|
+
sampleMs: number;
|
|
691
|
+
/** the same instant in the DELIVERED video (startMs head trim applied), s */
|
|
692
|
+
tSec: number;
|
|
693
|
+
/** expected cursor-tip position in the finished frame, output px */
|
|
694
|
+
expect: Pt;
|
|
695
|
+
/** camera scale at the sample instant (output px per video px) */
|
|
696
|
+
camScale: number;
|
|
697
|
+
/** the tip is not in the delivered frame (zoomed out of frame, or the head
|
|
698
|
+
* trim cut the sample) — unverifiable, never an error */
|
|
699
|
+
offscreen: boolean;
|
|
700
|
+
};
|
|
701
|
+
/** Where the compositor MEANT to draw the pointer tip, per pointer-landing
|
|
702
|
+
* beat, in finished-frame px — via the engine's own public math, so there is
|
|
703
|
+
* no second geometry to drift. */
|
|
704
|
+
declare function predictCursorTips(comp: TakeComposition, sampleAfterMs?: number): PredictedTip[];
|
|
705
|
+
/** Turn measured rows into issues (pure — unit-testable without a video). */
|
|
706
|
+
declare function auditIssues(rows: AuditRow[], tolPx?: number): CompositionIssue[];
|
|
707
|
+
/** Audit the drawn cursor of a delivered mp4 against the composition that
|
|
708
|
+
* rendered it. One row per pointer-landing beat; issues in the
|
|
709
|
+
* validateComposition shape ("error" = the render is wrong, "warn" = a beat
|
|
710
|
+
* the audit cannot see). */
|
|
711
|
+
declare function auditCursor(comp: TakeComposition, mp4Path: string, opts?: AuditCursorOpts): Promise<{
|
|
712
|
+
rows: AuditRow[];
|
|
713
|
+
issues: CompositionIssue[];
|
|
714
|
+
}>;
|
|
715
|
+
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region src/camera.d.ts
|
|
718
|
+
//# sourceMappingURL=audit-cursor.d.ts.map
|
|
719
|
+
/** One action, already mapped into video-px, handed to the director. */
|
|
720
|
+
type Beat = {
|
|
721
|
+
kind: "click" | "type" | "drag" | "scroll" | "hover" | "look" | "press" | "dropFiles";
|
|
722
|
+
tMs: number;
|
|
723
|
+
durationMs: number;
|
|
724
|
+
/** element bbox (for a drag: the path's bbox), video-px — or undefined for a
|
|
725
|
+
* bare press (no located element). */
|
|
726
|
+
box?: BBox;
|
|
727
|
+
/** the dominant region that changed after the action (frame-diff seam),
|
|
728
|
+
* video-px. Framed over `box` when present. */
|
|
729
|
+
effectBox?: BBox;
|
|
730
|
+
/** fraction of the frame that changed after the action, 0..1. */
|
|
731
|
+
changeCoverage?: number;
|
|
732
|
+
/** anchor / cursor rest point, video-px (for the reason only). */
|
|
733
|
+
point: Pt;
|
|
734
|
+
/** plan override; absent ⇒ "auto" (the director decides). */
|
|
735
|
+
intent: ZoomIntent;
|
|
736
|
+
/** short label (sel / note) for the cluster tag in the reason. */
|
|
737
|
+
label?: string;
|
|
738
|
+
/** press only: the key chord (for the Escape-dismissal rule). */
|
|
739
|
+
keys?: string;
|
|
740
|
+
};
|
|
741
|
+
/** The director's per-beat verdict. plan.ts adds `inAtMs` to make a full
|
|
742
|
+
* ZoomDecision. */
|
|
743
|
+
type Framing = {
|
|
744
|
+
enabled: boolean;
|
|
745
|
+
scale: number;
|
|
746
|
+
center: Pt;
|
|
747
|
+
reason: string;
|
|
748
|
+
};
|
|
749
|
+
/**
|
|
750
|
+
* Decide framing for every beat. `endMs` is when the last frame can hold until
|
|
751
|
+
* (for the min-hold check on the final segment). `rest` is the stage scale at
|
|
752
|
+
* full view.
|
|
753
|
+
*/
|
|
754
|
+
declare function directCamera(beats: Beat[], video: {
|
|
755
|
+
w: number;
|
|
756
|
+
h: number;
|
|
757
|
+
}, out: {
|
|
758
|
+
w: number;
|
|
759
|
+
h: number;
|
|
760
|
+
}, cam: CameraConfig, rest: number, endMs: number): Framing[];
|
|
761
|
+
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/ffmpeg.d.ts
|
|
764
|
+
//# sourceMappingURL=camera.d.ts.map
|
|
765
|
+
/** The ffmpeg-static release the managed builds come from. */
|
|
766
|
+
declare const FFMPEG_RELEASE = "b6.1.1";
|
|
767
|
+
/** The oldest ffmpeg among the managed builds. A system ffmpeg older than
|
|
768
|
+
* this is passed over: the managed builds are what the tests run on, and
|
|
769
|
+
* nothing older ever is. The pinned binaries' own `-version` banners (not the
|
|
770
|
+
* release's README assets, one of which is wrong) say: darwin-arm64 6.0,
|
|
771
|
+
* darwin-x64 6.1.1, linux 7.0.2, win32-x64 6.1.1. */
|
|
772
|
+
declare const FFMPEG_FLOOR: readonly [number, number];
|
|
773
|
+
type ManagedOpts = {
|
|
774
|
+
/** where to keep the build (tests point this at a temp dir) */
|
|
775
|
+
cacheDir?: string;
|
|
776
|
+
/** the fetch to download with (tests substitute a local one) */
|
|
777
|
+
fetchImpl?: typeof fetch;
|
|
778
|
+
/** progress lines go here (default: process.stderr) */
|
|
779
|
+
log?: (line: string) => void;
|
|
780
|
+
};
|
|
781
|
+
/** The managed ffmpeg regardless of what is on PATH — the build every
|
|
782
|
+
* zero-config install runs, so tests run against it too. */
|
|
783
|
+
declare const resolveManagedFfmpeg: (opts?: ManagedOpts) => Promise<string>;
|
|
784
|
+
declare const resolveManagedFfprobe: (opts?: ManagedOpts) => Promise<string>;
|
|
785
|
+
/** A binary named by OPEN_TAKE_FFMPEG / OPEN_TAKE_FFPROBE, taken as is once
|
|
786
|
+
* it runs. Renders chdir into their scratch dir before spawning, so a
|
|
787
|
+
* relative path is pinned now; a bare name keeps resolving through PATH. */
|
|
788
|
+
|
|
789
|
+
declare const resolveFfmpeg: () => Promise<string>;
|
|
790
|
+
declare const resolveFfprobe: () => Promise<string>;
|
|
791
|
+
/** What every delivered video is, as a filter that names it: limited-range
|
|
792
|
+
* BT.709 values with BT.709 primaries and sRGB's curve (iec61966-2-1). The
|
|
793
|
+
* pictures are screenshots and pages — sRGB — and the encode keeps their
|
|
794
|
+
* values; Chrome on macOS shows a video that names BT.709's curve, or none,
|
|
795
|
+
* through Apple's gamma (1.961), not as it decodes — grey 128 came out 139,
|
|
796
|
+
* #1d4d3c 32,86,70 — while one named sRGB shows as it decodes, as QuickTime
|
|
797
|
+
* does. It goes in the filter graph, after the conversion: ffmpeg 7+ takes
|
|
798
|
+
* an encoder's colour fields from its frames, over `-color_trc` and the
|
|
799
|
+
* rest, so on ffmpeg 8 a film named only by those flags came out with no
|
|
800
|
+
* curve or primaries at all. (The runtime names its captures the same way —
|
|
801
|
+
* see runtime/src/cdp.ts encodeFrames.) */
|
|
802
|
+
declare const SRGB_TAGS = "setparams=range=tv:colorspace=bt709:color_primaries=bt709:color_trc=iec61966-2-1";
|
|
803
|
+
|
|
804
|
+
//#endregion
|
|
805
|
+
//#region src/film/beats.d.ts
|
|
806
|
+
/** The encoder flags that name the same (for an ffmpeg that reads them). */
|
|
807
|
+
type Tempo = {
|
|
808
|
+
bpm: number;
|
|
809
|
+
/** seconds a beat, as fitted to the onsets */
|
|
810
|
+
periodS: number;
|
|
811
|
+
/** how strongly the onset strength repeats at this period: its
|
|
812
|
+
* autocorrelation there over at zero lag (0..1) */
|
|
813
|
+
strength: number;
|
|
814
|
+
/** the other periods that repeat almost as strongly (half, double…) */
|
|
815
|
+
alternatives: {
|
|
816
|
+
bpm: number;
|
|
817
|
+
strength: number;
|
|
818
|
+
}[];
|
|
819
|
+
/** the beat grid laid at this tempo, at the phase most onsets fall on */
|
|
820
|
+
beats: number[];
|
|
821
|
+
/** the share of beats with an onset within 40 ms */
|
|
822
|
+
gridFit: number;
|
|
823
|
+
/** the share of the sound within 40 ms of some onset: what gridFit would be
|
|
824
|
+
* for a grid laid anywhere */
|
|
825
|
+
chance: number;
|
|
826
|
+
/** false when the first half's period and the second half's differ by more
|
|
827
|
+
* than 0.4%: the beats then follow the onsets instead of one grid */
|
|
828
|
+
steady: boolean;
|
|
829
|
+
};
|
|
830
|
+
/** the period (60–200 BPM) at which the onset strength repeats most, and a
|
|
831
|
+
* beat grid at it: fitted to the onsets over the whole sound, on the beat the
|
|
832
|
+
* low end lands on, and following the onsets where the tempo does not hold;
|
|
833
|
+
* null when nothing repeats */
|
|
834
|
+
|
|
835
|
+
type Section = {
|
|
836
|
+
start: number;
|
|
837
|
+
end: number;
|
|
838
|
+
/** how sharply the texture changes at its start (0 for the first) */
|
|
839
|
+
change: number;
|
|
840
|
+
/** level (dBFS RMS, mean over the section's sounding frames) */
|
|
841
|
+
levelDb: number;
|
|
842
|
+
onsetsPerS: number;
|
|
843
|
+
/** spectral centre of mass (Hz) */
|
|
844
|
+
centroidHz: number;
|
|
845
|
+
};
|
|
846
|
+
/** where the texture changes: half-second blocks of band energy, compared
|
|
847
|
+
* with each other (cosine), and the boundaries where the blocks before stop
|
|
848
|
+
* resembling the blocks after (a checkerboard over the similarity matrix) */
|
|
849
|
+
|
|
850
|
+
type BeatsHow = "measured" | "estimated" | "not detected";
|
|
851
|
+
/** `<name>.beats.json`; times in seconds of the sound */
|
|
852
|
+
type FilmBeats = {
|
|
853
|
+
version: 1;
|
|
854
|
+
source: string;
|
|
855
|
+
duration: number;
|
|
856
|
+
tempo: {
|
|
857
|
+
bpm: number | null;
|
|
858
|
+
/** how far the grid sits on onsets above what chance gives: (gridFit −
|
|
859
|
+
* chance) / (1 − chance), 0..1 */
|
|
860
|
+
confidence: number;
|
|
861
|
+
label: BeatsHow;
|
|
862
|
+
periodS?: number;
|
|
863
|
+
/** the onset strength's autocorrelation at the period over zero lag */
|
|
864
|
+
strength?: number;
|
|
865
|
+
/** the share of beats with an onset within 40 ms */
|
|
866
|
+
gridFit?: number;
|
|
867
|
+
/** that share for a grid laid anywhere */
|
|
868
|
+
chance?: number;
|
|
869
|
+
steady?: boolean;
|
|
870
|
+
alternatives?: {
|
|
871
|
+
bpm: number;
|
|
872
|
+
strength: number;
|
|
873
|
+
}[];
|
|
874
|
+
};
|
|
875
|
+
beats: number[];
|
|
876
|
+
downbeats: number[];
|
|
877
|
+
bars: {
|
|
878
|
+
t: number;
|
|
879
|
+
index: number;
|
|
880
|
+
}[];
|
|
881
|
+
/** how the downbeats were chosen */
|
|
882
|
+
meter: {
|
|
883
|
+
beatsPerBar: number | null;
|
|
884
|
+
/** (agreement − chance) / (1 − chance), 0..1 */
|
|
885
|
+
confidence: number;
|
|
886
|
+
agreement: number;
|
|
887
|
+
chance: number;
|
|
888
|
+
label: BeatsHow;
|
|
889
|
+
};
|
|
890
|
+
sections: {
|
|
891
|
+
t: number;
|
|
892
|
+
end: number;
|
|
893
|
+
/** the section's level against the quietest (0) and loudest (1) section */
|
|
894
|
+
energy: number;
|
|
895
|
+
/** "drop" when a drop opens it */
|
|
896
|
+
label?: string;
|
|
897
|
+
levelDb: number;
|
|
898
|
+
onsetsPerS: number;
|
|
899
|
+
centroidHz: number;
|
|
900
|
+
}[];
|
|
901
|
+
drops: number[];
|
|
902
|
+
onsets: number[];
|
|
903
|
+
labels: Record<"duration" | "tempo" | "beats" | "downbeats" | "bars" | "sections" | "drops" | "onsets", BeatsHow>;
|
|
904
|
+
};
|
|
905
|
+
/** the whole analysis on mono samples at LISTEN_RATE */
|
|
906
|
+
|
|
907
|
+
type FilmBeatsOptions = {
|
|
908
|
+
/** any sound, or a film whose sound to read */
|
|
909
|
+
input: string;
|
|
910
|
+
/** default: `<input without extension>.beats.json` */
|
|
911
|
+
out?: string;
|
|
912
|
+
};
|
|
913
|
+
declare function filmBeats(opts: FilmBeatsOptions): Promise<{
|
|
914
|
+
out: string;
|
|
915
|
+
beats: FilmBeats;
|
|
916
|
+
}>;
|
|
917
|
+
declare function formatFilmBeats(b: FilmBeats): string;
|
|
918
|
+
|
|
919
|
+
//#endregion
|
|
920
|
+
//#region src/film/clock.d.ts
|
|
921
|
+
type FilmPageInfo = {
|
|
922
|
+
/** "render": the page draws any time on request (window.__render);
|
|
923
|
+
* "clock": it animates on its own and renders front to back */
|
|
924
|
+
mode: "render" | "clock";
|
|
925
|
+
duration: number | null;
|
|
926
|
+
width: number | null;
|
|
927
|
+
height: number | null;
|
|
928
|
+
fps: number | null;
|
|
929
|
+
audio: string | null;
|
|
930
|
+
/** the page has <audio> elements — they are not recorded */
|
|
931
|
+
audioElements: number;
|
|
932
|
+
/** libraries found running on their own tickers in clock mode */
|
|
933
|
+
tickers: ("GSAP" | "anime.js")[];
|
|
934
|
+
/** window.__film.marks as the page has them (see filmMarks) */
|
|
935
|
+
marks: unknown;
|
|
936
|
+
};
|
|
937
|
+
/** A moment the author means to look the way it does, in seconds of film
|
|
938
|
+
* time: `film check` lists what it finds there as marked, not as a defect. */
|
|
939
|
+
type FilmMark = {
|
|
940
|
+
at: number;
|
|
941
|
+
until: number;
|
|
942
|
+
what: string | null;
|
|
943
|
+
};
|
|
944
|
+
|
|
945
|
+
//#endregion
|
|
946
|
+
//#region src/film/layout.d.ts
|
|
947
|
+
/** window.__film.marks, checked: a list of { at, until?, what? } in seconds;
|
|
948
|
+
* a mark without `until` is the moment `at`. */
|
|
949
|
+
type LayoutFinding = {
|
|
950
|
+
kind: "text-over-text" | "text-over-badge" | "text-off-frame";
|
|
951
|
+
/** the two parties, described (the second is absent for text-off-frame) */
|
|
952
|
+
a: string;
|
|
953
|
+
b?: string;
|
|
954
|
+
/** where, in frame CSS px: x, y, w, h */
|
|
955
|
+
box: [number, number, number, number];
|
|
956
|
+
};
|
|
957
|
+
/** a finding that held, and from when to when (seconds, the film's own time) */
|
|
958
|
+
type LayoutSpan = LayoutFinding & {
|
|
959
|
+
from: number;
|
|
960
|
+
to: number;
|
|
961
|
+
};
|
|
962
|
+
|
|
963
|
+
//#endregion
|
|
964
|
+
//#region src/film/check.d.ts
|
|
965
|
+
type FilmCheckIssue = {
|
|
966
|
+
severity: "error" | "warn" | "info";
|
|
967
|
+
message: string;
|
|
968
|
+
};
|
|
969
|
+
type FilmCheck = {
|
|
970
|
+
file: string;
|
|
971
|
+
durationS: number;
|
|
972
|
+
video: {
|
|
973
|
+
codec: string;
|
|
974
|
+
profile: string | null;
|
|
975
|
+
width: number;
|
|
976
|
+
height: number;
|
|
977
|
+
fps: number;
|
|
978
|
+
pixFmt: string;
|
|
979
|
+
frames: number;
|
|
980
|
+
} | null;
|
|
981
|
+
audio: {
|
|
982
|
+
codec: string;
|
|
983
|
+
sampleRate: number;
|
|
984
|
+
channels: number;
|
|
985
|
+
/** integrated loudness, LUFS */
|
|
986
|
+
lufs: number | null;
|
|
987
|
+
/** loudness range, LU */
|
|
988
|
+
lra: number | null;
|
|
989
|
+
/** true peak, dBFS */
|
|
990
|
+
truePeak: number | null;
|
|
991
|
+
} | null;
|
|
992
|
+
/** seconds where one frame repeats inside motion */
|
|
993
|
+
stalls: number[];
|
|
994
|
+
/** runs of alternating still/moving frames: where they start and how many
|
|
995
|
+
* frames; with `every`, a frame held about every that many frames (held
|
|
996
|
+
* frames a few apart, four or more, rather than alternating) */
|
|
997
|
+
cadence: {
|
|
998
|
+
at: number;
|
|
999
|
+
frames: number;
|
|
1000
|
+
every?: number;
|
|
1001
|
+
}[];
|
|
1002
|
+
/** seconds of hard cuts */
|
|
1003
|
+
cuts: number[];
|
|
1004
|
+
/** frames unlike the frames on both sides: where they start and how many */
|
|
1005
|
+
flashes: {
|
|
1006
|
+
at: number;
|
|
1007
|
+
frames: number;
|
|
1008
|
+
}[];
|
|
1009
|
+
/** near-blank frames a shot starts on (or the film does): where, how many */
|
|
1010
|
+
blanks: {
|
|
1011
|
+
at: number;
|
|
1012
|
+
frames: number;
|
|
1013
|
+
}[];
|
|
1014
|
+
black: {
|
|
1015
|
+
start: number;
|
|
1016
|
+
end: number;
|
|
1017
|
+
}[];
|
|
1018
|
+
silences: {
|
|
1019
|
+
start: number;
|
|
1020
|
+
end: number;
|
|
1021
|
+
}[];
|
|
1022
|
+
/** seconds of isolated sample jumps */
|
|
1023
|
+
clicks: number[];
|
|
1024
|
+
/** what the page marks as intended, in the film's own time (its first frame is 0) */
|
|
1025
|
+
marks: FilmMark[];
|
|
1026
|
+
/** the page read for its layout (the size it was laid out at), when given */
|
|
1027
|
+
page: {
|
|
1028
|
+
file: string;
|
|
1029
|
+
width: number;
|
|
1030
|
+
height: number;
|
|
1031
|
+
every: number;
|
|
1032
|
+
} | null;
|
|
1033
|
+
/** text that collides or leaves the frame, from when to when; null without the page */
|
|
1034
|
+
layout: LayoutSpan[] | null;
|
|
1035
|
+
/** text drawn turned, skewed or mirrored: named, not read; null without the page */
|
|
1036
|
+
unreadText: string[] | null;
|
|
1037
|
+
/** the smallest text drawn — information, not a verdict; null without the page */
|
|
1038
|
+
smallestText: {
|
|
1039
|
+
px: number;
|
|
1040
|
+
at: number;
|
|
1041
|
+
text: string;
|
|
1042
|
+
} | null;
|
|
1043
|
+
/** the shoot logs and saved screens in the folder served to the page —
|
|
1044
|
+
* information; null without the page */
|
|
1045
|
+
material?: PageMaterial | null;
|
|
1046
|
+
/** what this check measured and what it does not: plain lines, no grade */
|
|
1047
|
+
scope?: FilmCheckScope;
|
|
1048
|
+
issues: FilmCheckIssue[];
|
|
1049
|
+
};
|
|
1050
|
+
type FilmCheckScope = {
|
|
1051
|
+
measured: string;
|
|
1052
|
+
notMeasured: string;
|
|
1053
|
+
};
|
|
1054
|
+
type FilmCheckExpect = {
|
|
1055
|
+
width?: number;
|
|
1056
|
+
height?: number;
|
|
1057
|
+
fps?: number;
|
|
1058
|
+
};
|
|
1059
|
+
/** the film's page, to read its layout over the film's time */
|
|
1060
|
+
type FilmCheckPage = {
|
|
1061
|
+
/** an .html file, or a directory holding index.html */
|
|
1062
|
+
page: string;
|
|
1063
|
+
/** the directory served to it (as for `film render`) */
|
|
1064
|
+
root?: string;
|
|
1065
|
+
chromePath: string;
|
|
1066
|
+
/** seconds between layout samples (default 0.25) */
|
|
1067
|
+
every?: number;
|
|
1068
|
+
onConsole?: (level: string, text: string) => void;
|
|
1069
|
+
};
|
|
1070
|
+
declare function checkFilm(file: string, expect?: FilmCheckExpect, page?: FilmCheckPage): Promise<FilmCheck>;
|
|
1071
|
+
/** what a check covered, from what it read: the streams it had and whether
|
|
1072
|
+
* the page was played — so an empty list of findings is not read as more
|
|
1073
|
+
* than it is. Motion between frames is `film probe`'s; how text looks while
|
|
1074
|
+
* it moves no tool here reads. */
|
|
1075
|
+
|
|
1076
|
+
type PageMaterial = {
|
|
1077
|
+
/** the folder served to the page, where the search started */
|
|
1078
|
+
root: string;
|
|
1079
|
+
/** `open-take shoot` logs (shots.json) under it: path from root, PNG
|
|
1080
|
+
* stills, and how many of those name a saved screen */
|
|
1081
|
+
logs: {
|
|
1082
|
+
file: string;
|
|
1083
|
+
stills: number;
|
|
1084
|
+
withState: number;
|
|
1085
|
+
}[];
|
|
1086
|
+
/** saved screens under it (a `state.html` each) */
|
|
1087
|
+
states: number;
|
|
1088
|
+
};
|
|
1089
|
+
/** the shoot logs and saved screens in the folder served to the page (as
|
|
1090
|
+
* `film render` serves it): read off the files, the page not run. */
|
|
1091
|
+
declare function readPageMaterial(page: string, root?: string): Promise<PageMaterial>;
|
|
1092
|
+
/** one line when the page's folder holds PNG stills from a shoot and no
|
|
1093
|
+
* saved screen: what else a still can keep. null otherwise. Information. */
|
|
1094
|
+
declare function pageMaterialNote(m: PageMaterial): string | null;
|
|
1095
|
+
declare function formatFilmCheck(c: FilmCheck): string;
|
|
1096
|
+
|
|
1097
|
+
//#endregion
|
|
1098
|
+
//#region src/state-index.d.ts
|
|
1099
|
+
//# sourceMappingURL=check.d.ts.map
|
|
1100
|
+
type StateElement = {
|
|
1101
|
+
/** "e<N>" — stable within its state */
|
|
1102
|
+
id: string;
|
|
1103
|
+
/** element-child indices from <html> */
|
|
1104
|
+
path: number[];
|
|
1105
|
+
tag: string;
|
|
1106
|
+
role?: string;
|
|
1107
|
+
name?: string;
|
|
1108
|
+
text?: string;
|
|
1109
|
+
/** viewport CSS px: x, y, width, height */
|
|
1110
|
+
box: [number, number, number, number];
|
|
1111
|
+
fixed?: true;
|
|
1112
|
+
interactive?: true;
|
|
1113
|
+
};
|
|
1114
|
+
type StateIndex = {
|
|
1115
|
+
version: 1;
|
|
1116
|
+
id: string;
|
|
1117
|
+
url: string;
|
|
1118
|
+
title: string;
|
|
1119
|
+
/** capture timeline ms */
|
|
1120
|
+
tMs: number;
|
|
1121
|
+
/** the plan step it follows (absent for the first) */
|
|
1122
|
+
step?: number;
|
|
1123
|
+
viewport: {
|
|
1124
|
+
w: number;
|
|
1125
|
+
h: number;
|
|
1126
|
+
dpr: number;
|
|
1127
|
+
};
|
|
1128
|
+
scroll: {
|
|
1129
|
+
x: number;
|
|
1130
|
+
y: number;
|
|
1131
|
+
};
|
|
1132
|
+
elements: StateElement[];
|
|
1133
|
+
/** the page's major regions, back to front (element ids) */
|
|
1134
|
+
layers: string[];
|
|
1135
|
+
/** state.html re-rendered against the recording at capture time */
|
|
1136
|
+
fidelity?: {
|
|
1137
|
+
psnr: number;
|
|
1138
|
+
diffFrac: number;
|
|
1139
|
+
ok: boolean;
|
|
1140
|
+
};
|
|
1141
|
+
};
|
|
1142
|
+
/** The index of the saved state in `folder`, or why there is none. */
|
|
1143
|
+
declare function readStateIndex(folder: string): StateIndex | string;
|
|
1144
|
+
/** The elements a film could lift out on their own: at least two labelled
|
|
1145
|
+
* things inside, 0.3–20% of the page, and — of a chain of wrappers that
|
|
1146
|
+
* share one box — the outermost (`maxFrac` raises the 20%). Element ids of `index`. (`open-take states`
|
|
1147
|
+
* marks these as cards; the component probe adds the visual test on top.) */
|
|
1148
|
+
declare function cardsOf(index: StateIndex, byPath?: Map<string, StateElement>, opts?: {
|
|
1149
|
+
maxFrac?: number;
|
|
1150
|
+
}): Set<string>;
|
|
1151
|
+
|
|
1152
|
+
//#endregion
|
|
1153
|
+
//#region src/film/components-probe.d.ts
|
|
1154
|
+
//# sourceMappingURL=state-index.d.ts.map
|
|
1155
|
+
type Box$4 = [number, number, number, number];
|
|
1156
|
+
type PartKind = "number" | "stat" | "heading" | "button" | "input" | "control" | "field" | "badge" | "media" | "logo" | "card" | "group" | "text";
|
|
1157
|
+
/** One part of a saved screen, as measured in the restored page. */
|
|
1158
|
+
type PartCandidate = {
|
|
1159
|
+
/** the element id in this state's index.json ("e170"; the ref is `<state>:e170`) */
|
|
1160
|
+
el: string;
|
|
1161
|
+
kind: PartKind;
|
|
1162
|
+
/** cards: "result" (holds a number) | "form" (holds inputs) | "media" (holds media) */
|
|
1163
|
+
sub?: "result" | "form" | "media";
|
|
1164
|
+
/** the button with the strongest fill contrast in this state */
|
|
1165
|
+
primary?: true;
|
|
1166
|
+
/** what it reads, for a glance (visible text, collapsed, ≤ 80 chars; an
|
|
1167
|
+
* input's value or placeholder; an icon-only control's name) */
|
|
1168
|
+
label: string;
|
|
1169
|
+
/** its visible text in full, collapsed — never cut (absent in parts.json
|
|
1170
|
+
* measured before the probe kept it) */
|
|
1171
|
+
text?: string;
|
|
1172
|
+
/** what the element itself holds, apart from its visible text: its
|
|
1173
|
+
* accessible name when that is not its text (aria-label, aria-labelledby,
|
|
1174
|
+
* title, an svg's <title>, an image's alt), an input's value and
|
|
1175
|
+
* placeholder kept apart, a range's bounds, a checkbox's state, a
|
|
1176
|
+
* select's options — each as the page had it */
|
|
1177
|
+
fields?: PartFields;
|
|
1178
|
+
/** the ARIA / form state it shows (aria-selected, aria-pressed,
|
|
1179
|
+
* aria-checked, aria-expanded, aria-current, disabled, open) — what a tab
|
|
1180
|
+
* or a toggle changes besides its text */
|
|
1181
|
+
state?: Record<string, string>;
|
|
1182
|
+
/** element ids its aria-controls names (a tab → its panel) */
|
|
1183
|
+
controls?: string[];
|
|
1184
|
+
/** element ids its aria-labelledby names (the heading that names a card) */
|
|
1185
|
+
labelledBy?: string[];
|
|
1186
|
+
/** a CSS path that finds it in state.html */
|
|
1187
|
+
selector: string;
|
|
1188
|
+
/** layout box, viewport CSS px */
|
|
1189
|
+
box: Box$4;
|
|
1190
|
+
/** the text's own extent (union of its text's line boxes) — text kinds
|
|
1191
|
+
* (number, stat, heading, text, button, badge) */
|
|
1192
|
+
ink?: Box$4;
|
|
1193
|
+
/** the nearest part around it */
|
|
1194
|
+
inside?: string;
|
|
1195
|
+
/** its content children in order — what an assemble / stagger would act on */
|
|
1196
|
+
parts?: string[];
|
|
1197
|
+
/** a group's members (also on a part of another kind that passes the group test) */
|
|
1198
|
+
members?: string[];
|
|
1199
|
+
axis?: "row" | "column" | "grid";
|
|
1200
|
+
/** input → its field (input + label); field → its input */
|
|
1201
|
+
field?: string;
|
|
1202
|
+
input?: string;
|
|
1203
|
+
look: {
|
|
1204
|
+
fontPx: number;
|
|
1205
|
+
weight: number;
|
|
1206
|
+
family: string;
|
|
1207
|
+
fg: string;
|
|
1208
|
+
/** its own fill (#rrggbb[aa]); "image" for a gradient / background image */
|
|
1209
|
+
fill: string | null;
|
|
1210
|
+
/** what is behind it: the nearest ancestor fill, else the root's, else white */
|
|
1211
|
+
backdrop: string;
|
|
1212
|
+
/** an ancestor between it and that fill paints an image / gradient */
|
|
1213
|
+
backdropImage?: true;
|
|
1214
|
+
radius: number;
|
|
1215
|
+
shadow: boolean;
|
|
1216
|
+
border: boolean;
|
|
1217
|
+
};
|
|
1218
|
+
facts: {
|
|
1219
|
+
/** box area / viewport area */
|
|
1220
|
+
areaShare: number;
|
|
1221
|
+
/** its font size / the page's median text size */
|
|
1222
|
+
fontRatio: number;
|
|
1223
|
+
/** WCAG contrast of its text against its fill or backdrop */
|
|
1224
|
+
contrast: number;
|
|
1225
|
+
/** WCAG contrast of its own fill against the backdrop (1 when it has none) */
|
|
1226
|
+
fillContrast: number;
|
|
1227
|
+
numeric: boolean;
|
|
1228
|
+
/** within the first screen of the page (scroll 0) */
|
|
1229
|
+
inFirstScreen: boolean;
|
|
1230
|
+
};
|
|
1231
|
+
/** the crisp picture (states/assets/<sha1>.png, relative to the state folder), if taken */
|
|
1232
|
+
picture?: string;
|
|
1233
|
+
/** why no picture was taken */
|
|
1234
|
+
noPicture?: string;
|
|
1235
|
+
/** the window the picture shows, viewport CSS px, and its pixel scale */
|
|
1236
|
+
clip?: Box$4;
|
|
1237
|
+
clipScale?: number;
|
|
1238
|
+
/** the lift() options that reproduce the picture */
|
|
1239
|
+
lift: {
|
|
1240
|
+
around: "clear";
|
|
1241
|
+
box: "ink" | "box";
|
|
1242
|
+
pad: number;
|
|
1243
|
+
};
|
|
1244
|
+
};
|
|
1245
|
+
type PartFields = {
|
|
1246
|
+
name?: string;
|
|
1247
|
+
value?: string;
|
|
1248
|
+
placeholder?: string;
|
|
1249
|
+
min?: string;
|
|
1250
|
+
max?: string;
|
|
1251
|
+
step?: string;
|
|
1252
|
+
checked?: boolean;
|
|
1253
|
+
options?: string[];
|
|
1254
|
+
};
|
|
1255
|
+
/** A candidate left out, and why (nothing is dropped silently). */
|
|
1256
|
+
type PartSkipped = {
|
|
1257
|
+
el: string;
|
|
1258
|
+
kind: PartKind;
|
|
1259
|
+
why: string;
|
|
1260
|
+
label?: string;
|
|
1261
|
+
box?: Box$4;
|
|
1262
|
+
};
|
|
1263
|
+
/** `states/<id>/parts.json` — version 1. */
|
|
1264
|
+
type PartsFile = {
|
|
1265
|
+
version: 1;
|
|
1266
|
+
state: string;
|
|
1267
|
+
viewport: {
|
|
1268
|
+
w: number;
|
|
1269
|
+
h: number;
|
|
1270
|
+
};
|
|
1271
|
+
scroll: {
|
|
1272
|
+
x: number;
|
|
1273
|
+
y: number;
|
|
1274
|
+
};
|
|
1275
|
+
/** median font size over the page's visible text, weighted by characters */
|
|
1276
|
+
medianTextPx: number;
|
|
1277
|
+
parts: PartCandidate[];
|
|
1278
|
+
skipped: PartSkipped[];
|
|
1279
|
+
/** measured: time in the page, and taking the pictures */
|
|
1280
|
+
ms: {
|
|
1281
|
+
measure: number;
|
|
1282
|
+
pictures?: number;
|
|
1283
|
+
};
|
|
1284
|
+
};
|
|
1285
|
+
/** What the page script takes. */
|
|
1286
|
+
type ComponentProbeInput = {
|
|
1287
|
+
/** element ids that pass `cardsOf` (states-list's card test, from index.json) */
|
|
1288
|
+
cards: string[];
|
|
1289
|
+
/** the size floor, a fraction of the viewport (default 0.0005) */
|
|
1290
|
+
minArea?: number;
|
|
1291
|
+
};
|
|
1292
|
+
/** What the page script returns (JSON string): PartsFile without the
|
|
1293
|
+
* fields only the caller knows. */
|
|
1294
|
+
type ComponentProbeResult = (Omit<PartsFile, "version" | "state" | "ms"> & {
|
|
1295
|
+
ms: number;
|
|
1296
|
+
}) | {
|
|
1297
|
+
error: string;
|
|
1298
|
+
};
|
|
1299
|
+
/**
|
|
1300
|
+
* A function expression: `(${COMPONENT_PROBE_JS})(input)` returns a JSON
|
|
1301
|
+
* string (ComponentProbeResult). Reads the page only, except that it may
|
|
1302
|
+
* set nothing at all — the pictures are taken separately.
|
|
1303
|
+
*/
|
|
1304
|
+
declare const COMPONENT_PROBE_JS: string;
|
|
1305
|
+
/** The expression to evaluate in a restored state.html: runs the probe on
|
|
1306
|
+
* this state's index (its card test runs here, in Node, on index.json). */
|
|
1307
|
+
declare function componentProbeExpression(index: StateIndex, opts?: {
|
|
1308
|
+
minArea?: number;
|
|
1309
|
+
}): string;
|
|
1310
|
+
/** The CSS that leaves only `[data-ot-clip]` drawn, on a see-through page —
|
|
1311
|
+
* what lift(…, { around: "clear" }) shows (kit/media.js). */
|
|
1312
|
+
declare const CLIP_CLEAR_CSS: string;
|
|
1313
|
+
/** The window a part's picture shows: its ink (text kinds) or box, ± pad,
|
|
1314
|
+
* inside the viewport; and the pixel scale (3×, less if that would pass
|
|
1315
|
+
* `maxSide` px). Null when nothing of it is on screen. */
|
|
1316
|
+
declare function pictureClip(part: Pick<PartCandidate, "box" | "ink" | "lift">, viewport: {
|
|
1317
|
+
w: number;
|
|
1318
|
+
h: number;
|
|
1319
|
+
}, opts?: {
|
|
1320
|
+
scale?: number;
|
|
1321
|
+
maxSide?: number;
|
|
1322
|
+
}): {
|
|
1323
|
+
clip: Box$4;
|
|
1324
|
+
scale: number;
|
|
1325
|
+
} | null;
|
|
1326
|
+
|
|
1327
|
+
//#endregion
|
|
1328
|
+
//#region src/film/components.d.ts
|
|
1329
|
+
type Box$3 = [number, number, number, number];
|
|
1330
|
+
/** One value a part holds, as the page showed it. */
|
|
1331
|
+
type ComponentValue = {
|
|
1332
|
+
/** as the page had it, in full */
|
|
1333
|
+
text: string;
|
|
1334
|
+
/** the number in it, read as written ("US$4,466" → 4466; "18.5個月" → 18.5) */
|
|
1335
|
+
value?: number;
|
|
1336
|
+
/** what stands with that number ("US$", "個月", "%") */
|
|
1337
|
+
unit?: string;
|
|
1338
|
+
/** read from a parts.json measured before the probe kept full text: the
|
|
1339
|
+
* 80-character label it had — `open-take components` measures it again */
|
|
1340
|
+
capped?: true;
|
|
1341
|
+
/** where it was read: the saved screen, the element (index.json id), its
|
|
1342
|
+
* CSS path in state.html, and the shoot's still of that moment (relative
|
|
1343
|
+
* to components.json) */
|
|
1344
|
+
source: {
|
|
1345
|
+
state: string;
|
|
1346
|
+
eid: string;
|
|
1347
|
+
selector?: string;
|
|
1348
|
+
shot?: string;
|
|
1349
|
+
};
|
|
1350
|
+
};
|
|
1351
|
+
/** How one part bears on another (a ref, `<state>:<element id>`):
|
|
1352
|
+
* - controls: its markup says so (aria-controls — a tab and its panel);
|
|
1353
|
+
* - changes: the action before a screen acted on it and `to` changed,
|
|
1354
|
+
* restyled or appeared on that screen (seen in the log and the diff);
|
|
1355
|
+
* - labels: its text names `to` (a field's label and its input; the
|
|
1356
|
+
* heading aria-labelledby points at);
|
|
1357
|
+
* - contains: `to` is the next part inside it.
|
|
1358
|
+
* `by` is how it is known: seen (the action log and the screens' diff),
|
|
1359
|
+
* markup (the page's own attributes) or layout (what holds what). */
|
|
1360
|
+
type ComponentRelation = {
|
|
1361
|
+
kind: "controls" | "changes" | "labels" | "contains";
|
|
1362
|
+
to: string;
|
|
1363
|
+
by: "seen" | "markup" | "layout";
|
|
1364
|
+
};
|
|
1365
|
+
/** Where a part was: the saved screen, the page's URL, when the screen was
|
|
1366
|
+
* saved (index.json's file time) and on the capture's clock. `local`: the
|
|
1367
|
+
* URL's host is this machine (localhost, 127.x, ::1, *.local, a file) — the
|
|
1368
|
+
* data on it may be a local seed rather than the live product's. */
|
|
1369
|
+
type ComponentProvenance = {
|
|
1370
|
+
state: string;
|
|
1371
|
+
url?: string;
|
|
1372
|
+
capturedAt?: string;
|
|
1373
|
+
tMs?: number;
|
|
1374
|
+
local?: true;
|
|
1375
|
+
};
|
|
1376
|
+
/** One part of one saved screen. Refs are `<state>:<element id>`, as
|
|
1377
|
+
* `open-take states` names elements and as lift() takes them. */
|
|
1378
|
+
type ComponentEntry = {
|
|
1379
|
+
ref: string;
|
|
1380
|
+
state: string;
|
|
1381
|
+
el: string;
|
|
1382
|
+
kind: PartKind;
|
|
1383
|
+
sub?: PartCandidate["sub"];
|
|
1384
|
+
primary?: true;
|
|
1385
|
+
/** what it reads, for a glance (≤ 80 characters); `values` has it in full */
|
|
1386
|
+
label: string;
|
|
1387
|
+
/** what it holds, by field: text (its visible text), number (the number in
|
|
1388
|
+
* it), label (a stat's or a field's words beside its value), value /
|
|
1389
|
+
* placeholder / min / max / checked (an input's own), name (an accessible
|
|
1390
|
+
* name that is not its text — an icon-only button's) */
|
|
1391
|
+
values: Record<string, ComponentValue>;
|
|
1392
|
+
relations: ComponentRelation[];
|
|
1393
|
+
provenance: ComponentProvenance;
|
|
1394
|
+
selector: string;
|
|
1395
|
+
/** layout box, the screen's CSS px */
|
|
1396
|
+
box: Box$3;
|
|
1397
|
+
/** the text's own extent (text kinds) */
|
|
1398
|
+
ink?: Box$3;
|
|
1399
|
+
/** the part it sits inside (a ref) */
|
|
1400
|
+
inside?: string;
|
|
1401
|
+
/** its content children in order (refs) — what an assemble acts on */
|
|
1402
|
+
parts?: string[];
|
|
1403
|
+
/** a group's members (refs) */
|
|
1404
|
+
members?: string[];
|
|
1405
|
+
axis?: PartCandidate["axis"];
|
|
1406
|
+
field?: string;
|
|
1407
|
+
input?: string;
|
|
1408
|
+
/** the ARIA / form state it shows (selected, pressed, expanded, current,
|
|
1409
|
+
* disabled, open), as the probe read it */
|
|
1410
|
+
shows?: Record<string, string>;
|
|
1411
|
+
look: PartCandidate["look"];
|
|
1412
|
+
facts: PartCandidate["facts"] & {
|
|
1413
|
+
/** the action before this screen acted on it (or on a control inside it) */
|
|
1414
|
+
acted?: true;
|
|
1415
|
+
/** its text since the screen before: "was → now" (each side ≤ 40
|
|
1416
|
+
* characters; the steps of its track have them in full) */
|
|
1417
|
+
changed?: string;
|
|
1418
|
+
/** its state or colour since the screen before, its text the same:
|
|
1419
|
+
* "selected: – → true", "fill #ffffff → #0a7f5a" */
|
|
1420
|
+
restyled?: string;
|
|
1421
|
+
/** its box moved or resized since the screen before (text the same) */
|
|
1422
|
+
moved?: true;
|
|
1423
|
+
/** not on the screen before (a result card, a toast) */
|
|
1424
|
+
appeared?: true;
|
|
1425
|
+
};
|
|
1426
|
+
/** its text in px on a phone (PHONE_W wide): as part of the whole screen
|
|
1427
|
+
* fitted to the stage, and fitted on its own (`fit`). Arithmetic on its
|
|
1428
|
+
* computed font size (a stat, card, group or field: the largest of the
|
|
1429
|
+
* parts inside it) — not measured on a phone */
|
|
1430
|
+
phone?: {
|
|
1431
|
+
asScreen: number;
|
|
1432
|
+
atFit: number;
|
|
1433
|
+
};
|
|
1434
|
+
/** the largest box of its shape within 70 % × 60 % of the stage, centred —
|
|
1435
|
+
* `k` its scale from the screen, `by` which of its boxes (with lift.pad) */
|
|
1436
|
+
fit: {
|
|
1437
|
+
box: Box$3;
|
|
1438
|
+
k: number;
|
|
1439
|
+
by: "ink" | "box";
|
|
1440
|
+
};
|
|
1441
|
+
/** the track it is a step of */
|
|
1442
|
+
track?: string;
|
|
1443
|
+
/** an earlier screen shows the same part (kind, text and place): its ref */
|
|
1444
|
+
repeats?: string;
|
|
1445
|
+
/** the same element on the screen before (matchStates, the same kind),
|
|
1446
|
+
* whether it changed or not — a part that stayed but moved is linked
|
|
1447
|
+
* here too */
|
|
1448
|
+
before?: string;
|
|
1449
|
+
/** its crisp picture (3×, see-through around it), relative to components.json */
|
|
1450
|
+
picture?: string;
|
|
1451
|
+
noPicture?: string;
|
|
1452
|
+
/** the lift() options that reproduce the picture */
|
|
1453
|
+
lift: PartCandidate["lift"];
|
|
1454
|
+
};
|
|
1455
|
+
type ComponentState = {
|
|
1456
|
+
id: string;
|
|
1457
|
+
/** state.html, relative to components.json */
|
|
1458
|
+
url: string;
|
|
1459
|
+
/** the page it was: its URL, title, when it was saved */
|
|
1460
|
+
page?: {
|
|
1461
|
+
url: string;
|
|
1462
|
+
title?: string;
|
|
1463
|
+
capturedAt?: string;
|
|
1464
|
+
tMs?: number;
|
|
1465
|
+
local?: true;
|
|
1466
|
+
};
|
|
1467
|
+
/** the shoot's still of this moment, relative to components.json */
|
|
1468
|
+
shot?: string;
|
|
1469
|
+
fidelity?: {
|
|
1470
|
+
ok: boolean;
|
|
1471
|
+
psnr?: number;
|
|
1472
|
+
diffFrac?: number;
|
|
1473
|
+
};
|
|
1474
|
+
/** the action that led here, as the log has it */
|
|
1475
|
+
action?: ComponentAction;
|
|
1476
|
+
/** the screen before it in the log (what `changed` / `appeared` compare with) */
|
|
1477
|
+
since?: string;
|
|
1478
|
+
/** most of the screen is new since the one before (another page): no part is
|
|
1479
|
+
* marked `appeared` */
|
|
1480
|
+
newPage?: true;
|
|
1481
|
+
medianTextPx?: number;
|
|
1482
|
+
/** this screen's components, in `order` */
|
|
1483
|
+
components: string[];
|
|
1484
|
+
/** why it has none (no parts.json, an unreadable index) */
|
|
1485
|
+
unmeasured?: string;
|
|
1486
|
+
};
|
|
1487
|
+
type ComponentAction = {
|
|
1488
|
+
kind: string;
|
|
1489
|
+
/** the shoot's still name / the plan's selector */
|
|
1490
|
+
label?: string;
|
|
1491
|
+
/** the element it acted on, a ref in this screen (when it is still there) */
|
|
1492
|
+
acted?: string;
|
|
1493
|
+
/** …or in the screen before, when this one no longer has it */
|
|
1494
|
+
actedBefore?: string;
|
|
1495
|
+
/** how that was found: the capture's own match of the action's box
|
|
1496
|
+
* ("capture"), or the element under the action's point ("point") */
|
|
1497
|
+
by?: "capture" | "point";
|
|
1498
|
+
/** the parts that changed, restyled or appeared on this screen after it
|
|
1499
|
+
* (seen: the log and the screens' diff), apart from the control itself
|
|
1500
|
+
* and what changed only inside it — also when the element acted on is
|
|
1501
|
+
* not a part of its own (a tab drawn as a bare link); in page order */
|
|
1502
|
+
changes?: string[];
|
|
1503
|
+
};
|
|
1504
|
+
type ComponentTrack = {
|
|
1505
|
+
id: string;
|
|
1506
|
+
kind: PartKind;
|
|
1507
|
+
/** what it reads at its last step (≤ 60 characters) */
|
|
1508
|
+
label: string;
|
|
1509
|
+
/** steps whose text, number or state differs from the step before */
|
|
1510
|
+
changes: number;
|
|
1511
|
+
/** each step: its text in full, the number in it, and its state (ARIA /
|
|
1512
|
+
* form state, fill) when it has one */
|
|
1513
|
+
steps: {
|
|
1514
|
+
state: string;
|
|
1515
|
+
ref: string;
|
|
1516
|
+
text: string;
|
|
1517
|
+
value?: number;
|
|
1518
|
+
unit?: string;
|
|
1519
|
+
shows?: string;
|
|
1520
|
+
}[];
|
|
1521
|
+
};
|
|
1522
|
+
/** `components.json` — version 2 (version 1 plus values, relations,
|
|
1523
|
+
* provenance, restyled, track values; the order is the page's). */
|
|
1524
|
+
type ComponentsFile = {
|
|
1525
|
+
version: 2;
|
|
1526
|
+
about: string;
|
|
1527
|
+
/** how `components` (and each screen's list) is ordered */
|
|
1528
|
+
order: string;
|
|
1529
|
+
source: {
|
|
1530
|
+
kind: ComponentSourceKind;
|
|
1531
|
+
/** the log it was read with, relative to components.json */
|
|
1532
|
+
log?: string;
|
|
1533
|
+
viewport: {
|
|
1534
|
+
w: number;
|
|
1535
|
+
h: number;
|
|
1536
|
+
dpr?: number;
|
|
1537
|
+
};
|
|
1538
|
+
/** px of what shows the screens — a shoot's stills (shots.json scale),
|
|
1539
|
+
* a take's recording (its video's width over the viewport's) — per CSS
|
|
1540
|
+
* px of the screen */
|
|
1541
|
+
srcRatio?: number;
|
|
1542
|
+
};
|
|
1543
|
+
stage: {
|
|
1544
|
+
width: number;
|
|
1545
|
+
height: number;
|
|
1546
|
+
phoneWidth: number;
|
|
1547
|
+
phoneScale: number;
|
|
1548
|
+
};
|
|
1549
|
+
states: ComponentState[];
|
|
1550
|
+
components: ComponentEntry[];
|
|
1551
|
+
groups: {
|
|
1552
|
+
ref: string;
|
|
1553
|
+
kind: PartKind;
|
|
1554
|
+
axis?: string;
|
|
1555
|
+
members: string[];
|
|
1556
|
+
}[];
|
|
1557
|
+
tracks: ComponentTrack[];
|
|
1558
|
+
skipped: {
|
|
1559
|
+
ref: string;
|
|
1560
|
+
kind: PartKind;
|
|
1561
|
+
why: string;
|
|
1562
|
+
label?: string;
|
|
1563
|
+
}[];
|
|
1564
|
+
/** measured: the component probe's time in the page and its pictures, summed */
|
|
1565
|
+
ms: {
|
|
1566
|
+
measure: number;
|
|
1567
|
+
pictures: number;
|
|
1568
|
+
};
|
|
1569
|
+
};
|
|
1570
|
+
/** The order, in words — printed by the CLI and written into the file. */
|
|
1571
|
+
declare const COMPONENT_ORDER = "screens in log order; within a screen, the page's own order (document order) \u2014 where to find a part, not a ranking";
|
|
1572
|
+
type ComponentSourceKind = "shoot" | "take" | "states" | "state";
|
|
1573
|
+
/** One saved screen to gather, with the action that led to it. */
|
|
1574
|
+
type ComponentSourceState = {
|
|
1575
|
+
id: string;
|
|
1576
|
+
/** the state's folder (absolute) */
|
|
1577
|
+
dir: string;
|
|
1578
|
+
fidelity?: ComponentState["fidelity"];
|
|
1579
|
+
/** the shoot's still of this moment (absolute) */
|
|
1580
|
+
shot?: string;
|
|
1581
|
+
action?: {
|
|
1582
|
+
kind: string;
|
|
1583
|
+
label?: string;
|
|
1584
|
+
/** the element acted on, by the capture's own match — in the screen before */
|
|
1585
|
+
target?: string;
|
|
1586
|
+
/** where the action was, viewport CSS px — of the screen before it
|
|
1587
|
+
* (`before`: a take's anchor) or of this one (`after`: a shoot's still
|
|
1588
|
+
* is taken where the mouse ended) */
|
|
1589
|
+
point?: {
|
|
1590
|
+
x: number;
|
|
1591
|
+
y: number;
|
|
1592
|
+
in: "before" | "after";
|
|
1593
|
+
};
|
|
1594
|
+
};
|
|
1595
|
+
};
|
|
1596
|
+
type ComponentSource = {
|
|
1597
|
+
kind: ComponentSourceKind;
|
|
1598
|
+
/** where components.json goes (absolute) */
|
|
1599
|
+
root: string;
|
|
1600
|
+
/** the log, absolute */
|
|
1601
|
+
log?: string;
|
|
1602
|
+
/** px of the stills or the recording per CSS px of the screen */
|
|
1603
|
+
srcRatio?: number;
|
|
1604
|
+
states: ComponentSourceState[];
|
|
1605
|
+
};
|
|
1606
|
+
/**
|
|
1607
|
+
* What `path` is and which saved screens it holds, in log order: a shoot's
|
|
1608
|
+
* folder (shots.json), a take's working dir (capture.json — `<name>.take/`),
|
|
1609
|
+
* one saved screen (index.json), or a folder of saved screens without a log
|
|
1610
|
+
* (a film folder's states/, or that folder itself). Throws with what it
|
|
1611
|
+
* found when it is none of these.
|
|
1612
|
+
*/
|
|
1613
|
+
declare function readComponentSource(path: string): ComponentSource;
|
|
1614
|
+
type Stage = {
|
|
1615
|
+
width: number;
|
|
1616
|
+
height: number;
|
|
1617
|
+
};
|
|
1618
|
+
declare const FILM_STAGE: Stage;
|
|
1619
|
+
/** The largest box of the part's shape (its ink or box, ± lift.pad) within
|
|
1620
|
+
* 70 % × 60 % of the stage, centred. */
|
|
1621
|
+
declare function fitOf(part: Pick<PartCandidate, "box" | "ink" | "lift">, stage?: Stage): ComponentEntry["fit"];
|
|
1622
|
+
/** Its text's px on a phone: the whole screen contained in the stage, and the
|
|
1623
|
+
* part at its fit — the stage shown PHONE_W px wide. */
|
|
1624
|
+
declare function phoneOf(fontPx: number, fitK: number, viewport: {
|
|
1625
|
+
w: number;
|
|
1626
|
+
h: number;
|
|
1627
|
+
}, stage?: Stage): {
|
|
1628
|
+
asScreen: number;
|
|
1629
|
+
atFit: number;
|
|
1630
|
+
};
|
|
1631
|
+
/** The first number in a text, as written, with what stands with it: "Save
|
|
1632
|
+
* US$4,466" → { text: "US$4,466", value: 4466, unit: "US$" }; "18.5個月" →
|
|
1633
|
+
* 18.5 "個月". Null when it holds no digit. */
|
|
1634
|
+
declare function readNumber(s: string): {
|
|
1635
|
+
text: string;
|
|
1636
|
+
value: number;
|
|
1637
|
+
unit?: string;
|
|
1638
|
+
} | null;
|
|
1639
|
+
/**
|
|
1640
|
+
* Gather the inventory of `source`'s saved screens from their parts.json.
|
|
1641
|
+
* Screens without one are listed with why (`unmeasured`); the runtime's
|
|
1642
|
+
* `inventoryComponents` measures them first.
|
|
1643
|
+
*/
|
|
1644
|
+
declare function gatherComponents(source: ComponentSource, opts?: {
|
|
1645
|
+
stage?: Stage;
|
|
1646
|
+
}): ComponentsFile;
|
|
1647
|
+
/** Write the inventory as `<root>/components.json`; returns its path. */
|
|
1648
|
+
declare function writeComponents(file: ComponentsFile, root: string): string;
|
|
1649
|
+
/** How many parts, on how many screens; how many of them are distinct (a
|
|
1650
|
+
* track counts once, a repeat not again). */
|
|
1651
|
+
declare function componentCounts(file: ComponentsFile): {
|
|
1652
|
+
parts: number;
|
|
1653
|
+
distinct: number;
|
|
1654
|
+
screens: number;
|
|
1655
|
+
measured: number;
|
|
1656
|
+
tracks: number;
|
|
1657
|
+
};
|
|
1658
|
+
/**
|
|
1659
|
+
* A module for the part named by `ref` (a part the film's author picked —
|
|
1660
|
+
* this never picks one): it lifts the part out of its saved screen with the
|
|
1661
|
+
* kit (screen() hidden + lift() with the inventory's options) and moves it
|
|
1662
|
+
* from where it sat to its fit, with one move of its own by kind, on the
|
|
1663
|
+
* product's own values — a number counts from the value its track held
|
|
1664
|
+
* first to the one it holds (and does not count when no screen before held
|
|
1665
|
+
* another: a count from a value the product never showed would be made up),
|
|
1666
|
+
* a button is pressed, an input types or runs to its own value, a card or
|
|
1667
|
+
* group assembles its parts.
|
|
1668
|
+
*
|
|
1669
|
+
* The saved screen's URL: with `root` (the folder components.json is in)
|
|
1670
|
+
* and `servedFrom` (the folder `film render` serves — the working directory,
|
|
1671
|
+
* or --root), a URL from that folder ("/shots/states/calc/state.html"),
|
|
1672
|
+
* which reads the same from any page under it; else `screens`, a path from
|
|
1673
|
+
* the page to the folder components.json is in.
|
|
1674
|
+
*/
|
|
1675
|
+
declare function exampleSource(file: ComponentsFile, ref: string, opts?: {
|
|
1676
|
+
screens?: string;
|
|
1677
|
+
root?: string;
|
|
1678
|
+
servedFrom?: string;
|
|
1679
|
+
}): string;
|
|
1680
|
+
/** How many of a screen's changed, restyled or appeared parts its summary
|
|
1681
|
+
* names (the rest are in the file). */
|
|
1682
|
+
|
|
1683
|
+
/** The summary `open-take components` prints — information only: per screen,
|
|
1684
|
+
* how many parts of each kind, what the action before it acted on, and
|
|
1685
|
+
* what changed, restyled or appeared since the screen before (in the
|
|
1686
|
+
* page's order); then where the rest is. */
|
|
1687
|
+
declare function formatComponents(file: ComponentsFile, opts?: {
|
|
1688
|
+
path: string;
|
|
1689
|
+
state?: string;
|
|
1690
|
+
dir?: string;
|
|
1691
|
+
/** the folder components.json is in, and the one film render serves
|
|
1692
|
+
* (the working directory): with them, the followed tracks and the
|
|
1693
|
+
* product() line */
|
|
1694
|
+
at?: string;
|
|
1695
|
+
servedFrom?: string;
|
|
1696
|
+
}): string;
|
|
1697
|
+
/** How many followed tracks a summary names (the rest are in the file). */
|
|
1698
|
+
|
|
1699
|
+
/** The tracks whose every step is a shoot still that kept the cursor
|
|
1700
|
+
* (shots.json) — a part followed through the screens with the mouse where
|
|
1701
|
+
* it was at each one — in the page's order: "followed: t1 input
|
|
1702
|
+
* "<label>" <a> → <b> over <first>…<last>, cursor kept at each step · …". Null when
|
|
1703
|
+
* there is none (a take's or a folder of screens' tracks have no stills).
|
|
1704
|
+
* `dir`: the folder components.json is in. Information only. */
|
|
1705
|
+
declare function followedLine(file: ComponentsFile, dir: string): string | null;
|
|
1706
|
+
/** What `now` gained over `was`, in whole words of `now`, compared without
|
|
1707
|
+
* whitespace (fact strings run words together); kit/media.js wordDiff. */
|
|
1708
|
+
|
|
1709
|
+
/** One line on what the actions changed: per screen an action led to, the
|
|
1710
|
+
* innermost part that appeared or changed there and the words it gained —
|
|
1711
|
+
* and the kit's way to have them all on the material the film holds (a
|
|
1712
|
+
* shoot's stills(), a take's readTake()), at the URL film render serves
|
|
1713
|
+
* `dir` from when run in `servedFrom`. Null when no action changed a
|
|
1714
|
+
* measured part. Information only. */
|
|
1715
|
+
declare function changedLine(file: ComponentsFile, dir: string, servedFrom: string): string | null;
|
|
1716
|
+
/** The line that names the kit's way to use an inventory's parts:
|
|
1717
|
+
* product() on `dir` (the folder components.json is in) at the URL film
|
|
1718
|
+
* render serves it from when run in `servedFrom`. */
|
|
1719
|
+
declare function partsLine(dir: string, servedFrom: string): string;
|
|
1720
|
+
/** The one line a shoot or a take prints about its inventory. */
|
|
1721
|
+
declare function componentsLine(file: ComponentsFile, path: string, dir: string, measuredS?: number): string;
|
|
1722
|
+
|
|
1723
|
+
//#endregion
|
|
1724
|
+
//#region src/film/gallery.d.ts
|
|
1725
|
+
/** a region of the stage, CSS px */
|
|
1726
|
+
type GalleryBox = {
|
|
1727
|
+
x: number;
|
|
1728
|
+
y: number;
|
|
1729
|
+
width: number;
|
|
1730
|
+
height: number;
|
|
1731
|
+
};
|
|
1732
|
+
type GalleryMaterial = {
|
|
1733
|
+
/** what the stage shows: a neutral stand-in when no --with was given */
|
|
1734
|
+
kind: "placeholder" | "image" | "state" | "video";
|
|
1735
|
+
/** what --with named (null for the stand-in) */
|
|
1736
|
+
source: string | null;
|
|
1737
|
+
/** the picture used (a saved screen's live.png, the take's frame, the image) */
|
|
1738
|
+
picture: string | null;
|
|
1739
|
+
width: number;
|
|
1740
|
+
height: number;
|
|
1741
|
+
/** what the blocks lift and move */
|
|
1742
|
+
subject: GalleryBox & {
|
|
1743
|
+
label: string;
|
|
1744
|
+
/** how it was picked: given, chosen automatically (and from what), or a fallback */
|
|
1745
|
+
how: string;
|
|
1746
|
+
};
|
|
1747
|
+
/** a second region, unlike the subject: where a match cut lands */
|
|
1748
|
+
other: GalleryBox & {
|
|
1749
|
+
label: string;
|
|
1750
|
+
};
|
|
1751
|
+
/** what type/untype write: the subject's own text when it has some */
|
|
1752
|
+
text: string;
|
|
1753
|
+
notes: string[];
|
|
1754
|
+
};
|
|
1755
|
+
/** one setting's numbers, measured on the function's output (1 ms apart) */
|
|
1756
|
+
type GalleryStats = {
|
|
1757
|
+
/** the value where the block starts and where it comes to rest */
|
|
1758
|
+
from: number;
|
|
1759
|
+
to: number;
|
|
1760
|
+
/** s after the block starts until it stays within 1 % of its travel (or of
|
|
1761
|
+
* its peak, for a move that comes back to where it was); null: not detected
|
|
1762
|
+
* in the window measured */
|
|
1763
|
+
settle: number | null;
|
|
1764
|
+
/** how far it first goes past its rest, as a share of the travel; null for a
|
|
1765
|
+
* move that comes back to where it was */
|
|
1766
|
+
swing: number | null;
|
|
1767
|
+
/** the largest distance from its rest, for a move that comes back (a kick, a
|
|
1768
|
+
* shake, a press); null otherwise */
|
|
1769
|
+
peak: number | null;
|
|
1770
|
+
/** the top speed (value units a second) and when (s after the start) */
|
|
1771
|
+
peakSpeed: number;
|
|
1772
|
+
peakSpeedAt: number;
|
|
1773
|
+
/** the window each speed is the change over (s): 2 ms, or a stepping value's */
|
|
1774
|
+
speedOver: number;
|
|
1775
|
+
/** when the value jumps (a cut: a quarter of its travel within 1 ms), s
|
|
1776
|
+
* after the start; its "speed" there is the jump over 2 ms, not a speed */
|
|
1777
|
+
jump: number | null;
|
|
1778
|
+
/** how long was measured (s after the start) */
|
|
1779
|
+
window: number;
|
|
1780
|
+
};
|
|
1781
|
+
type GalleryRow = {
|
|
1782
|
+
label: string;
|
|
1783
|
+
stats: GalleryStats | null;
|
|
1784
|
+
/** what the PNG and index.md say under the setting */
|
|
1785
|
+
text: string;
|
|
1786
|
+
error?: string;
|
|
1787
|
+
};
|
|
1788
|
+
type GalleryEntry = {
|
|
1789
|
+
name: string;
|
|
1790
|
+
group: "motion" | "camera" | "cut" | "draw" | "map" | "stage" | "seams" | "world";
|
|
1791
|
+
/** the call, as the film writes it */
|
|
1792
|
+
signature: string;
|
|
1793
|
+
/** where its defaults come from */
|
|
1794
|
+
note: string;
|
|
1795
|
+
/** what the plotted value is, and its unit */
|
|
1796
|
+
value: string;
|
|
1797
|
+
/** the PNG (absolute), or null when it could not be drawn */
|
|
1798
|
+
png: string | null;
|
|
1799
|
+
rows: GalleryRow[];
|
|
1800
|
+
/** why it could not be drawn (a kit changed under it, a missing export) */
|
|
1801
|
+
error?: string;
|
|
1802
|
+
};
|
|
1803
|
+
type FilmGalleryOptions = {
|
|
1804
|
+
chromePath: string;
|
|
1805
|
+
/** the folder to write the PNGs, index.md and gallery.json into */
|
|
1806
|
+
out: string;
|
|
1807
|
+
/** a film folder (its kit/ is used) or a kit folder; default: the kit this package ships */
|
|
1808
|
+
kit?: string;
|
|
1809
|
+
/** names (rise, camera.shake), or groups (motion, camera, cut); default all */
|
|
1810
|
+
blocks?: string[];
|
|
1811
|
+
/** a picture, a saved screen (state folder or its state.html) or a take */
|
|
1812
|
+
with?: string;
|
|
1813
|
+
/** the element to move: a saved screen's element id (e12), its text, or x,y,w,h */
|
|
1814
|
+
subject?: string;
|
|
1815
|
+
/** a beats file (`open-take film beats`): kit/cut.js is drawn on the film's
|
|
1816
|
+
* own music; default a stand-in pulse */
|
|
1817
|
+
beats?: string;
|
|
1818
|
+
};
|
|
1819
|
+
type FilmGalleryResult = {
|
|
1820
|
+
out: string;
|
|
1821
|
+
index: string;
|
|
1822
|
+
json: string;
|
|
1823
|
+
kit: string;
|
|
1824
|
+
material: GalleryMaterial;
|
|
1825
|
+
entries: GalleryEntry[];
|
|
1826
|
+
};
|
|
1827
|
+
/** the kit folder a --kit names: a film's kit/, or a kit folder itself */
|
|
1828
|
+
|
|
1829
|
+
declare function filmGallery(opts: FilmGalleryOptions): Promise<FilmGalleryResult>;
|
|
1830
|
+
|
|
1831
|
+
//#endregion
|
|
1832
|
+
//#region src/film/kit.d.ts
|
|
1833
|
+
//# sourceMappingURL=gallery.d.ts.map
|
|
1834
|
+
/** where the kit this package ships is */
|
|
1835
|
+
declare function filmKitDir(): string;
|
|
1836
|
+
/** where the starter this package ships is */
|
|
1837
|
+
declare function filmStarterDir(): string;
|
|
1838
|
+
/** what the starter puts in a film's folder, at the same paths there:
|
|
1839
|
+
* lib/sampler.mjs imports ../kit/audio.mjs and reads ../samples */
|
|
1840
|
+
|
|
1841
|
+
/** what copying a set of files into the film's folder did, file by file (absolute) */
|
|
1842
|
+
type FilmFiles = {
|
|
1843
|
+
/** written: there was none, or it was replaced (force) */
|
|
1844
|
+
written: string[];
|
|
1845
|
+
/** left alone because the film's copy is already the same */
|
|
1846
|
+
same: string[];
|
|
1847
|
+
/** left alone because the film's copy differs (changed by its author) */
|
|
1848
|
+
kept: string[];
|
|
1849
|
+
};
|
|
1850
|
+
/** the kit's files and the page at the top level, the starter's apart */
|
|
1851
|
+
type FilmInitResult = FilmFiles & {
|
|
1852
|
+
/** the film's folder (absolute) */
|
|
1853
|
+
dir: string;
|
|
1854
|
+
/** the starter's files: START.md, PLAN.md, reference/, lib/, samples/ —
|
|
1855
|
+
* none when it was left out */
|
|
1856
|
+
starter: FilmFiles;
|
|
1857
|
+
/** START.md in the film's folder, the page to read first, when the starter
|
|
1858
|
+
* wrote it or found it there */
|
|
1859
|
+
start: string | null;
|
|
1860
|
+
};
|
|
1861
|
+
/** Literal module specifiers in imports and re-exports. */
|
|
1862
|
+
|
|
1863
|
+
declare function initFilm(opts: {
|
|
1864
|
+
dir: string;
|
|
1865
|
+
/** replace the kit's and the starter's files the author has changed — PLAN.md excepted */
|
|
1866
|
+
force?: boolean;
|
|
1867
|
+
/** the starter beside the kit (default true); false writes the kit and the page only */
|
|
1868
|
+
starter?: boolean;
|
|
1869
|
+
/** where the starter is copied from, when supplied */
|
|
1870
|
+
starterDir?: string;
|
|
1871
|
+
}): Promise<FilmInitResult>;
|
|
1872
|
+
/**
|
|
1873
|
+
* The lines `film init` prints: a line a file written or kept, a folder of
|
|
1874
|
+
* the starter with many (samples/) as one line with its count, the files
|
|
1875
|
+
* already the same as one line, and last, where START.md is, the pointer to
|
|
1876
|
+
* it. `show` gives a path as typed from where the command runs.
|
|
1877
|
+
*/
|
|
1878
|
+
declare function filmInitLines(r: FilmInitResult, show: (p: string) => string): string[];
|
|
1879
|
+
|
|
1880
|
+
//#endregion
|
|
1881
|
+
//#region src/film/changes.d.ts
|
|
1882
|
+
//# sourceMappingURL=kit.d.ts.map
|
|
1883
|
+
type SoundChange = {
|
|
1884
|
+
/** s, on the nearest onset */
|
|
1885
|
+
t: number;
|
|
1886
|
+
/** against the film's sharpest change (1) */
|
|
1887
|
+
size: number;
|
|
1888
|
+
/** what changed there, each in words with its numbers */
|
|
1889
|
+
parts: string[];
|
|
1890
|
+
/** what led into it in the 1.5 s before, or null: nothing did */
|
|
1891
|
+
leadIn: string | null;
|
|
1892
|
+
};
|
|
1893
|
+
|
|
1894
|
+
//#endregion
|
|
1895
|
+
//#region src/film/tuning.d.ts
|
|
1896
|
+
/** the sharpest changes in a sound (mono samples at LISTEN_RATE), largest
|
|
1897
|
+
* first; null when the sound is too short to set `window` s either side of a
|
|
1898
|
+
* moment (2·window + 1 s) — not measured, rather than measured and calm */
|
|
1899
|
+
type Register = {
|
|
1900
|
+
name: string;
|
|
1901
|
+
lo: number;
|
|
1902
|
+
hi: number;
|
|
1903
|
+
/** frames where a pitched sound led this register */
|
|
1904
|
+
frames: number;
|
|
1905
|
+
/** the share of those within 15 cents of the piece's tuning */
|
|
1906
|
+
inTune: number;
|
|
1907
|
+
/** their median distance from it, cents (signed: below is flat) */
|
|
1908
|
+
offset: number;
|
|
1909
|
+
};
|
|
1910
|
+
type Tuning = {
|
|
1911
|
+
/** the piece's tuning against A440, cents (null: nothing pitched) */
|
|
1912
|
+
reference: number | null;
|
|
1913
|
+
registers: Register[];
|
|
1914
|
+
};
|
|
1915
|
+
|
|
1916
|
+
//#endregion
|
|
1917
|
+
//#region src/film/listen.d.ts
|
|
1918
|
+
type FilmEvent = {
|
|
1919
|
+
/** seconds on the film's time */
|
|
1920
|
+
t: number;
|
|
1921
|
+
/** "click", "key", "land", "cut", "mark", … — whatever the page names */
|
|
1922
|
+
kind: string;
|
|
1923
|
+
/** stage px */
|
|
1924
|
+
x?: number;
|
|
1925
|
+
y?: number;
|
|
1926
|
+
/** 0..1 */
|
|
1927
|
+
force?: number;
|
|
1928
|
+
label?: string;
|
|
1929
|
+
};
|
|
1930
|
+
type FilmEvents = {
|
|
1931
|
+
version: 1;
|
|
1932
|
+
duration: number;
|
|
1933
|
+
fps: number;
|
|
1934
|
+
/** sorted by t */
|
|
1935
|
+
events: FilmEvent[];
|
|
1936
|
+
/** hard-cut times the clock detected or the page declared */
|
|
1937
|
+
cuts: number[];
|
|
1938
|
+
/** rows[i][j] = curve names[j] at time t0 + i·dt */
|
|
1939
|
+
curves: {
|
|
1940
|
+
names: string[];
|
|
1941
|
+
t0: number;
|
|
1942
|
+
dt: number;
|
|
1943
|
+
rows: number[][];
|
|
1944
|
+
};
|
|
1945
|
+
};
|
|
1946
|
+
/** `<film>.events.json` read leniently: what is malformed is left out, never
|
|
1947
|
+
* fatal — on the film's own clock: a render of part of the page (`range`
|
|
1948
|
+
* [a, b]) starts at a, so its times move back by a and what falls outside
|
|
1949
|
+
* [0, b − a] is left out */
|
|
1950
|
+
declare function parseFilmEvents(raw: unknown): FilmEvents;
|
|
1951
|
+
type BarRepeats = {
|
|
1952
|
+
beatsPerBar: number;
|
|
1953
|
+
bars: number;
|
|
1954
|
+
/** bars (1-based) that sound like an earlier bar, each with the first bar it repeats */
|
|
1955
|
+
repeats: {
|
|
1956
|
+
bar: number;
|
|
1957
|
+
of: number;
|
|
1958
|
+
}[];
|
|
1959
|
+
/** the longest stretch of consecutive bars repeating a stretch before it */
|
|
1960
|
+
longestRun: {
|
|
1961
|
+
from: number;
|
|
1962
|
+
to: number;
|
|
1963
|
+
of: number;
|
|
1964
|
+
} | null;
|
|
1965
|
+
};
|
|
1966
|
+
/** bars (4 beats on the estimated grid) that repeat an earlier bar verbatim:
|
|
1967
|
+
* the same band energies, step by step, within 1.5 dB on average and shaped
|
|
1968
|
+
* alike (correlation ≥ 0.95). Silent bars are left out. */
|
|
1969
|
+
|
|
1970
|
+
type How$3 = "measured" | "estimated" | "not detected" | "not measured";
|
|
1971
|
+
/** how much the picture changes into each frame (mean grey difference from
|
|
1972
|
+
* the frame before, 0..1): values[i] at t0 + i·dt; NaN where unknown */
|
|
1973
|
+
type PictureEnergy = {
|
|
1974
|
+
t0: number;
|
|
1975
|
+
dt: number;
|
|
1976
|
+
values: number[];
|
|
1977
|
+
};
|
|
1978
|
+
/** the events file's picture.energy curve (`film render` writes it); null when it has none */
|
|
1979
|
+
|
|
1980
|
+
type HalfSecond = {
|
|
1981
|
+
/** start (s) */
|
|
1982
|
+
t: number;
|
|
1983
|
+
/** loudness (LUFS) of the momentary readings centred in it, power mean; −120 for silence */
|
|
1984
|
+
lufs: number;
|
|
1985
|
+
/** mean picture change of the frames in it; NaN when none is known */
|
|
1986
|
+
energy: number;
|
|
1987
|
+
};
|
|
1988
|
+
/** the film cut into `binS` pieces, each with its loudness and picture change.
|
|
1989
|
+
* A momentary reading (400 ms, stamped at its end) counts where its middle is. */
|
|
1990
|
+
|
|
1991
|
+
type PictureAgainstSound = {
|
|
1992
|
+
binS: number;
|
|
1993
|
+
/** how many of the loudest and of the busiest pieces each list holds */
|
|
1994
|
+
top: number;
|
|
1995
|
+
/** start times of the loudest pieces, loudest first */
|
|
1996
|
+
loudest: number[];
|
|
1997
|
+
/** start times of the pieces where the picture changes most, busiest first */
|
|
1998
|
+
busiest: number[];
|
|
1999
|
+
/** how many pieces are in both */
|
|
2000
|
+
shared: number;
|
|
2001
|
+
/** stretches where one is over this film's median while the other is under
|
|
2002
|
+
* it, holding at least one piece where one is in the film's top third while
|
|
2003
|
+
* the other is in its bottom third: "busy-quiet" the picture busy, the sound
|
|
2004
|
+
* quiet; "still-loud" the other way. Mean picture change and loudness over it */
|
|
2005
|
+
opposite: {
|
|
2006
|
+
from: number;
|
|
2007
|
+
to: number;
|
|
2008
|
+
kind: "busy-quiet" | "still-loud";
|
|
2009
|
+
energy: number;
|
|
2010
|
+
lufs: number;
|
|
2011
|
+
}[];
|
|
2012
|
+
};
|
|
2013
|
+
/** the picture's change against the loudness, piece by piece: where the
|
|
2014
|
+
* loudest and the busiest pieces are, and where they run opposite. Pieces
|
|
2015
|
+
* without a picture reading are left out. Information, not a grade */
|
|
2016
|
+
|
|
2017
|
+
type FilmListen = {
|
|
2018
|
+
input: string;
|
|
2019
|
+
duration: number;
|
|
2020
|
+
sampleRate: number;
|
|
2021
|
+
channels: number;
|
|
2022
|
+
loudness: {
|
|
2023
|
+
how: How$3;
|
|
2024
|
+
integratedLufs: number | null;
|
|
2025
|
+
lra: number | null;
|
|
2026
|
+
truePeakDb: number | null;
|
|
2027
|
+
/** momentary loudness (LUFS, 400 ms) every 100 ms */
|
|
2028
|
+
momentary: {
|
|
2029
|
+
t: number;
|
|
2030
|
+
lufs: number;
|
|
2031
|
+
}[];
|
|
2032
|
+
};
|
|
2033
|
+
onsets: {
|
|
2034
|
+
how: How$3;
|
|
2035
|
+
times: number[];
|
|
2036
|
+
perS: number;
|
|
2037
|
+
};
|
|
2038
|
+
tempo: {
|
|
2039
|
+
how: How$3;
|
|
2040
|
+
value: Tempo | null;
|
|
2041
|
+
};
|
|
2042
|
+
sections: {
|
|
2043
|
+
how: How$3;
|
|
2044
|
+
list: Section[];
|
|
2045
|
+
};
|
|
2046
|
+
/** where several things in the sound change at once, and whether anything led into it */
|
|
2047
|
+
changes: {
|
|
2048
|
+
how: How$3;
|
|
2049
|
+
list: SoundChange[];
|
|
2050
|
+
};
|
|
2051
|
+
/** how in tune the pitched sound is, by register */
|
|
2052
|
+
tuning: Tuning;
|
|
2053
|
+
bars: {
|
|
2054
|
+
how: How$3;
|
|
2055
|
+
value: BarRepeats | null;
|
|
2056
|
+
note?: string;
|
|
2057
|
+
};
|
|
2058
|
+
silences: {
|
|
2059
|
+
how: How$3;
|
|
2060
|
+
list: {
|
|
2061
|
+
start: number;
|
|
2062
|
+
end: number;
|
|
2063
|
+
}[];
|
|
2064
|
+
};
|
|
2065
|
+
dips: {
|
|
2066
|
+
how: How$3;
|
|
2067
|
+
list: {
|
|
2068
|
+
start: number;
|
|
2069
|
+
end: number;
|
|
2070
|
+
belowLu: number;
|
|
2071
|
+
}[];
|
|
2072
|
+
};
|
|
2073
|
+
events: {
|
|
2074
|
+
how: How$3;
|
|
2075
|
+
file: string | null;
|
|
2076
|
+
list: (FilmEvent & {
|
|
2077
|
+
nearestOnset: number | null;
|
|
2078
|
+
})[];
|
|
2079
|
+
unvoiced: (FilmEvent & {
|
|
2080
|
+
nearestOnset: number | null;
|
|
2081
|
+
})[];
|
|
2082
|
+
chance40: number;
|
|
2083
|
+
};
|
|
2084
|
+
cuts: {
|
|
2085
|
+
how: How$3;
|
|
2086
|
+
source: "events" | "picture" | "none";
|
|
2087
|
+
list: {
|
|
2088
|
+
t: number;
|
|
2089
|
+
nearestOnset: number | null;
|
|
2090
|
+
}[];
|
|
2091
|
+
};
|
|
2092
|
+
stems: {
|
|
2093
|
+
how: How$3;
|
|
2094
|
+
dir: string | null;
|
|
2095
|
+
list: {
|
|
2096
|
+
name: string;
|
|
2097
|
+
file: string;
|
|
2098
|
+
activeS: number;
|
|
2099
|
+
peakDb: number;
|
|
2100
|
+
lane: boolean[];
|
|
2101
|
+
}[];
|
|
2102
|
+
/** seconds per lane cell */
|
|
2103
|
+
laneS: number;
|
|
2104
|
+
/** per event: the stem that rises at it, and how many dB it sits over the rest */
|
|
2105
|
+
eventWindows: {
|
|
2106
|
+
t: number;
|
|
2107
|
+
kind: string;
|
|
2108
|
+
stem: string;
|
|
2109
|
+
overRestDb: number;
|
|
2110
|
+
}[];
|
|
2111
|
+
};
|
|
2112
|
+
curves: FilmEvents["curves"];
|
|
2113
|
+
/** how much the picture changes, beside the sound */
|
|
2114
|
+
picture: {
|
|
2115
|
+
how: How$3;
|
|
2116
|
+
/** the events file's "picture.energy" curve, or measured from the film's picture */
|
|
2117
|
+
source: "events" | "picture" | "none";
|
|
2118
|
+
/** per frame (see PictureEnergy); null without a picture */
|
|
2119
|
+
energy: PictureEnergy | null;
|
|
2120
|
+
/** the film in half-seconds: mean picture change and loudness in each */
|
|
2121
|
+
halves: HalfSecond[];
|
|
2122
|
+
against: PictureAgainstSound | null;
|
|
2123
|
+
};
|
|
2124
|
+
clips: string[];
|
|
2125
|
+
/** what the sound is like — instruments, synthesized or recorded — is not measured */
|
|
2126
|
+
timbre: {
|
|
2127
|
+
how: "not measured";
|
|
2128
|
+
};
|
|
2129
|
+
/** the events file's "credits", as written there (absent: no such field) */
|
|
2130
|
+
credits?: string[];
|
|
2131
|
+
/** this sound beside a previous version of it (`--vs`) */
|
|
2132
|
+
vs?: ListenVs;
|
|
2133
|
+
};
|
|
2134
|
+
type FilmListenOptions = {
|
|
2135
|
+
/** the film (an mp4) or the score alone (a wav, or any sound) */
|
|
2136
|
+
input: string;
|
|
2137
|
+
/** the folder to write listen.png / listen.md / listen.json into;
|
|
2138
|
+
* default: `<input without extension>.listen/` */
|
|
2139
|
+
out?: string;
|
|
2140
|
+
/** default: `<input without extension>.events.json` when it exists */
|
|
2141
|
+
events?: string;
|
|
2142
|
+
/** a folder of stems (one sound file each, the score's parts) */
|
|
2143
|
+
stems?: string;
|
|
2144
|
+
/** solo/<stem>.m4a and mute/<stem>.m4a beside the report */
|
|
2145
|
+
clips?: boolean;
|
|
2146
|
+
/** draws listen.png; without it only the text and data are written */
|
|
2147
|
+
chromePath?: string;
|
|
2148
|
+
/** the seconds between `film sheet`'s frames, to mark the same times
|
|
2149
|
+
* (default: the sheet's own default for this length) */
|
|
2150
|
+
every?: number;
|
|
2151
|
+
/** a previous version of the film or its sound (any file ffmpeg reads):
|
|
2152
|
+
* what changed, on the same film time, and A/B clips of where it changed most */
|
|
2153
|
+
vs?: string;
|
|
2154
|
+
};
|
|
2155
|
+
declare function filmListen(opts: FilmListenOptions): Promise<{
|
|
2156
|
+
png: string | null;
|
|
2157
|
+
md: string;
|
|
2158
|
+
json: string;
|
|
2159
|
+
listen: FilmListen;
|
|
2160
|
+
}>;
|
|
2161
|
+
type Loud = {
|
|
2162
|
+
integratedLufs: number | null;
|
|
2163
|
+
lra: number | null;
|
|
2164
|
+
truePeakDb: number | null;
|
|
2165
|
+
};
|
|
2166
|
+
type ListenVsMoment = {
|
|
2167
|
+
start: number;
|
|
2168
|
+
end: number;
|
|
2169
|
+
/** spectrumDiff's frame differences, averaged over the stretch (dB) */
|
|
2170
|
+
diffDb: number;
|
|
2171
|
+
/** dBFS RMS over the stretch */
|
|
2172
|
+
levelDb: {
|
|
2173
|
+
this: number;
|
|
2174
|
+
previous: number;
|
|
2175
|
+
};
|
|
2176
|
+
/** onsets in the stretch with none within 40 ms in the other */
|
|
2177
|
+
onlyThis: number;
|
|
2178
|
+
onlyPrevious: number;
|
|
2179
|
+
};
|
|
2180
|
+
type ListenVs = {
|
|
2181
|
+
previous: string;
|
|
2182
|
+
durations: {
|
|
2183
|
+
this: number;
|
|
2184
|
+
previous: number;
|
|
2185
|
+
};
|
|
2186
|
+
/** the time compared: the longer of the two, the shorter silent after its end */
|
|
2187
|
+
duration: number;
|
|
2188
|
+
/** where the previous one's onset strength lines up best with this one's, ±2 s
|
|
2189
|
+
* (both are still compared on the same film time) */
|
|
2190
|
+
offset: {
|
|
2191
|
+
how: How$3;
|
|
2192
|
+
seconds: number | null;
|
|
2193
|
+
};
|
|
2194
|
+
loudness: {
|
|
2195
|
+
how: How$3;
|
|
2196
|
+
this: Loud;
|
|
2197
|
+
previous: Loud;
|
|
2198
|
+
};
|
|
2199
|
+
tempo: {
|
|
2200
|
+
how: How$3;
|
|
2201
|
+
this: number | null;
|
|
2202
|
+
previous: number | null;
|
|
2203
|
+
};
|
|
2204
|
+
onsets: {
|
|
2205
|
+
how: How$3;
|
|
2206
|
+
this: number;
|
|
2207
|
+
previous: number;
|
|
2208
|
+
/** onset times with none within 40 ms in the other */
|
|
2209
|
+
onlyThis: number[];
|
|
2210
|
+
onlyPrevious: number[];
|
|
2211
|
+
};
|
|
2212
|
+
sections: {
|
|
2213
|
+
how: How$3;
|
|
2214
|
+
this: number[];
|
|
2215
|
+
previous: number[];
|
|
2216
|
+
/** boundaries with none within 0.5 s in the other */
|
|
2217
|
+
onlyThis: number[];
|
|
2218
|
+
onlyPrevious: number[];
|
|
2219
|
+
};
|
|
2220
|
+
/** the events file's events: an onset within 40 ms in this one and not the previous (gained), or the reverse */
|
|
2221
|
+
events: {
|
|
2222
|
+
how: How$3;
|
|
2223
|
+
gained: {
|
|
2224
|
+
t: number;
|
|
2225
|
+
kind: string;
|
|
2226
|
+
label?: string;
|
|
2227
|
+
}[];
|
|
2228
|
+
lost: {
|
|
2229
|
+
t: number;
|
|
2230
|
+
kind: string;
|
|
2231
|
+
label?: string;
|
|
2232
|
+
}[];
|
|
2233
|
+
};
|
|
2234
|
+
/** the 1 s stretches whose spectra differ most (1 dB or more), most first;
|
|
2235
|
+
* typicalDb: the median 1 s stretch's difference, to read them against */
|
|
2236
|
+
moments: {
|
|
2237
|
+
how: How$3;
|
|
2238
|
+
list: ListenVsMoment[];
|
|
2239
|
+
typicalDb: number;
|
|
2240
|
+
};
|
|
2241
|
+
/** <out>/vs/: moment-N.this.m4a and moment-N.previous.m4a (the same film time,
|
|
2242
|
+
* 1 s either side), aba.m4a (this, previous, this at the first moment) */
|
|
2243
|
+
clips: string[];
|
|
2244
|
+
};
|
|
2245
|
+
/** a film's momentary loudness (400 ms windows, stamped at their end), as
|
|
2246
|
+
* `film listen` reads it; [] when it has no sound */
|
|
2247
|
+
|
|
2248
|
+
declare function formatFilmListen(l: FilmListen): string;
|
|
2249
|
+
|
|
2250
|
+
//#endregion
|
|
2251
|
+
//#region src/film/look.d.ts
|
|
2252
|
+
/** the lines of "The picture's change against the sound" */
|
|
2253
|
+
type FontFormat = "ttf" | "otf" | "woff" | "woff2";
|
|
2254
|
+
type FontInfo = {
|
|
2255
|
+
format: FontFormat;
|
|
2256
|
+
/** "truetype" (glyf) / "cff" / "bitmap" — which outlines it carries */
|
|
2257
|
+
outlines: "truetype" | "cff" | "bitmap";
|
|
2258
|
+
family: string;
|
|
2259
|
+
subfamily: string;
|
|
2260
|
+
fullName: string;
|
|
2261
|
+
postscriptName: string;
|
|
2262
|
+
/** OS/2 usWeightClass (400 regular, 700 bold) */
|
|
2263
|
+
weight: number;
|
|
2264
|
+
italic: boolean;
|
|
2265
|
+
/** variation axes, when it is a variable font */
|
|
2266
|
+
axes: {
|
|
2267
|
+
tag: string;
|
|
2268
|
+
min: number;
|
|
2269
|
+
default: number;
|
|
2270
|
+
max: number;
|
|
2271
|
+
}[];
|
|
2272
|
+
glyphs: number;
|
|
2273
|
+
unitsPerEm: number;
|
|
2274
|
+
/** in font units: ascender/descender/lineGap (hhea), cap and x height (OS/2, 0 when absent) */
|
|
2275
|
+
ascender: number;
|
|
2276
|
+
descender: number;
|
|
2277
|
+
lineGap: number;
|
|
2278
|
+
capHeight: number;
|
|
2279
|
+
xHeight: number;
|
|
2280
|
+
/** code point → glyph id */
|
|
2281
|
+
cmap: Map<number, number>;
|
|
2282
|
+
/** advance widths by glyph id (font units) */
|
|
2283
|
+
advances: number[];
|
|
2284
|
+
};
|
|
2285
|
+
/** What a font file is: names, weight, axes, metrics, the characters it maps. */
|
|
2286
|
+
declare function parseFont(buf: Buffer, opts?: {
|
|
2287
|
+
index?: number;
|
|
2288
|
+
}): FontInfo;
|
|
2289
|
+
/** Characters that need no glyph of their own: spaces, controls, joiners,
|
|
2290
|
+
* variation selectors. */
|
|
2291
|
+
|
|
2292
|
+
/** the distinct characters of `text` that need a glyph, in code point order */
|
|
2293
|
+
declare function glyphChars(text: string): number[];
|
|
2294
|
+
/** Width of `text` set in `font` at `sizePx`, from the advance widths alone —
|
|
2295
|
+
* no kerning, no shaping, the default instance of a variable font: an
|
|
2296
|
+
* estimate, close for most Latin and CJK text. Unmapped characters count as
|
|
2297
|
+
* the font's .notdef. */
|
|
2298
|
+
declare function textWidth(font: FontInfo, text: string, sizePx: number): number;
|
|
2299
|
+
/** The font size (px) at which `font`'s capitals stand `px` tall (its em box
|
|
2300
|
+
* when the font gives no cap height): the way back from a height measured in
|
|
2301
|
+
* a frame to the size Latin text was set at. CJK fonts give a cap height too
|
|
2302
|
+
* (for their Latin); their ideographs stand near the whole em instead, so a
|
|
2303
|
+
* Han character's measured height is close to the size itself. */
|
|
2304
|
+
declare function sizeForCapHeight(font: FontInfo, px: number): number;
|
|
2305
|
+
type GlyphCoverage = {
|
|
2306
|
+
/** distinct characters checked (those needing a glyph) */
|
|
2307
|
+
chars: number;
|
|
2308
|
+
/** characters no font covers, with their code points */
|
|
2309
|
+
missing: {
|
|
2310
|
+
char: string;
|
|
2311
|
+
code: string;
|
|
2312
|
+
}[];
|
|
2313
|
+
/** per font: how many of the characters it has, and which it lacks */
|
|
2314
|
+
byFont: {
|
|
2315
|
+
name: string;
|
|
2316
|
+
covered: number;
|
|
2317
|
+
lacks: string;
|
|
2318
|
+
}[];
|
|
2319
|
+
};
|
|
2320
|
+
/** Which of `text`'s characters each font has, and which none of them has. */
|
|
2321
|
+
declare function glyphCoverage(fonts: readonly {
|
|
2322
|
+
name: string;
|
|
2323
|
+
font: Pick<FontInfo, "cmap">;
|
|
2324
|
+
}[], text: string): GlyphCoverage;
|
|
2325
|
+
type FontSubset = {
|
|
2326
|
+
/** the cut-down font (WOFF unless `format: "ttf"`), or the original bytes when copied */
|
|
2327
|
+
data: Buffer;
|
|
2328
|
+
how: "subset" | "copied";
|
|
2329
|
+
/** why it was copied whole */
|
|
2330
|
+
why?: string;
|
|
2331
|
+
/** the requested characters the font has (the ones it keeps) */
|
|
2332
|
+
kept: number;
|
|
2333
|
+
/** glyphs left with outlines, of all */
|
|
2334
|
+
glyphs: {
|
|
2335
|
+
kept: number;
|
|
2336
|
+
of: number;
|
|
2337
|
+
};
|
|
2338
|
+
};
|
|
2339
|
+
/** The font cut down to `chars` (a string, or code points): every glyph id
|
|
2340
|
+
* kept, the glyphs no kept character can reach emptied, the cmap holding
|
|
2341
|
+
* only the kept characters. TrueType outlines only — CFF and bitmap fonts
|
|
2342
|
+
* come back whole, saying so. */
|
|
2343
|
+
declare function subsetFont(buf: Buffer, chars: string | Iterable<number>, opts?: {
|
|
2344
|
+
format?: "woff" | "ttf";
|
|
2345
|
+
index?: number;
|
|
2346
|
+
}): FontSubset;
|
|
2347
|
+
/** sRGB 0..255 channels, alpha 0..1 */
|
|
2348
|
+
type Rgba = {
|
|
2349
|
+
r: number;
|
|
2350
|
+
g: number;
|
|
2351
|
+
b: number;
|
|
2352
|
+
a: number;
|
|
2353
|
+
};
|
|
2354
|
+
/** A CSS colour in hex, rgb()/rgba() (comma or space syntax), hsl()/hsla(),
|
|
2355
|
+
* `transparent` or a few common names; null for anything else. */
|
|
2356
|
+
declare function parseCssColor(input: string): Rgba | null;
|
|
2357
|
+
/** #rrggbb, or #rrggbbaa when not opaque */
|
|
2358
|
+
|
|
2359
|
+
/** WCAG relative luminance, 0 (black) .. 1 (white) */
|
|
2360
|
+
declare const relativeLuminance: (c: Rgba) => number;
|
|
2361
|
+
/** WCAG contrast ratio of `fg` on `bg` (1..21); a translucent fg is laid over bg first */
|
|
2362
|
+
declare function contrastRatio(fg: Rgba | string, bg: Rgba | string): number;
|
|
2363
|
+
/** OKLCH: lightness 0..1, chroma (≈0..0.37), hue in degrees */
|
|
2364
|
+
|
|
2365
|
+
type ScreenSize = {
|
|
2366
|
+
name: string;
|
|
2367
|
+
widthPx: number;
|
|
2368
|
+
mmPerPx?: number;
|
|
2369
|
+
};
|
|
2370
|
+
/** Where a film is watched, as the CSS px width the frame is shown across.
|
|
2371
|
+
* The phone's millimetres assume a 6.1-inch phone (393 px across 65 mm). */
|
|
2372
|
+
|
|
2373
|
+
type Readable = {
|
|
2374
|
+
filmPx: number;
|
|
2375
|
+
filmWidth: number;
|
|
2376
|
+
on: {
|
|
2377
|
+
screen: string;
|
|
2378
|
+
px: number;
|
|
2379
|
+
mm?: number;
|
|
2380
|
+
}[];
|
|
2381
|
+
/** what those sizes compare with: Apple's default text sizes (px = pt) */
|
|
2382
|
+
reference: string;
|
|
2383
|
+
};
|
|
2384
|
+
/** How big text set at `sizePx` in a `filmWidth`-wide film shows on the
|
|
2385
|
+
* screens it is watched on — information, not a rule. */
|
|
2386
|
+
declare function readableSize(sizePx: number, opts?: {
|
|
2387
|
+
filmWidth?: number;
|
|
2388
|
+
screens?: readonly ScreenSize[];
|
|
2389
|
+
}): Readable;
|
|
2390
|
+
type CssMotion = {
|
|
2391
|
+
durations: {
|
|
2392
|
+
ms: number;
|
|
2393
|
+
count: number;
|
|
2394
|
+
where: string[];
|
|
2395
|
+
}[];
|
|
2396
|
+
easings: {
|
|
2397
|
+
value: string;
|
|
2398
|
+
count: number;
|
|
2399
|
+
where: string[];
|
|
2400
|
+
}[];
|
|
2401
|
+
keyframes: string[];
|
|
2402
|
+
};
|
|
2403
|
+
/** Transition and animation timings declared in stylesheets. Declared is not
|
|
2404
|
+
* played: a utility class can sit in the CSS unused. */
|
|
2405
|
+
|
|
2406
|
+
/** The words a film page could show, read statically: its markup's text and
|
|
2407
|
+
* every string literal in its own scripts (inline, and the .js/.mjs/.json
|
|
2408
|
+
* files it loads from its folder — kit/ left out), markup inside strings
|
|
2409
|
+
* stripped. An estimate: text a page builds or fetches at run time is not
|
|
2410
|
+
* seen, and a string that never reaches the screen is counted. */
|
|
2411
|
+
declare function filmText(page: string): Promise<{
|
|
2412
|
+
text: string;
|
|
2413
|
+
files: string[];
|
|
2414
|
+
}>;
|
|
2415
|
+
type How$2 = "measured" | "estimated" | "not detected";
|
|
2416
|
+
type LookColour = {
|
|
2417
|
+
hex: string;
|
|
2418
|
+
/** share of the sampled screen it paints as a background (0..1) */
|
|
2419
|
+
background: number;
|
|
2420
|
+
/** characters set in it */
|
|
2421
|
+
text: number;
|
|
2422
|
+
/** px of border edge drawn in it */
|
|
2423
|
+
border: number;
|
|
2424
|
+
/** share of the screen its SVG fills and strokes cover */
|
|
2425
|
+
fill: number;
|
|
2426
|
+
/** share of its background and text use that is on links, buttons, inputs */
|
|
2427
|
+
interactive: number;
|
|
2428
|
+
/** the grounds its text sits on, with the contrast ratio there */
|
|
2429
|
+
on: {
|
|
2430
|
+
ground: string;
|
|
2431
|
+
chars: number;
|
|
2432
|
+
contrast: number | null;
|
|
2433
|
+
}[];
|
|
2434
|
+
/** elements it was found on, most first */
|
|
2435
|
+
where: string[];
|
|
2436
|
+
/** custom properties that resolve to it */
|
|
2437
|
+
vars: string[];
|
|
2438
|
+
/** OKLCH lightness, chroma, hue */
|
|
2439
|
+
oklch: [number, number, number];
|
|
2440
|
+
};
|
|
2441
|
+
type LookRole = {
|
|
2442
|
+
hex: string | null;
|
|
2443
|
+
how: How$2;
|
|
2444
|
+
why: string;
|
|
2445
|
+
where: string[];
|
|
2446
|
+
vars: string[];
|
|
2447
|
+
/** the next candidates, for a different reading */
|
|
2448
|
+
alternatives?: {
|
|
2449
|
+
hex: string;
|
|
2450
|
+
why: string;
|
|
2451
|
+
}[];
|
|
2452
|
+
};
|
|
2453
|
+
type RoleName = "bg" | "surface" | "text" | "muted" | "accent" | "onAccent" | "border";
|
|
2454
|
+
type LookFontFile = {
|
|
2455
|
+
/** relative to look.json, when the file is in fonts/ */
|
|
2456
|
+
file: string | null;
|
|
2457
|
+
/** where it came from (the product's URL, or the saved screen's asset) */
|
|
2458
|
+
source: string | null;
|
|
2459
|
+
weight: string;
|
|
2460
|
+
style: string;
|
|
2461
|
+
unicodeRange: string;
|
|
2462
|
+
status: "saved" | "downloaded" | "not saved" | "not downloaded" | string;
|
|
2463
|
+
bytes?: number;
|
|
2464
|
+
/** from the file itself */
|
|
2465
|
+
name?: string;
|
|
2466
|
+
glyphs?: number;
|
|
2467
|
+
chars?: number;
|
|
2468
|
+
outlines?: FontInfo["outlines"];
|
|
2469
|
+
axes?: FontInfo["axes"];
|
|
2470
|
+
/** font units per em, cap and x height — for sizing type by its letters */
|
|
2471
|
+
metrics?: {
|
|
2472
|
+
unitsPerEm: number;
|
|
2473
|
+
capHeight: number;
|
|
2474
|
+
xHeight: number;
|
|
2475
|
+
ascender: number;
|
|
2476
|
+
descender: number;
|
|
2477
|
+
};
|
|
2478
|
+
};
|
|
2479
|
+
type LookFont = {
|
|
2480
|
+
family: string;
|
|
2481
|
+
/** a web font the page loads (else a font of the machine that read it, or generic) */
|
|
2482
|
+
webfont: boolean;
|
|
2483
|
+
chars: number;
|
|
2484
|
+
share: number;
|
|
2485
|
+
weights: {
|
|
2486
|
+
weight: string;
|
|
2487
|
+
chars: number;
|
|
2488
|
+
}[];
|
|
2489
|
+
sizes: {
|
|
2490
|
+
px: number;
|
|
2491
|
+
chars: number;
|
|
2492
|
+
}[];
|
|
2493
|
+
stacks: string[];
|
|
2494
|
+
/** the product's own words in it, biggest first */
|
|
2495
|
+
samples: string[];
|
|
2496
|
+
files: LookFontFile[];
|
|
2497
|
+
/** @font-face rules declaring the family, and how many have no file here */
|
|
2498
|
+
declared: number;
|
|
2499
|
+
missingFiles: number;
|
|
2500
|
+
};
|
|
2501
|
+
type LookGlyphs = {
|
|
2502
|
+
how: How$2;
|
|
2503
|
+
/** what was checked: "--text", the page's files */
|
|
2504
|
+
source: string[];
|
|
2505
|
+
chars: number;
|
|
2506
|
+
missing: {
|
|
2507
|
+
char: string;
|
|
2508
|
+
code: string;
|
|
2509
|
+
}[];
|
|
2510
|
+
/** per face: family, weight and style (a weight lacking a character falls
|
|
2511
|
+
* back to the next family, whatever another weight has) */
|
|
2512
|
+
byFamily: {
|
|
2513
|
+
family: string;
|
|
2514
|
+
weight: string;
|
|
2515
|
+
style: string;
|
|
2516
|
+
covered: number;
|
|
2517
|
+
lacks: string;
|
|
2518
|
+
}[];
|
|
2519
|
+
/** faces the product declares for missing characters that are not here —
|
|
2520
|
+
* missing from every file, or from the files of that face's weight */
|
|
2521
|
+
declaredElsewhere: {
|
|
2522
|
+
family: string;
|
|
2523
|
+
weight: string;
|
|
2524
|
+
style: string;
|
|
2525
|
+
src: string | null;
|
|
2526
|
+
chars: string;
|
|
2527
|
+
}[];
|
|
2528
|
+
};
|
|
2529
|
+
type LookPackage = {
|
|
2530
|
+
dir: string;
|
|
2531
|
+
css: string;
|
|
2532
|
+
files: {
|
|
2533
|
+
file: string;
|
|
2534
|
+
family: string;
|
|
2535
|
+
weight: string;
|
|
2536
|
+
style: string;
|
|
2537
|
+
/** the film's characters it serves (the spaces it keeps besides are not counted) */
|
|
2538
|
+
chars: number;
|
|
2539
|
+
bytes: number;
|
|
2540
|
+
from: string;
|
|
2541
|
+
fromBytes: number;
|
|
2542
|
+
how: FontSubset["how"];
|
|
2543
|
+
why?: string;
|
|
2544
|
+
}[];
|
|
2545
|
+
};
|
|
2546
|
+
type FilmLook = {
|
|
2547
|
+
version: 1;
|
|
2548
|
+
source: {
|
|
2549
|
+
kind: "take" | "states" | "state" | "url" | "look";
|
|
2550
|
+
input: string;
|
|
2551
|
+
url: string | null;
|
|
2552
|
+
title: string | null;
|
|
2553
|
+
/** the saved screens read (ids), or the page */
|
|
2554
|
+
screens: string[];
|
|
2555
|
+
skipped: string[];
|
|
2556
|
+
viewport: {
|
|
2557
|
+
width: number;
|
|
2558
|
+
height: number;
|
|
2559
|
+
} | null;
|
|
2560
|
+
};
|
|
2561
|
+
roles: Record<RoleName, LookRole>;
|
|
2562
|
+
colours: LookColour[];
|
|
2563
|
+
gradients: {
|
|
2564
|
+
value: string;
|
|
2565
|
+
share: number;
|
|
2566
|
+
where: string[];
|
|
2567
|
+
}[];
|
|
2568
|
+
/** share of the sampled screen that is an image, video or canvas */
|
|
2569
|
+
imageShare: number;
|
|
2570
|
+
vars: {
|
|
2571
|
+
name: string;
|
|
2572
|
+
value: string;
|
|
2573
|
+
hex: string | null;
|
|
2574
|
+
}[];
|
|
2575
|
+
fonts: LookFont[];
|
|
2576
|
+
/** families with @font-face rules that no visible text is set in */
|
|
2577
|
+
declaredFamilies: string[];
|
|
2578
|
+
type: {
|
|
2579
|
+
family: string;
|
|
2580
|
+
weight: string;
|
|
2581
|
+
sizePx: number;
|
|
2582
|
+
chars: number;
|
|
2583
|
+
sample: string;
|
|
2584
|
+
where: string;
|
|
2585
|
+
}[];
|
|
2586
|
+
radii: {
|
|
2587
|
+
value: string;
|
|
2588
|
+
px: number;
|
|
2589
|
+
count: number;
|
|
2590
|
+
where: string[];
|
|
2591
|
+
}[];
|
|
2592
|
+
shadows: {
|
|
2593
|
+
value: string;
|
|
2594
|
+
count: number;
|
|
2595
|
+
where: string[];
|
|
2596
|
+
}[];
|
|
2597
|
+
motion: {
|
|
2598
|
+
declared: CssMotion;
|
|
2599
|
+
used: {
|
|
2600
|
+
value: string;
|
|
2601
|
+
count: number;
|
|
2602
|
+
where: string[];
|
|
2603
|
+
}[];
|
|
2604
|
+
usedHow: How$2;
|
|
2605
|
+
};
|
|
2606
|
+
glyphs?: LookGlyphs;
|
|
2607
|
+
packaged?: LookPackage;
|
|
2608
|
+
labels: Record<string, How$2>;
|
|
2609
|
+
notes: string[];
|
|
2610
|
+
};
|
|
2611
|
+
type FilmLookOptions = {
|
|
2612
|
+
/** a take (…/x.take, or a folder holding states/), a states/ folder, one
|
|
2613
|
+
* saved screen (its folder or state.html), an http(s) URL, or a look.json
|
|
2614
|
+
* written before (then only the font work is done) */
|
|
2615
|
+
source: string;
|
|
2616
|
+
/** the folder look.json, look.png and fonts/ go in (default ./look; for a
|
|
2617
|
+
* look.json source, its own folder) */
|
|
2618
|
+
out?: string;
|
|
2619
|
+
/** needed unless the source is a look.json */
|
|
2620
|
+
chromePath?: string;
|
|
2621
|
+
/** only these saved screens (ids: s0, s3) */
|
|
2622
|
+
states?: string[];
|
|
2623
|
+
/** the film's words, checked against the fonts */
|
|
2624
|
+
text?: string;
|
|
2625
|
+
/** the film's page (or folder): its words read statically */
|
|
2626
|
+
page?: string;
|
|
2627
|
+
/** write the fonts the film's words need here, cut down, with fonts.css */
|
|
2628
|
+
fonts?: string;
|
|
2629
|
+
/** more font files the film uses (checked and packaged with the product's) */
|
|
2630
|
+
fontFiles?: string[];
|
|
2631
|
+
/** the page's CSS px for a URL (default 1920×1080) */
|
|
2632
|
+
width?: number;
|
|
2633
|
+
height?: number;
|
|
2634
|
+
/** skip look.png */
|
|
2635
|
+
noPicture?: boolean;
|
|
2636
|
+
onConsole?: (level: string, text: string) => void;
|
|
2637
|
+
};
|
|
2638
|
+
type FilmLookResult = {
|
|
2639
|
+
look: FilmLook;
|
|
2640
|
+
json: string;
|
|
2641
|
+
png: string | null;
|
|
2642
|
+
css: string | null;
|
|
2643
|
+
};
|
|
2644
|
+
/** An estimate of which colour plays which part, from where and how much each is used. */
|
|
2645
|
+
|
|
2646
|
+
declare function filmLook(opts: FilmLookOptions): Promise<FilmLookResult>;
|
|
2647
|
+
/** Font files cut down to the characters each serves of `chars`, written to
|
|
2648
|
+
* `dir` with a fonts.css of @font-face rules (each unicode-range the
|
|
2649
|
+
* characters the file kept). A file serving none of them is left out. */
|
|
2650
|
+
declare function packageFonts(opts: {
|
|
2651
|
+
dir: string;
|
|
2652
|
+
chars: Iterable<number>;
|
|
2653
|
+
files: {
|
|
2654
|
+
family: string;
|
|
2655
|
+
weight: string;
|
|
2656
|
+
style: string;
|
|
2657
|
+
unicodeRange?: string;
|
|
2658
|
+
path: string;
|
|
2659
|
+
}[];
|
|
2660
|
+
}): Promise<LookPackage>;
|
|
2661
|
+
declare function formatFilmLook(look: FilmLook): string;
|
|
2662
|
+
|
|
2663
|
+
//#endregion
|
|
2664
|
+
//#region src/film/materials.d.ts
|
|
2665
|
+
type Box$2 = [number, number, number, number];
|
|
2666
|
+
type MaterialKind = "img" | "svg" | "background" | "video" | "canvas";
|
|
2667
|
+
/** One image of the page. */
|
|
2668
|
+
type MaterialImage = {
|
|
2669
|
+
kind: MaterialKind;
|
|
2670
|
+
/** PAGE CSS px — x, y from the top-left of the whole page (scroll 0), and
|
|
2671
|
+
* the size it is drawn at */
|
|
2672
|
+
box: Box$2;
|
|
2673
|
+
/** an <img>'s alt as written ("" — the page marks it decorative) */
|
|
2674
|
+
alt?: string;
|
|
2675
|
+
/** its accessible name when there is no alt: aria-label, title, an svg's <title> */
|
|
2676
|
+
name?: string;
|
|
2677
|
+
/** the largest source the page offers (srcset / <picture> / image-set), a URL */
|
|
2678
|
+
src?: string;
|
|
2679
|
+
/** that source's width descriptor (srcset `1600w`) */
|
|
2680
|
+
srcW?: number;
|
|
2681
|
+
/** how many sources the page offers for it */
|
|
2682
|
+
sources?: number;
|
|
2683
|
+
/** the source the browser drew, when it is not `src` */
|
|
2684
|
+
shown?: string;
|
|
2685
|
+
/** the drawn source's own pixel size, when it had loaded */
|
|
2686
|
+
natural?: [number, number];
|
|
2687
|
+
/** a video's poster frame, a URL */
|
|
2688
|
+
poster?: string;
|
|
2689
|
+
/** the saved copy, relative to the state folder ("../assets/<sha1>.jpg");
|
|
2690
|
+
* a video's is its poster frame */
|
|
2691
|
+
file?: string;
|
|
2692
|
+
/** the saved copy's pixel size (absent for a format whose header is not read) */
|
|
2693
|
+
fileSize?: [number, number];
|
|
2694
|
+
bytes?: number;
|
|
2695
|
+
/** why no copy was saved */
|
|
2696
|
+
notSaved?: string;
|
|
2697
|
+
/** it starts within the first screen (scroll 0) */
|
|
2698
|
+
firstScreen: boolean;
|
|
2699
|
+
/** inside a position: fixed layer (its box is where the page was scrolled to) */
|
|
2700
|
+
fixed?: true;
|
|
2701
|
+
/** the landmark it sits in: nav, header, footer, aside, dialog */
|
|
2702
|
+
in?: string;
|
|
2703
|
+
/** why it is not seen as the page stands: "opacity 0" (a reveal not yet
|
|
2704
|
+
* run), "visibility hidden", "outside the page width" (a carousel slide) */
|
|
2705
|
+
hidden?: string;
|
|
2706
|
+
/** a CSS path that finds it */
|
|
2707
|
+
selector: string;
|
|
2708
|
+
/** its element id in the saved screen (read from a state.html) */
|
|
2709
|
+
el?: string;
|
|
2710
|
+
};
|
|
2711
|
+
/** One piece of the page's copy. */
|
|
2712
|
+
type MaterialText = {
|
|
2713
|
+
/** the element's tag (h1–h6, p, li, blockquote, …; a div or span set larger than the body) */
|
|
2714
|
+
tag: string;
|
|
2715
|
+
/** a heading's level (h2 → 2, aria-level) */
|
|
2716
|
+
level?: number;
|
|
2717
|
+
/** the text, collapsed (cut at MATERIAL_TEXT_MAX chars, `chars` the whole length) */
|
|
2718
|
+
text: string;
|
|
2719
|
+
chars?: number;
|
|
2720
|
+
box: Box$2;
|
|
2721
|
+
fontPx: number;
|
|
2722
|
+
weight: number;
|
|
2723
|
+
firstScreen: boolean;
|
|
2724
|
+
fixed?: true;
|
|
2725
|
+
in?: string;
|
|
2726
|
+
hidden?: string;
|
|
2727
|
+
selector: string;
|
|
2728
|
+
el?: string;
|
|
2729
|
+
};
|
|
2730
|
+
type MaterialMeta = {
|
|
2731
|
+
description?: string;
|
|
2732
|
+
/** og:image / twitter:image, a URL — the page's share picture */
|
|
2733
|
+
ogImage?: string;
|
|
2734
|
+
ogImageFile?: string;
|
|
2735
|
+
ogTitle?: string;
|
|
2736
|
+
themeColor?: string;
|
|
2737
|
+
icon?: string;
|
|
2738
|
+
};
|
|
2739
|
+
/** A link the page offers — to its About, docs, examples, repository, store
|
|
2740
|
+
* page: other pages a film can read the product from. */
|
|
2741
|
+
type MaterialLink = {
|
|
2742
|
+
/** what it says (its text, else its accessible name) */
|
|
2743
|
+
text: string;
|
|
2744
|
+
href: string;
|
|
2745
|
+
/** on the page's own site (its host's last two labels) */
|
|
2746
|
+
own: boolean;
|
|
2747
|
+
/** the landmark it sits in: nav, header, footer, aside, dialog */
|
|
2748
|
+
in?: string;
|
|
2749
|
+
firstScreen: boolean;
|
|
2750
|
+
};
|
|
2751
|
+
/** The full-page picture: the page from top to bottom, small, cut into
|
|
2752
|
+
* columns side by side (column k shows page y k·columnPx … (k+1)·columnPx). */
|
|
2753
|
+
type MaterialSheet = {
|
|
2754
|
+
/** relative to the state folder */
|
|
2755
|
+
file: string;
|
|
2756
|
+
columns: number;
|
|
2757
|
+
/** page CSS px per column */
|
|
2758
|
+
columnPx: number;
|
|
2759
|
+
/** image px per page CSS px */
|
|
2760
|
+
scale: number;
|
|
2761
|
+
/** page CSS px it shows from the top (the whole page unless it is very tall) */
|
|
2762
|
+
coveredPx: number;
|
|
2763
|
+
/** read from the saved screen: images the snapshot did not carry are blank */
|
|
2764
|
+
from: "saved screen";
|
|
2765
|
+
};
|
|
2766
|
+
/** `states/<id>/materials.json` — version 1. */
|
|
2767
|
+
type MaterialsFile = {
|
|
2768
|
+
version: 1;
|
|
2769
|
+
/** the saved screen it was read with */
|
|
2770
|
+
state: string;
|
|
2771
|
+
/** "live": in the product's page as it was shot; "saved screen": in its state.html */
|
|
2772
|
+
read: "live" | "saved screen";
|
|
2773
|
+
url: string;
|
|
2774
|
+
title: string;
|
|
2775
|
+
viewport: {
|
|
2776
|
+
w: number;
|
|
2777
|
+
h: number;
|
|
2778
|
+
};
|
|
2779
|
+
/** the whole page, CSS px */
|
|
2780
|
+
page: {
|
|
2781
|
+
w: number;
|
|
2782
|
+
h: number;
|
|
2783
|
+
};
|
|
2784
|
+
medianTextPx: number;
|
|
2785
|
+
meta: MaterialMeta;
|
|
2786
|
+
/** in page order (top to bottom, then left to right) */
|
|
2787
|
+
images: MaterialImage[];
|
|
2788
|
+
/** in page order */
|
|
2789
|
+
copy: MaterialText[];
|
|
2790
|
+
/** the other pages it links to, one per address, in page order (absent in
|
|
2791
|
+
* a file written before links were read) */
|
|
2792
|
+
links?: MaterialLink[];
|
|
2793
|
+
/** counted, not listed — each with its reason in `scope` */
|
|
2794
|
+
skipped: MaterialSkipped;
|
|
2795
|
+
sheet?: MaterialSheet;
|
|
2796
|
+
/** what was read and what was not, in words */
|
|
2797
|
+
scope: string;
|
|
2798
|
+
ms: {
|
|
2799
|
+
read: number;
|
|
2800
|
+
files?: number;
|
|
2801
|
+
sheet?: number;
|
|
2802
|
+
};
|
|
2803
|
+
};
|
|
2804
|
+
type MaterialSkipped = {
|
|
2805
|
+
/** drawn at no size (display: none, an empty box) */
|
|
2806
|
+
hidden: number;
|
|
2807
|
+
/** images and backgrounds drawn smaller than MATERIAL_MIN_IMAGE_PX square (icons, pixels) */
|
|
2808
|
+
small: number;
|
|
2809
|
+
/** inline svgs smaller than MATERIAL_MIN_SVG_AREA px² (icons) */
|
|
2810
|
+
icons: number;
|
|
2811
|
+
/** copy inside aria-hidden (a marquee's repeat) */
|
|
2812
|
+
ariaHidden: number;
|
|
2813
|
+
/** iframes (embeds, ads): not read */
|
|
2814
|
+
frames: number;
|
|
2815
|
+
/** past MATERIAL_MAX_IMAGES / MATERIAL_MAX_COPY entries */
|
|
2816
|
+
more: number;
|
|
2817
|
+
};
|
|
2818
|
+
/** A source the page offers for an image. */
|
|
2819
|
+
type MaterialCandidate = {
|
|
2820
|
+
url: string;
|
|
2821
|
+
/** srcset width descriptor */
|
|
2822
|
+
w?: number;
|
|
2823
|
+
/** density descriptor (a plain src is 1x) */
|
|
2824
|
+
x?: number;
|
|
2825
|
+
/** a <source>'s type */
|
|
2826
|
+
type?: string;
|
|
2827
|
+
media?: string;
|
|
2828
|
+
};
|
|
2829
|
+
/** What the page script returns per image, before the Node side picks the
|
|
2830
|
+
* largest source and saves files. */
|
|
2831
|
+
type MaterialProbeImage = Omit<MaterialImage, "src" | "srcW" | "sources" | "shown" | "file" | "fileSize" | "bytes" | "notSaved"> & {
|
|
2832
|
+
candidates: MaterialCandidate[];
|
|
2833
|
+
/** the source drawn (currentSrc) */
|
|
2834
|
+
current?: string;
|
|
2835
|
+
/** an inline svg, standalone (xmlns added, drawn size and colour on a wrapper) */
|
|
2836
|
+
markup?: string;
|
|
2837
|
+
};
|
|
2838
|
+
type MaterialsProbeResult = {
|
|
2839
|
+
url: string;
|
|
2840
|
+
title: string;
|
|
2841
|
+
viewport: {
|
|
2842
|
+
w: number;
|
|
2843
|
+
h: number;
|
|
2844
|
+
};
|
|
2845
|
+
page: {
|
|
2846
|
+
w: number;
|
|
2847
|
+
h: number;
|
|
2848
|
+
};
|
|
2849
|
+
medianTextPx: number;
|
|
2850
|
+
meta: MaterialMeta;
|
|
2851
|
+
images: MaterialProbeImage[];
|
|
2852
|
+
copy: MaterialText[];
|
|
2853
|
+
links?: MaterialLink[];
|
|
2854
|
+
skipped: MaterialSkipped;
|
|
2855
|
+
ms: number;
|
|
2856
|
+
} | {
|
|
2857
|
+
error: string;
|
|
2858
|
+
};
|
|
2859
|
+
/**
|
|
2860
|
+
* A function expression: `(${MATERIALS_PROBE_JS})()` returns a JSON string
|
|
2861
|
+
* (MaterialsProbeResult). Reads the page only — no node, attribute or style
|
|
2862
|
+
* is touched and nothing scrolls; the page is being filmed.
|
|
2863
|
+
*/
|
|
2864
|
+
declare const MATERIALS_PROBE_JS: string;
|
|
2865
|
+
/** The expression to evaluate (returnByValue): a JSON string. */
|
|
2866
|
+
declare const materialsProbeExpression: () => string;
|
|
2867
|
+
/**
|
|
2868
|
+
* The largest source among what the page offers for one image: the widest
|
|
2869
|
+
* `w` descriptor when there is one, else the highest density (a plain src
|
|
2870
|
+
* is 1x). A data: URL counts only when nothing else is offered (a blurred
|
|
2871
|
+
* placeholder in src, the picture in srcset). Ties go to a plain format,
|
|
2872
|
+
* then to the first offered. Null when nothing can be fetched.
|
|
2873
|
+
*/
|
|
2874
|
+
declare function largestSource(cands: readonly MaterialCandidate[]): {
|
|
2875
|
+
url: string;
|
|
2876
|
+
w?: number;
|
|
2877
|
+
} | null;
|
|
2878
|
+
/** An ad or tracking host (the image is listed, never saved). */
|
|
2879
|
+
declare function adHost(url: string): boolean;
|
|
2880
|
+
/** The pixel size an image file states in its header (PNG, GIF, JPEG, WebP,
|
|
2881
|
+
* SVG's width/height or viewBox); null for a format it does not read. */
|
|
2882
|
+
declare function imageFileSize(buf: Buffer): [number, number] | null;
|
|
2883
|
+
/** What the probe found, as the file lists it: each image's largest source
|
|
2884
|
+
* chosen, the source list dropped (its count kept); what is to be saved is
|
|
2885
|
+
* returned beside it, by index. */
|
|
2886
|
+
declare function materialsFromProbe(res: Exclude<MaterialsProbeResult, {
|
|
2887
|
+
error: string;
|
|
2888
|
+
}>, o: {
|
|
2889
|
+
state: string;
|
|
2890
|
+
read: MaterialsFile["read"];
|
|
2891
|
+
}): {
|
|
2892
|
+
file: MaterialsFile;
|
|
2893
|
+
/** per image (same index): a URL to fetch, an svg's markup, or a data: URL to decode */
|
|
2894
|
+
save: ({
|
|
2895
|
+
url: string;
|
|
2896
|
+
} | {
|
|
2897
|
+
markup: string;
|
|
2898
|
+
} | {
|
|
2899
|
+
data: string;
|
|
2900
|
+
} | null)[];
|
|
2901
|
+
};
|
|
2902
|
+
declare function materialsScope(read: MaterialsFile["read"]): string;
|
|
2903
|
+
/** One page's materials.json, where a source's saved screens hold one. */
|
|
2904
|
+
type MaterialsPage = {
|
|
2905
|
+
id: string;
|
|
2906
|
+
dir: string;
|
|
2907
|
+
file: MaterialsFile;
|
|
2908
|
+
path: string;
|
|
2909
|
+
};
|
|
2910
|
+
/** The materials.json files of a source's saved screens (one per page the
|
|
2911
|
+
* shoot visited — the first screen kept on each), in shooting order, and
|
|
2912
|
+
* the screens of pages none of them covers (to read from their state.html). */
|
|
2913
|
+
declare function readMaterials(source: ComponentSource): {
|
|
2914
|
+
pages: MaterialsPage[];
|
|
2915
|
+
/** one screen per page URL that has no materials.json */
|
|
2916
|
+
missing: {
|
|
2917
|
+
id: string;
|
|
2918
|
+
dir: string;
|
|
2919
|
+
url: string;
|
|
2920
|
+
}[];
|
|
2921
|
+
};
|
|
2922
|
+
/** A page's identity: its URL without the fragment. */
|
|
2923
|
+
declare const pageKey: (url: string) => string;
|
|
2924
|
+
declare function imageLine(im: MaterialImage, dir: string, show: (abs: string) => string): string;
|
|
2925
|
+
declare function copyLine(t: MaterialText, max?: number): string;
|
|
2926
|
+
/**
|
|
2927
|
+
* The few lines a shoot and `film init --url` print: per page its size and
|
|
2928
|
+
* counts, then — for the first page — its first images in the first screen
|
|
2929
|
+
* and below it, and its first headings / large type below the first screen,
|
|
2930
|
+
* each in page order, and where the whole list and the sheet are. Counts
|
|
2931
|
+
* and positions only; nothing is ranked or recommended.
|
|
2932
|
+
*/
|
|
2933
|
+
declare function materialsSummary(pages: readonly MaterialsPage[], o: {
|
|
2934
|
+
show: (abs: string) => string;
|
|
2935
|
+
cmd: string;
|
|
2936
|
+
}): string[];
|
|
2937
|
+
/** The pages a film can read the product from, as the page's links name
|
|
2938
|
+
* them: its navigation, header and footer first, its own site before
|
|
2939
|
+
* others, a few words each. Null when it links nowhere. */
|
|
2940
|
+
|
|
2941
|
+
/** The whole list, as `open-take materials` prints it: per page, images
|
|
2942
|
+
* and copy interleaved in page order. */
|
|
2943
|
+
declare function formatMaterials(pages: readonly MaterialsPage[], o: {
|
|
2944
|
+
show: (abs: string) => string;
|
|
2945
|
+
}): string;
|
|
2946
|
+
|
|
2947
|
+
//#endregion
|
|
2948
|
+
//#region src/film/part-files.d.ts
|
|
2949
|
+
/** One part as the page gave it. */
|
|
2950
|
+
type PartDom = {
|
|
2951
|
+
el: string;
|
|
2952
|
+
/** the part's own element and everything inside it, every style inlined;
|
|
2953
|
+
* references to the saved screen's files are `otrel:<path from states/>` */
|
|
2954
|
+
html: string;
|
|
2955
|
+
/** rules the markup cannot carry: ::before / ::after / ::placeholder, by
|
|
2956
|
+
* `[data-ot-p="<n>"]` */
|
|
2957
|
+
css: string;
|
|
2958
|
+
/** a hidden <svg> holding what the part's SVG refers to outside itself
|
|
2959
|
+
* (a gradient, a symbol), or "" */
|
|
2960
|
+
defs: string;
|
|
2961
|
+
/** its natural size, CSS px (border box, untransformed) */
|
|
2962
|
+
w: number;
|
|
2963
|
+
h: number;
|
|
2964
|
+
/** what it draws to the right and below, its box included, when that is
|
|
2965
|
+
* more than its box (a heading set nowrap past its width) */
|
|
2966
|
+
drawn?: [number, number];
|
|
2967
|
+
/** font families its text is set in (lower case, unquoted) */
|
|
2968
|
+
families: string[];
|
|
2969
|
+
/** elements in it */
|
|
2970
|
+
nodes: number;
|
|
2971
|
+
};
|
|
2972
|
+
/** `states/<id>/parts-dom.json` — version 1. */
|
|
2973
|
+
type PartDomFile = {
|
|
2974
|
+
version: 1;
|
|
2975
|
+
state: string;
|
|
2976
|
+
parts: PartDom[];
|
|
2977
|
+
skipped: {
|
|
2978
|
+
el: string;
|
|
2979
|
+
why: string;
|
|
2980
|
+
}[];
|
|
2981
|
+
/** time in the page */
|
|
2982
|
+
ms: number;
|
|
2983
|
+
};
|
|
2984
|
+
/** What the page script takes. */
|
|
2985
|
+
type PartDomInput = {
|
|
2986
|
+
/** element ids (data-ot-id), the component probe's parts */
|
|
2987
|
+
els: string[];
|
|
2988
|
+
/** most elements in one part (default 3000) */
|
|
2989
|
+
maxNodes?: number;
|
|
2990
|
+
/** most characters of markup per screen, all parts together (default 12 000 000) */
|
|
2991
|
+
maxChars?: number;
|
|
2992
|
+
};
|
|
2993
|
+
/**
|
|
2994
|
+
* A function expression: `(${PART_DOM_JS})(input)` returns a JSON string
|
|
2995
|
+
* (Omit<PartDomFile, "version" | "state"> or { error }). Reads the page; the
|
|
2996
|
+
* only thing it adds is a hidden about:blank frame (the browser's own
|
|
2997
|
+
* defaults per tag), removed before it returns.
|
|
2998
|
+
*/
|
|
2999
|
+
declare const PART_DOM_JS: string;
|
|
3000
|
+
/** The expression to evaluate in a restored state.html for these parts. */
|
|
3001
|
+
declare function partDomExpression(els: string[], opts?: Omit<PartDomInput, "els">): string;
|
|
3002
|
+
/**
|
|
3003
|
+
* Every @font-face rule a saved screen's state.html carries — in its own
|
|
3004
|
+
* <style> elements and in the stylesheets it links (and those they @import)
|
|
3005
|
+
* — each with its url()s written relative to `toDir`, and the family it
|
|
3006
|
+
* declares (as written, and lower case to match by).
|
|
3007
|
+
*/
|
|
3008
|
+
declare function stateFontFaces(stateDir: string, toDir: string): {
|
|
3009
|
+
family: string;
|
|
3010
|
+
key: string;
|
|
3011
|
+
css: string;
|
|
3012
|
+
}[];
|
|
3013
|
+
/** One part's file in `parts/index.json`. */
|
|
3014
|
+
type PartFileEntry = {
|
|
3015
|
+
/** the file, relative to index.json */
|
|
3016
|
+
file: string;
|
|
3017
|
+
ref: string;
|
|
3018
|
+
state: string;
|
|
3019
|
+
el: string;
|
|
3020
|
+
kind: ComponentEntry["kind"];
|
|
3021
|
+
label: string;
|
|
3022
|
+
/** what it holds, by field, as the page showed it (components.json has
|
|
3023
|
+
* each with where it was read) */
|
|
3024
|
+
values: Record<string, string>;
|
|
3025
|
+
/** its natural size, CSS px — the file's body is this size */
|
|
3026
|
+
w: number;
|
|
3027
|
+
h: number;
|
|
3028
|
+
/** what it draws to the right and below, when more than w × h (as on the page) */
|
|
3029
|
+
drawn?: [number, number];
|
|
3030
|
+
/** where it sat on its screen, the screen's CSS px */
|
|
3031
|
+
box: [number, number, number, number];
|
|
3032
|
+
/** its crisp picture (components.json's), relative to index.json */
|
|
3033
|
+
picture?: string;
|
|
3034
|
+
/** what was behind it on the page (the file itself is see-through) */
|
|
3035
|
+
backdrop: string;
|
|
3036
|
+
/** font families set in it that have their font in the file */
|
|
3037
|
+
fonts: string[];
|
|
3038
|
+
};
|
|
3039
|
+
/** `parts/index.json` — version 1. */
|
|
3040
|
+
type PartFilesIndex = {
|
|
3041
|
+
version: 1;
|
|
3042
|
+
about: string;
|
|
3043
|
+
/** components.json, relative to index.json */
|
|
3044
|
+
components: string;
|
|
3045
|
+
parts: PartFileEntry[];
|
|
3046
|
+
skipped: {
|
|
3047
|
+
ref: string;
|
|
3048
|
+
kind: ComponentEntry["kind"];
|
|
3049
|
+
label: string;
|
|
3050
|
+
why: string;
|
|
3051
|
+
}[];
|
|
3052
|
+
};
|
|
3053
|
+
/** `<state>-<el>-<kind>.html`, safe as a file name */
|
|
3054
|
+
declare function partFileName(e: Pick<ComponentEntry, "state" | "el" | "kind">): string;
|
|
3055
|
+
/** One part's file. */
|
|
3056
|
+
|
|
3057
|
+
type PartFilesResult = {
|
|
3058
|
+
/** the parts folder (absolute) */
|
|
3059
|
+
dir: string;
|
|
3060
|
+
/** parts/index.json (absolute) */
|
|
3061
|
+
index: string;
|
|
3062
|
+
written: number;
|
|
3063
|
+
skipped: PartFilesIndex["skipped"];
|
|
3064
|
+
};
|
|
3065
|
+
/**
|
|
3066
|
+
* Write each part of `file` (gathered from `source`) as
|
|
3067
|
+
* `<dir>/<state>-<el>-<kind>.html`, from what its screen's page gave
|
|
3068
|
+
* (states/<id>/parts-dom.json), and `<dir>/index.json`. A part whose screen
|
|
3069
|
+
* has no parts-dom.json, or that the page could not give, is skipped with
|
|
3070
|
+
* its reason. A folder of part files written before is replaced; one that
|
|
3071
|
+
* is something else is refused.
|
|
3072
|
+
*/
|
|
3073
|
+
declare function writePartFiles(file: ComponentsFile, source: Pick<ComponentSource, "root" | "states">, dir: string): PartFilesResult;
|
|
3074
|
+
/** The one line a summary prints about the part files. */
|
|
3075
|
+
declare function partFilesLine(r: PartFilesResult, shownDir: string): string;
|
|
3076
|
+
|
|
3077
|
+
//#endregion
|
|
3078
|
+
//#region src/film/picture.d.ts
|
|
3079
|
+
//# sourceMappingURL=part-files.d.ts.map
|
|
3080
|
+
type FilmPictureOptions = {
|
|
3081
|
+
/** a saved screen's state.html, or its folder */
|
|
3082
|
+
state: string;
|
|
3083
|
+
chromePath: string;
|
|
3084
|
+
/** how many picture px per screen px (default 2) */
|
|
3085
|
+
scale?: number;
|
|
3086
|
+
/** the PNG to write (default picture@<scale>x.png beside state.html) */
|
|
3087
|
+
out?: string;
|
|
3088
|
+
};
|
|
3089
|
+
declare function filmPicture(opts: FilmPictureOptions): Promise<{
|
|
3090
|
+
out: string;
|
|
3091
|
+
width: number;
|
|
3092
|
+
height: number;
|
|
3093
|
+
}>;
|
|
3094
|
+
|
|
3095
|
+
//#endregion
|
|
3096
|
+
//#region src/film/moving.d.ts
|
|
3097
|
+
//# sourceMappingURL=picture.d.ts.map
|
|
3098
|
+
|
|
3099
|
+
/** one picture on screen, its still and how it was taken */
|
|
3100
|
+
type MovingShown = {
|
|
3101
|
+
/** the picture's file, from the served folder */
|
|
3102
|
+
src: string;
|
|
3103
|
+
/** the shoot's log it was found in, from the served folder */
|
|
3104
|
+
log: string;
|
|
3105
|
+
still: string;
|
|
3106
|
+
/** sampled times it was on screen, film seconds */
|
|
3107
|
+
times: number[];
|
|
3108
|
+
/** texts that read differently just before and after the still was taken */
|
|
3109
|
+
texts: {
|
|
3110
|
+
before: string;
|
|
3111
|
+
after: string;
|
|
3112
|
+
}[];
|
|
3113
|
+
more: number;
|
|
3114
|
+
moved: boolean;
|
|
3115
|
+
animations: number;
|
|
3116
|
+
};
|
|
3117
|
+
type MovingMaterial = {
|
|
3118
|
+
how: "measured" | "not measured";
|
|
3119
|
+
note?: string;
|
|
3120
|
+
/** shots.json logs found under the served folder */
|
|
3121
|
+
logs: number;
|
|
3122
|
+
/** pictures on screen matched to a still of one of them */
|
|
3123
|
+
matched: number;
|
|
3124
|
+
/** of those, matched in a log from before `moving` was recorded */
|
|
3125
|
+
unrecorded: number;
|
|
3126
|
+
/** the matched pictures whose still was taken while the screen changed */
|
|
3127
|
+
list: MovingShown[];
|
|
3128
|
+
};
|
|
3129
|
+
|
|
3130
|
+
//#endregion
|
|
3131
|
+
//#region src/film/probe-text.d.ts
|
|
3132
|
+
/** every shots.json under `root` (a few levels down, dot folders left out) */
|
|
3133
|
+
type Box$1 = [number, number, number, number];
|
|
3134
|
+
|
|
3135
|
+
//#endregion
|
|
3136
|
+
//#region src/film/render.d.ts
|
|
3137
|
+
/** one moment of the page, as read (frame CSS px) */
|
|
3138
|
+
type FilmProgress = {
|
|
3139
|
+
phase: "probe" | "render";
|
|
3140
|
+
done: number;
|
|
3141
|
+
total: number;
|
|
3142
|
+
};
|
|
3143
|
+
type FilmFinePlan = {
|
|
3144
|
+
seconds: number;
|
|
3145
|
+
supersample: number;
|
|
3146
|
+
ranges: {
|
|
3147
|
+
from: number;
|
|
3148
|
+
to: number;
|
|
3149
|
+
}[];
|
|
3150
|
+
/** text near the middle of the probe's moving text speeds, by frame count */
|
|
3151
|
+
causes: {
|
|
3152
|
+
element: string;
|
|
3153
|
+
frames: number;
|
|
3154
|
+
}[];
|
|
3155
|
+
};
|
|
3156
|
+
type FilmRenderOptions = {
|
|
3157
|
+
/** the film: an .html file, or a directory holding index.html */
|
|
3158
|
+
page: string;
|
|
3159
|
+
/** the MP4 to write */
|
|
3160
|
+
out: string;
|
|
3161
|
+
chromePath: string;
|
|
3162
|
+
/** the directory served to the page (its URLs resolve inside it); default:
|
|
3163
|
+
* the working directory when the page is inside it, else the page's folder */
|
|
3164
|
+
root?: string;
|
|
3165
|
+
/** CSS px the page lays out at; default the page's __film, else 1920×1080 */
|
|
3166
|
+
width?: number;
|
|
3167
|
+
height?: number;
|
|
3168
|
+
fps?: number;
|
|
3169
|
+
/** seconds; default the page's __film.duration (or __duration) */
|
|
3170
|
+
duration?: number;
|
|
3171
|
+
/** render only [from, to) seconds */
|
|
3172
|
+
from?: number;
|
|
3173
|
+
to?: number;
|
|
3174
|
+
/** a soundtrack file; null for none; default the page's __film.audio */
|
|
3175
|
+
audio?: string | null;
|
|
3176
|
+
/** measured motion blur; default on (off in drafts) */
|
|
3177
|
+
blur?: boolean;
|
|
3178
|
+
/** half size, 30 fps, no blur, fast encode — for looking, not for delivery */
|
|
3179
|
+
draft?: boolean;
|
|
3180
|
+
/** draw every frame at this many times the pixels each way and scale it down
|
|
3181
|
+
* to the film's size. Chrome puts each glyph on a whole device pixel, so text
|
|
3182
|
+
* in a slow zoom or drift steps instead of gliding; finer pixels make the
|
|
3183
|
+
* steps finer. Unset, the frames where the page's text moves under a device
|
|
3184
|
+
* pixel a frame are drawn at FINE_SUPERSAMPLE and the rest at the film's
|
|
3185
|
+
* size; a number draws every frame at it (1: none). Ignored in drafts. */
|
|
3186
|
+
supersample?: number;
|
|
3187
|
+
/** keep the page's `will-change` hints. By default they are dropped while
|
|
3188
|
+
* rendering: Chrome draws a will-change layer once, at the size it has
|
|
3189
|
+
* then, and scales that picture, so a layer the camera enlarges shows soft
|
|
3190
|
+
* text (at a density the frame is not drawn finer at) — dropping the hint
|
|
3191
|
+
* redraws it sharp at every size. */
|
|
3192
|
+
keepLayers?: boolean;
|
|
3193
|
+
workers?: number;
|
|
3194
|
+
onProgress?: (p: FilmProgress) => void;
|
|
3195
|
+
/** the automatic supersampling plan, after probing and before rendering */
|
|
3196
|
+
onFine?: (plan: FilmFinePlan) => void;
|
|
3197
|
+
onConsole?: (level: string, text: string) => void;
|
|
3198
|
+
};
|
|
3199
|
+
type FilmRenderResult = {
|
|
3200
|
+
out: string;
|
|
3201
|
+
mode: FilmPageInfo["mode"];
|
|
3202
|
+
/** output pixel size */
|
|
3203
|
+
width: number;
|
|
3204
|
+
/** stretches drawn finer than the rest because the page's text moved under
|
|
3205
|
+
* a device pixel a frame there (film seconds, on the page's timeline), and
|
|
3206
|
+
* how finely; none when --supersample was given or in a draft */
|
|
3207
|
+
fine: {
|
|
3208
|
+
from: number;
|
|
3209
|
+
to: number;
|
|
3210
|
+
}[];
|
|
3211
|
+
fineCauses: FilmFinePlan["causes"];
|
|
3212
|
+
/** window.__bake.hash, the same in every page the render opened; null
|
|
3213
|
+
* when the page publishes none */
|
|
3214
|
+
bake: string | null;
|
|
3215
|
+
fineSupersample: number;
|
|
3216
|
+
/** moves where what ends up framed does not head straight for its place
|
|
3217
|
+
* (see turnsBack); null when the frames were not probed */
|
|
3218
|
+
turnsBack: TurnBack[] | null;
|
|
3219
|
+
height: number;
|
|
3220
|
+
fps: number;
|
|
3221
|
+
frames: number;
|
|
3222
|
+
/** screenshots taken (a blurred frame takes several) */
|
|
3223
|
+
samples: number;
|
|
3224
|
+
durationS: number;
|
|
3225
|
+
/** the first frame rendered, and the whole film's length in frames */
|
|
3226
|
+
startFrame: number;
|
|
3227
|
+
filmFrames: number;
|
|
3228
|
+
wallMs: number;
|
|
3229
|
+
warnings: string[];
|
|
3230
|
+
/** the film's events file (<out without its extension>.events.json), when one was written */
|
|
3231
|
+
events?: string;
|
|
3232
|
+
};
|
|
3233
|
+
/** One thing that happens in the film, as the page declares it: in seconds of
|
|
3234
|
+
* page time, with where on the stage (CSS px) and how hard (0..1) if it says. */
|
|
3235
|
+
|
|
3236
|
+
/** One stretch of the film as the page means it (kit/time.js `segment`): in
|
|
3237
|
+
* seconds of page time, every other field the page's own free words;
|
|
3238
|
+
* `handoff` is how it hands over to what comes next, at `to`. "hidden-cut"
|
|
3239
|
+
* declares a cut under motion at `to`; "lift" says a layer moves on its
|
|
3240
|
+
* own over the span, which can look like jumps or a camera turning back. */
|
|
3241
|
+
type FilmSegment = {
|
|
3242
|
+
from: number;
|
|
3243
|
+
to: number;
|
|
3244
|
+
label?: string;
|
|
3245
|
+
hold?: boolean;
|
|
3246
|
+
handoff?: string;
|
|
3247
|
+
seam?: Record<string, string | number>;
|
|
3248
|
+
/** what lives through the boundary at `to`: a CSS selector, or "(a
|
|
3249
|
+
* function)" — followed across it as the curves `carry@<to>:…` */
|
|
3250
|
+
carry?: string;
|
|
3251
|
+
/** a CSS selector, or a subject's name in the curves */
|
|
3252
|
+
subject?: string;
|
|
3253
|
+
sound?: string;
|
|
3254
|
+
};
|
|
3255
|
+
/** Something the film uses that someone else made, and on what terms
|
|
3256
|
+
* (kit/time.js `credit`, or window.__film.credits): every field the page's
|
|
3257
|
+
* own free words, for the record only — nothing checks or acts on it. */
|
|
3258
|
+
|
|
3259
|
+
/** Where something on screen comes from (kit/time.js `source`, or
|
|
3260
|
+
* window.__film.sources): a part of components.json, the live page it shows
|
|
3261
|
+
* on, or a note ("demo", "illustrative") — the page's own word, for the
|
|
3262
|
+
* record; `film probe` sets it beside the film's text, nothing checks it. */
|
|
3263
|
+
type FilmSource = {
|
|
3264
|
+
/** what on screen it covers: the text as shown, or words for it */
|
|
3265
|
+
label: string;
|
|
3266
|
+
/** a part of components.json, "<state>:<element id>" */
|
|
3267
|
+
ref?: string;
|
|
3268
|
+
/** which of the part's values */
|
|
3269
|
+
field?: string;
|
|
3270
|
+
/** the components.json it was read from, as the page fetched it */
|
|
3271
|
+
file?: string;
|
|
3272
|
+
url?: string;
|
|
3273
|
+
note?: string;
|
|
3274
|
+
/** the strings on screen it covers, beside the label */
|
|
3275
|
+
text?: string[];
|
|
3276
|
+
/** the film's elements whose text it covers (CSS) */
|
|
3277
|
+
selector?: string;
|
|
3278
|
+
};
|
|
3279
|
+
/** <film>.events.json: what the score reads to put its sounds where the
|
|
3280
|
+
* picture is. Times are page time (s). */
|
|
3281
|
+
|
|
3282
|
+
declare function renderFilm(opts: FilmRenderOptions): Promise<FilmRenderResult>;
|
|
3283
|
+
/** a page's events, checked and in time order (see FilmEvent) */
|
|
3284
|
+
|
|
3285
|
+
type FilmStillsOptions = {
|
|
3286
|
+
page: string;
|
|
3287
|
+
chromePath: string;
|
|
3288
|
+
/** seconds */
|
|
3289
|
+
at: readonly number[];
|
|
3290
|
+
outDir: string;
|
|
3291
|
+
root?: string;
|
|
3292
|
+
width?: number;
|
|
3293
|
+
height?: number;
|
|
3294
|
+
/** with the shutter's motion blur, as in the master (default on) */
|
|
3295
|
+
blur?: boolean;
|
|
3296
|
+
/** as the master is rendered (see FilmRenderOptions.supersample) */
|
|
3297
|
+
supersample?: number;
|
|
3298
|
+
/** see FilmRenderOptions.keepLayers */
|
|
3299
|
+
keepLayers?: boolean;
|
|
3300
|
+
onConsole?: (level: string, text: string) => void;
|
|
3301
|
+
/** what the stills found wrong on the page (an inline style that did not
|
|
3302
|
+
* take), once each */
|
|
3303
|
+
onWarning?: (text: string) => void;
|
|
3304
|
+
};
|
|
3305
|
+
/** Render only [from, to) of the film, at master quality, into `into` — a
|
|
3306
|
+
* master of the whole film — in place of its own frames: a change to a few
|
|
3307
|
+
* seconds costs those seconds, not the film. The master's sound is kept (to
|
|
3308
|
+
* change it, muxFilm). Refused when `into` is not a whole master of this
|
|
3309
|
+
* film: one `film render` did not make, one whose frames are not evenly
|
|
3310
|
+
* spaced, another size, frame rate or length, or a range of its own. */
|
|
3311
|
+
declare function patchFilm(opts: FilmRenderOptions & {
|
|
3312
|
+
into: string;
|
|
3313
|
+
}): Promise<FilmRenderResult>;
|
|
3314
|
+
/** Put a soundtrack under a rendered film without rendering it again: the
|
|
3315
|
+
* picture is copied as it is, the sound encoded as a render encodes it.
|
|
3316
|
+
* `audio` null leaves the film silent. */
|
|
3317
|
+
declare function muxFilm(opts: {
|
|
3318
|
+
film: string;
|
|
3319
|
+
audio: string | null;
|
|
3320
|
+
out: string;
|
|
3321
|
+
}): Promise<{
|
|
3322
|
+
out: string;
|
|
3323
|
+
durationS: number;
|
|
3324
|
+
}>;
|
|
3325
|
+
/** a rendered film's picture: size, rate, length in frames, and the record
|
|
3326
|
+
* `film render` keeps in it (where it starts on the page's timeline) —
|
|
3327
|
+
* `made` when there is one */
|
|
3328
|
+
|
|
3329
|
+
/** PNG stills of the film at the given times — `t012.500.png` … — as the
|
|
3330
|
+
* master would show them. */
|
|
3331
|
+
declare function filmStills(opts: FilmStillsOptions): Promise<string[]>;
|
|
3332
|
+
/** An inline style the page set that did not take, as the film clock keeps
|
|
3333
|
+
* it: the element (or rule), the CSS property, what was set, what the
|
|
3334
|
+
* property kept, and the film time (s; null before the film starts). */
|
|
3335
|
+
|
|
3336
|
+
/** A move of the picture where what it ends up framing does not head
|
|
3337
|
+
* straight for its place: it goes the wrong way first (`back`), or past and
|
|
3338
|
+
* back (`past`), by `px` on `axis`. Times on the page's timeline. */
|
|
3339
|
+
type TurnBack = {
|
|
3340
|
+
from: number;
|
|
3341
|
+
to: number;
|
|
3342
|
+
at: number;
|
|
3343
|
+
axis: "x" | "y";
|
|
3344
|
+
kind: "back" | "past";
|
|
3345
|
+
px: number;
|
|
3346
|
+
};
|
|
3347
|
+
|
|
3348
|
+
//#endregion
|
|
3349
|
+
//#region src/film/provenance.d.ts
|
|
3350
|
+
/** Each run of frames where the picture moves (its zoom and pan, `view`, as
|
|
3351
|
+
* the motion probe fitted them), ended by a cut or a stop: the point at the
|
|
3352
|
+
* middle of the frame when it ends is followed back through it, and where
|
|
3353
|
+
* it went the wrong way, or past its place and back, by `min` px or more,
|
|
3354
|
+
* that is said. A camera that moves its centre and its zoom apart, or keeps
|
|
3355
|
+
* inside the page by clamping every frame, does this; a move straight to its
|
|
3356
|
+
* view does not. */
|
|
3357
|
+
type How$1 = "measured" | "estimated" | "not detected" | "not measured";
|
|
3358
|
+
type Span = [number, number];
|
|
3359
|
+
/** One block of the film's own text at one moment: `k` the same element
|
|
3360
|
+
* across samples, `text` its visible text in full, `cov` the indices of the
|
|
3361
|
+
* page's sources whose selector holds it. */
|
|
3362
|
+
|
|
3363
|
+
type NumberToken = {
|
|
3364
|
+
raw: string;
|
|
3365
|
+
norm: string;
|
|
3366
|
+
};
|
|
3367
|
+
/** the numbers in a text, as written, and each as a plain number to compare
|
|
3368
|
+
* ("US$3,376" → "3376", "4.50" → "4.5"): separators of thousands are commas
|
|
3369
|
+
* followed by three digits; any other comma is read as a decimal point */
|
|
3370
|
+
declare function numberTokens(text: string): NumberToken[];
|
|
3371
|
+
/** a value a part of components.json showed, flattened for matching */
|
|
3372
|
+
type PartValueEntry = {
|
|
3373
|
+
ref: string;
|
|
3374
|
+
field?: string;
|
|
3375
|
+
text: string;
|
|
3376
|
+
value?: number;
|
|
3377
|
+
/** the components.json it is in (absolute) */
|
|
3378
|
+
file: string;
|
|
3379
|
+
/** a version 2 value; a version 1 file's label or a track's step (matched
|
|
3380
|
+
* on, never shown as a value) */
|
|
3381
|
+
by: "values" | "label" | "track";
|
|
3382
|
+
};
|
|
3383
|
+
type ComponentValueIndex = {
|
|
3384
|
+
files: {
|
|
3385
|
+
file: string;
|
|
3386
|
+
version: number;
|
|
3387
|
+
parts: number;
|
|
3388
|
+
values: number;
|
|
3389
|
+
}[];
|
|
3390
|
+
entries: PartValueEntry[];
|
|
3391
|
+
refs: Set<string>;
|
|
3392
|
+
/** files that could not be read, and why */
|
|
3393
|
+
unread: {
|
|
3394
|
+
file: string;
|
|
3395
|
+
why: string;
|
|
3396
|
+
}[];
|
|
3397
|
+
};
|
|
3398
|
+
/** every value the parts of these components.json files showed */
|
|
3399
|
+
|
|
3400
|
+
type ProvenanceKind = "declared" | "matches a part" | "no source declared";
|
|
3401
|
+
type ProvenanceValue = {
|
|
3402
|
+
/** the number as shown */
|
|
3403
|
+
text: string;
|
|
3404
|
+
how: ProvenanceKind;
|
|
3405
|
+
/** film seconds it is held on screen */
|
|
3406
|
+
spans: Span[];
|
|
3407
|
+
/** the text of its element where it was first seen, in full */
|
|
3408
|
+
in: string;
|
|
3409
|
+
/** the labels of the sources that cover it */
|
|
3410
|
+
sources?: string[];
|
|
3411
|
+
/** the parts that showed it: "<ref> <field>" (or the ref alone) */
|
|
3412
|
+
parts?: string[];
|
|
3413
|
+
};
|
|
3414
|
+
type ProvenanceSource = FilmSource & {
|
|
3415
|
+
/** film seconds its element, label or text is on screen; null: not read */
|
|
3416
|
+
seen: Span[] | null;
|
|
3417
|
+
/** for a ref: whether the components.json read has that part */
|
|
3418
|
+
part?: "in components.json" | "not in the components.json read" | "no components.json read";
|
|
3419
|
+
};
|
|
3420
|
+
type FilmProvenance = {
|
|
3421
|
+
how: How$1;
|
|
3422
|
+
note?: string;
|
|
3423
|
+
every: number;
|
|
3424
|
+
sources: {
|
|
3425
|
+
from: "page" | "events file" | null;
|
|
3426
|
+
list: ProvenanceSource[];
|
|
3427
|
+
};
|
|
3428
|
+
components: ComponentValueIndex["files"];
|
|
3429
|
+
unreadComponents: ComponentValueIndex["unread"];
|
|
3430
|
+
values: ProvenanceValue[];
|
|
3431
|
+
/** a block of the film's own text without a digit that reads exactly as a
|
|
3432
|
+
* part's value */
|
|
3433
|
+
strings: {
|
|
3434
|
+
text: string;
|
|
3435
|
+
spans: Span[];
|
|
3436
|
+
parts: string[];
|
|
3437
|
+
}[];
|
|
3438
|
+
/** numbers shown once while their element kept changing (a count, a
|
|
3439
|
+
* tween): not product data, not listed */
|
|
3440
|
+
between: {
|
|
3441
|
+
values: number;
|
|
3442
|
+
elements: number;
|
|
3443
|
+
};
|
|
3444
|
+
};
|
|
3445
|
+
|
|
3446
|
+
//#endregion
|
|
3447
|
+
//#region src/film/probe.d.ts
|
|
3448
|
+
/**
|
|
3449
|
+
* The film's own text over time set beside its declared sources and the
|
|
3450
|
+
* values the product's parts showed. A value counts as shown when its
|
|
3451
|
+
* element holds the same text in two samples in a row, or it is the last
|
|
3452
|
+
* text the element shows (it then leaves, or the film ends); any other — a
|
|
3453
|
+
* text shown once between two others — is in-between and only counted.
|
|
3454
|
+
*/
|
|
3455
|
+
/** every frame of a film as 8-bit grey, `w`×`h`, one after another */
|
|
3456
|
+
type GreyFrames = {
|
|
3457
|
+
w: number;
|
|
3458
|
+
h: number;
|
|
3459
|
+
fps: number;
|
|
3460
|
+
count: number;
|
|
3461
|
+
data: Uint8Array;
|
|
3462
|
+
/** the film time (s) of frame 0 — a stream can start after the sound does */
|
|
3463
|
+
t0?: number;
|
|
3464
|
+
};
|
|
3465
|
+
/** the film time (s) of frame i */
|
|
3466
|
+
|
|
3467
|
+
type SeamSeen = {
|
|
3468
|
+
t: number;
|
|
3469
|
+
/** the outgoing shot in its last 0.15 s, the incoming in its first */
|
|
3470
|
+
before: "moving" | "still";
|
|
3471
|
+
after: "moving" | "still";
|
|
3472
|
+
across: CarryKind$1;
|
|
3473
|
+
/** the label of the cut the page declared there, if it declared one */
|
|
3474
|
+
declared: string | null;
|
|
3475
|
+
/** neither side moves and nothing crosses */
|
|
3476
|
+
nothing: boolean;
|
|
3477
|
+
};
|
|
3478
|
+
/** cuts per bin of `binS` seconds over the film */
|
|
3479
|
+
|
|
3480
|
+
type CarryKind$1 = "carried" | "background only" | "nothing carried";
|
|
3481
|
+
type ChangeKind = "hard cut" | CarryKind$1;
|
|
3482
|
+
type PictureChange = {
|
|
3483
|
+
/** the frame the new picture is complete at (a cut: its first frame) */
|
|
3484
|
+
frame: number;
|
|
3485
|
+
t: number;
|
|
3486
|
+
kind: ChangeKind;
|
|
3487
|
+
/** what crosses the change, cut or not */
|
|
3488
|
+
across: CarryKind$1;
|
|
3489
|
+
/** the frames compared: the last before the change, the first after it */
|
|
3490
|
+
before: number;
|
|
3491
|
+
after: number;
|
|
3492
|
+
/** share of the frame's blocks that changed between before and after */
|
|
3493
|
+
changed: number;
|
|
3494
|
+
/** share of the frame (blocks) with texture that stays in place */
|
|
3495
|
+
stays: number;
|
|
3496
|
+
/** share of the frame with texture that is followed from before to after,
|
|
3497
|
+
* in place or moving (each step a small search; a cut: one wider search) */
|
|
3498
|
+
carried: number;
|
|
3499
|
+
/** share of the frame that is flat in both and keeps its grey: background */
|
|
3500
|
+
background: number;
|
|
3501
|
+
/** where the carried blocks went on average, in % of the frame's width/height */
|
|
3502
|
+
shift: {
|
|
3503
|
+
x: number;
|
|
3504
|
+
y: number;
|
|
3505
|
+
} | null;
|
|
3506
|
+
};
|
|
3507
|
+
/** how the whole picture moved from frame `a` to frame `b`: a scale about the
|
|
3508
|
+
* frame's centre and a shift (px of the grey copy), p' = c + s·(p − c) + t,
|
|
3509
|
+
* searched on a quarter-size copy (scales 0.88–1.13, shifts up to a quarter
|
|
3510
|
+
* of the width, around `around` when given); a still picture, or two that
|
|
3511
|
+
* no motion lays together (fitting under 70 % of the difference left with
|
|
3512
|
+
* none), is { s: 1, x: 0, y: 0 } */
|
|
3513
|
+
|
|
3514
|
+
type CameraRun = {
|
|
3515
|
+
what: "zoom" | "pan x" | "pan y";
|
|
3516
|
+
/** zoom: "in" (the picture grows) / "out"; pan: the way the picture moves */
|
|
3517
|
+
dir: "in" | "out" | "left" | "right" | "up" | "down";
|
|
3518
|
+
start: number;
|
|
3519
|
+
end: number;
|
|
3520
|
+
/** zoom: the scale over the run (×); pan: the shift, share of the frame */
|
|
3521
|
+
amount: number;
|
|
3522
|
+
};
|
|
3523
|
+
/** stretches where the picture keeps zooming or moving one way: the motion
|
|
3524
|
+
* smoothed over about a sixth of a second, at least `minRate` a second
|
|
3525
|
+
* (zoom: in ln units; pan: share of the frame), adding up to at least
|
|
3526
|
+
* `minTotal`; a cut or an unread step ends one */
|
|
3527
|
+
|
|
3528
|
+
type CameraBackForth = {
|
|
3529
|
+
what: CameraRun["what"];
|
|
3530
|
+
start: number;
|
|
3531
|
+
end: number;
|
|
3532
|
+
/** the runs, each the other way to the one before */
|
|
3533
|
+
runs: number;
|
|
3534
|
+
};
|
|
3535
|
+
/** runs of the same kind that turn back within `gap` s of each other, at
|
|
3536
|
+
* least `min` in a row — a zoom in, out, in…, a pan back and forth */
|
|
3537
|
+
|
|
3538
|
+
type CameraRepeat = {
|
|
3539
|
+
what: CameraRun["what"];
|
|
3540
|
+
dir: CameraRun["dir"];
|
|
3541
|
+
start: number;
|
|
3542
|
+
end: number;
|
|
3543
|
+
runs: number;
|
|
3544
|
+
/** the median time from one run's start to the next */
|
|
3545
|
+
every: number;
|
|
3546
|
+
};
|
|
3547
|
+
/** the same short move made again and again: runs of one kind and way, each
|
|
3548
|
+
* after a pause (at least 0.1 s with no such run), starting within `gap` s
|
|
3549
|
+
* of the one before, of about the same size (within 2×), at least `min` in a
|
|
3550
|
+
* row — a pulse on every beat, a push that resets each time */
|
|
3551
|
+
|
|
3552
|
+
type SubjectExit = {
|
|
3553
|
+
name: string;
|
|
3554
|
+
start: number;
|
|
3555
|
+
end: number;
|
|
3556
|
+
/** out entirely, or only partly (a box crossing the frame's edge) */
|
|
3557
|
+
how: "out" | "partly out";
|
|
3558
|
+
edge: "left" | "right" | "top" | "bottom";
|
|
3559
|
+
};
|
|
3560
|
+
/** subjects' positions from an events file: curve pairs `<name>.x`/`<name>.y`
|
|
3561
|
+
* (with `<name>.w`/`<name>.h` for a box), and events of kind "subject" with
|
|
3562
|
+
* x, y and a label naming the subject */
|
|
3563
|
+
|
|
3564
|
+
/** a segment of the page's beat sheet (kit/time.js `segment`), in film time */
|
|
3565
|
+
type SheetSegment = {
|
|
3566
|
+
from: number;
|
|
3567
|
+
to: number;
|
|
3568
|
+
label?: string;
|
|
3569
|
+
hold?: boolean;
|
|
3570
|
+
handoff?: string;
|
|
3571
|
+
/** what the page named to follow across the boundary at `to` */
|
|
3572
|
+
carry?: string;
|
|
3573
|
+
subject?: string;
|
|
3574
|
+
sound?: string;
|
|
3575
|
+
};
|
|
3576
|
+
/** a beat sheet as an events file or a page gives it: kept where it has two
|
|
3577
|
+
* times in order, by `from` */
|
|
3578
|
+
|
|
3579
|
+
type SegmentReading = SheetSegment & {
|
|
3580
|
+
/** share of the segment's frames whose picture changes (≥ the still line) */
|
|
3581
|
+
moving: number;
|
|
3582
|
+
/** where it moves, stretches of at least 0.1 s */
|
|
3583
|
+
movingSpans: {
|
|
3584
|
+
start: number;
|
|
3585
|
+
end: number;
|
|
3586
|
+
}[];
|
|
3587
|
+
cuts: number[];
|
|
3588
|
+
swaps: number[];
|
|
3589
|
+
/** the whole picture's motion summed over the segment's read steps: scale
|
|
3590
|
+
* (×) and shift (share of the frame); null when no step could be read */
|
|
3591
|
+
camera: {
|
|
3592
|
+
zoom: number;
|
|
3593
|
+
x: number;
|
|
3594
|
+
y: number;
|
|
3595
|
+
read: number;
|
|
3596
|
+
} | null;
|
|
3597
|
+
runs: CameraRun[];
|
|
3598
|
+
/** the declared subject, when the segment names one */
|
|
3599
|
+
subjectSeen?: {
|
|
3600
|
+
how: "measured" | "estimated" | "not detected" | "not measured";
|
|
3601
|
+
/** page: a selector found on the page; curves/events: a declared track by name */
|
|
3602
|
+
source: "page" | "curves" | "events" | null;
|
|
3603
|
+
out: {
|
|
3604
|
+
start: number;
|
|
3605
|
+
end: number;
|
|
3606
|
+
how: "out" | "partly out" | "not visible";
|
|
3607
|
+
edge?: string;
|
|
3608
|
+
}[];
|
|
3609
|
+
};
|
|
3610
|
+
/** what the picture does at the segment's end, where its handoff is */
|
|
3611
|
+
handoffSeen?: {
|
|
3612
|
+
how: "measured" | "estimated";
|
|
3613
|
+
kind: "hard cut" | "small swap" | "gradual: carried" | "gradual: background only" | "gradual: nothing carried" | "continuous, camera moving" | "continuous, no change" | "film ends";
|
|
3614
|
+
at: number | null;
|
|
3615
|
+
/** a hard cut: what crosses it */
|
|
3616
|
+
across?: CarryKind$1;
|
|
3617
|
+
nearestOnset: number | null;
|
|
3618
|
+
};
|
|
3619
|
+
};
|
|
3620
|
+
/** set each segment beside what the picture did over it */
|
|
3621
|
+
|
|
3622
|
+
type TextSample = {
|
|
3623
|
+
t: number;
|
|
3624
|
+
/** share of the frame under text: the page's own, the product's (saved
|
|
3625
|
+
* screens), inside pictures (read off the film); null: not read */
|
|
3626
|
+
own: number | null;
|
|
3627
|
+
product: number | null;
|
|
3628
|
+
picture: number | null;
|
|
3629
|
+
/** all of it */
|
|
3630
|
+
share: number;
|
|
3631
|
+
/** characters visible: the same split */
|
|
3632
|
+
ownChars: number | null;
|
|
3633
|
+
productChars: number | null;
|
|
3634
|
+
pictureChars: number | null;
|
|
3635
|
+
chars: number | null;
|
|
3636
|
+
/** the smallest and the median (by character) text size, film px; where
|
|
3637
|
+
* each came from */
|
|
3638
|
+
smallest: {
|
|
3639
|
+
px: number;
|
|
3640
|
+
from: "page" | "picture";
|
|
3641
|
+
text: string;
|
|
3642
|
+
} | null;
|
|
3643
|
+
median: number | null;
|
|
3644
|
+
/** the median size (by character, film px) of the product's words alone:
|
|
3645
|
+
* the page's text less the film's own pieces, and text read in pictures;
|
|
3646
|
+
* null: none of it read */
|
|
3647
|
+
productMedian?: number | null;
|
|
3648
|
+
};
|
|
3649
|
+
type TextOverlap = {
|
|
3650
|
+
from: number;
|
|
3651
|
+
to: number;
|
|
3652
|
+
/** the page's own text */
|
|
3653
|
+
text: string;
|
|
3654
|
+
over: string;
|
|
3655
|
+
};
|
|
3656
|
+
/** the page's text and the film's read text, sample by sample, put together */
|
|
3657
|
+
|
|
3658
|
+
/** the text samples per `binS` second: mean share, most characters at once,
|
|
3659
|
+
* the smallest size, the median of the samples' medians */
|
|
3660
|
+
declare function textPerSecond(samples: readonly TextSample[], duration: number, binS?: number): {
|
|
3661
|
+
t: number;
|
|
3662
|
+
share: number;
|
|
3663
|
+
chars: number | null;
|
|
3664
|
+
smallest: number | null;
|
|
3665
|
+
median: number | null;
|
|
3666
|
+
}[];
|
|
3667
|
+
/** under this many px on the phone, a size is named beside the tools that act
|
|
3668
|
+
* on part of a screen: information, not a limit */
|
|
3669
|
+
|
|
3670
|
+
type How = "measured" | "estimated" | "not detected" | "not measured";
|
|
3671
|
+
type FilmProbe = {
|
|
3672
|
+
input: string;
|
|
3673
|
+
duration: number;
|
|
3674
|
+
fps: number;
|
|
3675
|
+
/** the film time of the first frame */
|
|
3676
|
+
t0: number;
|
|
3677
|
+
size: {
|
|
3678
|
+
width: number;
|
|
3679
|
+
height: number;
|
|
3680
|
+
};
|
|
3681
|
+
/** the grey copy everything is read on */
|
|
3682
|
+
read: {
|
|
3683
|
+
width: number;
|
|
3684
|
+
height: number;
|
|
3685
|
+
frames: number;
|
|
3686
|
+
};
|
|
3687
|
+
energy: {
|
|
3688
|
+
how: How;
|
|
3689
|
+
/** mean of the per-frame change (0..1) in each `binS` bin */
|
|
3690
|
+
bins: number[];
|
|
3691
|
+
binS: number;
|
|
3692
|
+
/** the share of frames with any change at all (≥ 0.0015) */
|
|
3693
|
+
movingShare: number;
|
|
3694
|
+
};
|
|
3695
|
+
stills: {
|
|
3696
|
+
how: How;
|
|
3697
|
+
under: number;
|
|
3698
|
+
minS: number;
|
|
3699
|
+
list: {
|
|
3700
|
+
start: number;
|
|
3701
|
+
end: number;
|
|
3702
|
+
}[];
|
|
3703
|
+
share: number;
|
|
3704
|
+
};
|
|
3705
|
+
cuts: {
|
|
3706
|
+
how: How;
|
|
3707
|
+
/** `changed`: the share of the frame's blocks the cut changes */
|
|
3708
|
+
list: {
|
|
3709
|
+
t: number;
|
|
3710
|
+
frame: number;
|
|
3711
|
+
changed: number;
|
|
3712
|
+
nearestOnset: number | null;
|
|
3713
|
+
}[];
|
|
3714
|
+
perMin: number;
|
|
3715
|
+
/** cuts per 5 s */
|
|
3716
|
+
density: number[];
|
|
3717
|
+
/** of them, cuts that change at least NEW_PICTURE of the frame (a new
|
|
3718
|
+
* picture, not a word or a colour swapped inside a held one), per 5 s */
|
|
3719
|
+
densityNewPicture: number[];
|
|
3720
|
+
newPictureShare: number;
|
|
3721
|
+
densityBinS: number;
|
|
3722
|
+
};
|
|
3723
|
+
/** the stretches between hard cuts, film start and end included: every
|
|
3724
|
+
* one-frame jump ends one (a word swapped on a held picture too) */
|
|
3725
|
+
shots: ShotStats & {
|
|
3726
|
+
how: How;
|
|
3727
|
+
/** the same, ended only by the cuts that change at least NEW_PICTURE of
|
|
3728
|
+
* the frame */
|
|
3729
|
+
newPicture: ShotStats;
|
|
3730
|
+
/** the same, ended by small swaps too */
|
|
3731
|
+
withSwaps: ShotStats;
|
|
3732
|
+
};
|
|
3733
|
+
changes: {
|
|
3734
|
+
how: How;
|
|
3735
|
+
list: (PictureChange & {
|
|
3736
|
+
thumbs?: {
|
|
3737
|
+
before: string;
|
|
3738
|
+
after: string;
|
|
3739
|
+
};
|
|
3740
|
+
})[];
|
|
3741
|
+
};
|
|
3742
|
+
sound: {
|
|
3743
|
+
how: How;
|
|
3744
|
+
onsets: number;
|
|
3745
|
+
onsetsPerS: number;
|
|
3746
|
+
/** share of the cuts with an onset within 40 / 80 ms */
|
|
3747
|
+
within40: number | null;
|
|
3748
|
+
within80: number | null;
|
|
3749
|
+
/** share of the film within 40 / 80 ms of an onset: what cuts at random times would get */
|
|
3750
|
+
chance40: number;
|
|
3751
|
+
chance80: number;
|
|
3752
|
+
medianAbsOffset: number | null;
|
|
3753
|
+
};
|
|
3754
|
+
/** at each hard cut: does either side move next to it, does anything cross */
|
|
3755
|
+
seams: {
|
|
3756
|
+
how: How;
|
|
3757
|
+
list: SeamSeen[];
|
|
3758
|
+
};
|
|
3759
|
+
declaredCuts: {
|
|
3760
|
+
how: How;
|
|
3761
|
+
file: string | null;
|
|
3762
|
+
list: number[];
|
|
3763
|
+
/** declared cuts with no picture cut within 1.5 frames, and the reverse */
|
|
3764
|
+
unseen: number[];
|
|
3765
|
+
undeclared: number[];
|
|
3766
|
+
};
|
|
3767
|
+
subjects: {
|
|
3768
|
+
how: How;
|
|
3769
|
+
tracks: {
|
|
3770
|
+
name: string;
|
|
3771
|
+
source: string;
|
|
3772
|
+
samples: number;
|
|
3773
|
+
}[];
|
|
3774
|
+
exits: SubjectExit[];
|
|
3775
|
+
};
|
|
3776
|
+
marks: {
|
|
3777
|
+
how: How;
|
|
3778
|
+
list: {
|
|
3779
|
+
t: number;
|
|
3780
|
+
label: string;
|
|
3781
|
+
still: boolean;
|
|
3782
|
+
nearestCut: number | null;
|
|
3783
|
+
}[];
|
|
3784
|
+
};
|
|
3785
|
+
/** one-frame jumps that change 2–12 % of the frame: too small for a cut */
|
|
3786
|
+
smallSwaps: {
|
|
3787
|
+
how: How;
|
|
3788
|
+
list: {
|
|
3789
|
+
t: number;
|
|
3790
|
+
changed: number;
|
|
3791
|
+
}[];
|
|
3792
|
+
perMin: number;
|
|
3793
|
+
};
|
|
3794
|
+
/** the whole picture's scale and shift, read step by step (a camera move,
|
|
3795
|
+
* or anything large enough to carry the picture with it) */
|
|
3796
|
+
camera: {
|
|
3797
|
+
how: How;
|
|
3798
|
+
/** seconds between the frames compared */
|
|
3799
|
+
stepS: number;
|
|
3800
|
+
/** share of the steps a single motion could be read for */
|
|
3801
|
+
read: number;
|
|
3802
|
+
/** over the film: every read step's zoom in multiplied together, and
|
|
3803
|
+
* every zoom out (×), and how far the picture travelled (frame widths) */
|
|
3804
|
+
zoomIn: number | null;
|
|
3805
|
+
zoomOut: number | null;
|
|
3806
|
+
travel: number | null;
|
|
3807
|
+
runs: CameraRun[];
|
|
3808
|
+
reversals: {
|
|
3809
|
+
t: number;
|
|
3810
|
+
what: CameraRun["what"];
|
|
3811
|
+
}[];
|
|
3812
|
+
backAndForth: CameraBackForth[];
|
|
3813
|
+
repeated: CameraRepeat[];
|
|
3814
|
+
};
|
|
3815
|
+
/** the page's beat sheet beside what the picture did */
|
|
3816
|
+
segments: {
|
|
3817
|
+
how: How;
|
|
3818
|
+
source: "page" | "events file" | null;
|
|
3819
|
+
list: SegmentReading[];
|
|
3820
|
+
};
|
|
3821
|
+
/** how much of the frame is text, and how big */
|
|
3822
|
+
text: {
|
|
3823
|
+
how: How;
|
|
3824
|
+
every: number;
|
|
3825
|
+
/** the page's text (measured), read on the film clock */
|
|
3826
|
+
page: {
|
|
3827
|
+
how: How;
|
|
3828
|
+
file: string | null;
|
|
3829
|
+
note?: string;
|
|
3830
|
+
};
|
|
3831
|
+
/** text read off the film's frames (estimated) */
|
|
3832
|
+
picture: {
|
|
3833
|
+
how: How;
|
|
3834
|
+
reader: "ocr" | "edges" | null;
|
|
3835
|
+
};
|
|
3836
|
+
/** the width a phone is taken to show the film at (CSS px) */
|
|
3837
|
+
phoneWidth: number;
|
|
3838
|
+
/** film px × phoneScale = px on that phone */
|
|
3839
|
+
phoneScale: number;
|
|
3840
|
+
samples: TextSample[];
|
|
3841
|
+
perSecond: ReturnType<typeof textPerSecond>;
|
|
3842
|
+
overlaps: TextOverlap[];
|
|
3843
|
+
};
|
|
3844
|
+
/** where the numbers in the film's own text come from, as the page
|
|
3845
|
+
* declares (tl.source) and as the product's parts showed them
|
|
3846
|
+
* (components.json) — information only */
|
|
3847
|
+
provenance: FilmProvenance;
|
|
3848
|
+
/** the product's stills and saved screens on screen that their shoot
|
|
3849
|
+
* took while the screen was still changing (shots.json `moving`) */
|
|
3850
|
+
moving: MovingMaterial;
|
|
3851
|
+
};
|
|
3852
|
+
type ShotStats = {
|
|
3853
|
+
/** seconds of each shot */
|
|
3854
|
+
lengths: number[];
|
|
3855
|
+
median: number | null;
|
|
3856
|
+
shortest: number | null;
|
|
3857
|
+
longest: number | null;
|
|
3858
|
+
/** spread of the shot lengths (standard deviation / mean) */
|
|
3859
|
+
cv: number | null;
|
|
3860
|
+
};
|
|
3861
|
+
type FilmProbeOptions = {
|
|
3862
|
+
input: string;
|
|
3863
|
+
/** default: `<input without extension>.probe/` */
|
|
3864
|
+
out?: string;
|
|
3865
|
+
/** default: `<input without extension>.events.json` when it exists */
|
|
3866
|
+
events?: string;
|
|
3867
|
+
/** draws probe.png; without it only the text, data and thumbnails */
|
|
3868
|
+
chromePath?: string;
|
|
3869
|
+
/** the seconds between `film sheet`'s frames, to mark the same times */
|
|
3870
|
+
every?: number;
|
|
3871
|
+
/** the film's page (an .html file or its folder): its text is read on the
|
|
3872
|
+
* film clock (needs chromePath) and its beat sheet taken from it */
|
|
3873
|
+
page?: string;
|
|
3874
|
+
/** the directory the page is served from (as for `film render`) */
|
|
3875
|
+
root?: string;
|
|
3876
|
+
/** read the film's frames for text (default true): the system's text
|
|
3877
|
+
* recognizer on macOS, else an edge count */
|
|
3878
|
+
text?: boolean;
|
|
3879
|
+
/** seconds between text samples (default 0.5) */
|
|
3880
|
+
textEvery?: number;
|
|
3881
|
+
/** components.json files to set the film's numbers beside (default: those
|
|
3882
|
+
* the page's sources name, and those in the page's folder) */
|
|
3883
|
+
components?: readonly string[];
|
|
3884
|
+
onConsole?: (level: string, text: string) => void;
|
|
3885
|
+
};
|
|
3886
|
+
declare function filmProbe(opts: FilmProbeOptions): Promise<{
|
|
3887
|
+
/** the ruler and the first changes' thumbnails */
|
|
3888
|
+
png: string | null;
|
|
3889
|
+
/** probe.png and, when the changes run past one picture, probe-2.png… */
|
|
3890
|
+
pages: string[];
|
|
3891
|
+
md: string;
|
|
3892
|
+
json: string;
|
|
3893
|
+
probe: FilmProbe;
|
|
3894
|
+
}>;
|
|
3895
|
+
/** every frame as grey w×h; frames past the stream's end are not invented */
|
|
3896
|
+
|
|
3897
|
+
declare function formatFilmProbe(p: FilmProbe): string;
|
|
3898
|
+
|
|
3899
|
+
//#endregion
|
|
3900
|
+
//#region src/film/carry.d.ts
|
|
3901
|
+
type CarryKind = "carried" | "anchored" | "bare";
|
|
3902
|
+
type BoundaryCarry = {
|
|
3903
|
+
/** the boundary, s on the film's own clock */
|
|
3904
|
+
at: number;
|
|
3905
|
+
/** the handoff written on the segment ending here, if any */
|
|
3906
|
+
handoff?: string;
|
|
3907
|
+
/** what the segment named to follow, if anything */
|
|
3908
|
+
carry?: string;
|
|
3909
|
+
how: {
|
|
3910
|
+
kind: CarryKind;
|
|
3911
|
+
measured: true;
|
|
3912
|
+
scale: number;
|
|
3913
|
+
move: number;
|
|
3914
|
+
fill: number;
|
|
3915
|
+
note?: string;
|
|
3916
|
+
} | {
|
|
3917
|
+
kind: "cut" | "lift" | "words" | "unwritten" | "not rendered";
|
|
3918
|
+
measured: false;
|
|
3919
|
+
};
|
|
3920
|
+
};
|
|
3921
|
+
|
|
3922
|
+
//#endregion
|
|
3923
|
+
//#region src/film/report.d.ts
|
|
3924
|
+
/** the page's beat sheet counted: its stretches inside the film */
|
|
3925
|
+
type StretchCount = {
|
|
3926
|
+
count: number;
|
|
3927
|
+
/** s */
|
|
3928
|
+
median: number;
|
|
3929
|
+
longest: {
|
|
3930
|
+
from: number;
|
|
3931
|
+
to: number;
|
|
3932
|
+
label?: string;
|
|
3933
|
+
};
|
|
3934
|
+
};
|
|
3935
|
+
/** The stretches of a beat sheet inside [from, to] of the page's timeline,
|
|
3936
|
+
* times from the film's start; null when there are none. Facts: how many,
|
|
3937
|
+
* how long at the median, which is longest. */
|
|
3938
|
+
|
|
3939
|
+
type ReportJump = {
|
|
3940
|
+
t: number;
|
|
3941
|
+
kind: "cut" | "swap";
|
|
3942
|
+
/** share of the frame that changed */
|
|
3943
|
+
changed: number;
|
|
3944
|
+
/** how far the content that changed moved, px of the page's frame; null:
|
|
3945
|
+
* changed where it stood */
|
|
3946
|
+
px: number | null;
|
|
3947
|
+
dx: number;
|
|
3948
|
+
dy: number;
|
|
3949
|
+
/** of the changed blocks with texture, the share found moved together
|
|
3950
|
+
* (`px`): near 1 when a part jumps whole; low when most of what changed
|
|
3951
|
+
* changed where it stood and only some of it shifted along — a word
|
|
3952
|
+
* rewritten in place, the text after it reflowing. Absent in older reports */
|
|
3953
|
+
movedShare?: number;
|
|
3954
|
+
};
|
|
3955
|
+
type JumpIntent = "cut" | "hidden-cut" | "lift";
|
|
3956
|
+
/** Match observations to what the page declares. A cut can land within a
|
|
3957
|
+
* frame and a half of where it was written. A lift covers a turn when the
|
|
3958
|
+
* moment it was measured at is within that same margin of the lift's span. */
|
|
3959
|
+
|
|
3960
|
+
type ReportSlowText = {
|
|
3961
|
+
from: number;
|
|
3962
|
+
to: number;
|
|
3963
|
+
/** the moving text's median speed, px of the page's frame per film frame
|
|
3964
|
+
* (the median of the samples' medians), and the fastest piece's */
|
|
3965
|
+
speed: number;
|
|
3966
|
+
fastest: number;
|
|
3967
|
+
};
|
|
3968
|
+
type FilmReport = {
|
|
3969
|
+
film: string;
|
|
3970
|
+
duration: number;
|
|
3971
|
+
fps: number;
|
|
3972
|
+
/** where the film starts on the page's timeline (a render of part of it);
|
|
3973
|
+
* every time here is on the film's own clock, from 0 */
|
|
3974
|
+
from: number;
|
|
3975
|
+
/** seconds between the page's samples */
|
|
3976
|
+
every: number;
|
|
3977
|
+
/** the size the page was laid out at: every px here is one of these */
|
|
3978
|
+
layout: {
|
|
512
3979
|
width: number;
|
|
513
3980
|
height: number;
|
|
514
|
-
fps: number;
|
|
515
3981
|
};
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
3982
|
+
/** how the slow text below is counted: device px per page px and frames
|
|
3983
|
+
* a second — this render's, or for a draft a master's (full size, the
|
|
3984
|
+
* page's rate, no --supersample) */
|
|
3985
|
+
density: number;
|
|
3986
|
+
slowFps: number;
|
|
3987
|
+
/** the stretches the render drew finer because text moved slowly there
|
|
3988
|
+
* (film clock), and how finely */
|
|
3989
|
+
fine: {
|
|
3990
|
+
from: number;
|
|
3991
|
+
to: number;
|
|
3992
|
+
}[];
|
|
3993
|
+
fineSupersample: number;
|
|
3994
|
+
draft: boolean;
|
|
3995
|
+
/** the product's words on screen: its saved screens' (measured on the
|
|
3996
|
+
* page) and those in its pictures (read from their files, estimated) */
|
|
3997
|
+
productText: {
|
|
3998
|
+
how: "measured" | "not measured";
|
|
3999
|
+
note?: string;
|
|
4000
|
+
/** pictures on screen read for text: one file per folder and size (a
|
|
4001
|
+
* sequence of stills shares its layout); `skipped` folders past the
|
|
4002
|
+
* first PICTURE_GROUPS; how: "not read" with no text recognizer here */
|
|
4003
|
+
pictures: {
|
|
4004
|
+
how: "read" | "not read" | "none on screen";
|
|
4005
|
+
files: number;
|
|
4006
|
+
skipped: number;
|
|
527
4007
|
};
|
|
4008
|
+
spans: {
|
|
4009
|
+
from: number;
|
|
4010
|
+
to: number;
|
|
4011
|
+
share: number;
|
|
4012
|
+
phone: number | null;
|
|
4013
|
+
at: number | null;
|
|
4014
|
+
}[];
|
|
528
4015
|
};
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
*
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
*
|
|
557
|
-
|
|
558
|
-
|
|
4016
|
+
/** one-frame jumps of the picture the page did not declare as cuts */
|
|
4017
|
+
jumps: {
|
|
4018
|
+
how: "measured";
|
|
4019
|
+
/** how many cuts the page declared */
|
|
4020
|
+
declared: number;
|
|
4021
|
+
list: ReportJump[];
|
|
4022
|
+
intended?: {
|
|
4023
|
+
t: number;
|
|
4024
|
+
kind: JumpIntent;
|
|
4025
|
+
}[];
|
|
4026
|
+
};
|
|
4027
|
+
moving: MovingMaterial;
|
|
4028
|
+
slowText: {
|
|
4029
|
+
how: "measured" | "not measured";
|
|
4030
|
+
note?: string;
|
|
4031
|
+
spans: ReportSlowText[];
|
|
4032
|
+
};
|
|
4033
|
+
/** moves of the picture where what it ends up framing does not head
|
|
4034
|
+
* straight for its place (the render's probe, in the events file) */
|
|
4035
|
+
turns: {
|
|
4036
|
+
how: "measured" | "not measured";
|
|
4037
|
+
list: TurnBack[];
|
|
4038
|
+
intended?: TurnBack[];
|
|
4039
|
+
};
|
|
4040
|
+
/** <img>, <video> and <canvas> drawn bigger than their own pixels, and
|
|
4041
|
+
* layers under a perspective drawn bigger than Chrome draws them
|
|
4042
|
+
* (`why` "tilt"), at the page samples: `ratio` the most frame px per px
|
|
4043
|
+
* of the picture */
|
|
4044
|
+
pastPixels: {
|
|
4045
|
+
how: "measured" | "not measured";
|
|
4046
|
+
note?: string;
|
|
4047
|
+
list: {
|
|
4048
|
+
src?: string;
|
|
4049
|
+
label: string;
|
|
4050
|
+
from: number;
|
|
4051
|
+
to: number;
|
|
4052
|
+
ratio: number;
|
|
4053
|
+
why?: "tilt";
|
|
4054
|
+
}[];
|
|
4055
|
+
};
|
|
4056
|
+
/** the parts the film named through product() (window.__otParts), each
|
|
4057
|
+
* use read at its times; `named` 0: none was (a drag no part of
|
|
4058
|
+
* components.json was pressed for is a use of no part) */
|
|
4059
|
+
parts: {
|
|
4060
|
+
how: "measured" | "not measured";
|
|
4061
|
+
note?: string;
|
|
4062
|
+
named: number;
|
|
4063
|
+
uses: ReportPartUse[];
|
|
4064
|
+
};
|
|
4065
|
+
/** each boundary of the beat sheet (a segment's end inside the film) and
|
|
4066
|
+
* what crossed it: the thing its segment named to `carry`, followed by the
|
|
4067
|
+
* render (src/film/carry.ts), or what the segment says instead; `strip`
|
|
4068
|
+
* a picture beside the film, one row per boundary: 0.3 s before, the
|
|
4069
|
+
* boundary, 0.3 s after */
|
|
4070
|
+
seams: {
|
|
4071
|
+
how: "measured" | "not measured";
|
|
4072
|
+
note?: string;
|
|
4073
|
+
list: BoundaryCarry[];
|
|
4074
|
+
strip: string | null;
|
|
4075
|
+
};
|
|
4076
|
+
/** the beat sheet's stretches inside the film, as the page wrote them
|
|
4077
|
+
* (`tl.segment`): how many, the median length, the longest; absent when
|
|
4078
|
+
* the page wrote none */
|
|
4079
|
+
stretches?: StretchCount | null;
|
|
4080
|
+
/** where the picture and the sound run opposite, half a second at a time
|
|
4081
|
+
* (`film listen`'s own reading, from the events file's picture.energy) */
|
|
4082
|
+
against: {
|
|
4083
|
+
how: "measured" | "not measured";
|
|
4084
|
+
note?: string;
|
|
4085
|
+
list: PictureAgainstSound["opposite"];
|
|
4086
|
+
};
|
|
4087
|
+
/** the sound on its own: where several things in it change at once (the
|
|
4088
|
+
* sharpest first), and how in tune it is, by register — `film listen`'s readings */
|
|
4089
|
+
sound?: {
|
|
4090
|
+
how: "estimated";
|
|
4091
|
+
changes: SoundChange[] | null;
|
|
4092
|
+
tuning: Tuning;
|
|
4093
|
+
} | {
|
|
4094
|
+
how: "not measured";
|
|
4095
|
+
note: string;
|
|
4096
|
+
};
|
|
4097
|
+
/** wall time of the report, ms */
|
|
4098
|
+
ms: number;
|
|
559
4099
|
};
|
|
560
|
-
/**
|
|
561
|
-
*
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
4100
|
+
/** one use of a part (a camera move, a click, a drag, a mark) and where the
|
|
4101
|
+
* part was at its times (its start, and its end when it has one) */
|
|
4102
|
+
type ReportPartUse = {
|
|
4103
|
+
name: string;
|
|
4104
|
+
/** its element on the screen it was read on at the use, `<state>:<eN>` */
|
|
4105
|
+
ref: string;
|
|
4106
|
+
use: string;
|
|
4107
|
+
t: number;
|
|
4108
|
+
end?: number;
|
|
4109
|
+
label?: string;
|
|
4110
|
+
seen: ReportPartSeen[];
|
|
4111
|
+
/** why a time was not read (the page threw there) */
|
|
4112
|
+
note?: string;
|
|
4113
|
+
};
|
|
4114
|
+
type ReportPartSeen = {
|
|
4115
|
+
t: number;
|
|
4116
|
+
/** the screen it was read on; `shown` false: not the one shown then (the
|
|
4117
|
+
* nearest screen it is on was read), `on` every screen it is on */
|
|
4118
|
+
state: string;
|
|
4119
|
+
shown: boolean;
|
|
4120
|
+
/** the screen shown then, when the kit says */
|
|
4121
|
+
showing?: string;
|
|
4122
|
+
on: string[];
|
|
4123
|
+
/** where it is in the picture, px of the frame */
|
|
4124
|
+
picture: Box$1;
|
|
4125
|
+
/** its share inside the frame, and the edge it is most past when not all */
|
|
4126
|
+
inFrame: number;
|
|
4127
|
+
edge?: "left" | "right" | "top" | "bottom";
|
|
4128
|
+
/** what the page draws over it, by share of it; null: not read */
|
|
4129
|
+
covered: {
|
|
4130
|
+
what: string;
|
|
4131
|
+
share: number;
|
|
4132
|
+
}[] | null;
|
|
4133
|
+
/** what shows it, and frame px per px of the still or recording */
|
|
4134
|
+
drawn: "screen" | "still" | "recording";
|
|
4135
|
+
sourcePx?: number;
|
|
4136
|
+
};
|
|
4137
|
+
type FilmReportOptions = {
|
|
4138
|
+
/** the film just rendered */
|
|
4139
|
+
film: string;
|
|
4140
|
+
/** its page (an .html file or its folder) and the folder it was served from */
|
|
4141
|
+
page: string;
|
|
4142
|
+
root?: string;
|
|
4143
|
+
chromePath: string;
|
|
4144
|
+
/** default: the film's events file beside it */
|
|
4145
|
+
events?: string;
|
|
4146
|
+
/** the render's --supersample and --draft: how finely it drew text */
|
|
4147
|
+
supersample?: number;
|
|
4148
|
+
draft?: boolean;
|
|
4149
|
+
/** what the render drew finer (FilmRenderResult.fine, on the page's
|
|
4150
|
+
* timeline) and how finely */
|
|
4151
|
+
fine?: {
|
|
4152
|
+
from: number;
|
|
4153
|
+
to: number;
|
|
4154
|
+
}[];
|
|
4155
|
+
fineSupersample?: number;
|
|
4156
|
+
/** seconds between page samples (default 0.5) */
|
|
4157
|
+
every?: number;
|
|
4158
|
+
onConsole?: (level: string, text: string) => void;
|
|
4159
|
+
};
|
|
4160
|
+
/** asked of the page at each sample, on the same seek as its text */
|
|
568
4161
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
4162
|
+
declare function filmReport(opts: FilmReportOptions): Promise<FilmReport>;
|
|
4163
|
+
/** where a film's strip of boundaries goes: `film.mp4` → `film.seams.jpg` */
|
|
4164
|
+
|
|
4165
|
+
/** the lines `film render` prints: one per thing measured, then where the
|
|
4166
|
+
* full report is */
|
|
4167
|
+
declare function formatFilmReport(r: FilmReport, o: {
|
|
4168
|
+
probe: string;
|
|
4169
|
+
}): string[];
|
|
4170
|
+
|
|
4171
|
+
//#endregion
|
|
4172
|
+
//#region src/film/sheet.d.ts
|
|
4173
|
+
type FilmSheetOptions = {
|
|
4174
|
+
/** the video */
|
|
4175
|
+
input: string;
|
|
4176
|
+
/** the PNG to write */
|
|
4177
|
+
out: string;
|
|
4178
|
+
chromePath: string;
|
|
4179
|
+
/** seconds between frames; default: about 48 frames over the film */
|
|
4180
|
+
every?: number;
|
|
4181
|
+
/** exact times instead (seconds) */
|
|
4182
|
+
at?: readonly number[];
|
|
577
4183
|
};
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
4184
|
+
declare function filmSheet(opts: FilmSheetOptions): Promise<{
|
|
4185
|
+
out: string;
|
|
4186
|
+
times: number[];
|
|
4187
|
+
}>;
|
|
4188
|
+
|
|
4189
|
+
//#endregion
|
|
4190
|
+
//#region src/film/study-picture.d.ts
|
|
4191
|
+
//# sourceMappingURL=sheet.d.ts.map
|
|
4192
|
+
type StudyFrames = GreyFrames & {
|
|
4193
|
+
times?: readonly number[];
|
|
585
4194
|
};
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
4195
|
+
type CutKind = "hard_cut" | "scale_jump" | "match_cut";
|
|
4196
|
+
type Verdict = CutKind | "fast_move" | "in_picture_change" | "flash_or_fade" | "unresolved";
|
|
4197
|
+
/** What the study says crosses a cut: the probe's reading on the grey copy,
|
|
4198
|
+
* or a small part seen staying put on a finer one. */
|
|
4199
|
+
type AcrossKind = CarryKind$1 | "small part kept";
|
|
589
4200
|
|
|
590
4201
|
//#endregion
|
|
591
|
-
//#region src/
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
/**
|
|
597
|
-
|
|
4202
|
+
//#region src/film/study-declared.d.ts
|
|
4203
|
+
/** The width of the copy `keptInPlace` reads: the strips' colour frames. A
|
|
4204
|
+
* thing 100 px across on a 1920 px film is one block of the 96 px grey copy
|
|
4205
|
+
* and two or three across here. */
|
|
4206
|
+
type DeclaredBoundary = {
|
|
4207
|
+
/** s on the film's own clock */
|
|
4208
|
+
at: number;
|
|
4209
|
+
/** the kinds of the page's events here: "cut", "hidden-cut", or the page's own word */
|
|
4210
|
+
kinds: string[];
|
|
4211
|
+
/** those events' labels */
|
|
4212
|
+
labels: string[];
|
|
4213
|
+
/** the handoff written on the segment ending here */
|
|
4214
|
+
handoff?: string;
|
|
4215
|
+
/** what that segment named to follow across */
|
|
4216
|
+
carry?: string;
|
|
4217
|
+
/** what the render measured of that thing (carry.ts), when it named one */
|
|
4218
|
+
carried?: {
|
|
4219
|
+
kind: "carried" | "anchored" | "bare";
|
|
4220
|
+
change: string;
|
|
4221
|
+
note?: string;
|
|
4222
|
+
};
|
|
598
4223
|
};
|
|
599
|
-
type
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
/** sample instant in the DELIVERED video (startMs head trim applied), s */
|
|
603
|
-
tSec: number;
|
|
604
|
-
/** expected cursor-tip position in the finished frame, output px */
|
|
605
|
-
expect: Pt;
|
|
606
|
-
/** best-match tip position, output px (absent when unverifiable) */
|
|
607
|
-
found?: Pt;
|
|
608
|
-
/** tip error in viewport px (output-px error / camera scale) */
|
|
609
|
-
errViewportPx?: number;
|
|
610
|
-
/** masked NCC score of the best match */
|
|
611
|
-
ncc?: number;
|
|
612
|
-
/** the expected tip is not in the delivered frame — unverifiable, never an error */
|
|
613
|
-
offscreen?: boolean;
|
|
4224
|
+
type Declarations = {
|
|
4225
|
+
file: string;
|
|
4226
|
+
boundaries: DeclaredBoundary[];
|
|
614
4227
|
};
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
sampleMs: number;
|
|
620
|
-
/** the same instant in the DELIVERED video (startMs head trim applied), s */
|
|
621
|
-
tSec: number;
|
|
622
|
-
/** expected cursor-tip position in the finished frame, output px */
|
|
623
|
-
expect: Pt;
|
|
624
|
-
/** camera scale at the sample instant (output px per video px) */
|
|
625
|
-
camScale: number;
|
|
626
|
-
/** the tip is not in the delivered frame (zoomed out of frame, or the head
|
|
627
|
-
* trim cut the sample) — unverifiable, never an error */
|
|
628
|
-
offscreen: boolean;
|
|
4228
|
+
/** why an events file beside a film was left unread */
|
|
4229
|
+
type DeclarationsSkipped = {
|
|
4230
|
+
file: string;
|
|
4231
|
+
skipped: string;
|
|
629
4232
|
};
|
|
630
|
-
/** Where the compositor MEANT to draw the pointer tip, per pointer-landing
|
|
631
|
-
* beat, in finished-frame px — via the engine's own public math, so there is
|
|
632
|
-
* no second geometry to drift. */
|
|
633
|
-
declare function predictCursorTips(comp: TakeComposition, sampleAfterMs?: number): PredictedTip[];
|
|
634
|
-
/** Turn measured rows into issues (pure — unit-testable without a video). */
|
|
635
|
-
declare function auditIssues(rows: AuditRow[], tolPx?: number): CompositionIssue[];
|
|
636
|
-
/** Audit the drawn cursor of a delivered mp4 against the composition that
|
|
637
|
-
* rendered it. One row per pointer-landing beat; issues in the
|
|
638
|
-
* validateComposition shape ("error" = the render is wrong, "warn" = a beat
|
|
639
|
-
* the audit cannot see). */
|
|
640
|
-
declare function auditCursor(comp: TakeComposition, mp4Path: string, opts?: AuditCursorOpts): Promise<{
|
|
641
|
-
rows: AuditRow[];
|
|
642
|
-
issues: CompositionIssue[];
|
|
643
|
-
}>;
|
|
644
4233
|
|
|
645
4234
|
//#endregion
|
|
646
|
-
//#region src/
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
* bare press (no located element). */
|
|
655
|
-
box?: BBox;
|
|
656
|
-
/** the dominant region that changed after the action (frame-diff seam),
|
|
657
|
-
* video-px. Framed over `box` when present. */
|
|
658
|
-
effectBox?: BBox;
|
|
659
|
-
/** fraction of the frame that changed after the action, 0..1. */
|
|
660
|
-
changeCoverage?: number;
|
|
661
|
-
/** anchor / cursor rest point, video-px (for the reason only). */
|
|
662
|
-
point: Pt;
|
|
663
|
-
/** plan override; absent ⇒ "auto" (the director decides). */
|
|
664
|
-
intent: ZoomIntent;
|
|
665
|
-
/** short label (sel / note) for the cluster tag in the reason. */
|
|
666
|
-
label?: string;
|
|
667
|
-
/** press only: the key chord (for the Escape-dismissal rule). */
|
|
668
|
-
keys?: string;
|
|
4235
|
+
//#region src/film/study.d.ts
|
|
4236
|
+
/** The boundaries an events file declares, on the film's clock: every "cut"
|
|
4237
|
+
* and "hidden-cut" event and every segment that ends before the film does.
|
|
4238
|
+
* Other events at one of those times (a "whip", say) lend their kind and
|
|
4239
|
+
* label. Times within `tolerance` seconds are one boundary. */
|
|
4240
|
+
type Mark<T> = {
|
|
4241
|
+
value: T;
|
|
4242
|
+
how: BeatsHow;
|
|
669
4243
|
};
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
4244
|
+
type Identity = {
|
|
4245
|
+
file: string;
|
|
4246
|
+
bytes: number;
|
|
4247
|
+
width: number;
|
|
4248
|
+
height: number;
|
|
4249
|
+
duration: number;
|
|
4250
|
+
sha256: string;
|
|
4251
|
+
audioPresent: boolean;
|
|
4252
|
+
timingMeasured: boolean;
|
|
4253
|
+
endMeasured?: boolean;
|
|
4254
|
+
durationMeasured?: boolean;
|
|
4255
|
+
fpsMeasured?: boolean;
|
|
677
4256
|
};
|
|
678
|
-
/**
|
|
679
|
-
*
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
4257
|
+
/** The reference pack as data. Frame ranges are zero-based and end-exclusive.
|
|
4258
|
+
* Times may be native PTS; the end of the picture is supplied separately. */
|
|
4259
|
+
declare function analyzeStudy(g: StudyFrames, identity: Identity, pictureEnd: number, pcm?: Float32Array | null, soundStart?: number,
|
|
4260
|
+
/** `declared`: what the film's own events file says of its boundaries.
|
|
4261
|
+
* `keptAt`: for a cut at this frame, the share of the picture seen staying
|
|
4262
|
+
* put on a finer copy (keptInPlace), or null where it was not read. */
|
|
4263
|
+
also?: {
|
|
4264
|
+
declared?: Declarations | DeclarationsSkipped | null;
|
|
4265
|
+
keptAt?: (frame: number) => number | null;
|
|
4266
|
+
}): {
|
|
4267
|
+
version: Mark<number>;
|
|
4268
|
+
identity: {
|
|
4269
|
+
file: Mark<string>;
|
|
4270
|
+
bytes: Mark<number>;
|
|
4271
|
+
width: Mark<number>;
|
|
4272
|
+
height: Mark<number>;
|
|
4273
|
+
fps: Mark<number>;
|
|
4274
|
+
frames: Mark<number>;
|
|
4275
|
+
duration: Mark<number>;
|
|
4276
|
+
pictureStart: Mark<number>;
|
|
4277
|
+
pictureEnd: Mark<number>;
|
|
4278
|
+
constantCadence: Mark<boolean | null>;
|
|
4279
|
+
sha256: Mark<string>;
|
|
4280
|
+
audioPresent: Mark<boolean>;
|
|
4281
|
+
};
|
|
4282
|
+
picture: {
|
|
4283
|
+
candidates: Mark<number>;
|
|
4284
|
+
verified: Mark<number>;
|
|
4285
|
+
shares: {
|
|
4286
|
+
travel: Mark<number | null>;
|
|
4287
|
+
drift: Mark<number | null>;
|
|
4288
|
+
hold: Mark<number | null>;
|
|
4289
|
+
sampledSeconds: Mark<number>;
|
|
4290
|
+
};
|
|
4291
|
+
runs: {
|
|
4292
|
+
what: Mark<"zoom" | "pan x" | "pan y">;
|
|
4293
|
+
dir: Mark<"in" | "out" | "left" | "right" | "up" | "down">;
|
|
4294
|
+
start: Mark<number>;
|
|
4295
|
+
end: Mark<number>;
|
|
4296
|
+
amount: Mark<number>;
|
|
4297
|
+
}[];
|
|
4298
|
+
motionRuns: {
|
|
4299
|
+
state: Mark<string>;
|
|
4300
|
+
from: Mark<number>;
|
|
4301
|
+
to: Mark<number>;
|
|
4302
|
+
seconds: Mark<number>;
|
|
4303
|
+
}[];
|
|
4304
|
+
};
|
|
4305
|
+
sound: {
|
|
4306
|
+
bedShare: Mark<number | null>;
|
|
4307
|
+
bedSpreadDb: Mark<number | null>;
|
|
4308
|
+
subShare: Mark<number | null>;
|
|
4309
|
+
subRelativeDb: Mark<number | null>;
|
|
4310
|
+
bpm: Mark<number | null>;
|
|
4311
|
+
events: {
|
|
4312
|
+
kind: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop">;
|
|
4313
|
+
time: Mark<number>;
|
|
4314
|
+
changeDb: Mark<number | null>;
|
|
4315
|
+
changeAgainst: Mark<"sub" | "mix" | null>;
|
|
4316
|
+
}[];
|
|
4317
|
+
gaps: {
|
|
4318
|
+
kind: Mark<"silence" | "relative_dip">;
|
|
4319
|
+
start: Mark<number>;
|
|
4320
|
+
end: Mark<number>;
|
|
4321
|
+
deepestDb: Mark<number>;
|
|
4322
|
+
}[];
|
|
4323
|
+
sections: {
|
|
4324
|
+
start: Mark<number>;
|
|
4325
|
+
end: Mark<number>;
|
|
4326
|
+
change: Mark<number>;
|
|
4327
|
+
levelDb: Mark<number>;
|
|
4328
|
+
onsetsPerS: Mark<number>;
|
|
4329
|
+
centroidHz: Mark<number>;
|
|
4330
|
+
}[];
|
|
4331
|
+
changes: {
|
|
4332
|
+
time: Mark<number>;
|
|
4333
|
+
size: Mark<number>;
|
|
4334
|
+
parts: Mark<string>[];
|
|
4335
|
+
leadIn: Mark<string | null>;
|
|
4336
|
+
}[];
|
|
4337
|
+
alignment: {
|
|
4338
|
+
kind: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop">;
|
|
4339
|
+
realShare: Mark<number | null>;
|
|
4340
|
+
nullMean: Mark<number | null>;
|
|
4341
|
+
nullP95: Mark<number | null>;
|
|
4342
|
+
p: Mark<number | null>;
|
|
4343
|
+
uniformShare: Mark<number | null>;
|
|
4344
|
+
windowS: Mark<number | null>;
|
|
4345
|
+
shuffles: Mark<number | null>;
|
|
4346
|
+
seed: Mark<number | null>;
|
|
4347
|
+
reading: Mark<string | null>;
|
|
4348
|
+
}[];
|
|
4349
|
+
};
|
|
4350
|
+
boundaries: {
|
|
4351
|
+
eventsFile: Mark<string | null>;
|
|
4352
|
+
unread: Mark<string | null>;
|
|
4353
|
+
list: ({
|
|
4354
|
+
time: Mark<number>;
|
|
4355
|
+
source: Mark<"both" | "detected">;
|
|
4356
|
+
declared: {
|
|
4357
|
+
time: Mark<number>;
|
|
4358
|
+
as: Mark<string | null>;
|
|
4359
|
+
handoff: Mark<string | null>;
|
|
4360
|
+
carry: Mark<string | null>;
|
|
4361
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4362
|
+
change: Mark<string | null>;
|
|
4363
|
+
} | Mark<null>;
|
|
4364
|
+
detected: {
|
|
4365
|
+
candidate: Mark<number>;
|
|
4366
|
+
verdict: Mark<Verdict>;
|
|
4367
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4368
|
+
strip: Mark<string>;
|
|
4369
|
+
};
|
|
4370
|
+
} | {
|
|
4371
|
+
time: Mark<number>;
|
|
4372
|
+
source: Mark<"declared">;
|
|
4373
|
+
declared: {
|
|
4374
|
+
time: Mark<number>;
|
|
4375
|
+
as: Mark<string | null>;
|
|
4376
|
+
handoff: Mark<string | null>;
|
|
4377
|
+
carry: Mark<string | null>;
|
|
4378
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4379
|
+
change: Mark<string | null>;
|
|
4380
|
+
};
|
|
4381
|
+
detected: Mark<null> | {
|
|
4382
|
+
candidate: Mark<number>;
|
|
4383
|
+
verdict: Mark<Verdict>;
|
|
4384
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4385
|
+
strip: Mark<string>;
|
|
4386
|
+
};
|
|
4387
|
+
})[];
|
|
4388
|
+
};
|
|
4389
|
+
shots: {
|
|
4390
|
+
index: Mark<number>;
|
|
4391
|
+
fromFrame: Mark<number>;
|
|
4392
|
+
toFrame: Mark<number>;
|
|
4393
|
+
from: Mark<number>;
|
|
4394
|
+
to: Mark<number>;
|
|
4395
|
+
length: Mark<number>;
|
|
4396
|
+
frames: Mark<number>;
|
|
4397
|
+
picture: {
|
|
4398
|
+
middleFrame: Mark<number>;
|
|
4399
|
+
medianGrey: Mark<number>;
|
|
4400
|
+
still: Mark<string>;
|
|
4401
|
+
};
|
|
4402
|
+
camera: {
|
|
4403
|
+
dominantMove: Mark<string | null>;
|
|
4404
|
+
travel: Mark<number | null>;
|
|
4405
|
+
drift: Mark<number | null>;
|
|
4406
|
+
hold: Mark<number | null>;
|
|
4407
|
+
sampledSeconds: Mark<number>;
|
|
4408
|
+
};
|
|
4409
|
+
boundaryOut: Mark<null> | {
|
|
4410
|
+
candidate: Mark<number>;
|
|
4411
|
+
kind: Mark<"picture_cut">;
|
|
4412
|
+
source: Mark<"both" | "detected">;
|
|
4413
|
+
declared: {
|
|
4414
|
+
time: Mark<number>;
|
|
4415
|
+
as: Mark<string | null>;
|
|
4416
|
+
handoff: Mark<string | null>;
|
|
4417
|
+
carry: Mark<string | null>;
|
|
4418
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4419
|
+
change: Mark<string | null>;
|
|
4420
|
+
} | Mark<null>;
|
|
4421
|
+
verdict: Mark<Verdict>;
|
|
4422
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4423
|
+
pictureReading: Mark<AcrossKind | null>;
|
|
4424
|
+
before: Mark<null> | {
|
|
4425
|
+
dir: Mark<string>;
|
|
4426
|
+
x: Mark<number>;
|
|
4427
|
+
y: Mark<number>;
|
|
4428
|
+
logScale: Mark<number>;
|
|
4429
|
+
pxPerFrame: Mark<number>;
|
|
4430
|
+
pxPerSecond: Mark<number>;
|
|
4431
|
+
};
|
|
4432
|
+
after: Mark<null> | {
|
|
4433
|
+
dir: Mark<string>;
|
|
4434
|
+
x: Mark<number>;
|
|
4435
|
+
y: Mark<number>;
|
|
4436
|
+
logScale: Mark<number>;
|
|
4437
|
+
pxPerFrame: Mark<number>;
|
|
4438
|
+
pxPerSecond: Mark<number>;
|
|
4439
|
+
};
|
|
4440
|
+
directionContinues: Mark<boolean | null>;
|
|
4441
|
+
atPeakSpeed: Mark<boolean | null>;
|
|
4442
|
+
scaleStep: Mark<number | null>;
|
|
4443
|
+
sound: {
|
|
4444
|
+
nearest: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop" | null>;
|
|
4445
|
+
time: Mark<number | null>;
|
|
4446
|
+
offset: Mark<number | null>;
|
|
4447
|
+
nearestByKind: Record<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop", Mark<number | null>>;
|
|
4448
|
+
};
|
|
4449
|
+
strip: Mark<string>;
|
|
4450
|
+
};
|
|
4451
|
+
}[];
|
|
4452
|
+
candidates: {
|
|
4453
|
+
index: Mark<number>;
|
|
4454
|
+
frame: Mark<number>;
|
|
4455
|
+
time: Mark<number>;
|
|
4456
|
+
verified: Mark<boolean>;
|
|
4457
|
+
verdict: Mark<Verdict>;
|
|
4458
|
+
across: Mark<AcrossKind | null>;
|
|
4459
|
+
nominations: {
|
|
4460
|
+
source: Mark<"cuts" | "small_swaps" | "changes" | "energy_peak">;
|
|
4461
|
+
frame: Mark<number>;
|
|
4462
|
+
from: Mark<number>;
|
|
4463
|
+
to: Mark<number>;
|
|
4464
|
+
}[];
|
|
4465
|
+
evidence: {
|
|
4466
|
+
previousFrame: Mark<number>;
|
|
4467
|
+
change: Mark<number>;
|
|
4468
|
+
nearbyChange: Mark<number>;
|
|
4469
|
+
changedBlocks: Mark<number>;
|
|
4470
|
+
alignedSupport: Mark<number | null>;
|
|
4471
|
+
alignedResidual: Mark<number | null>;
|
|
4472
|
+
scale: Mark<number | null>;
|
|
4473
|
+
keptInPlace: Mark<number | null>;
|
|
4474
|
+
};
|
|
4475
|
+
strip: Mark<string>;
|
|
4476
|
+
stripFrames: {
|
|
4477
|
+
frame: Mark<number>;
|
|
4478
|
+
time: Mark<number>;
|
|
4479
|
+
}[];
|
|
4480
|
+
}[];
|
|
4481
|
+
};
|
|
4482
|
+
type FilmStudy = ReturnType<typeof analyzeStudy>;
|
|
4483
|
+
declare function formatFilmStudy(s: FilmStudy): string;
|
|
4484
|
+
type FilmStudyOptions = {
|
|
4485
|
+
input: string;
|
|
4486
|
+
/** default is <input without extension>.study/ */
|
|
4487
|
+
out?: string;
|
|
4488
|
+
};
|
|
4489
|
+
declare function filmStudy(opts: FilmStudyOptions): Promise<{
|
|
4490
|
+
study: {
|
|
4491
|
+
version: Mark<number>;
|
|
4492
|
+
identity: {
|
|
4493
|
+
file: Mark<string>;
|
|
4494
|
+
bytes: Mark<number>;
|
|
4495
|
+
width: Mark<number>;
|
|
4496
|
+
height: Mark<number>;
|
|
4497
|
+
fps: Mark<number>;
|
|
4498
|
+
frames: Mark<number>;
|
|
4499
|
+
duration: Mark<number>;
|
|
4500
|
+
pictureStart: Mark<number>;
|
|
4501
|
+
pictureEnd: Mark<number>;
|
|
4502
|
+
constantCadence: Mark<boolean | null>;
|
|
4503
|
+
sha256: Mark<string>;
|
|
4504
|
+
audioPresent: Mark<boolean>;
|
|
4505
|
+
};
|
|
4506
|
+
picture: {
|
|
4507
|
+
candidates: Mark<number>;
|
|
4508
|
+
verified: Mark<number>;
|
|
4509
|
+
shares: {
|
|
4510
|
+
travel: Mark<number | null>;
|
|
4511
|
+
drift: Mark<number | null>;
|
|
4512
|
+
hold: Mark<number | null>;
|
|
4513
|
+
sampledSeconds: Mark<number>;
|
|
4514
|
+
};
|
|
4515
|
+
runs: {
|
|
4516
|
+
what: Mark<"zoom" | "pan x" | "pan y">;
|
|
4517
|
+
dir: Mark<"in" | "out" | "left" | "right" | "up" | "down">;
|
|
4518
|
+
start: Mark<number>;
|
|
4519
|
+
end: Mark<number>;
|
|
4520
|
+
amount: Mark<number>;
|
|
4521
|
+
}[];
|
|
4522
|
+
motionRuns: {
|
|
4523
|
+
state: Mark<string>;
|
|
4524
|
+
from: Mark<number>;
|
|
4525
|
+
to: Mark<number>;
|
|
4526
|
+
seconds: Mark<number>;
|
|
4527
|
+
}[];
|
|
4528
|
+
};
|
|
4529
|
+
sound: {
|
|
4530
|
+
bedShare: Mark<number | null>;
|
|
4531
|
+
bedSpreadDb: Mark<number | null>;
|
|
4532
|
+
subShare: Mark<number | null>;
|
|
4533
|
+
subRelativeDb: Mark<number | null>;
|
|
4534
|
+
bpm: Mark<number | null>;
|
|
4535
|
+
events: {
|
|
4536
|
+
kind: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop">;
|
|
4537
|
+
time: Mark<number>;
|
|
4538
|
+
changeDb: Mark<number | null>;
|
|
4539
|
+
changeAgainst: Mark<"sub" | "mix" | null>;
|
|
4540
|
+
}[];
|
|
4541
|
+
gaps: {
|
|
4542
|
+
kind: Mark<"silence" | "relative_dip">;
|
|
4543
|
+
start: Mark<number>;
|
|
4544
|
+
end: Mark<number>;
|
|
4545
|
+
deepestDb: Mark<number>;
|
|
4546
|
+
}[];
|
|
4547
|
+
sections: {
|
|
4548
|
+
start: Mark<number>;
|
|
4549
|
+
end: Mark<number>;
|
|
4550
|
+
change: Mark<number>;
|
|
4551
|
+
levelDb: Mark<number>;
|
|
4552
|
+
onsetsPerS: Mark<number>;
|
|
4553
|
+
centroidHz: Mark<number>;
|
|
4554
|
+
}[];
|
|
4555
|
+
changes: {
|
|
4556
|
+
time: Mark<number>;
|
|
4557
|
+
size: Mark<number>;
|
|
4558
|
+
parts: Mark<string>[];
|
|
4559
|
+
leadIn: Mark<string | null>;
|
|
4560
|
+
}[];
|
|
4561
|
+
alignment: {
|
|
4562
|
+
kind: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop">;
|
|
4563
|
+
realShare: Mark<number | null>;
|
|
4564
|
+
nullMean: Mark<number | null>;
|
|
4565
|
+
nullP95: Mark<number | null>;
|
|
4566
|
+
p: Mark<number | null>;
|
|
4567
|
+
uniformShare: Mark<number | null>;
|
|
4568
|
+
windowS: Mark<number | null>;
|
|
4569
|
+
shuffles: Mark<number | null>;
|
|
4570
|
+
seed: Mark<number | null>;
|
|
4571
|
+
reading: Mark<string | null>;
|
|
4572
|
+
}[];
|
|
4573
|
+
};
|
|
4574
|
+
boundaries: {
|
|
4575
|
+
eventsFile: Mark<string | null>;
|
|
4576
|
+
unread: Mark<string | null>;
|
|
4577
|
+
list: ({
|
|
4578
|
+
time: Mark<number>;
|
|
4579
|
+
source: Mark<"both" | "detected">;
|
|
4580
|
+
declared: {
|
|
4581
|
+
time: Mark<number>;
|
|
4582
|
+
as: Mark<string | null>;
|
|
4583
|
+
handoff: Mark<string | null>;
|
|
4584
|
+
carry: Mark<string | null>;
|
|
4585
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4586
|
+
change: Mark<string | null>;
|
|
4587
|
+
} | Mark<null>;
|
|
4588
|
+
detected: {
|
|
4589
|
+
candidate: Mark<number>;
|
|
4590
|
+
verdict: Mark<Verdict>;
|
|
4591
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4592
|
+
strip: Mark<string>;
|
|
4593
|
+
};
|
|
4594
|
+
} | {
|
|
4595
|
+
time: Mark<number>;
|
|
4596
|
+
source: Mark<"declared">;
|
|
4597
|
+
declared: {
|
|
4598
|
+
time: Mark<number>;
|
|
4599
|
+
as: Mark<string | null>;
|
|
4600
|
+
handoff: Mark<string | null>;
|
|
4601
|
+
carry: Mark<string | null>;
|
|
4602
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4603
|
+
change: Mark<string | null>;
|
|
4604
|
+
};
|
|
4605
|
+
detected: Mark<null> | {
|
|
4606
|
+
candidate: Mark<number>;
|
|
4607
|
+
verdict: Mark<Verdict>;
|
|
4608
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4609
|
+
strip: Mark<string>;
|
|
4610
|
+
};
|
|
4611
|
+
})[];
|
|
4612
|
+
};
|
|
4613
|
+
shots: {
|
|
4614
|
+
index: Mark<number>;
|
|
4615
|
+
fromFrame: Mark<number>;
|
|
4616
|
+
toFrame: Mark<number>;
|
|
4617
|
+
from: Mark<number>;
|
|
4618
|
+
to: Mark<number>;
|
|
4619
|
+
length: Mark<number>;
|
|
4620
|
+
frames: Mark<number>;
|
|
4621
|
+
picture: {
|
|
4622
|
+
middleFrame: Mark<number>;
|
|
4623
|
+
medianGrey: Mark<number>;
|
|
4624
|
+
still: Mark<string>;
|
|
4625
|
+
};
|
|
4626
|
+
camera: {
|
|
4627
|
+
dominantMove: Mark<string | null>;
|
|
4628
|
+
travel: Mark<number | null>;
|
|
4629
|
+
drift: Mark<number | null>;
|
|
4630
|
+
hold: Mark<number | null>;
|
|
4631
|
+
sampledSeconds: Mark<number>;
|
|
4632
|
+
};
|
|
4633
|
+
boundaryOut: Mark<null> | {
|
|
4634
|
+
candidate: Mark<number>;
|
|
4635
|
+
kind: Mark<"picture_cut">;
|
|
4636
|
+
source: Mark<"both" | "detected">;
|
|
4637
|
+
declared: {
|
|
4638
|
+
time: Mark<number>;
|
|
4639
|
+
as: Mark<string | null>;
|
|
4640
|
+
handoff: Mark<string | null>;
|
|
4641
|
+
carry: Mark<string | null>;
|
|
4642
|
+
carried: Mark<"carried" | "anchored" | "bare" | null>;
|
|
4643
|
+
change: Mark<string | null>;
|
|
4644
|
+
} | Mark<null>;
|
|
4645
|
+
verdict: Mark<Verdict>;
|
|
4646
|
+
whatMovesAcross: Mark<AcrossKind | null>;
|
|
4647
|
+
pictureReading: Mark<AcrossKind | null>;
|
|
4648
|
+
before: Mark<null> | {
|
|
4649
|
+
dir: Mark<string>;
|
|
4650
|
+
x: Mark<number>;
|
|
4651
|
+
y: Mark<number>;
|
|
4652
|
+
logScale: Mark<number>;
|
|
4653
|
+
pxPerFrame: Mark<number>;
|
|
4654
|
+
pxPerSecond: Mark<number>;
|
|
4655
|
+
};
|
|
4656
|
+
after: Mark<null> | {
|
|
4657
|
+
dir: Mark<string>;
|
|
4658
|
+
x: Mark<number>;
|
|
4659
|
+
y: Mark<number>;
|
|
4660
|
+
logScale: Mark<number>;
|
|
4661
|
+
pxPerFrame: Mark<number>;
|
|
4662
|
+
pxPerSecond: Mark<number>;
|
|
4663
|
+
};
|
|
4664
|
+
directionContinues: Mark<boolean | null>;
|
|
4665
|
+
atPeakSpeed: Mark<boolean | null>;
|
|
4666
|
+
scaleStep: Mark<number | null>;
|
|
4667
|
+
sound: {
|
|
4668
|
+
nearest: Mark<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop" | null>;
|
|
4669
|
+
time: Mark<number | null>;
|
|
4670
|
+
offset: Mark<number | null>;
|
|
4671
|
+
nearestByKind: Record<"onset" | "hit" | "sub_entry" | "sub_exit" | "drop", Mark<number | null>>;
|
|
4672
|
+
};
|
|
4673
|
+
strip: Mark<string>;
|
|
4674
|
+
};
|
|
4675
|
+
}[];
|
|
4676
|
+
candidates: {
|
|
4677
|
+
index: Mark<number>;
|
|
4678
|
+
frame: Mark<number>;
|
|
4679
|
+
time: Mark<number>;
|
|
4680
|
+
verified: Mark<boolean>;
|
|
4681
|
+
verdict: Mark<Verdict>;
|
|
4682
|
+
across: Mark<AcrossKind | null>;
|
|
4683
|
+
nominations: {
|
|
4684
|
+
source: Mark<"cuts" | "small_swaps" | "changes" | "energy_peak">;
|
|
4685
|
+
frame: Mark<number>;
|
|
4686
|
+
from: Mark<number>;
|
|
4687
|
+
to: Mark<number>;
|
|
4688
|
+
}[];
|
|
4689
|
+
evidence: {
|
|
4690
|
+
previousFrame: Mark<number>;
|
|
4691
|
+
change: Mark<number>;
|
|
4692
|
+
nearbyChange: Mark<number>;
|
|
4693
|
+
changedBlocks: Mark<number>;
|
|
4694
|
+
alignedSupport: Mark<number | null>;
|
|
4695
|
+
alignedResidual: Mark<number | null>;
|
|
4696
|
+
scale: Mark<number | null>;
|
|
4697
|
+
keptInPlace: Mark<number | null>;
|
|
4698
|
+
};
|
|
4699
|
+
strip: Mark<string>;
|
|
4700
|
+
stripFrames: {
|
|
4701
|
+
frame: Mark<number>;
|
|
4702
|
+
time: Mark<number>;
|
|
4703
|
+
}[];
|
|
4704
|
+
}[];
|
|
4705
|
+
};
|
|
4706
|
+
md: string;
|
|
4707
|
+
json: string;
|
|
4708
|
+
strips: string;
|
|
4709
|
+
}>;
|
|
690
4710
|
|
|
691
4711
|
//#endregion
|
|
692
|
-
//#region src/
|
|
693
|
-
|
|
694
|
-
/**
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
fetchImpl?: typeof fetch;
|
|
707
|
-
/** progress lines go here (default: process.stderr) */
|
|
708
|
-
log?: (line: string) => void;
|
|
4712
|
+
//#region src/film/viewer.d.ts
|
|
4713
|
+
type ViewerRound = {
|
|
4714
|
+
/** the round's folder, <film>.viewer/<n>/ (absolute) */
|
|
4715
|
+
dir: string;
|
|
4716
|
+
/** 1 for the first round */
|
|
4717
|
+
round: number;
|
|
4718
|
+
/** the brief to hand to the viewer */
|
|
4719
|
+
brief: string;
|
|
4720
|
+
/** where the viewer writes what they felt */
|
|
4721
|
+
notes: string;
|
|
4722
|
+
/** the ffmpeg and ffprobe the brief names: a full path for open-take's own,
|
|
4723
|
+
* the bare name when the one in use is on PATH already */
|
|
4724
|
+
ffmpeg: string;
|
|
4725
|
+
ffprobe: string;
|
|
709
4726
|
};
|
|
710
|
-
/**
|
|
711
|
-
*
|
|
712
|
-
|
|
713
|
-
declare const
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
4727
|
+
/** What a viewer has to be allowed to do, in Claude Code's tool names: run
|
|
4728
|
+
* ffmpeg and open-take (Bash), look at the frames (Read), write its notes
|
|
4729
|
+
* and sheets (Write, Edit), find its files (Glob, Grep). */
|
|
4730
|
+
declare const VIEWER_TOOLS: readonly ["Bash", "Read", "Write", "Edit", "Glob", "Grep"];
|
|
4731
|
+
type ViewerRounds = {
|
|
4732
|
+
/** rounds with the viewer's notes written, oldest first; `frames` is how
|
|
4733
|
+
* many pictures are in the round's folder — 0 means it watched nothing */
|
|
4734
|
+
done: {
|
|
4735
|
+
round: number;
|
|
4736
|
+
notes: string;
|
|
4737
|
+
filmMtimeMs: number;
|
|
4738
|
+
frames: number;
|
|
4739
|
+
}[];
|
|
4740
|
+
/** rounds set up whose notes are not there yet */
|
|
4741
|
+
open: number[];
|
|
4742
|
+
};
|
|
4743
|
+
/** the rounds already set up beside a film */
|
|
4744
|
+
declare function viewerRounds(film: string): Promise<ViewerRounds>;
|
|
4745
|
+
/** The latest round's state, for `film viewer --check`: `ok` only when its
|
|
4746
|
+
* notes are written and its folder holds at least one frame. */
|
|
4747
|
+
declare function checkViewer(film: string): Promise<{
|
|
4748
|
+
ok: boolean;
|
|
4749
|
+
round: number | null;
|
|
4750
|
+
dir: string | null;
|
|
4751
|
+
message: string;
|
|
4752
|
+
}>;
|
|
4753
|
+
declare function viewerBrief(filmCopy: string, notes: string, invoke?: string, tools?: {
|
|
4754
|
+
ffmpeg?: string;
|
|
4755
|
+
ffprobe?: string;
|
|
4756
|
+
}): string;
|
|
4757
|
+
/** The command that starts a viewer as a fresh Claude Code session in the
|
|
4758
|
+
* round's folder: open-take's ffmpeg and ffprobe first on its PATH, and the
|
|
4759
|
+
* tools it needs allowed, so it is not left waiting on a permission no one
|
|
4760
|
+
* is there to give. */
|
|
4761
|
+
declare function viewerCommand(v: Pick<ViewerRound, "dir" | "ffmpeg" | "ffprobe">): string;
|
|
4762
|
+
/** sets up the next round: <film>.viewer/<n>/film.mp4 and BRIEF.md */
|
|
4763
|
+
declare function prepareViewer(film: string, invoke?: string): Promise<ViewerRound>;
|
|
720
4764
|
|
|
721
4765
|
//#endregion
|
|
722
4766
|
//#region src/motion-types.d.ts
|
|
723
|
-
|
|
724
|
-
* `encoder` (" V....D libx264 ..."), not merely the name as a substring
|
|
725
|
-
* somewhere — descriptions repeat encoder names constantly. */
|
|
4767
|
+
//# sourceMappingURL=viewer.d.ts.map
|
|
726
4768
|
type MotionEasing = "linear" | "ease-in" | "ease-out" | "ease-in-out" | "step";
|
|
727
4769
|
type MotionProperty = "x" | "y" | "opacity" | "scaleX" | "scaleY" | "rotation" | "width" | "height" | "radius" | "fill" | "stroke" | "strokeWidth" | "fontSize" | "reveal" | "end";
|
|
728
4770
|
type MotionKeyframe = {
|
|
@@ -1111,7 +5153,7 @@ declare function formatLaunchIssues(issues: LaunchIssue[]): string;
|
|
|
1111
5153
|
//#region src/math.d.ts
|
|
1112
5154
|
//# sourceMappingURL=launch-validate.d.ts.map
|
|
1113
5155
|
declare namespace math_d_exports {
|
|
1114
|
-
export { CamRect, StageKeyframes, bboxFitScale, buildLegs, buildStageKeyframes, cameraRampSchedule, carryWindow, clampCenter, cubicBezier, cursorPos, fmtBytes, ghostCardLines, gradientEndpoints, isDragging, keyvalN, keyvalR, restStageScale, smoother, springEase, stageCamera, stageEasing };
|
|
5156
|
+
export { CamRect, KF, StageKeyframes, bboxFitScale, buildLegs, buildStageKeyframes, cameraRampSchedule, carryWindow, clampCenter, cubicBezier, cursorPos, fmtBytes, ghostCardLines, gradientEndpoints, isDragging, keyvalN, keyvalR, restStageScale, settleDecay, settleRectAt, smoother, springEase, stageCamera, stageEasing };
|
|
1115
5157
|
}
|
|
1116
5158
|
declare function smoother(t: number): number;
|
|
1117
5159
|
declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): (x: number) => number;
|
|
@@ -1178,6 +5220,24 @@ declare function cameraRampSchedule(comp: TakeComposition): ({
|
|
|
1178
5220
|
pullOut: boolean;
|
|
1179
5221
|
} | null)[];
|
|
1180
5222
|
declare function buildStageKeyframes(comp: TakeComposition): StageKeyframes;
|
|
5223
|
+
/** Residual (1 − progress) of an overdamped spring's unit step response, on
|
|
5224
|
+
* NORMALISED segment time u = (t − t0)/(t1 − t0). ω0 is solved so the
|
|
5225
|
+
* residual at u=1 (the action instant) equals `frac`; past u=1 the same
|
|
5226
|
+
* curve keeps decaying — the tail that replaces the legacy cut. ζ=1.2 gives
|
|
5227
|
+
* the reference-measured shape: a fast main ramp (peak velocity ~14% in)
|
|
5228
|
+
* plus a slow settle pole; at frac 0.04 the tail τ ≈ duration/3.6 (730ms →
|
|
5229
|
+
* ~205ms, 1340ms → ~375ms — the frame-tracked reference tails; a different
|
|
5230
|
+
* frac shifts ω0 and with it τ). */
|
|
5231
|
+
declare function settleDecay(frac: number): (u: number) => number;
|
|
5232
|
+
/** Evaluate the rect track with moves that settle ASYMPTOTICALLY: each ramp
|
|
5233
|
+
* covers 1−frac of its distance by its keyframe end, then keeps creeping
|
|
5234
|
+
* toward the target through the following hold (never a velocity cliff). A
|
|
5235
|
+
* ramp launches from wherever the previous tail actually is (position-
|
|
5236
|
+
* continuous chaining); every emitted rect is a convex combination of
|
|
5237
|
+
* build-time-clamped rects, and the valid-rect set is convex (linear
|
|
5238
|
+
* half-plane bounds in cx,cy,w), so in-between rects stay valid exactly as
|
|
5239
|
+
* in the lerped path. */
|
|
5240
|
+
declare function settleRectAt(kfs: KF<CamRect>[], decay: (u: number) => number, t: number): CamRect;
|
|
1181
5241
|
/** The one camera evaluator — scene.tsx (render) and the editor preview both
|
|
1182
5242
|
* consume THIS, so preview and export can never drift. */
|
|
1183
5243
|
declare function stageCamera(comp: TakeComposition): {
|
|
@@ -1239,8 +5299,39 @@ declare function ghostCardLines(files: {
|
|
|
1239
5299
|
meta: string;
|
|
1240
5300
|
};
|
|
1241
5301
|
|
|
5302
|
+
//#endregion
|
|
5303
|
+
//#region src/mjpeg-matroska.d.ts
|
|
5304
|
+
/** A frame and the moment (ms from the capture's t0) the video shows it. */
|
|
5305
|
+
type TimedFrame = {
|
|
5306
|
+
file: string;
|
|
5307
|
+
tMs: number;
|
|
5308
|
+
};
|
|
5309
|
+
/** Pixel size from a JPEG's frame header (any SOF marker: baseline,
|
|
5310
|
+
* progressive, lossless…), read past APPn/COM/DQT segments by their lengths. */
|
|
5311
|
+
declare function jpegDimensions(jpeg: Buffer): {
|
|
5312
|
+
width: number;
|
|
5313
|
+
height: number;
|
|
5314
|
+
};
|
|
5315
|
+
/** Everything before the first cluster. `durationMs` is advisory (players and
|
|
5316
|
+
* ffprobe report it); the frames themselves carry the timing. */
|
|
5317
|
+
declare function matroskaHead(width: number, height: number, durationMs: number): Buffer;
|
|
5318
|
+
/** One frame: a cluster stamped with its absolute time holding a single
|
|
5319
|
+
* keyframe SimpleBlock (track 1, relative timecode 0) around the raw JPEG. */
|
|
5320
|
+
|
|
5321
|
+
/** The whole stream, chunk by chunk, so a minute of Retina frames never sits
|
|
5322
|
+
* in memory or on disk twice. Frames must be in non-decreasing tMs order;
|
|
5323
|
+
* a file repeated back to back is read once.
|
|
5324
|
+
*
|
|
5325
|
+
* The track's pixel size comes from the first frame whose header parses.
|
|
5326
|
+
* ffmpeg takes the size from each JPEG anyway, so one truncated frame (a
|
|
5327
|
+
* write cut short) must not fail the whole encode here when the decoder
|
|
5328
|
+
* would have skipped it; only a stream with no readable header at all is an
|
|
5329
|
+
* error. */
|
|
5330
|
+
declare function mjpegMatroska(frames: TimedFrame[]): AsyncGenerator<Buffer>;
|
|
5331
|
+
|
|
1242
5332
|
//#endregion
|
|
1243
5333
|
//#region src/motion-evaluate.d.ts
|
|
5334
|
+
//# sourceMappingURL=mjpeg-matroska.d.ts.map
|
|
1244
5335
|
declare function evaluateMotionTrack(track: MotionTrack, localS: number): number | string;
|
|
1245
5336
|
declare function motionGraphemes(text: string): string[];
|
|
1246
5337
|
/** Input must have passed validation. Evaluation is pure and shared by Node and the browser. */
|
|
@@ -1419,7 +5510,48 @@ type RenderTakeResult = {
|
|
|
1419
5510
|
declare function renderTake(opts: RenderTakeOpts): Promise<RenderTakeResult>;
|
|
1420
5511
|
|
|
1421
5512
|
//#endregion
|
|
5513
|
+
//#region src/state-diff.d.ts
|
|
1422
5514
|
//# sourceMappingURL=render.d.ts.map
|
|
5515
|
+
type Box = [number, number, number, number];
|
|
5516
|
+
/** What an element reads as: its accessible name, else its own text. */
|
|
5517
|
+
declare const elementLabel: (e: StateElement) => string;
|
|
5518
|
+
/** Pairs `a` element id → `b` element id: first the element the DOM kept in
|
|
5519
|
+
* place (same path and tag — unless it reads differently AND sits somewhere
|
|
5520
|
+
* else, which is a different element that took the slot), then a unique
|
|
5521
|
+
* (tag, role, label) among the rest, then the same tag overlapping most. */
|
|
5522
|
+
declare function matchStates(a: StateIndex, b: StateIndex): Map<string, string>;
|
|
5523
|
+
type StateChange = {
|
|
5524
|
+
kind: "added";
|
|
5525
|
+
b: StateElement;
|
|
5526
|
+
} | {
|
|
5527
|
+
kind: "removed";
|
|
5528
|
+
a: StateElement;
|
|
5529
|
+
} | {
|
|
5530
|
+
kind: "changed";
|
|
5531
|
+
a: StateElement;
|
|
5532
|
+
b: StateElement;
|
|
5533
|
+
text: boolean;
|
|
5534
|
+
moved: boolean;
|
|
5535
|
+
resized: boolean;
|
|
5536
|
+
};
|
|
5537
|
+
/** Everything that differs between two states, in `b`'s document order
|
|
5538
|
+
* (removals last). A box change under 3 px is layout noise, not a change. */
|
|
5539
|
+
declare function diffStates(a: StateIndex, b: StateIndex): StateChange[];
|
|
5540
|
+
/** The element and everything inside it (by path). */
|
|
5541
|
+
declare function subtree(index: StateIndex, id: string): StateElement[];
|
|
5542
|
+
/** What an element shows: its own text, or its name when the name is that
|
|
5543
|
+
* text in full (a span whose text is split by inline children reads whole),
|
|
5544
|
+
* or its name alone when it has no text (an icon button's label) — never a
|
|
5545
|
+
* tooltip over visible text. */
|
|
1423
5546
|
|
|
1424
|
-
|
|
5547
|
+
/** What an element shows with everything inside it, in document order:
|
|
5548
|
+
* each element's visible label, leaving out a label that an element already
|
|
5549
|
+
* read contains (the pieces of a sentence read once). */
|
|
5550
|
+
declare function contentOf(index: StateIndex, id: string): string[];
|
|
5551
|
+
/** Where on the page an action changed something (boxes in `b`), leaving
|
|
5552
|
+
* out one element's own subtree — the element being shown on its own. */
|
|
5553
|
+
declare function changedBoxes(a: StateIndex, b: StateIndex, except?: string): Box[];
|
|
5554
|
+
|
|
5555
|
+
//#endregion
|
|
5556
|
+
export { AuditCursorOpts, AuditRow, BBox, Beat, CLAMP_TOL_MS, CLIP_CLEAR_CSS, COMPONENT_ORDER, COMPONENT_PROBE_JS, CameraConfig, Caption, CaptureClick, CaptureDrag, CaptureDropFiles, CaptureEvent, CaptureEventBase, CaptureHover, CaptureLog, CaptureLook, CapturePress, CaptureScroll, CaptureType, CompEvent, CompareMotionRecipe, ComponentAction, ComponentEntry, ComponentProbeInput, ComponentProbeResult, ComponentProvenance, ComponentRelation, ComponentSource, ComponentSourceKind, ComponentSourceState, ComponentState, ComponentTrack, ComponentValue, ComponentsFile, CompositionIssue, CursorConfig, DEFAULT_CAMERA, DEFAULT_CURSOR, DEFAULT_FRAMING, DEFAULT_MOTION_BLUR, EvaluatedMotionLayer, EvaluatedMotionScene, FFMPEG_FLOOR, FFMPEG_RELEASE, FILM_STAGE, FINISH, FilmBeats, FilmBeatsOptions, FilmCheck, FilmCheckExpect, FilmCheckIssue, FilmEvent, FilmEvents, FilmFiles, FilmGalleryOptions, FilmGalleryResult, FilmInitResult, FilmListen, FilmListenOptions, FilmLook, FilmLookOptions, FilmLookResult, FilmPictureOptions, FilmProbe, FilmProbeOptions, FilmProgress, FilmProvenance, FilmRenderOptions, FilmRenderResult, FilmReport, FilmReportOptions, FilmSegment, FilmSheetOptions, FilmSource, FilmStillsOptions, FilmStudy, FilmStudyOptions, FinishName, FocusMotionRecipe, FontInfo, Framing, FramingConfig, GalleryEntry, GalleryMaterial, GalleryStats, GhostCardConfig, LOOKS, LaunchAudioTrack, LaunchComposition, LaunchEndCardScene, LaunchFootageScene, LaunchIssue, LaunchScene, LaunchStory, LaunchStoryBeat, LaunchStoryEvidence, LaunchStoryIntent, LaunchStoryRole, LaunchTheme, LaunchTitleScene, LaunchTransition, LaunchUiMorphScene, LaunchUiState, LookName, LookPreset, MATERIALS_PROBE_JS, MOTION, MaterialCandidate, MaterialImage, MaterialKind, MaterialMeta, MaterialProbeImage, MaterialSheet, MaterialSkipped, MaterialText, MaterialsFile, MaterialsPage, MaterialsProbeResult, MotionBlurConfig, MotionEasing, MotionEllipseLayer, MotionGroupLayer, MotionImageCrop, MotionImageLayer, MotionKeyframe, MotionLayer, MotionLayerBase, MotionLineLayer, MotionName, MotionPreset, MotionProperty, MotionRecipe, MotionRecipeImage, MotionRecipeStyle, MotionRectLayer, MotionScene, MotionShadow, MotionStoryBrief, MotionStoryResult, MotionTextLayer, MotionTrack, MotionVideoLayer, PART_DOM_JS, PageMaterial, PartCandidate, PartDom, PartDomFile, PartDomInput, PartFields, PartFileEntry, PartFilesIndex, PartFilesResult, PartKind, PartSkipped, PartsFile, PlanOpts, ProvenanceValue, Pt, RenderLaunchOpts, RenderLaunchResult, RenderTakeOpts, RenderTakeResult, ReviewBadge, ReviewDecor, SRGB_TAGS, SceneBase, SheetSegment, StateChange, StateElement, StateIndex, StepsMotionRecipe, TakeComposition, TimedFrame, TitleCard, VIEWER_TOOLS, ValidateOpts, ViewerRound, ViewerRounds, ZOOM_LEVELS, ZoomDecision, ZoomIntent, ZoomLevelName, adHost, analyzeLaunchStory, analyzeMotionQuality, auditCursor, auditIssues, cardsOf, changedBoxes, changedLine, checkFilm, checkViewer, componentCounts, componentProbeExpression, componentsLine, composeMotionStory, contentOf, contrastRatio, copyLine, diffStates, directCamera, elementLabel, evaluateMotionScene, evaluateMotionTrack, evaluateUiMorph, exampleSource, filmBeats, filmGallery, filmInitLines, filmKitDir, filmListen, filmLook, filmPicture, filmProbe, filmReport, filmSheet, filmStarterDir, filmStills, filmStudy, filmText, finishName, fitOf, followedLine, formatComponents, formatFilmBeats, formatFilmCheck, formatFilmListen, formatFilmLook, formatFilmProbe, formatFilmReport, formatFilmStudy, formatIssues, formatLaunchIssues, formatMaterials, gatherComponents, glyphChars, glyphCoverage, imageFileSize, imageLine, initFilm, jpegDimensions, largestSource, launchAudioAtS, launchDurationS, launchSceneDurationS, launchSceneWindows, launchStarter, launchTemplate, lookName, matchStates, materialsFromProbe, materialsProbeExpression, materialsScope, materialsSummary, math_d_exports as math, matroskaHead, mjpegMatroska, motionBlurActive, motionGraphemes, motionName, muxFilm, numberTokens, packageFonts, pageKey, pageMaterialNote, parseCssColor, parseFilmEvents, parseFont, partDomExpression, partFileName, partFilesLine, partsLine, patchFilm, phoneOf, pictureClip, planComposition, predictCursorTips, prepareViewer, readComponentSource, readMaterials, readNumber, readPageMaterial, readStateIndex, readableSize, relativeLuminance, renderFilm, renderLaunch, renderTake, resolveFfmpeg, resolveFfprobe, resolveManagedFfmpeg, resolveManagedFfprobe, sizeForCapHeight, stateFontFaces, subsetFont, subtree, textWidth, uiMorphDurationS, uiStateDurationS, validateComposition, validateLaunchAssets, validateLaunchComposition, validateLaunchStory, validateMotionScene, viewerBrief, viewerCommand, viewerRounds, writeComponents, writePartFiles, zoomLevelName };
|
|
1425
5557
|
//# sourceMappingURL=index.d.ts.map
|