feat: support injection for theme

This commit is contained in:
Justineo
2021-02-22 14:36:06 +08:00
parent cd02c3131c
commit 84a89e3883
4 changed files with 32 additions and 24 deletions

View File

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