Files
notification-elements-demo/node_modules/thingies/lib/TimedState.d.ts
Giuliano Silvestro 5d0c9ec7eb Initial commit: notification-elements-demo app
Interactive Angular 19 demo for @sda/notification-elements-ui with
6 sections: Bell & Feed, Notification Center, Inbox, Comments &
Threads, Mention Input, and Full-Featured layout. Includes mock
data, dark mode toggle, and real-time event log.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-13 21:49:19 +10:00

27 lines
778 B
TypeScript

/**
* TimedState works similar to TimedQueue, but instead of saving
* a list of all items pushed, it reduces the state on each push.
*/
export declare class TimedState<S, I> {
protected readonly initState: () => S;
protected readonly reducer: (state: S, item: I) => S;
/**
* State will be flushed when it reaches this number of items.
*/
itemLimit: number;
/**
* State will be flushed after this many milliseconds.
*/
timeLimit: number;
/**
* Method that will be called when state is flushed.
*/
onFlush: (state: S) => void;
constructor(initState: () => S, reducer: (state: S, item: I) => S);
protected length: number;
protected state: S;
private timer;
push(item: I): void;
flush(): S;
}