From bb345b4d8984bbe89dc152b54f69d3765ce55542 Mon Sep 17 00:00:00 2001 From: Jakub Synowiec Date: Sat, 17 Feb 2018 17:02:32 +0100 Subject: [PATCH] Reformat document according to guidelines --- types/electron-store/index.d.ts | 134 +++++++++++++++++--------------- 1 file changed, 70 insertions(+), 64 deletions(-) diff --git a/types/electron-store/index.d.ts b/types/electron-store/index.d.ts index 1e687fee0e..357ec98460 100644 --- a/types/electron-store/index.d.ts +++ b/types/electron-store/index.d.ts @@ -16,20 +16,20 @@ declare module 'electron-store' { interface JSONArray extends Array {} interface ElectronStoreOptions { - /** - * Default data. - */ - defaults?: T; + /** + * Default data. + */ + defaults?: T; - /** - * Name of the storage file (without extension). - */ - name?: string; + /** + * Name of the storage 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; /** * When specified, the store will be encrypted using the aes-256-cbc encryption algorithm. @@ -38,70 +38,76 @@ declare module 'electron-store' { } class ElectronStore implements Iterable<[keyof T, JSONValue]> { - constructor(options?: ElectronStoreOptions); + constructor(options?: ElectronStoreOptions); - /** - * Set an item. - */ - set(key: K, value: T[K]): void; - set(key: string, value: any): void; + /** + * Set an item. + */ + set(key: K, value: T[K]): void; + set(key: string, value: any): void; - /** - * Set multiple items at once. - */ - set(object: Pick | T): void; - set(object: JSONObject): void + /** + * Set multiple items at once. + */ + set(object: Pick | T): void; + set(object: JSONObject): void; - /** - * Get an item or defaultValue if the item does not exist. - */ - get(key: K, defaultValue?: JSONValue): T[K]; - get(key: string, defaultValue?: any): any; + /** + * Get an item or defaultValue if the item does not exist. + */ + get(key: K, defaultValue?: JSONValue): T[K]; + get(key: string, defaultValue?: any): any; - /** - * Check if an item exists. - */ - has(key: K | string): boolean; + /** + * Check if an item exists. + */ + has(key: K | string): boolean; - /** - * Delete an item. - */ - delete(key: K | string): void; + /** + * Delete an item. + */ + delete(key: K | string): void; - /** - * Delete all items. - */ - clear(): void; + /** + * Delete all items. + */ + clear(): void; - /** - * Watches the given key, calling callback on any changes. When a key is first set oldValue - * will be undefined, and when a key is deleted newValue will be undefined. - */ - onDidChange(key: K, callback: (newValue: T[K], oldValue: T[K]) => void): void; - onDidChange(key: string, callback: (newValue: JSONValue, oldValue: JSONValue) => void): void; + /** + * Watches the given key, calling callback on any changes. When a key is first set oldValue + * will be undefined, and when a key is deleted newValue will be undefined. + */ + onDidChange( + key: K, + callback: (newValue: T[K], oldValue: T[K]) => void + ): void; + onDidChange( + key: string, + callback: (newValue: JSONValue, oldValue: JSONValue) => void + ): void; - /** - * Get the item count. - */ - size: number; + /** + * Get the item count. + */ + size: number; - /** - * Get all the data as an object or replace the current data with an object. - */ - store: T; + /** + * Get all the data as an object or replace the current data with an object. + */ + store: T; - /** - * Get the path to the storage file. - */ - path: string; + /** + * Get the path to the storage file. + */ + path: string; - /** - * Open the storage file in the user's editor. - */ - openInEditor(): void; + /** + * Open the storage file in the user's editor. + */ + openInEditor(): void; - [Symbol.iterator](): Iterator<[keyof T, JSONValue]>; + [Symbol.iterator](): Iterator<[keyof T, JSONValue]>; } export = ElectronStore; - } +}