12 lines
331 B
TypeScript
12 lines
331 B
TypeScript
import { inject, type ComputedRef, type InjectionKey } from "vue";
|
|
|
|
export interface ConfigContext {
|
|
dir: ComputedRef<"ltr" | "rtl">;
|
|
locale: ComputedRef<string>;
|
|
}
|
|
export const configContextKey: InjectionKey<ConfigContext> =
|
|
Symbol("hv-config");
|
|
export function useConfig() {
|
|
return inject(configContextKey, undefined);
|
|
}
|