mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-04 07:19:52 +00:00
fix(cli): align snapshot's local InjectFn return type with engine
`injectVideoFramesBatch` now returns `Promise<string[]>` so the caller can
filter cache entries to videos the page actually painted. The cli-side
snapshot command does not use the return value, but its local `InjectFn`
declared `Promise<void>` which made the `as { injectVideoFramesBatch:
InjectFn }` cast on the dynamic engine import fail typecheck under TS's
"sufficiently overlapping types" rule. Match the engine's actual export
shape.
This commit is contained in:
@@ -232,10 +232,16 @@ async function captureSnapshots(
|
||||
|
||||
// Chrome-headless ignores programmatic <video>.currentTime writes, so
|
||||
// we extract frames via FFmpeg and overlay them as <img> elements.
|
||||
//
|
||||
// The engine's injectVideoFramesBatch returns the subset of videoIds it
|
||||
// actually painted (skipped ancestor-hidden videos are excluded).
|
||||
// Snapshot doesn't use the return value, but the local type must match
|
||||
// the real export — a `Promise<void>` shape rejects the `as` cast on
|
||||
// the dynamic import.
|
||||
type InjectFn = (
|
||||
page: unknown,
|
||||
updates: Array<{ videoId: string; dataUri: string }>,
|
||||
) => Promise<void>;
|
||||
) => Promise<string[]>;
|
||||
type SyncVisibilityFn = (page: unknown, activeVideoIds: string[]) => Promise<void>;
|
||||
type ExtractMediaMetadataFn = (
|
||||
filePath: string,
|
||||
|
||||
Reference in New Issue
Block a user