update onError to be record

This commit is contained in:
Jacob Nguyen
2023-09-09 11:32:11 -05:00
parent 374a12bb92
commit 4591471e7e
10 changed files with 31 additions and 27 deletions

View File

@@ -12,12 +12,12 @@ interface MetadataAccess {
}
interface OnErrorAccess {
getErrorCallback(m: Module): Function|undefined;
setErrorCallback(m: Module, c: Function): void;
getErrorCallback(m: Module): Record<string,Function>|undefined;
setErrorCallback(m: Module, c: Record<string,Function>): void;
}
/**
* @since 2.0.0
* @deprecated - direct access to the module manager will be removed in version 4
* @internal - direct access to the module manager will be removed in version 4
*/
export interface ModuleManager extends MetadataAccess, OnErrorAccess {
get(id: string): string | undefined;

View File

@@ -6,5 +6,5 @@ import type { CommandMeta, Module } from '../../types/core-modules';
export interface CoreModuleStore {
commands: Map<string, string>;
metadata: WeakMap<Module, CommandMeta>;
onError: WeakMap<Module, Function>;
onError: WeakMap<Module, Record<string,Function>>;
}