mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 07:17:04 +00:00
electron-store - Fix onDidChange return value
This commit is contained in:
@@ -52,3 +52,7 @@ typedElectronStore.set({
|
||||
enabled: true,
|
||||
interval: 10000,
|
||||
});
|
||||
|
||||
const offDidChange = typedElectronStore.onDidChange("enabled", (n: boolean | undefined, p: boolean | undefined) => {});
|
||||
|
||||
offDidChange();
|
||||
|
||||
Vendored
+6
-4
@@ -8,6 +8,8 @@
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import EventEmitter = require("events");
|
||||
|
||||
type JSONValue = string | number | boolean | JSONObject | JSONArray;
|
||||
|
||||
interface JSONObject {
|
||||
@@ -79,12 +81,12 @@ declare class ElectronStore<T = {}> implements Iterable<[string, JSONValue]> {
|
||||
*/
|
||||
onDidChange<K extends keyof T>(
|
||||
key: K,
|
||||
callback: (newValue: T[K], oldValue: T[K]) => void
|
||||
): void;
|
||||
callback: (newValue: T[K] | undefined, oldValue: T[K] | undefined) => void
|
||||
): () => EventEmitter;
|
||||
onDidChange(
|
||||
key: string,
|
||||
callback: (newValue: JSONValue, oldValue: JSONValue) => void
|
||||
): void;
|
||||
callback: (newValue: JSONValue | undefined, oldValue: JSONValue | undefined) => void
|
||||
): () => EventEmitter;
|
||||
|
||||
/**
|
||||
* Get the item count.
|
||||
|
||||
Reference in New Issue
Block a user