vue-admin-core
Version:
A Component Library for Vue 3
10 lines (9 loc) • 390 B
TypeScript
import type { DefineComponent } from "vue";
import { InjectionKey, Ref } from "vue";
export type CreateContext<T> = {
Provider?: DefineComponent;
Consumer?: DefineComponent;
injectKey: InjectionKey<Ref<T>>;
};
export declare const createContext: <T>(defaultValue?: T | undefined) => CreateContext<T>;
export declare const useContext: <T>(context: CreateContext<T>) => Ref<any>;