interface RetryOptions { retries: number; factor: number; minTimeout: number; maxTimeout: number; randomize: boolean; } declare const retry: (callbackFn: () => T | Promise, options?: Partial) => Promise; type SpatialPoint = { x: number; y: number; }; type SpatialRect = { x: number; y: number; width: number; height: number; }; declare class SpatialHash { private cs; private cells; private entries; private _size; constructor(cellSize: number); get size(): number; private key; private coordsForRect; insert(item: T, bounds: SpatialRect): void; remove(item: T): boolean; update(item: T, bounds: SpatialRect): void; query(bounds: SpatialRect): T[]; nearest(point: SpatialPoint, maxDist?: number): T | null; private scanCell; clear(): this; } declare class Quadtree { private root; private cap; private maxDepth; private known; private _size; constructor(bounds: SpatialRect, capacity?: number, maxDepth?: number); get size(): number; insert(item: T, bounds: SpatialRect): boolean; private insertNode; private tryChildren; private subdivide; remove(item: T): boolean; private removeNode; update(item: T, bounds: SpatialRect): void; query(bounds: SpatialRect): T[]; private queryNode; nearest(point: SpatialPoint, maxDist?: number): T | null; private nearestNode; clear(): this; } declare const Spatial: { SpatialHash: typeof SpatialHash; Quadtree: typeof Quadtree; }; declare class Deferred { private _resolve; private _reject; readonly promise: Promise; constructor(); resolve(value: T): void; reject(reason?: unknown): void; } declare class Semaphore { private permits; private queue; constructor(permits: number); get available(): number; acquire(): Promise; release(): void; run(fn: () => T | Promise): Promise; } declare class Mutex { private semaphore; constructor(); get locked(): boolean; acquire(): Promise<() => void>; run(fn: () => T | Promise): Promise; } declare function pLimit(concurrency: number): (fn: () => T | Promise) => Promise; declare function withTimeout(fn: () => T | Promise, ms: number): Promise; declare function sleep(ms: number): Promise; type DebounceFn = (...args: any[]) => void; type DebouncedFn = ((...args: Parameters) => void) & { cancel(): void; }; declare function debounce(fn: T, ms: number): DebouncedFn; type ThrottleFn = (...args: any[]) => void; type ThrottledFn = ((...args: Parameters) => void) & { cancel(): void; }; declare function throttle(fn: T, ms: number): ThrottledFn; declare class AsyncQueue { private readonly cap; private readonly buf; private readonly pullers; private readonly pushers; private readonly drainers; private isDone; constructor(capacity?: number); get size(): number; get closed(): boolean; push(item: T): Promise; pull(): Promise; close(): void; drain(): Promise; [Symbol.asyncIterator](): AsyncIterator; private wakePusher; private flushDrainers; } declare const Async: { Deferred: typeof Deferred; Semaphore: typeof Semaphore; Mutex: typeof Mutex; pLimit: typeof pLimit; withTimeout: typeof withTimeout; sleep: typeof sleep; debounce: typeof debounce; throttle: typeof throttle; AsyncQueue: typeof AsyncQueue; }; interface Size { width: number; height: number; } interface Rect$1 extends Size { x: number; y: number; } interface PlacedRect extends Rect$1 { rotated: boolean; } interface PixelGrid { width: number; height: number; alphaAt(x: number, y: number): number; } interface Sprite { id: string; width: number; height: number; pixels?: PixelGrid; } interface PreparedSprite { id: string; width: number; height: number; sourceWidth: number; sourceHeight: number; sourceOffsetX: number; sourceOffsetY: number; rotated: boolean; pixels?: PixelGrid; } interface PlacedSprite extends PreparedSprite { rect: Rect$1; page: number; } interface PackedPage { width: number; height: number; sprites: PlacedSprite[]; occupancy: number; } interface PackResult { pages: PackedPage[]; unpacked: PreparedSprite[]; } type POTMode = 'none' | 'page' | 'square'; interface AlgorithmOptions { maxWidth: number; maxHeight: number; allowRotation: boolean; pot: POTMode; } interface MemoryBudget { maxPagePixels?: number; maxPages?: number; maxSinglePagePixels?: number; } type AlgorithmKind = 'max-rects' | 'guillotine' | 'shelf' | 'skyline' | 'binary-tree'; type SortStrategy = 'area-desc' | 'max-side-desc' | 'height-desc' | 'width-desc' | 'perimeter-desc'; interface PackerOptions extends AlgorithmOptions { algorithm: AlgorithmKind; sort: SortStrategy | 'none'; trim: boolean; alphaThreshold: number; budget: MemoryBudget; padding: number; extrude: number; } declare abstract class Algorithm { protected width: number; protected height: number; protected allowRotation: boolean; constructor(options: AlgorithmOptions); abstract insert(size: Size): PlacedRect | null; abstract reset(): void; abstract occupancy(): number; abstract usedBounds(): Size; } declare class BinaryTree extends Algorithm { private root; private usedArea; private maxX; private maxY; constructor(options: AlgorithmOptions); insert(size: Size): PlacedRect | null; reset(): void; occupancy(): number; usedBounds(): Size; private find; private split; } type GuillotineSplit = 'shorter-axis' | 'longer-axis' | 'minimize-area'; type GuillotineChoice = 'best-short-side-fit' | 'best-long-side-fit' | 'best-area-fit' | 'worst-area-fit'; declare class Guillotine extends Algorithm { private freeRects; private splitStrategy; private choice; private usedArea; private maxX; private maxY; constructor(options: AlgorithmOptions); setSplit(strategy: GuillotineSplit): this; setChoice(choice: GuillotineChoice): this; insert(size: Size): PlacedRect | null; merge(): void; reset(): void; occupancy(): number; usedBounds(): Size; private scoreFit; private splitFreeRect; } type MaxRectsHeuristic = 'best-short-side-fit' | 'best-long-side-fit' | 'best-area-fit' | 'bottom-left'; declare class MaxRects extends Algorithm { private freeRects; private heuristic; private usedArea; private maxX; private maxY; constructor(options: AlgorithmOptions); setHeuristic(heuristic: MaxRectsHeuristic): this; insert(size: Size): PlacedRect | null; reset(): void; occupancy(): number; usedBounds(): Size; private findPlacement; private score; private isBetter; private placeRect; private splitFreeNode; private pruneFreeList; private contains; } type AlgorithmFactory = () => Algorithm; interface PlanOptions { padding: number; extrude: number; } declare class MultiPagePlanner { private algorithmFactory; private budget; private padding; private extrude; private pageWidth; private pageHeight; constructor(algorithmFactory: AlgorithmFactory, options: PlanOptions, budget?: MemoryBudget); pack(sprites: PreparedSprite[]): PackResult; } declare class Packer { private options; constructor(options: PackerOptions); pack(inputs: Sprite[]): PackResult; private createAlgorithm; private finalizePage; private static passthrough; } declare function potCeil(value: number): number; declare class Rotator { apply(placed: PlacedSprite[]): PlacedSprite[]; } type ShelfFit = 'next-fit' | 'first-fit' | 'best-fit'; declare class Shelf extends Algorithm { private shelves; private fit; private nextY; private usedArea; private maxX; private maxY; constructor(options: AlgorithmOptions); setFit(fit: ShelfFit): this; insert(size: Size): PlacedRect | null; reset(): void; occupancy(): number; usedBounds(): Size; private findShelf; private openShelf; } type SkylineHeuristic = 'bottom-left' | 'min-waste'; declare class Skyline extends Algorithm { private skyline; private heuristic; private usedArea; private maxX; private maxY; constructor(options: AlgorithmOptions); setHeuristic(heuristic: SkylineHeuristic): this; insert(size: Size): PlacedRect | null; reset(): void; occupancy(): number; usedBounds(): Size; private fits; private addLevel; } declare class Sorter { private strategy; constructor(strategy?: SortStrategy); sort(sprites: PreparedSprite[]): PreparedSprite[]; private compareFn; } declare class Trimmer { private alphaThreshold; constructor(alphaThreshold?: number); trim(input: Sprite): PreparedSprite; private passthrough; } declare const Packing: { Algorithm: typeof Algorithm; BinaryTree: typeof BinaryTree; Guillotine: typeof Guillotine; MaxRects: typeof MaxRects; MultiPagePlanner: typeof MultiPagePlanner; Packer: typeof Packer; potCeil: typeof potCeil; Rotator: typeof Rotator; Shelf: typeof Shelf; Skyline: typeof Skyline; Sorter: typeof Sorter; Trimmer: typeof Trimmer; }; declare class Ok { readonly value: T; readonly _tag: "ok"; constructor(value: T); isOk(): this is Ok; isErr(): this is Err; map(fn: (v: T) => U): Ok; mapErr(_fn: (e: E) => F): Ok; andThen(fn: (v: T) => Result): Result; flatMap(fn: (v: T) => Result): Result; unwrap(): T; unwrapErr(): never; unwrapOr(_defaultValue: T): T; } declare class Err { readonly error: E; readonly _tag: "err"; constructor(error: E); isOk(): this is Ok; isErr(): this is Err; map(_fn: (v: T) => U): Err; mapErr(fn: (e: E) => F): Err; andThen(_fn: (v: T) => Result): Err; flatMap(_fn: (v: T) => Result): Err; unwrap(): never; unwrapErr(): E; unwrapOr(defaultValue: T): T; } type Result = Ok | Err; declare function ok(value: T): Ok; declare function err(error: E): Err; declare class Some { readonly value: T; readonly _tag: "some"; constructor(value: T); isSome(): this is Some; isNone(): this is None; map(fn: (v: T) => U): Some; andThen(fn: (v: T) => Option): Option; flatMap(fn: (v: T) => Option): Option; unwrap(): T; unwrapOr(_defaultValue: T): T; } declare class None { readonly _tag: "none"; isSome(): this is Some; isNone(): this is None; map(_fn: (v: never) => U): None; andThen(_fn: (v: never) => Option): None; flatMap(_fn: (v: never) => Option): None; unwrap(): never; unwrapOr(defaultValue: T): T; } type Option = Some | None; declare function some(value: T): Some; declare function none(): None; declare class VectorClock { readonly nodeId: string; private data; constructor(nodeId: string, data?: Record); setClock(clock?: Record): void; getClock(): Record; setVersion(version: number, nodeId?: string): void; getVersion(nodeId?: string): number; increment(): void; update(vectorClock: VectorClock): void; isAfter(vectorClock: VectorClock): boolean; isConcurrent(vectorClock: VectorClock): boolean; isBefore(vectorClock: VectorClock): boolean; static getNodeIds(vectorClock1: VectorClock, vectorClock2: VectorClock): string[]; static isAfter(vectorClock1: VectorClock, vectorClock2: VectorClock): boolean; static isEqual(vectorClock1: VectorClock, vectorClock2: VectorClock): boolean; static isConcurrent(vectorClock1: VectorClock, vectorClock2: VectorClock): boolean; static isBefore(vectorClock1: VectorClock, vectorClock2: VectorClock): boolean; static compare(vectorClock1: VectorClock, vectorClock2: VectorClock): number; } type EventListener = (...args: any[]) => void; declare class EventEmitter { private _listeners; on(event: string | symbol, fn: EventListener, context?: any): this; once(event: string | symbol, fn: EventListener, context?: any): this; off(event: string | symbol, fn?: EventListener, context?: any): this; emit(event: string | symbol, ...args: any[]): boolean; removeAllListeners(event?: string | symbol): this; listenerCount(event: string | symbol): number; eventNames(): (string | symbol)[]; } declare class Broadcast { private events; on(event: string | symbol, fn: (...args: any[]) => void, context?: any): this; off(event: string | symbol, fn: (...args: any[]) => void, context?: any): this; once(event: string | symbol, fn: (...args: any[]) => void, context?: any): this; protected emit(event: string | symbol, ...messages: any[]): boolean; removeAllListeners(event?: string | symbol): this; listenerCount(event: string | symbol): number; eventNames(): (string | symbol)[]; } interface LSystemConfig { axiom: string; rules: Record; } declare class LSystem { private config; private _state; private _iteration; constructor(config: LSystemConfig); get state(): string; get iteration(): number; iterate(): string; reset(): void; } type ResetFn = (object: T) => void; type InstanceFn = (objectClass: new () => T) => T; declare class ObjectPool> { private pool; private objectClass; /** Cumulative count of instances ever created, not the current live count. */ readonly instances: number; private resetFn; private instanceFn; private inPool; constructor(objectClass: new () => T, resetFn?: ResetFn | null, instanceFn?: InstanceFn | null); obtain(): T; release: (object: T) => this; dispose(): void; private createInstance; } type PriorityFn = (node: T) => number; type UniqueFn = (node: T) => string; declare class PriorityQueue { private values; private hashMap; private priorityFn; private uniqueFn; constructor(priorityFn: PriorityFn, uniqueFn?: UniqueFn | null); get length(): number; enqueue(value: T): boolean; dequeue(): T | null; pop(): T | null; has(value: T): boolean | null; private bubbleUp; private bubbleDown; private swap; private getPriority; } declare class Stack { private items; get size(): number; push(item: T): this; pop(): T | null; peek(): T | null; isEmpty(): boolean; clear(): this; [Symbol.iterator](): Iterator; } declare class Deque { private head; private tail; private count; get size(): number; pushFront(item: T): this; pushBack(item: T): this; popFront(): T | null; popBack(): T | null; peekFront(): T | null; peekBack(): T | null; isEmpty(): boolean; clear(): this; [Symbol.iterator](): Iterator; } /** * Generates a random hex string of the given `length`. * * **Entropy note:** the default `length = 8` produces 4 bytes (32 bits) of entropy. * At that size birthday collisions become likely around ~77 000 IDs (~√(2³²/2)). * This is fine for short-lived or ephemeral keys, but for persistent or globally * unique identifiers use `length = 16` (64 bits, safe to ~4 billion IDs) or higher. */ declare const generateId: (length?: number) => string; declare function ulid(): string; declare const toHex: (value: number, digits?: number) => string; declare const formatByteSize: (bytes: number, decimals?: number) => string; declare function formatDuration(ms: number): string; interface FormatNumberOptions { compact?: boolean; } declare function formatNumber(n: number, options?: FormatNumberOptions): string; declare function relativeTime(date: Date | number): string; declare const bufferToHex: (buffer: Uint8Array) => string; declare const hexToBuffer: (hexNumber: string) => Uint8Array; type ColorType = 'white' | 'red' | 'pink' | 'purple' | 'deep_purple' | 'indigo' | 'blue' | 'light_blue' | 'cyan' | 'teal' | 'green' | 'light_green' | 'lime' | 'yellow' | 'amber' | 'orange' | 'deep_orange' | 'brown' | 'grey' | 'blue_grey' | 'black'; type WCAGReadability = { AA: boolean; AAA: boolean; AALarge: boolean; AAALarge: boolean; }; declare const Color: Record any)> & { getHex: (color: ColorType) => string | null; toNumber: (color: ColorType) => number; getRandomHex: () => string; luminance: (hex: string) => number; contrastRatio: (a: string, b: string) => number; readableOn: (fg: string, bg: string) => WCAGReadability; }; type PrimitiveTypeName = 'string' | 'boolean' | 'number' | 'integer' | 'email' | 'username' | 'password' | 'url' | 'uuid' | 'date' | 'datetime' | 'ipv4' | 'ipv6' | 'hex' | 'slug' | 'semver' | 'base64'; interface BaseSchema { required?: boolean; enum?: unknown[]; minLength?: number; maxLength?: number; pattern?: string; min?: number; max?: number; minItems?: number; maxItems?: number; $defs?: Record; } interface PrimitiveSchema extends BaseSchema { type: PrimitiveTypeName; } interface ObjectSchema extends BaseSchema { type: 'object'; flexible?: boolean; properties?: Record; } interface ArraySchema extends BaseSchema { type: 'array'; items?: Schema; } interface CustomSchema extends BaseSchema { type: string & {}; flexible?: boolean; properties?: Record; items?: Schema; } interface RefSchema { $ref: string; required?: boolean; $defs?: Record; } type Schema = PrimitiveSchema | ObjectSchema | ArraySchema | CustomSchema | RefSchema; interface JSONSchemaOptions { coerce?: boolean; } interface RawSchema { type?: string; $ref?: string; $defs?: Record; required?: boolean; flexible?: boolean; properties?: Record; items?: RawSchema; enum?: unknown[]; minLength?: number; maxLength?: number; pattern?: string; min?: number; max?: number; minItems?: number; maxItems?: number; } interface ValidationIssue { path: string; message: string; } interface ValidationError { issues: ValidationIssue[]; } type ValidationFn = (propertyName: string | null, schema: RawSchema, data: any, issues: ValidationIssue[]) => void; declare class JSONSchema { private validators; private schema; private defs; private isSchemaValidated; private latestError; constructor(schema: S, customValidators?: Record, _options?: JSONSchemaOptions); register(type: string, validationFn: ValidationFn): void; validate(data: any): boolean; /** * Coerce `data` toward the schema's expected types then validate. * * Supported coercions: * - string → number / integer (when the string is a valid number) * - string "true"/"false"/"1"/"0" → boolean * - number or boolean → string * - nested object properties and array items are coerced recursively * * Returns the (possibly coerced) value. On failure `getLatestError()` is * populated with the validation issues. */ coerce(data: unknown): unknown; getLatestError(): ValidationError | null; private parseRefName; private resolveRef; private applyCoercion; private runValidator; private validateSchema; private validateString; private validateBoolean; private validateNumber; private validateInteger; private validateObject; private validateArray; private validateEmail; private validateUsername; private validatePassword; private validateUrl; private validateUuid; private validateDate; private validateDateTime; private validateIpv4; private validateIpv6; private validateHex; private validateSlug; private validateSemver; private validateBase64; } declare const getNumberInRange: (value: string | number, defaultValue?: number, min?: number, max?: number) => number; declare function clamp(value: number, min: number, max: number): number; declare function lerp(a: number, b: number, t: number): number; declare function inverseLerp(a: number, b: number, value: number): number; declare function mapRange(value: number, inMin: number, inMax: number, outMin: number, outMax: number): number; declare function smoothstep(edge0: number, edge1: number, x: number): number; declare function approximately(a: number, b: number, epsilon?: number): boolean; type FetchFn = (...args: any[]) => T | Promise; declare class Cache { private entries; private inflight; private ms; private fetchFn; private maxEntries; /** * @param fetchFn - Function invoked to load data on a cache miss. * @param ms - Time-to-live in milliseconds. `0` (default) or any value `≤ 0` * means entries never expire: once fetched, the cached value is * returned on every subsequent call until explicitly invalidated. * Positive values expire entries after the given number of * milliseconds. * @param maxEntries - Optional cap on stored entries; the least-recently-used entry * is evicted when the limit is exceeded. */ constructor(fetchFn: FetchFn, ms?: number, maxEntries?: number); get(...args: any[]): Promise; /** * Update the TTL. `ms ≤ 0` sets cache-forever mode; positive values set a * finite expiry window in milliseconds. */ setMS(ms?: number): void; invalidate(...args: any[]): void; private getTime; private getHash; private getEntry; } declare class AdjacencyMatrix

{ private DEFAULT; readonly vertices: string[]; private vertexIndices; private matrix; constructor(defaultPositive?: P, defaultNegative?: N); addVertex(vertex: string): boolean; removeVertex(vertex: string): boolean; addEdge(vertexA: string, vertexB: string, value?: P | any): boolean; removeEdge(vertexA: string, vertexB: string): boolean; getEdge(vertexA: string, vertexB: string): P | N; getEdges(vertex: string): string[]; hasEdge(vertexA: string, vertexB: string): boolean; private cacheVertices; } declare class State = Record> extends Broadcast { private data; constructor(data?: Partial); get(): Partial; set(data: Partial, emit?: boolean): this; empty(emit?: boolean): this; private setProperties; private isObject; private emitEvent; } type WeightFn = (item: T) => number; type RandomFn = () => number; declare class WeightedRandom { private items; private cumulative; private total; private random; constructor(items: Iterable, weightFn: WeightFn, random?: RandomFn); get length(): number; get totalWeight(): number; pick(): T; pickMany(count: number): T[]; probabilityOf(predicate: (item: T) => boolean): number; } declare class Random { private state; constructor(seed: number); next(): number; int(min: number, max: number): number; float(min: number, max: number): number; bool(p?: number): boolean; pick(arr: T[]): T; shuffle(arr: T[]): T[]; weighted(entries: Array<{ item: T; weight: number; }>): T; } type Neighbors = (node: N) => Iterable; type EdgeCost = (from: N, to: N) => number; type NodeHash = (node: N) => string; interface DijkstraOptions { neighbors: Neighbors; cost: EdgeCost; hash?: NodeHash; } interface PathResult { path: N[]; cost: number; } type SearchStatus = 'searching' | 'found' | 'failed'; type FailReason = 'exhausted' | 'max_iterations'; interface FrontierEntry { key: string; g: number; priority: number; } declare class Dijkstra extends EventEmitter { static readonly FOUND = "found"; static readonly FAILED = "failed"; static readonly VISIT = "visit"; static readonly OPEN = "open"; readonly start: N; readonly end: N; iterations: number; maxIterations: number; protected status: SearchStatus; protected hash: NodeHash; protected endKey: string; protected options: DijkstraOptions; protected distances: Map; protected previousKey: Map; protected nodeMap: Map; protected frontier: PriorityQueue; private seeded; constructor(start: N, end: N, options: DijkstraOptions); static find(start: N, end: N, options: DijkstraOptions): PathResult | null; get isComplete(): boolean; getStatus(): SearchStatus; getResult(): PathResult | null; step(): SearchStatus; run(maxSteps?: number): PathResult | null; protected relax(currentKey: string, node: N, neighbor: N, currentG: number): void; protected priorityOf(_neighbor: N, gCost: number): number; protected seed(): void; protected reconstruct(): PathResult; protected fail(reason: FailReason): SearchStatus; } type Heuristic = (node: N, goal: N) => number; interface AStarOptions extends DijkstraOptions { heuristic: Heuristic; } declare class AStar extends Dijkstra { protected heuristic: Heuristic; constructor(start: N, end: N, options: AStarOptions); static find(start: N, end: N, options: AStarOptions): PathResult | null; protected priorityOf(neighbor: N, gCost: number): number; } declare class RingBuffer { private readonly buf; private head; private count; readonly capacity: number; constructor(capacity: number); get size(): number; push(item: T): this; peek(): T | null; tail(n: number): T[]; clear(): this; [Symbol.iterator](): Iterator; } declare class DisjointSet { private parent; private rank; private _count; get count(): number; makeSet(id: string): this; find(id: string): string | null; union(a: string, b: string): boolean; connected(a: string, b: string): boolean; } declare class Trie { private root; private _size; get size(): number; insert(word: string): this; has(word: string): boolean; delete(word: string): boolean; startsWith(prefix: string): string[]; private collect; clear(): this; } declare class BiMap { private forward; private reverse; get size(): number; set(key: K, value: V): this; get(key: K): V | null; getKey(value: V): K | null; has(key: K): boolean; hasValue(value: V): boolean; delete(key: K): boolean; deleteByValue(value: V): boolean; clear(): this; [Symbol.iterator](): Iterator<[K, V]>; } declare class BloomFilter { private readonly bits; private readonly hashCount; readonly bitSize: number; constructor(bitSize: number, hashCount: number); private h1; private h2; add(item: string): this; has(item: string): boolean; } declare class MultiMap { private store; private total; get size(): number; set(key: K, value: V): this; get(key: K): ReadonlySet | undefined; has(key: K, value?: V): boolean; delete(key: K, value?: V): boolean; keys(): IterableIterator; clear(): this; [Symbol.iterator](): Iterator<[K, ReadonlySet]>; } interface Rect { x: number; y: number; width: number; height: number; } declare class Vec2 { static readonly ZERO: Vec2; static readonly ONE: Vec2; readonly x: number; readonly y: number; constructor(x?: number, y?: number); add(other: Vec2): Vec2; subtract(other: Vec2): Vec2; scale(factor: number): Vec2; dot(other: Vec2): number; get length(): number; get lengthSq(): number; normalize(): Vec2; lerp(other: Vec2, t: number): Vec2; rotate(angle: number): Vec2; negate(): Vec2; distanceTo(other: Vec2): number; equals(other: Vec2): boolean; toArray(): [number, number]; toString(): string; } type NowFn$1 = () => number; declare class TokenBucket { readonly capacity: number; readonly refillRate: number; private readonly clock; private current; private lastRefill; constructor(capacity: number, refillRate: number, now?: NowFn$1); get tokens(): number; tryRemove(n?: number): boolean; take(n?: number): boolean; private doRefill; } type NowFn = () => number; declare class Stopwatch { private readonly clock; private startedAt; private accumulatedMs; private lapTimes; private lapStart; constructor(now?: NowFn); get running(): boolean; get elapsed(): number; get laps(): readonly number[]; start(): this; stop(): this; lap(): number; reset(): this; } type TickCallback = (delta: number, elapsed: number) => void; declare class Ticker { private readonly step; private accumulator; private totalElapsed; private listeners; private active; constructor(step?: number); get running(): boolean; get elapsed(): number; onTick(fn: TickCallback): this; offTick(fn: TickCallback): this; tick(delta: number): void; start(): this; stop(): this; reset(): this; } declare function slugify(input: string): string; declare function truncate(input: string, maxLength: number, suffix?: string): string; declare function escapeHtml(input: string): string; type Edit = [unknown] | [unknown, unknown] | [unknown, 0, 0]; type ObjectDelta = { [key: string]: unknown; }; type ArrayDelta = { _t: 'a'; _l: number; [key: string]: unknown; }; type Delta = ObjectDelta | ArrayDelta; declare function diff(a: unknown, b: unknown): Delta | null; declare function patch(target: unknown, delta: Delta | null): unknown; interface StorageAdapter { read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; truncate?(pageCount: number): Promise; flush?(): Promise; close?(): Promise; } interface BPlusIndexOptions { adapter: StorageAdapter; pageSize?: number; order?: number; keyEncoding?: string; compare: (a: K, b: K) => number; serializeKey: (k: K) => Uint8Array; deserializeKey: (b: Uint8Array) => K; serializeValue: (v: V) => Uint8Array; deserializeValue: (b: Uint8Array) => V; overflowThreshold?: number; } interface RangeOptions { gte?: K; gt?: K; lte?: K; lt?: K; reverse?: boolean; limit?: number; } interface BPlusIndexStats { /** Number of levels in the tree (1 = root is a leaf). */ height: number; /** Total number of pages allocated (including the two superblock slots). */ pageCount: number; /** Number of page IDs stored across all free-list pages — pages available for reuse. */ freePages: number; /** * Fraction of non-superblock allocated pages that are live tree data. * 1.0 = no waste; 0.5 = half the file is free slots that compact() can reclaim. */ fillFactor: number; } declare class BPlusIndex { static comparators: { string: (a: string, b: string) => 0 | 1 | -1; number: (a: number, b: number) => 0 | 1 | -1; bigint: (a: bigint, b: bigint) => 0 | 1 | -1; uint8Array: (a: Uint8Array, b: Uint8Array) => number; }; static serializers: { string: (k: string) => Uint8Array; number: (k: number) => Uint8Array; bigint: (k: bigint) => Uint8Array; uint8Array: (k: Uint8Array) => Uint8Array; }; static deserializers: { string: (b: Uint8Array) => string; number: (b: Uint8Array) => number; bigint: (b: Uint8Array) => bigint; uint8Array: (b: Uint8Array) => Uint8Array; }; static keyPreset: { string: { compare: (a: string, b: string) => 0 | 1 | -1; serializeKey: (k: string) => Uint8Array; deserializeKey: (b: Uint8Array) => string; keyEncoding: string; }; number: { compare: (a: number, b: number) => 0 | 1 | -1; serializeKey: (k: number) => Uint8Array; deserializeKey: (b: Uint8Array) => number; keyEncoding: string; }; bigint: { compare: (a: bigint, b: bigint) => 0 | 1 | -1; serializeKey: (k: bigint) => Uint8Array; deserializeKey: (b: Uint8Array) => bigint; keyEncoding: string; }; uint8Array: { compare: (a: Uint8Array, b: Uint8Array) => number; serializeKey: (k: Uint8Array) => Uint8Array; deserializeKey: (b: Uint8Array) => Uint8Array; keyEncoding: string; }; }; static open(opts: BPlusIndexOptions): Promise>; /** * Build a balanced B+ tree bottom-up from pre-sorted, de-duplicated entries. * Throws if entries are out-of-order or contain duplicate keys. * Requires a fresh (empty) index — opens `opts` as a new file. */ static bulkLoad(opts: BPlusIndexOptions, entries: [K, V][]): Promise>; private readonly adapter; private readonly compare; private readonly serializeKey; private readonly deserializeKey; private readonly serializeValue; private readonly deserializeValue; private readonly keyEncoding; private readonly overflowThreshold; private pageSize; private order; private rootPageId; private pageCount; private freeListHeadPageId; private _size; private writeSeq; private activeSuperblockSlot; private constructor(); get size(): number; private _init; private _commitSuperblock; private _flushSuperblock; flush(): Promise; close(): Promise; private _allocatePage; private _freePage; private _readInternal; private _writeInternal; private _readLeaf; /** Write a leaf. Allocates overflow pages for any entry that needs them (overflowHead === 0 and value too large). */ private _writeLeaf; private _readOverflow; private _writeOverflow; private _freeOverflowChain; /** Returns index in leaf entries, or bitwise-NOT of insert position. */ private _bsearch; /** * Upper bound: first i where keyRaws[i] > target. * Used to route through internal nodes: children[upperBound(keys, k)] contains k. */ private _upperBound; /** Lower bound: first i where keyRaws[i] >= target. Used for range start. */ private _lowerBound; private _findLeaf; get(key: K): Promise; has(key: K): Promise; set(key: K, value: V): Promise; private _setOne; setMany(entries: [K, V][]): Promise; getMany(keys: K[]): Promise<(V | undefined)[]>; private _cowLeaf; private _splitLeaf; private _insertIntoParent; private _splitInternal; private _updatePath; delete(key: K): Promise; private _deleteOne; deleteMany(keys: K[]): Promise; clear(): Promise; range(opts?: RangeOptions): AsyncGenerator<[K, V]>; /** * Gather every leaf page ID in ascending key order by descending the tree * via internal-node children (which are kept authoritative on every COW * split/update). The leaf `nextPageId` sibling chain is NOT used: a leaf * that is copied or split is relocated to a fresh page and freed, but its * left sibling's `nextPageId` is intentionally not rewritten (see * `_splitLeaf`), so that chain can dangle to a freed/reused page. */ private _collectAllLeafIds; entries(): AsyncGenerator<[K, V]>; keys(): AsyncGenerator; values(): AsyncGenerator; /** * O(log n) — descend the tree accumulating `childCounts` of skipped * left-sibling subtrees; returns the 0-based rank (number of entries * strictly less than `key`) and whether `key` itself exists. */ private _rankOf; /** * O(log n) — 0-based position of `key` in sorted order (= number of * entries strictly less than `key`). Returns the insertion rank even * when `key` is absent. */ rank(key: K): Promise; /** * O(log n) — entry at 0-based index `i` in sorted order; `undefined` * when `i` is out of range. Uses `childCounts` to pick the right child * at every internal node without scanning. */ nth(i: number): Promise<[K, V] | undefined>; /** * O(log n) — count of entries within the given range bounds. When no * bounds are provided, returns `this.size` without any page I/O. */ count(opts?: RangeOptions): Promise; /** Descend to the rightmost non-empty leaf and return its last entry. */ private _rightmostEntry; /** Descend to the leftmost non-empty leaf and return its first entry. */ private _leftmostEntry; /** O(log n) — smallest [key, value] in the index; `undefined` if empty. */ first(): Promise<[K, V] | undefined>; /** O(log n) — largest [key, value] in the index; `undefined` if empty. */ last(): Promise<[K, V] | undefined>; /** * O(log n) — largest [key, value] whose key ≤ `target`; `undefined` if * no such entry exists. Uses the descent path to avoid stale prevPageId * links left by copy-on-write splits. */ floor(target: K): Promise<[K, V] | undefined>; /** * O(log n) — smallest [key, value] whose key ≥ `target`; `undefined` if * no such entry exists. Uses the descent path to avoid stale nextPageId * dependencies when the current leaf is fully to the left of the target. */ ceil(target: K): Promise<[K, V] | undefined>; stats(): Promise; /** * Pack all live tree pages to the front of the file, then truncate the * tail. After returning: * - `freeListHeadPageId` is `NULL_PAGE` (the free list is gone) * - `pageCount` equals `FIRST_TREE_PAGE + livePageCount` * - the backing adapter is truncated if it supports `truncate()` * - the new layout is committed via the dual-superblock flip so a crash * mid-compact leaves the old superblock intact and consistent * * Must be called exclusively — no concurrent reads, writes, or open * iterators. Outstanding in-memory page IDs are invalidated; callers * should re-open or discard any held references after `compact()` returns. */ compact(): Promise; private _collectCompactLiveIds; /** * Patch all page-ID references inside `raw` according to `remap`, update * the page's `pageSeq` to the current `writeSeq`, recompute the CRC, and * return the modified copy. Operates in-place on a copy of the raw bytes * to avoid decoding + re-encoding (which would lose the overflow totalLen * stored in leaf entries whose value data lives in overflow chains). */ private _compactRemapPage; } declare class MemoryAdapter implements StorageAdapter { private pages; read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; truncate(pageCount: number): Promise; flush(): Promise; close(): Promise; } /** * Single-file Node.js storage adapter for BPlusIndex. * * Stores page N at byte offset N * pageSize. Opens the file with O_RDWR | * O_CREAT so it is created on first use and never truncated on open. * * The node:fs import is deferred inside _open() so browser bundlers can * tree-shake the dependency when FsAdapter is never instantiated. */ declare class FsAdapter implements StorageAdapter { private readonly _path; private readonly _pageSize; private _handle; private _opening; constructor(path: string, pageSize?: number); private _openHandle; read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; truncate(pageCount: number): Promise; flush(): Promise; close(): Promise; } /** * Browser Web Worker storage adapter for BPlusIndex backed by the Origin * Private File System (OPFS). * * CONSTRAINTS * - MUST run in a dedicated Web Worker. FileSystemSyncAccessHandle is only * available in worker contexts; calling it on the main thread throws. * - OPFS acquires an exclusive lock on the file for the lifetime of the * SyncAccessHandle, enforcing the single-writer guarantee required by * BPlusIndex without any additional locking. * * PAGE LAYOUT * Page N is stored at byte offset N × pageSize — identical to FsAdapter. * * TREE-SHAKING * navigator.storage.getDirectory() is accessed lazily inside _openHandle(). * The OPFS API is never referenced at module load time, so bundlers can * tree-shake this adapter out of non-browser builds when OpfsAdapter is never * instantiated. * * @example * ```ts * // Inside a dedicated Web Worker: * const adapter = new OpfsAdapter('myindex.idx') * const idx = await BPlusIndex.open({ ...opts, adapter }) * ``` */ declare class OpfsAdapter implements StorageAdapter { private readonly _name; private readonly _pageSize; private _handle; private _opening; /** * @param name OPFS file name relative to the OPFS root directory. * @param pageSize Must match the pageSize used when the index was first * created (default 4096, matching BPlusIndex's default). */ constructor(name: string, pageSize?: number); private _openHandle; read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; truncate(pageCount: number): Promise; flush(): Promise; close(): Promise; } /** * Browser main-thread storage adapter for BPlusIndex backed by `localStorage`. * * Each page is stored under `page:` as a latin-1 string * (1 byte → 1 char), staying within the ~5 MB origin quota without base64 * overhead. * * CONSTRAINTS * - Synchronous under the hood; single-tab only. * - `truncate` is intentionally omitted — localStorage provides no way to * shrink the key namespace atomically. * - Requires `localStorage` to be available; throws on first I/O otherwise. * * @example * ```ts * const adapter = new LocalStorageAdapter('myapp:index:') * const idx = await BPlusIndex.open({ ...opts, adapter }) * ``` */ declare class LocalStorageAdapter implements StorageAdapter { private readonly _prefix; /** * @param prefix Namespace prepended to every key written into localStorage. * Default `'bplus:'`. Use a unique prefix per index to avoid * collisions with other indexes or unrelated localStorage data. */ constructor(prefix?: string); private _key; private _storage; read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; flush(): Promise; close(): Promise; } /** * LRU buffer pool that wraps any StorageAdapter. * Reads are served from the in-memory cache on hits and delegated to the inner * adapter on misses; the returned page is then stored for future hits. * Writes are write-through: the page is sent to the inner adapter AND the cache * is updated with the new bytes so subsequent reads do not re-fetch. * Truncate evicts cached entries for all pages that fall outside the new boundary. * Because BPlusIndex uses copy-on-write allocation, a cached Uint8Array is never * silently overwritten by a different write — a page id is either absent or * immutable once written (superblock pages 0 and 1 are the only exception; they * are always written through and the cache is kept consistent). */ declare class PageCache implements StorageAdapter { private readonly inner; private readonly lru; private readonly maxSize; constructor(inner: StorageAdapter, maxSize?: number); read(pageId: number): Promise; write(pageId: number, data: Uint8Array): Promise; truncate(pageCount: number): Promise; flush(): Promise; close(): Promise; private _put; } declare class RESTError extends Error { readonly status: number; constructor(status: number, message: string); toJSON(): { status: string; cause: string; }; static notFound: (message?: string) => RESTError; static notImplemented: (message?: string) => RESTError; static internalServerError: (message?: string) => RESTError; } declare class RESTResponse { readonly status: number; readonly data: T; readonly count: number | undefined; constructor(status: number, data: T, count?: number | null); toJSON(): { status: string; code: number; count?: number; data: T; }; } type EasingFn = (t: number) => number; declare function easeInSine(t: number): number; declare function easeOutSine(t: number): number; declare function easeInOutSine(t: number): number; declare function easeInQuad(t: number): number; declare function easeOutQuad(t: number): number; declare function easeInOutQuad(t: number): number; declare function easeInCubic(t: number): number; declare function easeOutCubic(t: number): number; declare function easeInOutCubic(t: number): number; declare function easeInQuart(t: number): number; declare function easeOutQuart(t: number): number; declare function easeInOutQuart(t: number): number; declare function easeInQuint(t: number): number; declare function easeOutQuint(t: number): number; declare function easeInOutQuint(t: number): number; declare function easeInExpo(t: number): number; declare function easeOutExpo(t: number): number; declare function easeInOutExpo(t: number): number; declare function easeInCirc(t: number): number; declare function easeOutCirc(t: number): number; declare function easeInOutCirc(t: number): number; declare function easeInBack(t: number): number; declare function easeOutBack(t: number): number; declare function easeInOutBack(t: number): number; declare function easeInElastic(t: number): number; declare function easeOutElastic(t: number): number; declare function easeInOutElastic(t: number): number; declare function easeInBounce(t: number): number; declare function easeOutBounce(t: number): number; declare function easeInOutBounce(t: number): number; declare function cubicBezier(x1: number, y1: number, x2: number, y2: number): EasingFn; declare const Easing: { easeInSine: typeof easeInSine; easeOutSine: typeof easeOutSine; easeInOutSine: typeof easeInOutSine; easeInQuad: typeof easeInQuad; easeOutQuad: typeof easeOutQuad; easeInOutQuad: typeof easeInOutQuad; easeInCubic: typeof easeInCubic; easeOutCubic: typeof easeOutCubic; easeInOutCubic: typeof easeInOutCubic; easeInQuart: typeof easeInQuart; easeOutQuart: typeof easeOutQuart; easeInOutQuart: typeof easeInOutQuart; easeInQuint: typeof easeInQuint; easeOutQuint: typeof easeOutQuint; easeInOutQuint: typeof easeInOutQuint; easeInExpo: typeof easeInExpo; easeOutExpo: typeof easeOutExpo; easeInOutExpo: typeof easeInOutExpo; easeInCirc: typeof easeInCirc; easeOutCirc: typeof easeOutCirc; easeInOutCirc: typeof easeInOutCirc; easeInBack: typeof easeInBack; easeOutBack: typeof easeOutBack; easeInOutBack: typeof easeInOutBack; easeInElastic: typeof easeInElastic; easeOutElastic: typeof easeOutElastic; easeInOutElastic: typeof easeInOutElastic; easeInBounce: typeof easeInBounce; easeOutBounce: typeof easeOutBounce; easeInOutBounce: typeof easeInOutBounce; cubicBezier: typeof cubicBezier; }; declare const HTTP: { Status: { readonly CONTINUE: 100; readonly SWITCHING_PROTOCOLS: 101; readonly EARLY_HINTS: 103; readonly OK: 200; readonly CREATED: 201; readonly ACCEPTED: 202; readonly NONAUTHORITATIVE_INFORMATION: 203; readonly NON_AUTHORITATIVE_INFORMATION: 203; readonly NO_CONTENT: 204; readonly RESET_CONTENT: 205; readonly PARCIAL_CONTENT: 206; readonly PARTIAL_CONTENT: 206; readonly MULTIPLE_CHOICES: 300; readonly MOVED_PERMANENTLY: 301; readonly FOUND: 302; readonly SEE_OTHER: 303; readonly NOT_MODIFIED: 304; readonly TEMPORARY_REDIRECT: 307; readonly PERMANENT_REDIRECT: 308; readonly BAD_REQUEST: 400; readonly UNAUTHORIZED: 401; readonly PAYMENT_REQUIRED: 402; readonly FORBIDDEN: 403; readonly NOT_FOUND: 404; readonly METHOD_NOT_ALLOWED: 405; readonly NOT_ACCEPTABLE: 406; readonly PROXY_AUTHENTICATION_REQUIRED: 407; readonly REQUEST_TIMEOUT: 408; readonly CONFLICT: 409; readonly GONE: 410; readonly LENGTH_REQUIRED: 411; readonly PRECONDITION_FAILED: 412; readonly PAYLOAD_TOO_LARGE: 413; readonly URI_TOO_LONG: 414; readonly UNSUPPORTED_MEDIA_TYPE: 415; readonly RANGE_NOT_SATISFIABLE: 416; readonly EXPECTATION_FAILED: 417; readonly IM_A_TEAPOT: 418; readonly UNPROCESSABLE_ENTITY: 422; readonly TOO_EARLY: 425; readonly UPGRADE_REQUIRED: 426; readonly PRECONDITION_REQUIRED: 428; readonly TOO_MANY_REQUESTS: 429; readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431; readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451; readonly INTERNAL_SERVER_ERROR: 500; readonly NOT_IMPLEMENTED: 501; readonly BAD_GATEWAY: 502; readonly SERVICE_UNAVAILABLE: 503; readonly GATEWAY_TIMEOUT: 504; readonly HTTP_VERSION_NOT_SUPPORTED: 505; readonly VARIANT_ALSO_NEGOTIATES: 506; readonly INSUFFICIENT_STORAGE: 507; readonly LOOP_DETECTED: 508; readonly NOT_EXTENDED: 510; readonly NETWORK_AUTHENTICATION_REQUIRED: 511; }; RESTError: typeof RESTError; RESTResponse: typeof RESTResponse; }; declare const BASE: { ok: typeof ok; err: typeof err; some: typeof some; none: typeof none; HTTP: { Status: { readonly CONTINUE: 100; readonly SWITCHING_PROTOCOLS: 101; readonly EARLY_HINTS: 103; readonly OK: 200; readonly CREATED: 201; readonly ACCEPTED: 202; readonly NONAUTHORITATIVE_INFORMATION: 203; readonly NON_AUTHORITATIVE_INFORMATION: 203; readonly NO_CONTENT: 204; readonly RESET_CONTENT: 205; readonly PARCIAL_CONTENT: 206; readonly PARTIAL_CONTENT: 206; readonly MULTIPLE_CHOICES: 300; readonly MOVED_PERMANENTLY: 301; readonly FOUND: 302; readonly SEE_OTHER: 303; readonly NOT_MODIFIED: 304; readonly TEMPORARY_REDIRECT: 307; readonly PERMANENT_REDIRECT: 308; readonly BAD_REQUEST: 400; readonly UNAUTHORIZED: 401; readonly PAYMENT_REQUIRED: 402; readonly FORBIDDEN: 403; readonly NOT_FOUND: 404; readonly METHOD_NOT_ALLOWED: 405; readonly NOT_ACCEPTABLE: 406; readonly PROXY_AUTHENTICATION_REQUIRED: 407; readonly REQUEST_TIMEOUT: 408; readonly CONFLICT: 409; readonly GONE: 410; readonly LENGTH_REQUIRED: 411; readonly PRECONDITION_FAILED: 412; readonly PAYLOAD_TOO_LARGE: 413; readonly URI_TOO_LONG: 414; readonly UNSUPPORTED_MEDIA_TYPE: 415; readonly RANGE_NOT_SATISFIABLE: 416; readonly EXPECTATION_FAILED: 417; readonly IM_A_TEAPOT: 418; readonly UNPROCESSABLE_ENTITY: 422; readonly TOO_EARLY: 425; readonly UPGRADE_REQUIRED: 426; readonly PRECONDITION_REQUIRED: 428; readonly TOO_MANY_REQUESTS: 429; readonly REQUEST_HEADER_FIELDS_TOO_LARGE: 431; readonly UNAVAILABLE_FOR_LEGAL_REASONS: 451; readonly INTERNAL_SERVER_ERROR: 500; readonly NOT_IMPLEMENTED: 501; readonly BAD_GATEWAY: 502; readonly SERVICE_UNAVAILABLE: 503; readonly GATEWAY_TIMEOUT: 504; readonly HTTP_VERSION_NOT_SUPPORTED: 505; readonly VARIANT_ALSO_NEGOTIATES: 506; readonly INSUFFICIENT_STORAGE: 507; readonly LOOP_DETECTED: 508; readonly NOT_EXTENDED: 510; readonly NETWORK_AUTHENTICATION_REQUIRED: 511; }; RESTError: typeof RESTError; RESTResponse: typeof RESTResponse; }; Packing: { Algorithm: typeof Algorithm; BinaryTree: typeof BinaryTree; Guillotine: typeof Guillotine; MaxRects: typeof MaxRects; MultiPagePlanner: typeof MultiPagePlanner; Packer: typeof Packer; potCeil: typeof potCeil; Rotator: typeof Rotator; Shelf: typeof Shelf; Skyline: typeof Skyline; Sorter: typeof Sorter; Trimmer: typeof Trimmer; }; Async: { Deferred: typeof Deferred; Semaphore: typeof Semaphore; Mutex: typeof Mutex; pLimit: typeof pLimit; withTimeout: typeof withTimeout; sleep: typeof sleep; debounce: typeof debounce; throttle: typeof throttle; AsyncQueue: typeof AsyncQueue; }; Spatial: { SpatialHash: typeof SpatialHash; Quadtree: typeof Quadtree; }; Easing: { easeInSine: typeof easeInSine; easeOutSine: typeof easeOutSine; easeInOutSine: typeof easeInOutSine; easeInQuad: typeof easeInQuad; easeOutQuad: typeof easeOutQuad; easeInOutQuad: typeof easeInOutQuad; easeInCubic: typeof easeInCubic; easeOutCubic: typeof easeOutCubic; easeInOutCubic: typeof easeInOutCubic; easeInQuart: typeof easeInQuart; easeOutQuart: typeof easeOutQuart; easeInOutQuart: typeof easeInOutQuart; easeInQuint: typeof easeInQuint; easeOutQuint: typeof easeOutQuint; easeInOutQuint: typeof easeInOutQuint; easeInExpo: typeof easeInExpo; easeOutExpo: typeof easeOutExpo; easeInOutExpo: typeof easeInOutExpo; easeInCirc: typeof easeInCirc; easeOutCirc: typeof easeOutCirc; easeInOutCirc: typeof easeInOutCirc; easeInBack: typeof easeInBack; easeOutBack: typeof easeOutBack; easeInOutBack: typeof easeInOutBack; easeInElastic: typeof easeInElastic; easeOutElastic: typeof easeOutElastic; easeInOutElastic: typeof easeInOutElastic; easeInBounce: typeof easeInBounce; easeOutBounce: typeof easeOutBounce; easeInOutBounce: typeof easeInOutBounce; cubicBezier: typeof cubicBezier; }; easeInSine: typeof easeInSine; easeOutSine: typeof easeOutSine; easeInOutSine: typeof easeInOutSine; easeInQuad: typeof easeInQuad; easeOutQuad: typeof easeOutQuad; easeInOutQuad: typeof easeInOutQuad; easeInCubic: typeof easeInCubic; easeOutCubic: typeof easeOutCubic; easeInOutCubic: typeof easeInOutCubic; easeInQuart: typeof easeInQuart; easeOutQuart: typeof easeOutQuart; easeInOutQuart: typeof easeInOutQuart; easeInQuint: typeof easeInQuint; easeOutQuint: typeof easeOutQuint; easeInOutQuint: typeof easeInOutQuint; easeInExpo: typeof easeInExpo; easeOutExpo: typeof easeOutExpo; easeInOutExpo: typeof easeInOutExpo; easeInCirc: typeof easeInCirc; easeOutCirc: typeof easeOutCirc; easeInOutCirc: typeof easeInOutCirc; easeInBack: typeof easeInBack; easeOutBack: typeof easeOutBack; easeInOutBack: typeof easeInOutBack; easeInElastic: typeof easeInElastic; easeOutElastic: typeof easeOutElastic; easeInOutElastic: typeof easeInOutElastic; easeInBounce: typeof easeInBounce; easeOutBounce: typeof easeOutBounce; easeInOutBounce: typeof easeInOutBounce; cubicBezier: typeof cubicBezier; VectorClock: typeof VectorClock; EventEmitter: typeof EventEmitter; Broadcast: typeof Broadcast; LSystem: typeof LSystem; ObjectPool: typeof ObjectPool; PriorityQueue: typeof PriorityQueue; Stack: typeof Stack; Deque: typeof Deque; generateId: (length?: number) => string; ulid: typeof ulid; toHex: (value: number, digits?: number) => string; formatByteSize: (bytes: number, decimals?: number) => string; formatDuration: typeof formatDuration; formatNumber: typeof formatNumber; relativeTime: typeof relativeTime; bufferToHex: (buffer: Uint8Array) => string; hexToBuffer: (hexNumber: string) => Uint8Array; Color: Record any)> & { getHex: (color: "white" | "red" | "pink" | "purple" | "deep_purple" | "indigo" | "blue" | "light_blue" | "cyan" | "teal" | "green" | "light_green" | "lime" | "yellow" | "amber" | "orange" | "deep_orange" | "brown" | "grey" | "blue_grey" | "black") => string | null; toNumber: (color: "white" | "red" | "pink" | "purple" | "deep_purple" | "indigo" | "blue" | "light_blue" | "cyan" | "teal" | "green" | "light_green" | "lime" | "yellow" | "amber" | "orange" | "deep_orange" | "brown" | "grey" | "blue_grey" | "black") => number; getRandomHex: () => string; luminance: (hex: string) => number; contrastRatio: (a: string, b: string) => number; readableOn: (fg: string, bg: string) => { AA: boolean; AAA: boolean; AALarge: boolean; AAALarge: boolean; }; }; JSONSchema: typeof JSONSchema; getNumberInRange: (value: string | number, defaultValue?: number, min?: number, max?: number) => number; clamp: typeof clamp; lerp: typeof lerp; inverseLerp: typeof inverseLerp; mapRange: typeof mapRange; smoothstep: typeof smoothstep; approximately: typeof approximately; Cache: typeof Cache; AdjacencyMatrix: typeof AdjacencyMatrix; State: typeof State; retry: (callbackFn: () => T | Promise, options?: Partial) => Promise; WeightedRandom: typeof WeightedRandom; Random: typeof Random; Dijkstra: typeof Dijkstra; AStar: typeof AStar; RingBuffer: typeof RingBuffer; DisjointSet: typeof DisjointSet; Trie: typeof Trie; BiMap: typeof BiMap; BloomFilter: typeof BloomFilter; MultiMap: typeof MultiMap; Vec2: typeof Vec2; TokenBucket: typeof TokenBucket; Stopwatch: typeof Stopwatch; Ticker: typeof Ticker; slugify: typeof slugify; truncate: typeof truncate; escapeHtml: typeof escapeHtml; diff: typeof diff; patch: typeof patch; BPlusIndex: typeof BPlusIndex; MemoryAdapter: typeof MemoryAdapter; FsAdapter: typeof FsAdapter; OpfsAdapter: typeof OpfsAdapter; LocalStorageAdapter: typeof LocalStorageAdapter; PageCache: typeof PageCache; }; export { AStar, type AStarOptions, AdjacencyMatrix, type ArrayDelta, Async, BPlusIndex, type BPlusIndexOptions, type BPlusIndexStats, BiMap, BloomFilter, Broadcast, Cache, Color, type Delta, Deque, Dijkstra, type DijkstraOptions, DisjointSet, Easing, type EasingFn, type Edit, EventEmitter, type FormatNumberOptions, FsAdapter, HTTP, JSONSchema, type JSONSchemaOptions, LSystem, LocalStorageAdapter, MemoryAdapter, MultiMap, type ObjectDelta, ObjectPool, OpfsAdapter, type Option, Packing, type AlgorithmKind as PackingAlgorithmKind, type AlgorithmOptions as PackingAlgorithmOptions, type MemoryBudget as PackingMemoryBudget, type POTMode as PackingPOTMode, type PackedPage as PackingPackedPage, type PackerOptions as PackingPackerOptions, type PlacedRect as PackingPlacedRect, type PlacedSprite as PackingPlacedSprite, type PreparedSprite as PackingPreparedSprite, type Rect$1 as PackingRect, type PackResult as PackingResult, type Size as PackingSize, type SortStrategy as PackingSortStrategy, type Sprite as PackingSprite, PageCache, type EdgeCost as PathEdgeCost, type FailReason as PathFailReason, type Heuristic as PathHeuristic, type Neighbors as PathNeighbors, type NodeHash as PathNodeHash, type PathResult, type SearchStatus as PathSearchStatus, PriorityQueue, Quadtree, Random, type RangeOptions, type Rect, type RefSchema, type Result, RingBuffer, type Schema, Spatial, SpatialHash, type SpatialPoint, type SpatialRect, Stack, State, Stopwatch, type StorageAdapter, Ticker, TokenBucket, Trie, type ValidationError, type ValidationFn, type ValidationIssue, Vec2, VectorClock, WeightedRandom, approximately, bufferToHex, clamp, cubicBezier, BASE as default, diff, easeInBack, easeInBounce, easeInCirc, easeInCubic, easeInElastic, easeInExpo, easeInOutBack, easeInOutBounce, easeInOutCirc, easeInOutCubic, easeInOutElastic, easeInOutExpo, easeInOutQuad, easeInOutQuart, easeInOutQuint, easeInOutSine, easeInQuad, easeInQuart, easeInQuint, easeInSine, easeOutBack, easeOutBounce, easeOutCirc, easeOutCubic, easeOutElastic, easeOutExpo, easeOutQuad, easeOutQuart, easeOutQuint, easeOutSine, err, escapeHtml, formatByteSize, formatDuration, formatNumber, generateId, getNumberInRange, hexToBuffer, inverseLerp, lerp, mapRange, none, ok, patch, relativeTime, retry, slugify, smoothstep, some, toHex, truncate, ulid };