@meld-ts/core
    Preparing search index...

    Interface DebugConfiguration

    初始化时传入的调试配置,挂载在原型上,所有实例共享。

    可变性是有意设计——debugConfig 的字段(如 namecolor)可在 constructor 中按实例修改。在原型上改一个字段,该字段对所有实例生效; 在实例自有属性上改,仅影响该实例。debuggable 提供的默认值只是起点,不是锁死的契约。

    安全注意color / scopeColor / style / scopeStyle 直接拼入 console.log%c 格式字符串,未做转义。 传入的 CSS 值将原样生效,请确保来源可信。

    • name — 显示在日志头部的模块名称,默认 'Debug'
    • color — name 的颜色值(仅色值,自动包装为 color: <value>),如 '#ff6b6b'
    • style — name 的完整 CSS 样式字符串,优先级高于 color,如 'color: #ff6b6b; font-weight: bold'
    • scopeColor — scope 的颜色值(同 color 规则)
    • scopeStyle — scope 的完整 CSS 样式字符串,优先级高于 scopeColor
    • method — 输出方法:'log'(默认)、'debug',或自定义函数
    • timeFlag — 是否在日志头部追加时间戳;true 使用内置格式,也可传自定义函数
    • format — 自定义头部格式函数,返回传给 console.log 的参数数组
    interface DebugConfiguration {
        name?: string;
        color?: string;
        style?: string;
        scopeColor?: string;
        scopeStyle?: string;
        method?: "log" | "debug" | DebugFunction;
        timeFlag?: boolean | TimeFlagFunction;
        format?: (
            vars: Record<string, string | null | undefined>,
            styles: Record<string, string | null | undefined>,
        ) => string[];
        [key: string]: unknown;
    }

    Indexable

    • [key: string]: unknown
    Index

    Properties

    name?: string
    color?: string
    style?: string
    scopeColor?: string
    scopeStyle?: string
    method?: "log" | "debug" | DebugFunction
    timeFlag?: boolean | TimeFlagFunction
    format?: (
        vars: Record<string, string | null | undefined>,
        styles: Record<string, string | null | undefined>,
    ) => string[]