vuestic-ui
Version:
Vue 3 UI Framework
19 lines (18 loc) • 878 B
TypeScript
import { App, AppContext, ComponentCustomProperties } from 'vue';
/** Type safe return app global properties for assign */
export declare const extractGlobalProperties: (app: App | AppContext) => ComponentCustomProperties & Record<string, any>;
/**
* Type safe set vue global property
* Declare type before use this method.
* ```
declare module 'vue' {
export interface ComponentCustomProperties {
$vaThing: ThingType
}
}
* ```
* @example See `global-config` or `color-config` for example
*/
export declare const defineGlobalProperty: <Key extends keyof ComponentCustomProperties, Value extends ComponentCustomProperties[Key]>(app: App, key: Key, v: Value) => void;
/** Type safe return vue global property */
export declare const getGlobalProperty: <Key extends keyof ComponentCustomProperties>(app: App | AppContext, key: Key) => ComponentCustomProperties[Key];