@modern-js/types
Advanced tools
Comparing version 0.0.0-next-20250219231626 to 0.0.0-next-20250220033742
@@ -18,3 +18,3 @@ { | ||
], | ||
"version": "0.0.0-next-20250219231626", | ||
"version": "0.0.0-next-20250220033742", | ||
"types": "./index.d.ts", | ||
@@ -52,4 +52,4 @@ "exports": { | ||
"type-fest": "2.15.0", | ||
"@scripts/build": "0.0.0-next-20250219231626", | ||
"@scripts/jest-config": "0.0.0-next-20250219231626" | ||
"@scripts/build": "0.0.0-next-20250220033742", | ||
"@scripts/jest-config": "0.0.0-next-20250220033742" | ||
}, | ||
@@ -56,0 +56,0 @@ "sideEffects": false, |
/** Monitor Events */ | ||
export type LogLevel = 'warn' | 'error' | 'debug' | 'info'; | ||
export type LogLevel = 'error' | 'warn' | 'info' | 'debug' | 'trace'; | ||
@@ -19,7 +19,16 @@ export interface LogEvent { | ||
desc?: string; | ||
args?: any[]; | ||
}; | ||
} | ||
export type MonitorEvent = LogEvent | TimingEvent; | ||
export interface CounterEvent { | ||
type: 'counter'; | ||
payload: { | ||
name: string; | ||
args?: any[]; | ||
}; | ||
} | ||
export type MonitorEvent = LogEvent | TimingEvent | CounterEvent; | ||
export type CoreMonitor = (event: MonitorEvent) => void; | ||
@@ -30,2 +39,3 @@ | ||
// 日志事件 | ||
error(message: string, ...args: any[]): void; | ||
@@ -35,4 +45,7 @@ warn(message: string, ...args: any[]): void; | ||
info(message: string, ...args: any[]): void; | ||
trace(message: string, ...args: any[]): void; | ||
timing(name: string, dur: number, desc?: string): void; | ||
// 打点事件 | ||
timing(name: string, dur: number, ...args: any[]): void; | ||
counter(name: string, ...args: any[]): void; | ||
} |
27667
861