patronum
Version:
☄️ Effector utility library delivering modularity and convenience
42 lines (41 loc) • 1.15 kB
TypeScript
import { Node, Unit, Scope } from 'effector';
type LogContext = {
logType: 'initial' | 'update';
scope: Scope | null;
scopeName: string | null;
/** node, kind, value, name - common fields for logs and traces */
node: Node;
kind: string;
value: unknown;
name: string | null;
loc?: {
file?: string;
line: number;
column: number;
};
stackMeta: Record<string, unknown>;
trace: {
node: Node;
name: string | null;
kind: string;
value: unknown;
loc?: {
file?: string;
line: number;
column: number;
};
stackMeta: Record<string, unknown>;
}[];
};
interface Config {
trace?: boolean;
handler?: (context: LogContext) => void;
}
export declare function debug(...entries: [Unit<any>, ...Unit<any>[]] | [Config, ...Unit<any>[]] | [Record<string, Unit<any>>] | [Config, Record<string, Unit<any>>]): void;
export declare namespace debug {
var registerScope: (scope: Scope, config: {
name: string;
}) => () => void;
var unregisterAllScopes: () => void;
}
export {};