hooks-plugin
Version:
A plugin system built through various hooks.
32 lines (31 loc) • 824 B
TypeScript
import type { PluginSystem } from './PluginSystem';
import type {
EachEvent,
ListenErrorEvent,
PerformanceEvent,
} from './Interface';
interface Data {
tag?: string;
time: number;
e: EachEvent<unknown, unknown>;
}
interface PerformanceData {
tag?: string;
e: PerformanceEvent;
}
export interface DebuggerOptions {
tag?: string;
group?: boolean;
listenError?: boolean;
logPluginTime?: boolean;
filter?: string | ((e: Data) => boolean);
performance?: ReturnType<PluginSystem<any>['performance']>;
receiver?: (data: Data) => void;
errorReceiver?: (data: ListenErrorEvent) => void;
performanceReceiver?: (data: PerformanceData) => void;
}
export declare function createDebugger<T extends Record<string, unknown>>(
plSys: PluginSystem<T>,
options: DebuggerOptions,
): () => void;
export {};