/** * @since 1.0.0 */ import type * as Option from "@effect/data/Option"; import type * as Order from "@effect/data/Order"; import type { Predicate } from "@effect/data/Predicate"; import type * as STM from "@effect/stm/STM"; /** * @since 1.0.0 * @category symbols */ export declare const TPriorityQueueTypeId: unique symbol; /** * @since 1.0.0 * @category symbols */ export type TPriorityQueueTypeId = typeof TPriorityQueueTypeId; /** * A `TPriorityQueue` contains values of type `A` that an `Order` is defined * on. Unlike a `TQueue`, `take` returns the highest priority value (the value * that is first in the specified ordering) as opposed to the first value * offered to the queue. The ordering that elements with the same priority will * be taken from the queue is not guaranteed. * * @since 1.0.0 * @category models */ export interface TPriorityQueue extends TPriorityQueue.Variance { } /** * @since 1.0.0 */ export declare namespace TPriorityQueue { /** * @since 1.0.0 * @category models */ interface Variance { readonly [TPriorityQueueTypeId]: { readonly _A: (_: never) => A; }; } } /** * Constructs a new empty `TPriorityQueue` with the specified `Order`. * * @since 1.0.0 * @category constructors */ export declare const empty: (order: Order.Order) => STM.STM>; /** * Makes a new `TPriorityQueue` initialized with provided iterable. * * @since 1.0.0 * @category constructors */ export declare const fromIterable: (order: Order.Order) => (iterable: Iterable) => STM.STM>; /** * Checks whether the queue is empty. * * @since 1.0.0 * @category getters */ export declare const isEmpty: (self: TPriorityQueue) => STM.STM; /** * Checks whether the queue is not empty. * * @since 1.0.0 * @category getters */ export declare const isNonEmpty: (self: TPriorityQueue) => STM.STM; /** * Makes a new `TPriorityQueue` that is initialized with specified values. * * @since 1.0.0 * @category constructors */ export declare const make: (order: Order.Order) => (...elements: Array) => STM.STM>; /** * Offers the specified value to the queue. * * @since 1.0.0 * @category mutations */ export declare const offer: { (value: A): (self: TPriorityQueue) => STM.STM; (self: TPriorityQueue, value: A): STM.STM; }; /** * Offers all of the elements in the specified collection to the queue. * * @since 1.0.0 * @category mutations */ export declare const offerAll: { (values: Iterable): (self: TPriorityQueue) => STM.STM; (self: TPriorityQueue, values: Iterable): STM.STM; }; /** * Peeks at the first value in the queue without removing it, retrying until a * value is in the queue. * * @since 1.0.0 * @category getters */ export declare const peek: (self: TPriorityQueue) => STM.STM; /** * Peeks at the first value in the queue without removing it, returning `None` * if there is not a value in the queue. * * @since 1.0.0 * @category getters */ export declare const peekOption: (self: TPriorityQueue) => STM.STM>; /** * Removes all elements from the queue matching the specified predicate. * * @since 1.0.0 * @category getters */ export declare const removeIf: { (predicate: Predicate): (self: TPriorityQueue) => STM.STM; (self: TPriorityQueue, predicate: Predicate): STM.STM; }; /** * Retains only elements from the queue matching the specified predicate. * * @since 1.0.0 * @category getters */ export declare const retainIf: { (predicate: Predicate): (self: TPriorityQueue) => STM.STM; (self: TPriorityQueue, predicate: Predicate): STM.STM; }; /** * Returns the size of the queue. * * @since 1.0.0 * @category getters */ export declare const size: (self: TPriorityQueue) => STM.STM; /** * Takes a value from the queue, retrying until a value is in the queue. * * @since 1.0.0 * @category mutations */ export declare const take: (self: TPriorityQueue) => STM.STM; /** * Takes all values from the queue. * * @since 1.0.0 * @category mutations */ export declare const takeAll: (self: TPriorityQueue) => STM.STM>; /** * Takes a value from the queue, returning `None` if there is not a value in * the queue. * * @since 1.0.0 * @category mutations */ export declare const takeOption: (self: TPriorityQueue) => STM.STM>; /** * Takes up to the specified maximum number of elements from the queue. * * @since 1.0.0 * @category mutations */ export declare const takeUpTo: { (n: number): (self: TPriorityQueue) => STM.STM>; (self: TPriorityQueue, n: number): STM.STM>; }; /** * Collects all values into a chunk. * * @since 1.0.0 * @category destructors */ export declare const toArray: (self: TPriorityQueue) => STM.STM>; /** * Collects all values into an array. * * @since 1.0.0 * @category destructors */ export declare const toReadonlyArray: (self: TPriorityQueue) => STM.STM>; //# sourceMappingURL=TPriorityQueue.d.ts.map