@synergy-design-system/components
Version:
42 lines (41 loc) • 1.28 kB
TypeScript
import type { ChartConfigHandle, ChartConfigType, ECConfig } from '../types.js';
export declare class ChartConfigBuilder {
#private;
/**
* Creates a new handle seeded with an empty chart configuration.
*
* @param base The initial config to extend.
*/
constructor(base?: ECConfig);
/**
* Sets the base chart config that subsequent preset calls extend.
*
* Calling `baseConfig()` again replaces the previous base config.
*/
baseConfig(config: ECConfig): ChartConfigHandle;
/**
* Returns the composed chart configuration.
*
* @returns The final merged ECConfig.
*/
build(): ECConfig;
}
/**
* Resolves all supported chart config inputs to a final `ECConfig` object.
*
* When the input is a callback, the callback receives a typed handle and can
* update the config via semantic helper methods.
*
* @param input Chart config object or callback handle input.
* @returns The final chart option object.
*
* @example
* ```ts
* chart.config = handle => {
* handle.baseConfig(baseConfig);
* handle.axesShowSplitLines();
* handle.axesAddXLabelIcons({ iconUrls, iconPosition: 'top' });
* };
* ```
*/
export declare const resolveConfigInput: (input: ChartConfigType) => ECConfig;