import { Collection } from "@tsplus/stdlib/collections/Collection/definition"; import { Equals } from "@tsplus/stdlib/structure/Equals"; import { Chunk } from "@tsplus/stdlib/collections/Chunk/definition"; export declare const MutableQueueSym: unique symbol; export type MutableQueueSym = typeof MutableQueueSym; export declare const EmptyMutableQueue: unique symbol; export type EmptyMutableQueue = typeof EmptyMutableQueue; /** * @tsplus type MutableQueue */ export interface MutableQueue extends Collection, Equals { readonly [MutableQueueSym]: MutableQueueSym; /** * The **maximum** number of elements that a queue can hold. * * **Note**: unbounded queues can still implement this interface with * `capacity = Number.MAX_SAFE_INTEGER`. */ readonly capacity: number; /** * Enqueues an element into the queue. * * Returns whether the enqueue was successful or not. */ readonly offer: (a: A) => boolean; /** * Enqueues a collection of elements into the queue. * * Returns a `Chunk` of the elements that were **not** enqueued. */ readonly offerAll: (a: Collection) => Chunk; /** * Dequeues an element from the queue. * * Returns either an element from the queue, or the `default` param. * * **Note**: if there is no meaningful default for your type, you can always * use `poll(EmptyMutableQueue)`. */ readonly poll: (a: D) => A | D; /** * Dequeues up to `n` elements from the queue. * * Returns a `Chunk` of up to `n` elements. */ readonly pollUpTo: (n: number) => Chunk; /** * Returns the current number of elements in the queue. */ readonly size: number; /** * Returns whether or not the queue is empty. */ readonly isEmpty: boolean; /** * Returns whether or not the queue is full. */ readonly isFull: boolean; } /** * @tsplus type MutableQueue.Ops */ export interface MutableQueueOps { } export declare const MutableQueue: MutableQueueOps; //# sourceMappingURL=definition.d.ts.map