import { type AxisID, type ChartModuleDefinition, type CloneOptions, type DeepPartial, type LogIssue, Logger, type ModuleScope, type PlainObject } from 'ag-charts-core'; import { type AgChartModule, type AgChartOptions, type AgChartThemeParams } from 'ag-charts-types'; import { ChartTheme } from '../chart/themes/chartTheme'; import { type ChartValidations, type ValidationsRuntime } from '../chart/validation/chartValidations'; import { type OptionsGraphAccessor } from './optionsGraph'; export interface ChartSpecialOverrides { document: Document; window: Window; styleContainer?: HTMLElement; skipCss?: boolean; } export interface ChartInternalOptionMetadata { presetType?: 'price-volume' | 'gauge-preset' | 'sparkline' | 'quadrant' | 'volume-profile'; pool?: boolean; domMode?: 'normal' | 'minimal'; withDragInterpretation?: boolean; /** Modules registered for this chart only, additive over the global registry. */ modules?: AgChartModule[]; } export declare class ChartOptions { static readonly OPTIONS_CLONE_OPTS_SLOW: CloneOptions; static readonly OPTIONS_CLONE_OPTS_FAST: CloneOptions; static readonly JSON_DIFF_OPTS: Set; private static readonly REMOVED; private static readonly perfDebug; private static readonly FAST_PATH_OPTIONS; private static isFastPathDelta; private static containsRemovalSentinel; activeTheme: ChartTheme; processedOptions: T; userOptions: Partial; processedOverrides: Partial; specialOverrides: ChartSpecialOverrides; optionMetadata: ChartInternalOptionMetadata; readonly moduleRegistry: ModuleScope; themeParameters: AgChartThemeParams; annotationThemes: any; googleFonts?: Set; fonts?: Set; fastDelta?: DeepPartial; /** The axes predicted from the data at the last slow pass, which a fast pass carries on unchanged. */ predictedAxesKey?: string; /** The series override and datum key the preset's data transform derived at the last slow pass. */ presetShapeKey?: string; chartDef?: ChartModuleDefinition; optionsProcessingTime?: number; optionsGraph?: OptionsGraphAccessor; remappedAxisKeys?: Map; /** The validated options, less `data`, of a preset declaring `transformSeriesData`. */ presetOptions?: object; seriesWithUserVisibility?: { identifiers: Set; indices: Set; }; userDeltaKeys?: Set; processedCSSVariables?: Record; /** * The `var()` values that could not be resolved on a detached container, to be resolved once it is attached. Unset * when the pass did not process CSS variables and theme params, as the fast path does not, so the previous pass's * stand. */ deferredCSSVariables?: string[]; /** What stylers' partial options deferred since it was last taken; see `takePartialDeferredCSSVariables`. */ private readonly partialDeferred; /** The theme's params with the unresolvable `var()` values removed; unset when the theme's own are usable. */ processedThemeParams?: PlainObject; /** Every issue the Logger reported while this pass ran; the chart starts its validation cycle from them. */ issues: LogIssue[]; /** False when the fast path or the structural cache carried the previous pass's issues forward unvalidated. */ revalidated: boolean; unmappedAxisKeys: Map; private seriesTheme?; logger: Logger; /** The subscriber this pass reported through: the chart's own, or a provisional stand-in. */ validations: ChartValidations; private static readonly debug; constructor(currentUserOptions: T | ChartOptions | undefined, newUserOptions: T, processedOverrides: Partial, specialOverrides: Partial, metadata: ChartInternalOptionMetadata, deltaOptions?: DeepPartial | null, stripSymbols?: boolean, refreshCSSVariables?: boolean, apiStartTime?: number, runtime?: ValidationsRuntime); private findSeriesWithUserVisiblity; private fastSetup; private fastSeriesSetup; private armValidations; /** * Resolves the theme and arms `validations` from it. The theme validates itself while it resolves, before * its own `validations` are known, so what it reports is held back and replayed under the armed settings. */ private resolveThemeAndArmValidations; private slowSetup; private computeStructuralCacheKeyForSlowSetup; private slowSetupCached; /** * Points these options at the chart that ended up owning them, which is not knowable until the type is * resolved and the pool consulted. `validations` stays the instance that handled the pass, so the chart * can tell what it already reported. */ adopt(runtime: ValidationsRuntime): void; private replay; private get validateParams(); private logValidationErrors; /** * Reports an argument that could not be options at all (`create(undefined)`, `create(3)`) at `error` * severity: unlike a per-option problem, nothing of the caller's intent survives it. Raised after * construction, so it joins this pass's issues by hand. */ recordOptionsArgumentError(message: string): void; private validateContributedOptions; private validateSeriesOptions; private validateAxesOptions; diffOptions(other?: ChartOptions): Partial; private optionsType; private processSeriesOptions; private validateSizeBounds; /** * Collates axis keys from the axis and series options to determine the full set of axis keys, defaults series to * the primary axes and renames the primary axes to the internal direction-based names. */ private processAxesOptions; /** * These keys are used to map a series to an axis for each direction. They are retrieved per-series to allow a * mixture of flipped and non-flipped series within the same chart. */ private getSeriesDirectionAxisKey; private isSeriesHorizontal; /** Series and axis processing run before the options graph applies the theme, so themed values are read here. */ private getThemedSeriesOption; /** Swaps a series' axis keys when both axes are positioned for the other direction, as with swapped `x` and `y`. */ private transposeSwappedSeriesAxes; private removeMismatchedAxisPositions; /** The direction series reference an axis key for, ignoring references that only name the default direction. */ private getSeriesReferenceDirection; /** * Check if any of the series' axis keys have values that do not match the expected value, i.e. the direction. */ private countNonDefaultSeriesAxisKeys; /** * The primary axes are defined, for each direction, as those first in the `axes` object or referenced by a series. * This is irregardless of the specific key of the axis, e.g. an axis with the key `y` may have the position `top`, * and would therefore be classified as the primary `x` axis. */ private getPrimaryAxisKeys; private getRemappedAxisKeys; /** * Update each series' axis keys to match the name used internally, such as the direction or a constant suffixed by * the index for secondary axes. */ private remapSeriesAxisKeys; /** * Attempt to predict the axes for each direction based on a subset of the data. Each series has its own prediction * algorithm. */ private predictAxes; private cloneDefaultAxes; private predictAxesMissingTypesAndPositions; private predictAxisMissingTypeFromPosition; private predictAxisMissingTypeAndPositionFromSeries; /** * If the first secondary axis in either direction does not have a specified position, it will be placed opposite * the primary axis. */ private alternateSecondaryAxisPositions; /** Last-resort positions for axes the options and theme left unplaced, alternating edges like secondary axes. */ private assignMissingAxisPositions; /** Unreferenced secondary axes default to vertical. */ private getAxisKeyDirection; private processMiniChartSeriesOptions; private getSeriesGroupingOptions; private setSeriesGroupingOptions; private getSeriesGroupId; private getSeriesGrouping; private soloSeriesIntegrity; private static processFontOptions; private processFonts; /** * Theme params carry a family per element (`titleFontFamily`, `axisLabelFontFamily`, ...) as well as * `fontFamily`, and options `$ref` them, so each must reach the options as a plain string. */ private processParamFonts; private static removeDisabledOptionJson; private removeDisabledOptions; private static removeLeftoverSymbolsJson; /** Whether `node` holds a `data` key outside the pass-through options, without looking inside one. */ private static containsDataKey; /** * A `data` delta needs the slow path when it isn't an array, or when its rows change the axes or the preset's * derived shape. */ private dataChangeNeedsSlowPath; /** * A preset derives its `series` and `datumKey` from the first non-null row alone, so the shape key is read from * that row rather than from a transform of every row. */ private static shapeSample; private static shapeKeyOf; private predictedAxesKeyOf; private predictionSeriesOptions; private static axisDirections; private removeLeftoverSymbols; private static processCSSVariablesJSON; private static isExternalColorVar; private static resolveColorVar; private processCSSVariables; /** The variables `processCSSVariablesPartial` left out while detached; `undefined` when none, so it never clears. */ takePartialDeferredCSSVariables(): string[] | undefined; processCSSVariablesPartial(partialOptions: PlainObject | undefined, container: HTMLElement | null | undefined): Record | undefined; private specialOverridesDefaults; }