UNPKG

@fjell/logging

Version:
18 lines (17 loc) 525 B
export declare const hash: (message: string, data: any[]) => string; export type FloodControlConfig = { enabled: boolean; threshold: number; timeframe: number; }; export declare class FloodControl { private config; private history; private suppressed; private cleanupTimer; constructor(config: FloodControlConfig); destroy(): void; private cleanup; check(message: string, data: any[]): 'log' | 'suppress' | 'resume'; getSuppressedCount(message: string, data: any[]): number; }