node-ffmetadata icon indicating copy to clipboard operation
node-ffmetadata copied to clipboard

Typescript Types

Open Dianoga opened this issue 3 years ago • 0 comments

If it's useful to anyone here is an initial pass at types for this project.

declare module 'ffmetadata' {
	function read(path: string, cb: (err: Error, data: any) => void): void;

	function read(
		path: string,
		options: { dryRun?: boolean; coverPath?: string },
		cb: (err: Error, data: any) => void
	): void;

	function write(
		path: string,
		data: Record<string, unknown>,
		cb: (err: Error) => void
	): void;

	function write(
		path: string,
		data: Record<string, unknown>,
		options: {
			attachments?: string[];
			dryRun?: boolean;
			coverPath?: string;
			id3v1?: boolean;
			'id3v2.3'?: boolean;
		},

		cb: (err: Error) => void
	): void;

	function setFfmpegPath(path: string): void;
}

Dianoga avatar Jul 22 '21 20:07 Dianoga