@esmx/router-vue
Version:
Vue integration for @esmx/router - A universal router that works seamlessly with both Vue 2.7+ and Vue 3
21 lines (20 loc) • 1.21 kB
TypeScript
import type { Route, Router } from '@esmx/router';
import type { Ref } from 'vue';
export declare const isVue2: boolean;
/**
* Define $router and $route properties on a target object.
* Used to set up global properties for Vue components.
*
* @param target - The target object to define properties on (e.g., globalProperties or prototype)
* @param routerGetter - Getter function for $router (can use `this` in Vue 2)
* @param routeGetter - Getter function for $route (can use `this` in Vue 2)
* @param configurable - Whether the properties should be configurable (default: false)
*/
export declare function defineRouterProperties(target: Record<string, unknown>, routerGetter: (this: unknown) => Router, routeGetter: (this: unknown) => Route, configurable?: boolean): void;
export declare function createSymbolProperty<T>(symbol: symbol): {
readonly set: (instance: any, value: T) => void;
readonly get: (instance: any) => T | undefined;
};
export declare function createDependentProxy<T extends object>(obj: T, dep: Ref<any>): T;
export declare function isESModule(obj: unknown): obj is Record<string | symbol, any>;
export declare function resolveComponent(component: unknown): unknown;