securityos/utils/ffmpeg/types.ts

34 lines
672 B
TypeScript
Raw Normal View History

2024-09-06 15:32:35 +00:00
export type IFFmpegInstance = {
FS: (
command: string,
fileName: string,
fileData?: Buffer
) => Uint8Array | void;
exit: () => void;
load: () => Promise<void>;
run: (...commandArgs: string[]) => Promise<void>;
};
export type IFFmpegLog = {
message: string;
type: string;
};
type FFmpegConfig = {
corePath: string;
log: boolean;
logger: (log: IFFmpegLog) => void;
mainName: string;
};
export type FFmpegTranscodeFile = [string, Buffer];
declare global {
interface Window {
FFmpeg: {
createFFmpeg: (config: FFmpegConfig) => IFFmpegInstance;
};
FFmpegInstance: IFFmpegInstance;
}
}