fix: improve types for option

This commit is contained in:
Justineo
2023-08-16 14:31:23 +08:00
parent f8e7597193
commit e224c49951

View File

@ -1,9 +1,10 @@
import {
init,
type SetOptionOpts,
type ECElementEvent,
type ElementEvent
} from "echarts/core";
import { init } from "echarts/core";
import type {
SetOptionOpts,
ECElementEvent,
ElementEvent,
EChartsOption
} from "echarts";
import type { Ref } from "vue";
export type Injection<T> = T | null | Ref<T | null> | { value: T | null };
@ -22,8 +23,7 @@ export type UpdateOptionsInjection = Injection<UpdateOptions>;
export type EChartsType = ReturnType<InitType>;
type ZRenderType = ReturnType<EChartsType["getZr"]>;
export type EventTarget = EChartsType | ZRenderType;
type SetOptionType = EChartsType["setOption"];
export type Option = Parameters<SetOptionType>[0];
export type Option = EChartsOption;
export type LoadingOptions = {
text?: string;