Neurotic Programmer Masquerade

    @types/file-exists
    TypeScript icon, indicating that this package has built-in type declarations

    5.0.0 • Public • Published

    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

    // Type definitions for file-exists 5.0
    // Project: https://github.com/scottcorgan/file-exists
    // Definitions by: BendingBender <https://github.com/BendingBender>
    // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
    
    /// <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: Sat, 07 Aug 2021 13:31:24 GMT
    • Dependencies: @types/node
    • Global values: none

    Credits

    These definitions were written by BendingBender.

    Keywords

    none

    Install

    npm i @types/file-exists

    DownloadsWeekly Downloads

    352

    Version

    5.0.0

    License

    MIT

    Unpacked Size

    5.14 kB

    Total Files

    4

    Last publish

    Collaborators

    • types