@cute-dw/core
Version:
This TypeScript library is the main part of a more powerfull package designed for the fast WEB software development. The cornerstone of the library is the **DataStore** class, which might be useful when you need a full control of the data, but do not need
19 lines (18 loc) • 1.18 kB
TypeScript
import { SortedSet } from "./SortedSet";
/**
* A `SortedSet` extended with navigation methods reporting closest matches for given search targets
*/
export interface NavigableSet<K> extends SortedSet<K> {
/** Returns the least element in this set greater than or equal to the given element, or _undefined_ if there is no such element */
ceiling(key: K): K | undefined;
/** Returns the greatest element in this set less than or equal to the given element, or _undefined_ if there is no such element */
floor(key: K): K | undefined;
/** Returns the least element in this set strictly greater than the given element, or _undefined_ if there is no such element */
higher(key: K): K | undefined;
/** Returns the greatest element in this set strictly less than the given element, or _undefined_ if there is no such element */
lower(key: K): K | undefined;
/** Retrieves and removes the first (lowest) element, or returns _undefined_ if this set is empty */
pollFirst(): K | undefined;
/** Retrieves and removes the last (highest) element, or returns _undefined_ if this set is empty */
pollLast(): K | undefined;
}