@dskripchenko/ui 1.5.0 → 1.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/composables/useRouterLink.d.ts +18 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +729 -733
- package/package.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Component, ComputedRef } from 'vue';
|
|
2
|
+
export type RouterLocation = string | Record<string, unknown>;
|
|
3
|
+
export interface UseRouterLinkSource {
|
|
4
|
+
href?: string;
|
|
5
|
+
to?: RouterLocation;
|
|
6
|
+
}
|
|
7
|
+
export interface UseRouterLink {
|
|
8
|
+
/** The app's globally registered `RouterLink`, or `null` when `to` is unset or vue-router is not installed. */
|
|
9
|
+
routerLink: ComputedRef<Component | null>;
|
|
10
|
+
/** Plain `href` for the `<a>` fallback: explicit `href`, else a string `to`. */
|
|
11
|
+
fallbackHref: ComputedRef<string | undefined>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves `to` against a globally registered RouterLink without warning or rendering a
|
|
15
|
+
* broken `<routerlink>` element when vue-router is absent; callers fall back to `<a href>`.
|
|
16
|
+
* Must be called during component setup.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useRouterLink(source: UseRouterLinkSource): UseRouterLink;
|