export { R as ResizeOptions, o as observeResize } from './ui-utils-CEm626XG.js';
export { E as Event, a as EventHandler, b as EventListener, V as VoidEvent } from './event-eVGLSgY3.js';

/** @deprecated use `mnemonist/heap` from npm — Tier 3 commodity, scheduled for removal in a future major. See CHANGELOG.md § Deprecated. */
declare class EmptyHeapError extends Error {
    constructor();
}
/** @deprecated use `mnemonist/heap` from npm — Tier 3 commodity, scheduled for removal in a future major. See CHANGELOG.md § Deprecated. */
declare class HeapItemRef<T> {
    /** @internal */ _value: T;
    /** @internal */ _index: number;
    /** @internal */ _heap: Heap<T>;
    constructor(value: T, index: number, heap: Heap<T>);
    get value(): T;
}
/** @deprecated use `mnemonist/heap` from npm — Tier 3 commodity, scheduled for removal in a future major. See CHANGELOG.md § Deprecated. */
declare class Heap<T> {
    private _compare;
    private _items;
    constructor(compare: (a: T, b: T) => number, items?: Iterable<T>);
    get size(): number;
    /**
     * Insert a value. Returns a ref handle for later update/delete. O(log n).
     */
    insert(value: T): HeapItemRef<T>;
    /**
     * Return the top value without removing it. O(1).
     * Throws `EmptyHeapError` if the heap is empty.
     */
    peek(): T;
    /**
     * Remove and return the top value. O(log n).
     * Throws `EmptyHeapError` if the heap is empty.
     */
    pop(): T;
    /**
     * Update a ref's value and re-heapify. O(log n).
     */
    update(ref: HeapItemRef<T>, newValue: T): void;
    /**
     * Remove an arbitrary element by its ref. O(log n).
     */
    delete(ref: HeapItemRef<T>): void;
    /**
     * Return all values in sorted order (smallest first for a min-heap).
     * The heap is left unchanged. O(n log n).
     */
    toSortedArray(): T[];
    private _swap;
    private _bubbleUp;
    private _siftDown;
    private _removeAt;
}

/**
 * Least-Recently-Used cache backed by a doubly-linked list + HashMap.
 * All core operations (get, set, has, delete) are O(1).
 *
 * Iteration order is MRU → LRU (most recently used first).
 */
/** @deprecated use `lru-cache` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare class LRU<K, V> {
    private _capacity;
    private _map;
    private _head;
    private _tail;
    constructor(capacity?: number, entries?: [K, V][]);
    /**
     * Return the value for `key` and promote it to MRU.
     * Returns `undefined` if the key is not in the cache.
     */
    get(key: K): V | undefined;
    /**
     * Return the value for `key` WITHOUT updating LRU order.
     * Returns `undefined` if the key is not in the cache.
     */
    peek(key: K): V | undefined;
    /**
     * Insert or update `key` with `value`.
     * - If the key already exists its value is updated and it is promoted to MRU.
     * - If the cache is at capacity the least-recently-used entry is evicted.
     *
     * Returns the evicted `[key, value]` pair, or `null` if nothing was evicted.
     */
    set(key: K, value: V): [K, V] | null;
    /**
     * Return `true` if `key` is in the cache (does NOT update LRU order).
     */
    has(key: K): boolean;
    /**
     * Remove `key` from the cache.
     * Returns `true` if the key existed, `false` otherwise.
     */
    delete(key: K): boolean;
    /** Remove all entries. */
    clear(): void;
    get size(): number;
    keys(): K[];
    values(): V[];
    entries(): [K, V][];
    forEach(callback: (value: V, key: K, lru: this) => void): void;
    private _addToHead;
    private _removeNode;
    private _moveToHead;
}

/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
type Point = number[];
type Vector = number[];
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
type Segment = [Point, Point];
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function centroid(points: Point[], dim: number): number[];
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function dot(vec1: Vector, vec2: Vector, dim: number): number;
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function magnitude(vec: Vector): number;
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function normalize(vec: Vector): number[];
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function projectPointOnSegment(point: Point, seg: Segment, dim: number): number[];
/** @deprecated use `gl-matrix` (vector ops) or `@turf/turf` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function pointSegmentDistance(point: Point, seg: Segment, dim: number): number;

/** @deprecated use `kdbush` or `mnemonist/k-d-tree` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare class KDTree<T> {
    private _data;
    private _k;
    private _getPoint;
    private _distanceTo;
    private _qualifier;
    private _root;
    constructor(options: {
        k: number;
        data: T[];
        getPoint: (item: T) => Point;
        distanceTo: (item: T, query: Point) => number;
        qualifier?: (item: T, splitDim: number, splitVal: number) => [boolean, boolean];
    });
    /**
     * Find the k nearest neighbours to `query`.
     * Returns `[dataIndex, distance]` pairs sorted by distance ascending.
     */
    kNN(k: number, query: Point): Array<[index: number, distance: number]>;
    /**
     * Find all data indices whose point lies within `bounds`.
     * `bounds` is `[minCoords, maxCoords]`, each an array of length `k`.
     */
    rangeQuery(bounds: [Point, Point]): number[];
    private _buildNode;
    private _knnSearch;
    private _rangeSearch;
    private _nthElement;
    private _partition;
}
/** @deprecated use `kdbush` or `mnemonist/k-d-tree` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function kdPointTree(points: Point[]): KDTree<Point>;
/** @deprecated use `kdbush` or `mnemonist/k-d-tree` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function kdSegmentTree(segments: Segment[]): KDTree<Segment>;

declare const Collinear: unique symbol;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare const Clockwise: unique symbol;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare const CounterClockWise: unique symbol;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
type Point2D = readonly [number, number];
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
type Polygon2D = Point2D[];
type PointsOrientation = typeof Collinear | typeof Clockwise | typeof CounterClockWise;
type PolygonOrientation = typeof Clockwise | typeof CounterClockWise;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function getPointsOrientation(p: Point2D, q: Point2D, r: Point2D): PointsOrientation;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function computeConvexHull(points: Point2D[]): Point2D[];
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function pointInPolygon(point: Point2D, poly: Polygon2D): boolean;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function polygonInPolygon(sourcePolygon: Polygon2D, targetPolygon: Polygon2D): boolean;
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function normalizePolygon(poly: Polygon2D, orientation: PolygonOrientation): Point2D[];
/** @deprecated use `@turf/turf` or `polygon-clipping` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function intersectingPolygons(poly1: Polygon2D, poly2: Polygon2D): boolean;

/** @deprecated use `framer-motion` or CSS transitions — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function animate(callback: (time: number) => void): () => void;
/** @deprecated use `framer-motion` or CSS transitions — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function transition<T extends Record<string, number>>(from: T, to: T, setState: (state: T) => void, duration: number): () => void;
/** @deprecated use `framer-motion` or CSS transitions — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function lazyAnimate(callback: () => void | Promise<void>): (callback?: () => void) => Promise<void>;

/** @deprecated inline canvas operations at call site — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare class Failed2DContextError extends Error {
    constructor();
}
/** @deprecated inline canvas operations at call site — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function imageFromDataUrl(dataUrl: string): Promise<HTMLImageElement>;
/** @deprecated Use imageFromDataUrl */
declare const imagefromDataUrl: typeof imageFromDataUrl;
/** @deprecated inline canvas operations at call site — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function imageFromCanvas(canvas: HTMLCanvasElement): Promise<HTMLImageElement>;
/** @deprecated inline canvas operations at call site — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function resizeImage(img: HTMLImageElement, width?: number, height?: number): HTMLImageElement | HTMLCanvasElement;
/** @deprecated inline canvas operations at call site — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function cropImage(img: HTMLImageElement | HTMLCanvasElement, sx: number, sy: number, width: number, height: number): HTMLCanvasElement;

/** @deprecated use `file-saver` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function downloadFile(name: string, content: string): void;
/** @deprecated use `file-saver` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function downloadCSVRows<R extends Array<unknown>>(name: string, rows: R[]): void;
/** @deprecated use `file-saver` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function downloadCSVColumns<C extends ArrayLike<unknown>>(name: string, columns: C[]): void;

/** @deprecated use `ky` from npm or native `fetch` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
interface RequestOptions extends RequestInit {
    onProgress?: (progress: number) => void;
}
/** @deprecated use `ky` from npm or native `fetch` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function requestGlobalOptions({ baseUrl }: {
    baseUrl: string;
}): void;
/** @deprecated use `ky` from npm or native `fetch` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function createApiUrl(url: string): string;
/** @deprecated use `ky` from npm or native `fetch` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function request(url: string | Response | ReadableStream, options?: RequestOptions): Promise<Response>;

/** @deprecated use `pretty-bytes` from npm or `Intl.NumberFormat` — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function formatBytes(bytes: number, decimals?: number): string;

/** @deprecated inline at call site or use `lodash-es` directly — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function mapEffect<ItemType>(collection: ItemType[], effect: (arg: ItemType) => (() => void) | void): () => void;

/** @deprecated use `new URL()` or `path-browserify` from npm — Tier 3 commodity. See CHANGELOG.md § Deprecated. */
declare function join(...path: string[]): string;

export { Clockwise, CounterClockWise, EmptyHeapError, Failed2DContextError, Heap, HeapItemRef, KDTree, LRU, type Point, type Point2D, type Polygon2D, type RequestOptions, type Segment, animate, centroid, computeConvexHull, createApiUrl, cropImage, dot, downloadCSVColumns, downloadCSVRows, downloadFile, formatBytes, getPointsOrientation, imageFromCanvas, imageFromDataUrl, imagefromDataUrl, intersectingPolygons, join, kdPointTree, kdSegmentTree, lazyAnimate, magnitude, mapEffect, normalize, normalizePolygon, pointInPolygon, pointSegmentDistance, polygonInPolygon, projectPointOnSegment, request, requestGlobalOptions, resizeImage, transition };
