ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
19 lines (18 loc) • 811 B
TypeScript
import type { ModuleInstance } from 'ag-charts-core';
export declare class ModuleMap<T extends ModuleInstance = ModuleInstance> {
protected moduleMap: Map<string, T>;
private _version;
/**
* Monotonic counter incremented whenever a module is added or removed. Consumers can cache
* derived state keyed on the value and refresh when it changes — avoiding repeated map lookups
* without needing per-module invalidation hooks.
*/
get version(): number;
modules(): IterableIterator<T>;
addModule(moduleName: string, moduleInstance: T): void;
removeModule(moduleName: string): void;
getModule(moduleName: string): T | undefined;
isEnabled(moduleName: string): boolean;
mapModules<R>(callback: (value: T, index: number) => R): R[];
destroy(): void;
}