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

5.0.3 • 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

/// <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

Credits

These definitions were written by BendingBender.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/file-exists

Weekly Downloads

1,208

Version

5.0.3

License

MIT

Unpacked Size

4.66 kB

Total Files

5

Last publish

Collaborators

  • types