heartbeat-monitor/node_modules/next/dist/client/components/segment-cache/tuple-map.d.ts
Matt Bruce bed1169443 Initial commit: Heartbeat Monitor dashboard
- Full-featured monitoring dashboard for local web apps
- Real-time status tracking with uptime percentages
- Visual sparklines for status history
- Add/Edit/Delete apps dynamically
- Categories and color coding
- Auto-refresh every 30 seconds
- API endpoints for apps and status management
2026-02-18 11:16:01 -06:00

20 lines
858 B
TypeScript

export type Prefix<T extends any[]> = T extends [infer First, ...infer Rest] ? [] | [First] | [First, ...Prefix<Rest>] : [];
export type TupleMap<Keypath extends Array<any>, V> = {
set(keys: Prefix<Keypath>, value: V): void;
get(keys: Prefix<Keypath>): V | null;
delete(keys: Prefix<Keypath>): void;
};
/**
* Creates a map whose keys are tuples. Tuples are compared per-element. This
* is useful when a key has multiple parts, but you don't want to concatenate
* them into a single string value.
*
* In the Segment Cache, we use this to store cache entries by both their href
* and their Next-URL.
*
* Example:
* map.set(['https://localhost', 'foo/bar/baz'], 'yay');
* map.get(['https://localhost', 'foo/bar/baz']); // returns 'yay'
*/
export declare function createTupleMap<Keypath extends Array<any>, V>(): TupleMap<Keypath, V>;