0.1.4 • Published 6 months ago

@types/settings v0.1.4

Weekly downloads
727
License
MIT
Repository
github
Last release
6 months ago

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

// Type definitions for settings 0.1
// Project: https://github.com/mgutz/node-settings
// Definitions by: Shrey Jain <https://github.com/shreyjain1994>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2

// 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, 06 Jul 2021 16:34:40 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Shrey Jain.

0.1.2

8 months ago

0.1.4

6 months ago

0.1.3

7 months ago

0.1.1

3 years ago

0.1.0

6 years ago