tav-media
Version:
Cross platform media editing framework
34 lines (33 loc) • 1.17 kB
TypeScript
/// <reference types="offscreencanvas" />
import { PAGView as NativePAGView } from '../pag-view';
import type { PAGComposition } from '../pag-composition';
export interface PAGViewOptions {
/**
* Render first frame when pag view init. default true.
*/
firstFrame?: boolean;
}
export declare type wxCanvas = (HTMLCanvasElement | OffscreenCanvas) & {
requestAnimationFrame: (callback: () => void) => number;
cancelAnimationFrame: (requestID: number) => void;
};
export declare class PAGView extends NativePAGView {
/**
* Create pag view.
* @param file pag file.
* @param canvas target render canvas.
* @param initOptions pag view options
* @returns
*/
static init(file: PAGComposition, canvas: HTMLCanvasElement | OffscreenCanvas, initOptions?: PAGViewOptions): Promise<PAGView>;
protected pagViewOptions: PAGViewOptions;
/**
* Update size when changed canvas size.
*/
updateSize(): void;
protected flushLoop(): Promise<void>;
protected flushNextFrame(): Promise<boolean>;
protected getNowTime(): number;
protected clearTimer(): void;
protected resetSize(): void;
}