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

0.1.4 • Public • Published

Installation

npm install --save @types/settings

Summary

This package contains type definitions for settings (https://github.com/mgutz/node-settings).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/settings.

index.d.ts

// This wierd looking class definition is necessary since the function that the module
// exposes NEEDS (will throw error otherwise) to be called with the `new` keyword
// BUT returns a random object...not an instance of the class
declare class Settings {
    constructor(pathOrModule: Settings.PathOrModule, options?: Settings.Options);

    [setting: string]: any;
}

declare namespace Settings {
    interface Options {
        env?: string | undefined;
        root?: string | undefined;
        defaults?: any;
    }

    type PathOrModule =
        | string
        | {
            forceEnv?: string | undefined;
            common: any; // error is thrown if 'common' object is not provided
            [envName: string]: any;
        };
}
export = Settings;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Shrey Jain.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/settings

Weekly Downloads

165

Version

0.1.4

License

MIT

Unpacked Size

4.07 kB

Total Files

5

Last publish

Collaborators

  • types