Complete basic rewrite
This commit is contained in:
39
packages/types/types/index.d.ts
vendored
Normal file
39
packages/types/types/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
export type Pointer = number;
|
||||
export type StringPointer = Pointer;
|
||||
export type StringArrayPointer = Pointer;
|
||||
|
||||
export interface FS {
|
||||
mkdir: (fileName: string) => void;
|
||||
readFile: (fileName: string) => Uint8Array;
|
||||
readdir: (pathName: string) => string[];
|
||||
unlink: (fileName: string) => void;
|
||||
writeFile: (fileName: string, binaryData: Uint8Array | string) => void;
|
||||
}
|
||||
|
||||
export interface Log {
|
||||
type: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface FFmpegCoreModule {
|
||||
DEFAULT_ARGS: string[];
|
||||
FS: FS;
|
||||
NULL: Pointer;
|
||||
SIZE_I32: number;
|
||||
|
||||
ret: number;
|
||||
timeout: number;
|
||||
mainScriptUrlOrBlob: string;
|
||||
|
||||
exec: (...args: string[]) => number;
|
||||
reset: () => void;
|
||||
setLogger: (logger: (log: Log) => void) => void;
|
||||
setTimeout: (timeout: number) => void;
|
||||
setProgress: (handler: (progress: number) => void) => void;
|
||||
|
||||
locateFile: (path: string, prefix: string) => string;
|
||||
}
|
||||
|
||||
export type FFmpegCoreModuleFactory = (
|
||||
moduleOverrides?: Partial<FFmpegCoreModule>
|
||||
) => Promise<FFmpegCoreModule>;
|
||||
18
packages/types/types/tsconfig.json
Normal file
18
packages/types/types/tsconfig.json
Normal file
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": ["es6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
|
||||
// If the library is an external module (uses `export`), this allows your test file to import "mylib" instead of "./index".
|
||||
// If the library is global (cannot be imported via `import` or `require`), leave this out.
|
||||
"baseUrl": ".",
|
||||
"paths": { "@ffmpeg/types": ["."] }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user