/**
* @since 1.0.0
*/
import * as Chunk from "@fp-ts/data/Chunk";
declare const TypeId: unique symbol;
/**
* @since 1.0.0
* @category symbol
*/
export type TypeId = typeof TypeId;
/**
* @since 1.0.0
* @category symbol
*/
export declare const EmptyMutableQueue: unique symbol;
/**
* @since 1.0.0
* @category model
*/
export interface MutableQueue extends Iterable {
readonly _id: TypeId;
}
/**
* @since 1.0.0
*/
export declare namespace MutableQueue {
type Empty = typeof EmptyMutableQueue;
}
/**
* Creates a new bounded `MutableQueue`.
*
* @since 1.0.0
* @category constructors
*/
export declare const bounded: (capacity: number) => MutableQueue;
/**
* Creates a new unbounded `MutableQueue`.
*
* @since 1.0.0
* @category constructors
*/
export declare const unbounded: () => MutableQueue;
/**
* Returns the current number of elements in the queue.
*
* @since 1.0.0
* @category getters
*/
export declare const length: (self: MutableQueue) => number;
/**
* Returns `true` if the queue is empty, `false` otherwise.
*
* @since 1.0.0
* @category getters
*/
export declare const isEmpty: (self: MutableQueue) => boolean;
/**
* Returns `true` if the queue is full, `false` otherwise.
*
* @since 1.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 1.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 1.0.0
* @category mutations
*/
export declare const offer: {
(self: MutableQueue, value: A): boolean;
(value: A): (self: MutableQueue) => boolean;
};
/**
* Enqueues a collection of values into the queue.
*
* Returns a `List` of the values that were **not** able to be enqueued.
*
* @since 1.0.0
* @category mutations
*/
export declare const offerAll: {
(self: MutableQueue, values: Iterable): Chunk.Chunk;
(values: Iterable): (self: MutableQueue) => 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 1.0.0
* @category mutations
*/
export declare const poll: {
(self: MutableQueue, def: D): A | D;
(def: D): (self: MutableQueue) => D | A;
};
/**
* Dequeues up to `n` elements from the queue.
*
* Returns a `List` of up to `n` elements.
*
* @since 1.0.0
* @category mutations
*/
export declare const pollUpTo: {
(self: MutableQueue, n: number): Chunk.Chunk;
(n: number): (self: MutableQueue) => Chunk.Chunk;
};
export {};
//# sourceMappingURL=MutableQueue.d.ts.map