UNPKG

@leafer/debug

Version:
50 lines (45 loc) 1.53 kB
import { IBooleanMap, ILeaferCanvas, IBoundsData, ILeaf, IRenderOptions } from '@leafer/interface'; interface ids { [name: string]: number; } interface names { [name: string]: string; } declare const Run: { currentId: number; currentName: string; idMap: ids; nameMap: names; nameToIdMap: ids; start(name: string, microsecond?: boolean): number; end(id: number, microsecond?: boolean): void; endOfName(name: string, microsecond?: boolean): void; }; declare class Debug { static enable: boolean; static filterList: string[]; static excludeList: string[]; static showWarn: boolean; static showRepaint: boolean | string; static showBounds: boolean | string | 'hit'; name: string; repeatMap: IBooleanMap; constructor(name: string); static get(name: string): Debug; static set filter(name: string | string[]); static set exclude(name: string | string[]); static drawRepaint(canvas: ILeaferCanvas, bounds: IBoundsData): void; static drawBounds(leaf: ILeaf, canvas: ILeaferCanvas, _options: IRenderOptions): void; log(...messages: unknown[]): void; tip(...messages: unknown[]): void; warn(...messages: unknown[]): void; repeat(name: string, ...messages: unknown[]): void; error(...messages: unknown[]): void; } declare const Plugin: { list: IBooleanMap; add(name: string, ...needPlugins: string[]): void; has(name: string, tip?: boolean): boolean; need(name: string): any; }; export { Debug, Plugin, Run };