diff --git a/types/electron-settings/v2/index.d.ts b/types/electron-settings/v2/index.d.ts index 71677cb0df..a869fd52b8 100644 --- a/types/electron-settings/v2/index.d.ts +++ b/types/electron-settings/v2/index.d.ts @@ -2,7 +2,6 @@ // Project: https://github.com/nathanbuchar/electron-settings // Definitions by: Leonard Thieu // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 /// @@ -20,7 +19,7 @@ declare class Settings extends EventEmitter { * * @throws if options is not an object. */ - configure(options: ElectronSettings.Options.Param): void; + configure(options: ElectronSettings.Options): void; /** * Globally configures default settings. @@ -79,14 +78,14 @@ declare class Settings extends EventEmitter { * @throws if options is not an object. * @see setSync */ - set(keyPath: string, value: any, options?: ElectronSettings.Options.Param): Promise; + set(keyPath: string, value: any, options?: ElectronSettings.Options): Promise; /** * The synchronous version of set(). * * @see set */ - setSync(keyPath: string, value: any, options?: ElectronSettings.Options.Param): void; + setSync(keyPath: string, value: any, options?: ElectronSettings.Options): void; /** * Deletes the key and value at the chosen key path. @@ -97,14 +96,14 @@ declare class Settings extends EventEmitter { * @throws if options is not an object. * @see deleteSync */ - delete(keyPath: string, options?: ElectronSettings.Options.Param): Promise; + delete(keyPath: string, options?: ElectronSettings.Options): Promise; /** * The synchronous version of delete(). * * @see delete */ - deleteSync(keyPath: string, options?: ElectronSettings.Options.Param): void; + deleteSync(keyPath: string, options?: ElectronSettings.Options): void; /** * Clears the entire settings object. @@ -113,14 +112,14 @@ declare class Settings extends EventEmitter { * @throws if options is not an object. * @see clearSync */ - clear(options?: ElectronSettings.Options.Param): Promise; + clear(options?: ElectronSettings.Options): Promise; /** * The synchronous version of clear(). * * @see clear */ - clearSync(options?: ElectronSettings.Options.Param): void; + clearSync(options?: ElectronSettings.Options): void; /** * Applies defaults to the current settings object (deep). @@ -133,14 +132,14 @@ declare class Settings extends EventEmitter { * @see defaults * @see applyDefaultsSync */ - applyDefaults(options?: ElectronSettings.ApplyDefaultsOptions.Param): Promise; + applyDefaults(options?: ElectronSettings.ApplyDefaultsOptions): Promise; /** * The synchronous version of applyDefaults(). * * @see applyDefaults */ - applyDefaultsSync(options?: ElectronSettings.ApplyDefaultsOptions.Param): void; + applyDefaultsSync(options?: ElectronSettings.ApplyDefaultsOptions): void; /** * Resets all settings to defaults. @@ -151,14 +150,14 @@ declare class Settings extends EventEmitter { * @see defaults * @see resetToDefaultsSync */ - resetToDefaults(options?: ElectronSettings.Options.Param): Promise; + resetToDefaults(options?: ElectronSettings.Options): Promise; /** * The synchronous version of resetToDefaults(). * * @see resetToDefaults */ - resetToDefaultsSync(options?: ElectronSettings.Options.Param): void; + resetToDefaultsSync(options?: ElectronSettings.Options): void; /** * Observes the chosen key path for changes and calls the handler if the value changes. @@ -209,40 +208,28 @@ declare namespace ElectronSettings { dispose(): void; } - interface Options extends Pick { } - - namespace Options { - type Param = Options | object; - - interface _Impl { - /** - * Whether electron-settings should create a tmp file during save to ensure data-write consistency. - * - * @default true - */ - atomicSaving: boolean; - /** - * Prettify the JSON output. - * - * @default false - */ - prettify: boolean; - } + interface Options { + /** + * Whether electron-settings should create a tmp file during save to ensure data-write consistency. + * + * @default true + */ + atomicSaving?: boolean; + /** + * Prettify the JSON output. + * + * @default false + */ + prettify?: boolean; } - interface ApplyDefaultsOptions extends Pick { } - - namespace ApplyDefaultsOptions { - type Param = ApplyDefaultsOptions | object; - - interface _Impl extends Options._Impl { - /** - * Overwrite pre-existing settings with their respective default values. - * - * @default false - */ - overwrite: boolean; - } + interface ApplyDefaultsOptions extends Options { + /** + * Overwrite pre-existing settings with their respective default values. + * + * @default false + */ + overwrite?: boolean; } interface ChangeEvent { diff --git a/types/electron-settings/v2/tsconfig.json b/types/electron-settings/v2/tsconfig.json index 3a5b7b152c..335711f7ef 100644 --- a/types/electron-settings/v2/tsconfig.json +++ b/types/electron-settings/v2/tsconfig.json @@ -4,6 +4,7 @@ "lib": [ "es6" ], + "target": "es2015", "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true,