UNPKG

obsidian-dev-utils

Version:

This is the collection of useful functions that you can use for your Obsidian plugin development

43 lines (42 loc) 1.45 kB
/** * @packageDocumentation * * Contains utility functions for debugging. */ import type { Debugger } from 'debug'; import type { DebugController } from './DebugController.mjs'; interface DebuggerEx extends Debugger { printStackTrace(stackTrace: string, title?: string): void; } /** * Enables the debuggers for the `obsidian-dev-utils` library. */ export declare function enableLibraryDebuggers(): void; /** * Returns a debug controller. * * @returns A debug controller. */ export declare function getDebugController(): DebugController; /** * Returns a debugger instance with a log function that includes the caller's file name and line number. * * @param namespace - The namespace for the debugger instance. * @param framesToSkip - The number of frames to skip in the stack trace. * @returns A debugger instance with a log function that includes the caller's file name and line number. */ export declare function getDebugger(namespace: string, framesToSkip?: number): DebuggerEx; /** * Returns a debugger instance for the `obsidian-dev-utils` library. * * @param namespace - The namespace for the debugger instance. * @returns A debugger instance for the `obsidian-dev-utils` library. */ export declare function getLibDebugger(namespace: string): DebuggerEx; /** * Shows an initial debug message. * * @param pluginId - The plugin ID. */ export declare function showInitialDebugMessage(pluginId: string): void; export {};