UNPKG

@diffusionstudio/core-v4

Version:

2D motion graphics and video rendering engine

40 lines (39 loc) 1.11 kB
import { Serializer } from '../../services'; import { ClipType } from '../../clips'; import { MediaInput, RemoteFile } from '../../types'; export type SourceOptions = { input: MediaInput; mimeType: string; name?: string; }; export type SourceInitOptions = { prefetch?: boolean; }; export declare class BaseSource extends Serializer { /** * Unique identifier of the source */ id: string; /** * Data associated with the source */ data: Record<string, unknown>; readonly type: ClipType; mimeType: string; input: MediaInput; name: string; createdAt: Date; file?: RemoteFile; constructor(options: SourceOptions); init(options?: SourceInitOptions): Promise<void>; /** * Get the source as an array buffer */ arrayBuffer(): Promise<ArrayBuffer>; /** * Create a checkpoint of the source. May include Blob or FileSystemFileHandle. * @param middleware A function to modify the checkpoint data * @returns A serialized representation of the source */ createCheckpoint(): Promise<unknown>; }