DefinitelyTyped/types/write-file-atomic/index.d.ts
2019-05-28 09:32:10 -07:00

26 lines
839 B
TypeScript

// Type definitions for write-file-atomic 2.1
// Project: https://github.com/npm/write-file-atomic
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
export = writeFile;
declare function writeFile(filename: string, data: string | Buffer, options: writeFile.Options, callback: (error?: Error) => void): void;
declare function writeFile(filename: string, data: string | Buffer, callback: (error?: Error) => void): void;
declare namespace writeFile {
function sync(filename: string, data: string | Buffer, options?: Options): void;
interface Options {
chown?: {
uid: number;
gid: number;
};
encoding?: string;
fsync?: boolean;
mode?: number;
}
}