UNPKG

@types/file-exists

Version:
56 lines (43 loc) 1.67 kB
# Installation > `npm install --save @types/file-exists` # Summary This package contains type definitions for file-exists (https://github.com/scottcorgan/file-exists). # Details Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/file-exists. ## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/file-exists/index.d.ts) ````ts /// <reference types="node" /> export = fileExists; type FilePathType = string | Buffer | URL; interface FalsyRoot { root?: ""; [otherKey: string]: any; } // Promise APIs declare function fileExists(filepath: FilePathType, options?: FalsyRoot): Promise<boolean>; declare function fileExists(filepath: string, options: fileExists.Options): Promise<boolean>; // Callback APIs declare function fileExists(filepath: FilePathType, callback: (err: Error | null, exists: boolean) => void): void; declare function fileExists( filepath: FilePathType, options: FalsyRoot, callback: (err: Error | null, exists: boolean) => void, ): void; declare function fileExists( filepath: string, options: fileExists.Options, callback: (err: Error | null, exists: boolean) => void, ): void; declare namespace fileExists { function sync(filepath: FilePathType, options?: Options): boolean; interface Options { root?: string; [ignoredValues: string]: any; } } ```` ### Additional Details * Last updated: Tue, 07 Nov 2023 03:09:37 GMT * Dependencies: [@types/node](https://npmjs.com/package/@types/node) # Credits These definitions were written by [BendingBender](https://github.com/BendingBender).