refactor: declare KeyWeakMap<K, V> returned by createIDWeakMap() / createDoubleIDWeakMap() (#21171)
This commit is contained in:
parent
92ff39c168
commit
3f2cb91a35
4 changed files with 15 additions and 7 deletions
3
typings/internal-ambient.d.ts
vendored
3
typings/internal-ambient.d.ts
vendored
|
@ -29,7 +29,8 @@ declare namespace NodeJS {
|
|||
setHiddenValue<T>(obj: any, key: string, value: T): void;
|
||||
deleteHiddenValue(obj: any, key: string): void;
|
||||
requestGarbageCollectionForTesting(): void;
|
||||
createDoubleIDWeakMap(): any;
|
||||
createIDWeakMap<V>(): ElectronInternal.KeyWeakMap<number, V>;
|
||||
createDoubleIDWeakMap<V>(): ElectronInternal.KeyWeakMap<[string, number], V>;
|
||||
setRemoteCallbackFreer(fn: Function, frameId: number, contextId: String, id: number, sender: any): void
|
||||
}
|
||||
|
||||
|
|
7
typings/internal-electron.d.ts
vendored
7
typings/internal-electron.d.ts
vendored
|
@ -112,6 +112,13 @@ declare namespace ElectronInternal {
|
|||
appIcon: string | null;
|
||||
}
|
||||
|
||||
interface KeyWeakMap<K, V> {
|
||||
set(key: K, value: V): void;
|
||||
get(key: K): V | undefined;
|
||||
has(key: K): boolean;
|
||||
remove(key: K): void;
|
||||
}
|
||||
|
||||
// Internal IPC has _replyInternal and NO reply method
|
||||
interface IpcMainInternalEvent extends Omit<Electron.IpcMainEvent, 'reply'> {
|
||||
_replyInternal(...args: any[]): void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue