import type { SyncMessage } from "../sync.js"; /** * Since we have a fixed range of priority values (0-7) we can create a fixed array of queues. */ type Tuple = A extends { length: N; } ? A : Tuple; export type QueueTuple = Tuple, 3>; export type LinkedListNode = { value: T; prev: LinkedListNode | undefined; next: LinkedListNode | undefined; }; /** * Using a linked list to make the shift operation O(1) instead of O(n) * as our queues can grow very large when the system is under pressure. */ export declare class LinkedList { private meter?; constructor(meter?: QueueMeter | undefined); head: LinkedListNode | undefined; tail: LinkedListNode | undefined; length: number; push(value: T): LinkedListNode; shift(): T | undefined; trackPushPull(): void; /** * Remove a specific node from the list in O(1) time. * The node must be a valid node that was returned by push(). */ remove(node: LinkedListNode): void; isEmpty(): boolean; } declare class QueueMeter { private attrs?; private pullCounter; private pushCounter; constructor(prefix: string, attrs?: Record | undefined); pull(): void; push(): void; trackPushPull(): void; } export declare function meteredList(type: "incoming" | "outgoing" | "storage-streaming" | "load-requests-queue", attrs?: Record): LinkedList; export {}; //# sourceMappingURL=LinkedList.d.ts.map