1.0.5 • Published 3 months ago

@types/is-file-esm v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Installation

npm install --save @types/is-file-esm

Summary

This package contains type definitions for is-file-esm (https://github.com/davidmarkclements/is-file-esm).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/is-file-esm.

index.d.ts

// Type definitions for is-file-esm 1.0
// Project: https://github.com/davidmarkclements/is-file-esm
// Definitions by: Leon Si <https://github.com/leonzalion>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

interface Result {
    esm: boolean;
    type: 'module' | 'commonjs' | undefined;
    extType: 'c' | 'm' | 'j';
    path: string;
    pkgPath: string;
}

declare const isFileEsm: {
    constants: {
        ERR_PATH_MUST_BE_STRING: string;
        ERR_PATH_MUST_BE_ABSOLUTE: string;
        ERR_PATH_MUST_EXIST: string;
        ERR_PATH_MUST_HAVE_VALID_EXT: string;
    };

    (path: string, callback: (error: Error | null, result?: Result) => void): void;
    (path: string): Promise<Result>;
    sync(path: string): Result;
};

export = isFileEsm;

Additional Details

  • Last updated: Sun, 24 Apr 2022 23:31:35 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Leon Si.

1.0.5

3 months ago

1.0.4

3 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.3

6 months ago

1.0.0

2 years ago