feat: support ref for provide api

This commit is contained in:
Justineo
2021-02-22 14:14:54 +08:00
parent 5744cd1f53
commit cd02c3131c
6 changed files with 128 additions and 7 deletions

View File

@ -1,9 +1,11 @@
import { init } from "echarts/core";
import { Ref } from "vue";
type InitType = typeof init;
export type InitParameters = Parameters<InitType>;
export type Theme = NonNullable<InitParameters[1]>;
export type InitOptions = NonNullable<InitParameters[2]>;
export type InitOptionsInjection = InitOptions | Ref<InitOptions>;
export type EChartsType = ReturnType<InitType>;
type SetOptionType = EChartsType["setOption"];
@ -18,3 +20,4 @@ export interface UpdateOptions {
replaceMerge?: any;
transition?: any;
}
export type UpdateOptionsInjection = UpdateOptions | Ref<UpdateOptions>;