import type { As, Option } from '@chzky/core'; export interface QueueNode { value: T; next: Option>; } /** ## `Queue` : 队列 : 先进先出(FIFO, First-In-First-Out)的线性表 对比数组的优势是不需要记录临时的index信息,在一些只需要往后遍历数据场景中具有很大优势 */ export declare class Queue implements As, 'array'> { private readonly head; private now; private len; /** ### `length` : 返回当前队列的长度 */ get length(): number; constructor(value: T); /** ### `start` : 返回队列头部节点,用于开始进行遍历 */ start(): QueueNode; /** ### `push` : 加载数据进入队列中 */ push(value: T): void; /** ## `new` : 实现{@linkcode NewAble} */ static new: (value: R) => Queue; /** ### `as` : 实现{@linkcode As}接口 */ as(flag: 'array'): T[]; } //# sourceMappingURL=queue.d.ts.map