UNPKG

lag-monitor

Version:

A lightweight utility for monitoring JavaScript event loop lag in real-time

22 lines (21 loc) 486 B
interface Buffer<T> { push(item: T): void; latest: T | undefined; toArray(): T[]; length: number; clear(): void; } declare class CircularBuffer<T> implements Buffer<T> { private capacity; private buffer; private index; private filled; constructor(capacity: number); push(item: T): void; get latest(): T | undefined; toArray(): T[]; get length(): number; clear(): void; } export default CircularBuffer; export type { Buffer };