import type { ChartDataState, EventBus, KeisenState, KlineTimezone, Resolution, Store, ThemeInput, ThemeMode, UpDownScheme, } from "@keisen-charts/core"; import type { InjectionKey } from "vue"; export type KeisenStore = Store>; export const keisenStoreKey: InjectionKey = Symbol("keisenStore"); export const keisenEventBusKey: InjectionKey = Symbol("keisenEventBus"); export type ThemeCallbacks = { onThemeChange?: (theme: ThemeInput) => void; onModeChange?: (mode: ThemeMode) => void; onUpDownChange?: (scheme: UpDownScheme) => void; }; export type TimezoneCallbacks = { onTimezoneChange?: (timezone: KlineTimezone) => void; }; export type LocaleCallbacks = { onLocaleChange?: (localeId: string) => void; }; export type ResolutionCallbacks = { /** 根组件 resolution prop(首屏 meta 未写入前供 hook 回退) */ resolutionProp?: Resolution; onResolutionChange?: (resolution: Resolution) => void; }; export const themeCallbacksKey: InjectionKey = Symbol("themeCallbacks"); export const timezoneCallbacksKey: InjectionKey = Symbol("timezoneCallbacks"); export const localeCallbacksKey: InjectionKey = Symbol("localeCallbacks"); export const resolutionCallbacksKey: InjectionKey = Symbol("resolutionCallbacks");