ca9b0b0240dc615a27644ca7b852adc6d74468614fc14194dd3661fd87bf555bb6b543a1668d621277efe5d08b8c32e2bfc1de786306481d88319b8245efb9 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. export * from '../core/echarts.js';
  2. export * from './api.js';
  3. export { ZRColor as Color, Payload } from '../util/types.js';
  4. export { LinearGradientObject } from 'zrender/lib/graphic/LinearGradient.js';
  5. export { RadialGradientObject } from 'zrender/lib/graphic/RadialGradient.js';
  6. export { PatternObject, ImagePatternObject, SVGPatternObject } from 'zrender/lib/graphic/Pattern.js';
  7. export { ElementEvent } from 'zrender/lib/Element.js';
  8. import type { ComponentOption, ECBasicOption as EChartsCoreOption } from '../util/types.js';
  9. import type { AxisPointerOption } from '../component/axisPointer/AxisPointerModel.js';
  10. import type { XAXisOption, YAXisOption } from '../coord/cartesian/AxisModel.js';
  11. import type { AngleAxisOption, RadiusAxisOption } from '../coord/polar/AxisModel.js';
  12. import type { ParallelAxisOption } from '../coord/parallel/AxisModel.js';
  13. export { EChartsType as ECharts } from '../core/echarts.js';
  14. export { EChartsCoreOption };
  15. declare type Dependencies = {
  16. grid: XAXisOption | YAXisOption | AxisPointerOption;
  17. polar: AngleAxisOption | RadiusAxisOption;
  18. parallel: ParallelAxisOption;
  19. };
  20. declare type DependenciesKeys = keyof Dependencies & string;
  21. declare type Arrayable<T> = T | T[];
  22. declare type GetMainType<OptionUnion extends ComponentOption> = Exclude<OptionUnion['mainType'], undefined>;
  23. declare type ExtractComponentOption<OptionUnion, ExtractMainType> = OptionUnion extends {
  24. mainType?: ExtractMainType;
  25. } ? OptionUnion : never;
  26. declare type GetDependency<DependencyOption extends ComponentOption> = {
  27. [key in GetMainType<DependencyOption>]?: Arrayable<ExtractComponentOption<DependencyOption, key>>;
  28. };
  29. declare type GetDependencies<MainType extends string> = GetDependency<Dependencies[Extract<MainType, DependenciesKeys>]>;
  30. declare type ComposeUnitOption<OptionUnion extends ComponentOption> = CheckMainType<GetMainType<OptionUnion>> & Omit<EChartsCoreOption, 'baseOption' | 'options'> & {
  31. [key in GetMainType<OptionUnion>]?: Arrayable<ExtractComponentOption<OptionUnion, key>>;
  32. } & GetDependencies<GetMainType<OptionUnion>>;
  33. declare type CheckMainType<OptionUnionMainType extends string> = string extends OptionUnionMainType ? never : {};
  34. export declare type ComposeOption<OptionUnion extends ComponentOption> = ComposeUnitOption<OptionUnion> & {
  35. baseOption?: ComposeUnitOption<OptionUnion>;
  36. options?: ComposeUnitOption<OptionUnion>[];
  37. };