UNPKG

remotion

Version:

Make videos programmatically

25 lines (24 loc) 1.15 kB
import { CanvasPool } from './canvas-pool.js'; import type { EffectDefinition, EffectDefinitionAndStack } from './effect-types.js'; export type EffectChainState = { pool: CanvasPool; setupCache: WeakMap<EffectDefinition<unknown, unknown>, unknown>; cleanupRegistry: Array<{ definition: EffectDefinition<unknown, unknown>; state: unknown; }>; currentRunId: number; }; export declare const createEffectChainState: (width: number, height: number) => EffectChainState; export declare const cleanupEffectChainState: (state: EffectChainState) => void; /** Final compositing target for an effect chain (layout canvas or transferred offscreen). */ export type EffectChainOutput = HTMLCanvasElement | OffscreenCanvas; export type RunEffectChainOptions = { readonly state: EffectChainState; readonly source: CanvasImageSource; readonly effects: EffectDefinitionAndStack<unknown>[]; readonly output: EffectChainOutput; readonly width: number; readonly height: number; }; export declare const runEffectChain: ({ state, source, effects, output, width, height, }: RunEffectChainOptions) => Promise<boolean>;