UNPKG

@wroud/navigation

Version:

A flexible, pattern-matching navigation system for JavaScript applications with built-in routing, browser integration, and navigation state management

31 lines 932 B
export interface ILinkedListNode<T> { value: T; back: ILinkedListNode<T> | null; next: ILinkedListNode<T> | null; } export declare class LinkedList<T> { get size(): number; get first(): T | undefined; get last(): T | undefined; private head; private tail; private length; constructor(elements?: T[]); setHead(head: ILinkedListNode<T> | null): void; get(index: number): T | null | undefined; set(index: number, value: T): void; add(index: number, value: T): void; push(value: T): void; remove(value: T): void; removeFrom(index: number): void; removeFirst(): T | undefined; removeLast(): T | undefined; forEach(callback: (value: T) => void): void; /** * Serialize the linked list into a plain object. */ toJSON(): ILinkedListNode<T> | null; toArray(): T[]; private assertIndexInBounds; } //# sourceMappingURL=LinkedList.d.ts.map