/** * thinConsole - A lightweight web debugging console * @version 1.6.0 */ /** * ThinConsole instance (the runtime export is an ES6 class, must be used with `new`) */ declare class thinConsole { constructor(options?: thinConsole.Options); /** Version string, e.g. "1.5.8" (matches the built bundle) */ readonly version: string; /** Current options (sanitized) */ readonly options: thinConsole.Options; /** Current tab id */ currentTab: string; /** Current theme id */ currentTheme: string; /** Max log entries */ maxLog: number; /** Max network request records */ maxNetwork: number; /** Currently selected element (Elements tab) */ selectedElement: Element | null; /** Shared store: plugin-visible writable state (get / set / subscribe) */ readonly store: thinConsole.Store; /** Register & mount a class-based plugin on this instance. Only classes extending tCPlugin are accepted (function plugins were removed — use hooks instead) */ addPlugin(name: string, plugin: typeof thinConsole.Plugin): this; /** * Show the console overlay, optionally switching to a tab and to a specific filter. * * @param tab Tab id ('console' | 'localstorage' | 'network' | 'elements' | plugin id) * @param filterName Optional filter id inside that tab. If omitted/empty/nonexistent, * only the tab is switched and the current filter is left untouched. * Built-in filter ids: * console → 'all' | 'log' | 'info' | 'warn' | 'error' * network → 'all' | 'get' | 'post' | 'put' | 'success' | 'failed' * localstorage → 'local' | 'session' | 'cookie' */ show(tab?: string, filterName?: string): this; /** Hide the console overlay */ hide(): this; /** * Destroy the instance and remove all DOM elements; mounted plugins get destroy() called. * * NOTE: only acts when this instance is the current singleton (tC === this). * Calling it on a stale/non-current instance is a silent no-op. */ destroy(): void; /** Destroy this instance and create a NEW one with the given options (returns the new instance) */ setOption(options: thinConsole.Options): thinConsole; /** * Switch to a tab by id, optionally also selecting a filter inside that tab. * * Named `switch` (not `switchTab`) because the scope is broader than "tabs": * it moves to a tab AND, with the second argument, to a specific filter panel. * * @param tab Tab id ('console' | 'localstorage' | 'network' | 'elements' | plugin id) * @param filterName Optional filter id. If omitted/empty/nonexistent, only the tab is switched. */ switch(tab: string, filterName?: string): void; /** Enable previously disabled plugin(s) - single name or array */ enablePlugin(name: string | string[]): this; /** Disable & unload plugin(s) - single name or array (calls the plugin destroy()) */ disablePlugin(name: string | string[]): this; /** Unload & remove a mounted plugin entirely (calls plugin destroy(), removes its tab UI) */ destroyPlugin(name: string): this; /** * Hide / restore log-type filter buttons. * `ban("warn")` hides the warn filter; `ban("warn", false)` restores it. * Called with no arguments it defaults to ("all", true) — i.e. hides EVERY filter. * @param type filter id, or "all" (default "all") * @param on true = hide, false = restore (default true) */ ban(type?: string, on?: boolean): this; /** Show a toast notification */ showNotification(message: string, type?: string): void; /** Send a new network request from the request editor */ sendNewRequest(): void; /** Resend a previous network request */ resendRequest(req: thinConsole.NetRequest): void; /** Apply custom icon overrides. Values must be "viewBox|path.d" format */ applyIcon(icons: Record): void; /** * Trigger a hook by name. The name is auto-registered when it does not exist. * Listeners registered via addHook are called with (...args); this = the thinConsole instance. */ triggerHook(name: string, ...args: any[]): void; /** Alias used internally: fire all listeners of a hook (auto-registers the name) */ triggerGlobalHook(name: string, ...args: any[]): void; /** Escape HTML special characters */ escapeHtml(str: string): string; /** Safe JSON stringify with circular reference handling */ safeStringify(value: any, indent?: number, json?: boolean): string; /** Get the icon SVG string */ icon(name: string, className?: string): string; /** Append a