UNPKG

@zenweb/core

Version:

ZenWeb Core Module - Module loader and Server

31 lines (30 loc) 908 B
import { Debugger as _Debugger } from 'debug'; export interface Debugger extends _Debugger { extend: (namespace: string, delimiter?: string) => Debugger; } /** * zenweb debug */ export declare const debug: Debugger; /** * 扩展 zenweb debug * @param namespace 命名空间 */ export declare function zenwebDebug(namespace?: string): Debugger; /** * 创建一个新的 debug 对象 * @param namespace 命名空间 * @returns */ export declare function createDebug(namespace: string): Debugger; /** * 取得调用栈中位置信息,例如文件位置 * @param stackIndex 第几层 */ export declare function getStackLocation(stackIndex?: number): string | undefined; /** * 调用代理 * - 当对象中属性或方法被调用时通过 `call` 取得对象并返回被调用方法 * @param call 返回对象实例 */ export declare function callProxy<T extends object>(call: () => T): T;