/** * @since 2.0.0 */ import * as Chunk from "./Chunk.js"; import { type Inspectable } from "./Inspectable.js"; import type { Pipeable } from "./Pipeable.js"; declare const TypeId: unique symbol; /** * @since 2.0.0 * @category symbol */ export type TypeId = typeof TypeId; /** * @since 2.0.0 * @category symbol */ export declare const EmptyMutableQueue: unique symbol; /** * @since 2.0.0 * @category model */ export interface MutableQueue extends Iterable, Pipeable, Inspectable { readonly [TypeId]: TypeId; } /** * @since 2.0.0 */ export declare namespace MutableQueue { /** * @since 2.0.0 */ type Empty = typeof EmptyMutableQueue; } /** * Creates a new bounded `MutableQueue`. * * @since 2.0.0 * @category constructors */ export declare const bounded: (capacity: number) => MutableQueue; /** * Creates a new unbounded `MutableQueue`. * * @since 2.0.0 * @category constructors */ export declare const unbounded: () => MutableQueue; /** * Returns the current number of elements in the queue. * * @since 2.0.0 * @category getters */ export declare const length: (self: MutableQueue) => number; /** * Returns `true` if the queue is empty, `false` otherwise. * * @since 2.0.0 * @category getters */ export declare const isEmpty: (self: MutableQueue) => boolean; /** * Returns `true` if the queue is full, `false` otherwise. * * @since 2.0.0 * @category getters */ export declare const isFull: (self: MutableQueue) => boolean; /** * The **maximum** number of elements that a queue can hold. * * **Note**: unbounded queues can still implement this interface with * `capacity = Infinity`. * * @since 2.0.0 * @category getters */ export declare const capacity: (self: MutableQueue) => number; /** * Offers an element to the queue. * * Returns whether the enqueue was successful or not. * * @since 2.0.0 */ export declare const offer: { /** * Offers an element to the queue. * * Returns whether the enqueue was successful or not. * * @since 2.0.0 */ (self: MutableQueue, value: A): boolean; /** * Offers an element to the queue. * * Returns whether the enqueue was successful or not. * * @since 2.0.0 */ (value: A): (self: MutableQueue) => boolean; }; /** * Enqueues a collection of values into the queue. * * Returns a `Chunk` of the values that were **not** able to be enqueued. * * @since 2.0.0 */ export declare const offerAll: { /** * Enqueues a collection of values into the queue. * * Returns a `Chunk` of the values that were **not** able to be enqueued. * * @since 2.0.0 */ (values: Iterable): (self: MutableQueue) => Chunk.Chunk; /** * Enqueues a collection of values into the queue. * * Returns a `Chunk` of the values that were **not** able to be enqueued. * * @since 2.0.0 */ (self: MutableQueue, values: Iterable): Chunk.Chunk; }; /** * Dequeues an element from the queue. * * Returns either an element from the queue, or the `def` param. * * **Note**: if there is no meaningful default for your type, you can always * use `poll(MutableQueue.EmptyMutableQueue)`. * * @since 2.0.0 */ export declare const poll: { /** * Dequeues an element from the queue. * * Returns either an element from the queue, or the `def` param. * * **Note**: if there is no meaningful default for your type, you can always * use `poll(MutableQueue.EmptyMutableQueue)`. * * @since 2.0.0 */ (def: D): (self: MutableQueue) => D | A; /** * Dequeues an element from the queue. * * Returns either an element from the queue, or the `def` param. * * **Note**: if there is no meaningful default for your type, you can always * use `poll(MutableQueue.EmptyMutableQueue)`. * * @since 2.0.0 */ (self: MutableQueue, def: D): A | D; }; /** * Dequeues up to `n` elements from the queue. * * Returns a `List` of up to `n` elements. * * @since 2.0.0 */ export declare const pollUpTo: { /** * Dequeues up to `n` elements from the queue. * * Returns a `List` of up to `n` elements. * * @since 2.0.0 */ (n: number): (self: MutableQueue) => Chunk.Chunk; /** * Dequeues up to `n` elements from the queue. * * Returns a `List` of up to `n` elements. * * @since 2.0.0 */ (self: MutableQueue, n: number): Chunk.Chunk; }; export {}; //# sourceMappingURL=MutableQueue.d.ts.map