import type { ISciChartSurfaceBase } from "../Charting/Visuals/ISciChartSurfaceBase"; import type { TSciChartDestination } from "../types/SurfaceDestination"; /** * Which population a destination belongs to. `2d`/`3d` are the multi-chart families that share * one wasm context and the master canvas; `2dSingle`/`3dSingle` each own their own context; * `pie` is SVG-only. * @ignore */ export type TDestinationKind = "2d" | "3d" | "2dSingle" | "3dSingle" | "pie"; /** @ignore */ export declare const ALL_KINDS: readonly TDestinationKind[]; /** * The destinations that share the one master wasm context and the master canvas. Single charts * are excluded because each owns its own context; pie is excluded because it is SVG-only. * Naming this pair is the point: several call sites test emptiness over exactly these two. * @ignore */ export declare const SHARED_ENGINE_KINDS: readonly TDestinationKind[]; /** Registers a destination under the given kind. @ignore */ export declare function addDestination(kind: TDestinationKind, destination: Omit): void; /** * Removes and returns every destination of the given kinds. The native * ClearDestinations()+re-add dance needs the removed entries back so it can re-add them. * Returned in global registration order (splice order over the single backing array), NOT * grouped by kind like {@link getDestinations} — benign today because its one caller * (`resyncNativeDestinations` in createMaster.ts) always passes a single kind ("2d"), so there * is nothing to group. * @ignore */ export declare function clearDestinations(...kinds: TDestinationKind[]): TSciChartDestination[]; /** * All destinations of the given kinds. Passing no kinds means every kind. * Grouped by kind, in `ALL_KINDS` order for the no-arg case and argument order otherwise — NOT * global registration order, matching the five-array implementation this replaced, which * concatenated per family. Within a kind, registration order is preserved. Always returns a fresh * array, so callers cannot mutate the store by accident. * * No consumer relies on the grouping any more. `licenseManager2D`'s `getAllLicenseContexts` used * to — it read the result positionally after asking for "2d" and "3d" separately — but it now takes * `getSharedEngineDestinations()[0]`, and under the union wasm every shared-engine destination * hands back the SAME license context, so which one lands at index 0 cannot matter. It orders its * own result (shared engine before single charts) rather than inheriting an order from here. * @ignore */ export declare function getDestinations(...kinds: TDestinationKind[]): TSciChartDestination[]; /** * As {@link getDestinations}, minus the given surface. Identity comparison, not id, so a * revocable proxy wrapping a surface is not mistaken for the surface itself. * @ignore */ export declare function getOtherDestinations(surface: ISciChartSurfaceBase, ...kinds: TDestinationKind[]): TSciChartDestination[]; /** Destinations sharing the master wasm context — see {@link SHARED_ENGINE_KINDS}. @ignore */ export declare function getSharedEngineDestinations(): TSciChartDestination[]; /** Which kind a surface is currently registered under, or undefined if it is not registered. @ignore */ export declare function getDestinationKind(surface: ISciChartSurfaceBase): TDestinationKind | undefined; /** * Removes a surface's destination entry, whichever kind holds it. Replaces surfaces holding a * live reference to their family's array and splicing themselves out of it — that reference * holding is what forced callers to mutate the arrays in place rather than reassign. * * Identity is tried first and is correct for almost every caller. It is not sufficient alone: * `MemoryUsageHelper`'s memory-debug mode makes `DeletableEntity`'s constructor return a Proxy in * place of `this` for every surface, and that Proxy is what ends up stored as * `dest.sciChartSurface`. The Proxy's own `delete()` trap then invokes the *unwrapped* target's * `delete()` method directly, so inside `delete()` `this` is not the object that was registered — * an identity comparison there always misses. Falling back to `id` (matching the * `dest.sciChartSurface.id === this.id` comparison this function replaces) covers that case * without weakening the identity comparison everyone else relies on. * * The `id` fallback searches across ALL kinds, with no kind check — so if a 2D surface and a 3D * surface ever shared an `id`, this could evict the wrong family's entry. Parked: no known way to * hit this today, and adding a kind check would require threading the surface's kind through every * call site. * @returns whether an entry was found and removed. * @ignore */ export declare function removeDestination(surface: ISciChartSurfaceBase): boolean;