interface EnableFlags { error?: boolean; perf?: boolean; request?: boolean; tracing?: boolean; } interface TracingOptions { sampleRate?: number; urlBlacklist?: (string | RegExp)[]; } interface RequestOptions { urlGroupRules?: Record; } type OtlpEncoding = 'proto' | 'json'; interface MonitorOptions { service: string; serviceVersion?: string; serviceInstance?: string; collector?: string; traceCollector?: string; platform?: 'wechat' | 'alipay'; enable?: EnableFlags; tracing?: TracingOptions; request?: RequestOptions; maxQueue?: number; flushInterval?: number; encoding?: OtlpEncoding; debug?: boolean; } type EventKind = 'log' | 'metric' | 'segment'; interface MonitorEvent { kind: EventKind; time: number; payload: unknown; } declare function init(opts: MonitorOptions): void; declare function record(kind: EventKind, payload: unknown): void; declare function flush(): Promise; declare function shutdown(): void; export { type EventKind, type MonitorEvent, type MonitorOptions, flush, init, record, shutdown };