export interface List extends Iterable { item: T | null; next: List | null; context: C; toArray(): Array; } export declare function atEnd(xs: List): xs is (List & { item: null; next: null; }); export declare function notAtEnd(xs: List): xs is (List & { item: T; next: List; }); export declare class ArrayList implements List { context: C; readonly items: Array; readonly index: number; constructor(items: Array, context: C, index?: number); get item(): T | null; get next(): List | null; toArray(): Array; [Symbol.iterator](): Iterator; }