@flightdev/router 0.4.0

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.
@@ -0,0 +1,147 @@
1
+ import { P as PrefetchStrategy, b as RouterProviderProps, a as RouterContextValue } from '../prefetch-DRp54Q7z.js';
2
+ export { L as LinkProps, N as NavigateOptions, d as PrefetchOptions, c as PrefetchPriority, R as RouteParams, S as SearchParams, w as clearPrefetchCache, l as findRoute, o as generatePath, B as getRouterContext, D as initRouter, q as isActive, v as isPrefetched, m as matchRoute, n as navigate, x as observeForPrefetch, p as parseParams, s as prefetch, t as prefetchAll, z as prefetchPages, A as prefetchWhenIdle, r as redirect, y as setupIntentPrefetch, C as subscribe } from '../prefetch-DRp54Q7z.js';
3
+ import * as vue from 'vue';
4
+ import { PropType, Ref } from 'vue';
5
+
6
+ /**
7
+ * Vue Link Component
8
+ *
9
+ * @example
10
+ * ```vue
11
+ * <template>
12
+ * <Link href="/docs" prefetch="intent">Documentation</Link>
13
+ * </template>
14
+ * ```
15
+ */
16
+ declare const Link: vue.DefineComponent<vue.ExtractPropTypes<{
17
+ href: {
18
+ type: StringConstructor;
19
+ required: true;
20
+ };
21
+ prefetch: {
22
+ type: PropType<boolean | PrefetchStrategy>;
23
+ default: string;
24
+ };
25
+ replace: {
26
+ type: BooleanConstructor;
27
+ default: boolean;
28
+ };
29
+ scroll: {
30
+ type: BooleanConstructor;
31
+ default: boolean;
32
+ };
33
+ class: {
34
+ type: StringConstructor;
35
+ default: undefined;
36
+ };
37
+ target: {
38
+ type: StringConstructor;
39
+ default: undefined;
40
+ };
41
+ rel: {
42
+ type: StringConstructor;
43
+ default: undefined;
44
+ };
45
+ }>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
46
+ [key: string]: any;
47
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
48
+ href: {
49
+ type: StringConstructor;
50
+ required: true;
51
+ };
52
+ prefetch: {
53
+ type: PropType<boolean | PrefetchStrategy>;
54
+ default: string;
55
+ };
56
+ replace: {
57
+ type: BooleanConstructor;
58
+ default: boolean;
59
+ };
60
+ scroll: {
61
+ type: BooleanConstructor;
62
+ default: boolean;
63
+ };
64
+ class: {
65
+ type: StringConstructor;
66
+ default: undefined;
67
+ };
68
+ target: {
69
+ type: StringConstructor;
70
+ default: undefined;
71
+ };
72
+ rel: {
73
+ type: StringConstructor;
74
+ default: undefined;
75
+ };
76
+ }>> & Readonly<{}>, {
77
+ replace: boolean;
78
+ scroll: boolean;
79
+ prefetch: boolean | PrefetchStrategy;
80
+ class: string;
81
+ target: string;
82
+ rel: string;
83
+ }, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
84
+
85
+ /**
86
+ * Vue Composables for Router
87
+ *
88
+ * Provides Vue 3 composition API composables for routing.
89
+ */
90
+
91
+ /**
92
+ * Vue RouterProvider component for composition API
93
+ *
94
+ * @example
95
+ * ```vue
96
+ * <script setup>
97
+ * import { RouterProvider } from '@flightdev/router/vue';
98
+ * </script>
99
+ *
100
+ * <template>
101
+ * <RouterProvider initial-path="/">
102
+ * <App />
103
+ * </RouterProvider>
104
+ * </template>
105
+ * ```
106
+ */
107
+ declare function RouterProvider(props: RouterProviderProps, { slots }: {
108
+ slots: {
109
+ default?: () => unknown;
110
+ };
111
+ }): unknown;
112
+ /**
113
+ * Composable to access router functions
114
+ *
115
+ * @example
116
+ * ```vue
117
+ * <script setup>
118
+ * import { useRouter } from '@flightdev/router/vue';
119
+ *
120
+ * const { navigate, back, forward } = useRouter();
121
+ * </script>
122
+ * ```
123
+ */
124
+ declare function useRouter(): RouterContextValue;
125
+ /**
126
+ * Composable to get current pathname
127
+ *
128
+ * @example
129
+ * ```vue
130
+ * <script setup>
131
+ * import { usePathname } from '@flightdev/router/vue';
132
+ *
133
+ * const pathname = usePathname();
134
+ * </script>
135
+ * ```
136
+ */
137
+ declare function usePathname(): Ref<string>;
138
+ /**
139
+ * Composable to get current search params
140
+ */
141
+ declare function useSearchParams(): Ref<URLSearchParams>;
142
+ /**
143
+ * Composable to get route params
144
+ */
145
+ declare function useParams(): Ref<Record<string, string>>;
146
+
147
+ export { Link, PrefetchStrategy, RouterContextValue, RouterProvider, RouterProviderProps, useParams, usePathname, useRouter, useSearchParams };