mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Wrap in module
This commit is contained in:
Vendored
+74
-71
@@ -1,79 +1,82 @@
|
||||
// Type definitions for electron-store 1.2
|
||||
// Project: https://github.com/sindresorhus/electron-store
|
||||
// Definitions by: Daniel Perez Alvarez <https://github.com/unindented>
|
||||
// Jakub Synowiec <https://github.com/jsynowiec>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
interface ElectronStoreOptions {
|
||||
/**
|
||||
* Default config.
|
||||
*/
|
||||
defaults?: {};
|
||||
declare module 'electron-store' {
|
||||
interface ElectronStoreOptions {
|
||||
/**
|
||||
* Default config.
|
||||
*/
|
||||
defaults?: {};
|
||||
|
||||
/**
|
||||
* Name of the config file (without extension).
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Name of the config file (without extension).
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* Storage file location. *Don't specify this unless absolutely necessary!*
|
||||
*/
|
||||
cwd?: string;
|
||||
/**
|
||||
* Storage file location. *Don't specify this unless absolutely necessary!*
|
||||
*/
|
||||
cwd?: string;
|
||||
}
|
||||
|
||||
class ElectronStore implements Iterable<[string, string | number | boolean | symbol | {}]> {
|
||||
constructor(options?: ElectronStoreOptions);
|
||||
|
||||
/**
|
||||
* Sets an item.
|
||||
*/
|
||||
set(key: string, value: any): void;
|
||||
|
||||
/**
|
||||
* Sets multiple items at once.
|
||||
*/
|
||||
set(object: {}): void;
|
||||
|
||||
/**
|
||||
* Retrieves an item.
|
||||
*/
|
||||
get(key: string, defaultValue?: any): any;
|
||||
|
||||
/**
|
||||
* Checks if an item exists.
|
||||
*/
|
||||
has(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Deletes an item.
|
||||
*/
|
||||
delete(key: string): void;
|
||||
|
||||
/**
|
||||
* Deletes all items.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Open the storage file in the user's editor.
|
||||
*/
|
||||
openInEditor(): void;
|
||||
|
||||
/**
|
||||
* Gets the item count.
|
||||
*/
|
||||
size: number;
|
||||
|
||||
/**
|
||||
* Gets all the config as an object or replace the current config with an object.
|
||||
*/
|
||||
store: {};
|
||||
|
||||
/**
|
||||
* Gets the path to the config file.
|
||||
*/
|
||||
path: string;
|
||||
|
||||
[Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>;
|
||||
}
|
||||
|
||||
export = ElectronStore;
|
||||
}
|
||||
|
||||
declare class ElectronStore implements Iterable<[string, string | number | boolean | symbol | {}]> {
|
||||
constructor(options?: ElectronStoreOptions);
|
||||
|
||||
/**
|
||||
* Sets an item.
|
||||
*/
|
||||
set(key: string, value: any): void;
|
||||
|
||||
/**
|
||||
* Sets multiple items at once.
|
||||
*/
|
||||
set(object: {}): void;
|
||||
|
||||
/**
|
||||
* Retrieves an item.
|
||||
*/
|
||||
get(key: string, defaultValue?: any): any;
|
||||
|
||||
/**
|
||||
* Checks if an item exists.
|
||||
*/
|
||||
has(key: string): boolean;
|
||||
|
||||
/**
|
||||
* Deletes an item.
|
||||
*/
|
||||
delete(key: string): void;
|
||||
|
||||
/**
|
||||
* Deletes all items.
|
||||
*/
|
||||
clear(): void;
|
||||
|
||||
/**
|
||||
* Open the storage file in the user's editor.
|
||||
*/
|
||||
openInEditor(): void;
|
||||
|
||||
/**
|
||||
* Gets the item count.
|
||||
*/
|
||||
size: number;
|
||||
|
||||
/**
|
||||
* Gets all the config as an object or replace the current config with an object.
|
||||
*/
|
||||
store: {};
|
||||
|
||||
/**
|
||||
* Gets the path to the config file.
|
||||
*/
|
||||
path: string;
|
||||
|
||||
[Symbol.iterator](): Iterator<[string, string | number | boolean | symbol | {}]>;
|
||||
}
|
||||
|
||||
export = ElectronStore;
|
||||
|
||||
Reference in New Issue
Block a user