@adonisjs/inertia 4.0.0-next.9 → 4.1.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.
Files changed (48) hide show
  1. package/build/commands/commands.json +1 -0
  2. package/build/commands/main.d.ts +4 -0
  3. package/build/commands/main.js +36 -0
  4. package/build/commands/make_page.d.ts +16 -0
  5. package/build/commands/make_page.js +47 -0
  6. package/build/debug-CBMTuPUm.js +3 -0
  7. package/build/define_config-Du2hAFGX.js +57 -0
  8. package/build/factories/main.js +60 -172
  9. package/build/headers-DafWEpBh.js +11 -0
  10. package/build/index.js +5 -24
  11. package/build/inertia_manager-Ra2dhBKa.js +410 -0
  12. package/build/providers/inertia_provider.js +25 -79
  13. package/build/src/client/common.d.ts +27 -0
  14. package/build/src/client/helpers.js +11 -28
  15. package/build/src/client/react/context.d.ts +24 -0
  16. package/build/src/client/react/form.d.ts +76 -0
  17. package/build/src/client/react/index.d.ts +4 -0
  18. package/build/src/client/react/index.js +62 -0
  19. package/build/src/client/react/link.d.ts +59 -0
  20. package/build/src/client/react/router.d.ts +60 -0
  21. package/build/src/client/vite.js +19 -29
  22. package/build/src/client/vue/context.d.ts +23 -0
  23. package/build/src/client/vue/form.d.ts +68 -0
  24. package/build/src/client/vue/index.d.ts +4 -0
  25. package/build/src/client/vue/index.js +103 -0
  26. package/build/src/client/vue/link.d.ts +52 -0
  27. package/build/src/client/vue/router.d.ts +62 -0
  28. package/build/src/debug.d.ts +1 -1
  29. package/build/src/index_pages.d.ts +32 -1
  30. package/build/src/inertia_middleware.js +45 -111
  31. package/build/src/plugins/edge/plugin.js +49 -81
  32. package/build/src/plugins/japa/api_client.js +44 -59
  33. package/build/src/types.d.ts +14 -21
  34. package/build/src/types.js +1 -0
  35. package/build/stubs/make/page/react.stub +20 -0
  36. package/build/stubs/make/page/vue.stub +18 -0
  37. package/build/tests/commands/make_page.spec.d.ts +1 -0
  38. package/build/tests/helpers.d.ts +2 -2
  39. package/build/tests/react_components.spec.d.ts +1 -0
  40. package/build/tests/types/react.spec.d.ts +68 -0
  41. package/build/tests/types/vue.spec.d.ts +1 -0
  42. package/build/tsdown.config.d.ts +2 -0
  43. package/package.json +68 -57
  44. package/build/chunk-4EZ2J6OA.js +0 -7
  45. package/build/chunk-5QRJHXXQ.js +0 -91
  46. package/build/chunk-DISC5OYC.js +0 -46
  47. package/build/chunk-MLKGABMK.js +0 -9
  48. package/build/chunk-XXMTGYB5.js +0 -813
@@ -0,0 +1,62 @@
1
+ import React from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { Form as Form$1, Link as Link$1, router } from "@inertiajs/react";
4
+ const TuyauContext = React.createContext(null);
5
+ function TuyauProvider(props) {
6
+ return /* @__PURE__ */ jsx(TuyauContext.Provider, {
7
+ value: props.client,
8
+ children: props.children
9
+ });
10
+ }
11
+ function useTuyau() {
12
+ const context = React.useContext(TuyauContext);
13
+ if (!context) throw new Error("You must wrap your app in a TuyauProvider");
14
+ return context;
15
+ }
16
+ function useRouter() {
17
+ const tuyau = useTuyau();
18
+ return { visit: (props, options) => {
19
+ if ("href" in props) return router.visit(props.href, options);
20
+ const routeInfo = tuyau.getRoute(props.route, { params: props.routeParams });
21
+ const url = routeInfo.url;
22
+ return router.visit(url, {
23
+ ...options,
24
+ method: routeInfo.methods[0].toLowerCase()
25
+ });
26
+ } };
27
+ }
28
+ function LinkInner(props, ref) {
29
+ const tuyau = useTuyau();
30
+ if ("href" in props) return /* @__PURE__ */ jsx(Link$1, {
31
+ ...props,
32
+ ref
33
+ });
34
+ const { route: _route, routeParams: params, ...linkProps } = props;
35
+ const routeInfo = tuyau.getRoute(props.route, { params });
36
+ return /* @__PURE__ */ jsx(Link$1, {
37
+ ...linkProps,
38
+ href: routeInfo.url,
39
+ method: routeInfo.methods[0].toLowerCase(),
40
+ ref
41
+ });
42
+ }
43
+ const Link = React.forwardRef(LinkInner);
44
+ function FormInner(props, ref) {
45
+ const tuyau = useTuyau();
46
+ if ("action" in props) return /* @__PURE__ */ jsx(Form$1, {
47
+ ...props,
48
+ ref
49
+ });
50
+ const { route: _route, routeParams: params, ...formProps } = props;
51
+ const routeInfo = tuyau.getRoute(props.route, { params });
52
+ return /* @__PURE__ */ jsx(Form$1, {
53
+ ...formProps,
54
+ action: {
55
+ url: routeInfo.url,
56
+ method: routeInfo.methods[0].toLowerCase()
57
+ },
58
+ ref
59
+ });
60
+ }
61
+ const Form = React.forwardRef(FormInner);
62
+ export { Form, Link, TuyauProvider, useRouter, useTuyau };
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import { Link as InertiaLink } from '@inertiajs/react';
3
+ import type { RouteParams, Routes } from '../common.ts';
4
+ /**
5
+ * Parameters required for route navigation with proper type safety.
6
+ */
7
+ export type LinkParams<Route extends keyof Routes> = RouteParams<Route>;
8
+ /**
9
+ * Props for the Link component when using route-based navigation
10
+ */
11
+ export type LinkRouteProps<Route extends keyof Routes> = Omit<React.ComponentPropsWithoutRef<typeof InertiaLink>, 'href' | 'method'> & LinkParams<Route> & {
12
+ href?: never;
13
+ };
14
+ /**
15
+ * Props for the Link component when using direct href
16
+ */
17
+ export type LinkHrefProps = Omit<React.ComponentPropsWithoutRef<typeof InertiaLink>, 'route'> & {
18
+ route?: never;
19
+ };
20
+ /**
21
+ * Union type for Link component props - either route-based or direct href
22
+ */
23
+ export type LinkProps<Route extends keyof Routes = keyof Routes> = LinkRouteProps<Route> | LinkHrefProps;
24
+ /**
25
+ * Internal Link component implementation with forward ref support.
26
+ * Resolves route parameters and generates the appropriate URL and HTTP method
27
+ * for Inertia navigation when using route-based navigation.
28
+ * Falls back to standard InertiaLink when href is provided directly.
29
+ *
30
+ * @param props - Link properties including route and parameters, or direct href
31
+ * @param ref - Forward ref for the underlying InertiaLink component
32
+ */
33
+ declare function LinkInner<Route extends keyof Routes>(props: LinkProps<Route>, ref?: React.ForwardedRef<React.ElementRef<typeof InertiaLink>>): import("react/jsx-runtime").JSX.Element;
34
+ /**
35
+ * Type-safe Link component for Inertia.js navigation.
36
+ *
37
+ * Provides compile-time route validation and automatic parameter type checking
38
+ * based on your application's route definitions. Automatically resolves the
39
+ * correct URL and HTTP method for each route. Alternatively, you can use
40
+ * the standard href prop for direct navigation.
41
+ *
42
+ * @example
43
+ * ```tsx
44
+ * // Link to a route without parameters
45
+ * <Link route="home">Home</Link>
46
+ *
47
+ * // Link to a route with required parameters
48
+ * <Link route="user.show" routeParams={{ id: 1 }}>
49
+ * View User
50
+ * </Link>
51
+ *
52
+ * // Link with direct href
53
+ * <Link href="/about">About</Link>
54
+ * ```
55
+ */
56
+ export declare const Link: <Route extends keyof Routes>(props: LinkProps<Route> & {
57
+ ref?: React.Ref<React.ElementRef<typeof InertiaLink>>;
58
+ }) => ReturnType<typeof LinkInner>;
59
+ export {};
@@ -0,0 +1,60 @@
1
+ import type { UserRegistry, InferRoutes } from '@tuyau/core/types';
2
+ import { router as InertiaRouter } from '@inertiajs/react';
3
+ import type { LinkParams } from './link.tsx';
4
+ /**
5
+ * Parameters for route-based visit
6
+ */
7
+ type VisitRouteParams<Route extends keyof InferRoutes<UserRegistry>> = LinkParams<Route> & {
8
+ href?: never;
9
+ };
10
+ /**
11
+ * Parameters for direct href visit - supports all Inertia visit parameters
12
+ */
13
+ type VisitHrefParams = {
14
+ href: Parameters<typeof InertiaRouter.visit>[0];
15
+ route?: never;
16
+ };
17
+ /**
18
+ * Union type for visit parameters - either route-based or direct href
19
+ */
20
+ type VisitParams<Route extends keyof InferRoutes<UserRegistry> = keyof InferRoutes<UserRegistry>> = VisitRouteParams<Route> | VisitHrefParams;
21
+ /**
22
+ * Custom hook providing type-safe navigation utilities for Inertia.js.
23
+ *
24
+ * Returns an enhanced router object with type-safe navigation methods
25
+ * that automatically resolve route URLs and HTTP methods based on
26
+ * your application's route definitions. Alternatively, you can use
27
+ * direct href for navigation.
28
+ *
29
+ * @returns Router object with type-safe navigation methods
30
+ */
31
+ export declare function useRouter(): {
32
+ /**
33
+ * Navigate to a route with type-safe parameters and options, or use
34
+ * direct href for navigation.
35
+ *
36
+ * When using route-based navigation, automatically resolves the route
37
+ * URL and HTTP method based on the route definition. When using direct
38
+ * href, passes through to Inertia's router.
39
+ *
40
+ * @param props - Route navigation parameters or direct href
41
+ * @param options - Optional Inertia visit options for controlling navigation behavior
42
+ *
43
+ * @example
44
+ * ```tsx
45
+ * // Navigate to a simple route
46
+ * router.visit({ route: 'dashboard' })
47
+ *
48
+ * // Navigate with parameters
49
+ * router.visit({ route: 'user.edit', routeParams: { id: userId } })
50
+ *
51
+ * // Navigate with direct href
52
+ * router.visit({ href: '/about' })
53
+ *
54
+ * // Navigate with direct href and method
55
+ * router.visit({ href: '/logout' }, { method: 'post' })
56
+ * ```
57
+ */
58
+ visit: <Route extends keyof InferRoutes<UserRegistry>>(props: VisitParams<Route>, options?: Parameters<typeof InertiaRouter.visit>[1]) => any;
59
+ };
60
+ export {};
@@ -1,31 +1,21 @@
1
- import "../../chunk-MLKGABMK.js";
2
-
3
- // src/client/vite.ts
4
1
  function inertia(options) {
5
- return {
6
- name: "vite-plugin-inertia",
7
- config: (_, { command }) => {
8
- if (command === "build") {
9
- process.env.NODE_ENV = "production";
10
- }
11
- return {
12
- builder: {},
13
- build: { outDir: "build/public/assets" },
14
- environments: {
15
- ...options?.ssr?.enabled && {
16
- ssr: {
17
- build: {
18
- ssr: true,
19
- outDir: options.ssr.output || "build/ssr",
20
- rollupOptions: { input: options.ssr.entrypoint }
21
- }
22
- }
23
- }
24
- }
25
- };
26
- }
27
- };
2
+ return {
3
+ name: "vite-plugin-inertia",
4
+ config: (_, { command }) => {
5
+ if (command === "build") process.env.NODE_ENV = "production";
6
+ return {
7
+ builder: { buildApp: async (builder) => {
8
+ await builder.build(builder.environments.client);
9
+ if (options?.ssr?.enabled) await builder.build(builder.environments.ssr);
10
+ } },
11
+ build: { outDir: "build/public/assets" },
12
+ environments: { ...options?.ssr?.enabled && { ssr: { build: {
13
+ ssr: true,
14
+ outDir: options.ssr.output || "build/ssr",
15
+ rollupOptions: { input: options.ssr.entrypoint }
16
+ } } } }
17
+ };
18
+ }
19
+ };
28
20
  }
29
- export {
30
- inertia as default
31
- };
21
+ export { inertia as default };
@@ -0,0 +1,23 @@
1
+ import type { Tuyau } from '@tuyau/core/client';
2
+ import type { TuyauRegistry } from '@tuyau/core/types';
3
+ import type { PropType } from 'vue';
4
+ /**
5
+ * Provider component that makes the Tuyau client available to child components.
6
+ */
7
+ export declare const TuyauProvider: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
8
+ client: {
9
+ type: PropType<Tuyau<TuyauRegistry>>;
10
+ required: true;
11
+ };
12
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
13
+ [key: string]: any;
14
+ }>[] | undefined, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
15
+ client: {
16
+ type: PropType<Tuyau<TuyauRegistry>>;
17
+ required: true;
18
+ };
19
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
20
+ /**
21
+ * Composable to access the Tuyau client from any component within a TuyauProvider.
22
+ */
23
+ export declare function useTuyau(): Tuyau<any, any>;
@@ -0,0 +1,68 @@
1
+ import type { PropType, SlotsType } from 'vue';
2
+ import { Form as InertiaForm } from '@inertiajs/vue3';
3
+ import type { RouteParams, RouteParamsFormats, Routes } from '../common.ts';
4
+ export type InertiaFormSlots = InstanceType<typeof InertiaForm>['$slots'];
5
+ export type InertiaFormDefaultSlot = InertiaFormSlots['default'];
6
+ export type InertiaFormSlotProps = InertiaFormDefaultSlot extends (...args: any[]) => any ? Parameters<InertiaFormDefaultSlot>[0] : never;
7
+ /**
8
+ * Parameters required for route navigation with proper type safety.
9
+ */
10
+ export type FormParams<Route extends keyof Routes> = RouteParams<Route>;
11
+ /**
12
+ * Type-safe Form component for Inertia.js form submissions.
13
+ *
14
+ * Supports both route-based form submission with automatic URL resolution
15
+ * and direct action for maximum flexibility.
16
+ *
17
+ * @example
18
+ * ```vue
19
+ * <!-- Route-based form -->
20
+ * <Form route="users.store" v-slot="{ processing }">
21
+ * <input type="text" name="name" />
22
+ * <button :disabled="processing">Create</button>
23
+ * </Form>
24
+ *
25
+ * <!-- Direct action form -->
26
+ * <Form :action="{ url: '/users', method: 'post' }" v-slot="{ processing }">
27
+ * <input type="text" name="name" />
28
+ * <button :disabled="processing">Create</button>
29
+ * </Form>
30
+ * ```
31
+ */
32
+ export declare const Form: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
33
+ route: {
34
+ type: PropType<keyof Routes>;
35
+ required: false;
36
+ };
37
+ params: {
38
+ type: PropType<RouteParamsFormats<keyof Routes>>;
39
+ required: false;
40
+ };
41
+ action: {
42
+ type: PropType<{
43
+ url: string;
44
+ method: string;
45
+ }>;
46
+ required: false;
47
+ };
48
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
49
+ [key: string]: any;
50
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
51
+ route: {
52
+ type: PropType<keyof Routes>;
53
+ required: false;
54
+ };
55
+ params: {
56
+ type: PropType<RouteParamsFormats<keyof Routes>>;
57
+ required: false;
58
+ };
59
+ action: {
60
+ type: PropType<{
61
+ url: string;
62
+ method: string;
63
+ }>;
64
+ required: false;
65
+ };
66
+ }>> & Readonly<{}>, {}, SlotsType<{
67
+ default: InertiaFormSlotProps;
68
+ }>, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,4 @@
1
+ export * from './context.ts';
2
+ export * from './router.ts';
3
+ export * from './link.ts';
4
+ export * from './form.ts';
@@ -0,0 +1,103 @@
1
+ import { defineComponent, h, inject, provide } from "vue";
2
+ import { Form as Form$1, Link as Link$1, router } from "@inertiajs/vue3";
3
+ const TuyauContext = Symbol("Tuyau");
4
+ const TuyauProvider = defineComponent({
5
+ name: "TuyauProvider",
6
+ props: { client: {
7
+ type: Object,
8
+ required: true
9
+ } },
10
+ setup(props, { slots }) {
11
+ provide(TuyauContext, props.client);
12
+ return () => slots.default?.();
13
+ }
14
+ });
15
+ function useTuyau() {
16
+ const context = inject(TuyauContext, null);
17
+ if (!context) throw new Error("You must wrap your app in a TuyauProvider");
18
+ return context;
19
+ }
20
+ function useRouter() {
21
+ const tuyau = useTuyau();
22
+ return { visit: (props, options) => {
23
+ if ("href" in props) return router.visit(props.href, options);
24
+ const routeInfo = tuyau.getRoute(props.route, { params: props.routeParams });
25
+ const url = routeInfo.url;
26
+ return router.visit(url, {
27
+ ...options,
28
+ method: routeInfo.methods[0].toLowerCase()
29
+ });
30
+ } };
31
+ }
32
+ const Link = defineComponent({
33
+ name: "TuyauLink",
34
+ inheritAttrs: false,
35
+ props: {
36
+ route: {
37
+ type: String,
38
+ required: false
39
+ },
40
+ params: {
41
+ type: [Array, Object],
42
+ required: false
43
+ },
44
+ href: {
45
+ type: String,
46
+ required: false
47
+ }
48
+ },
49
+ setup(props, { attrs, slots }) {
50
+ const tuyau = useTuyau();
51
+ return () => {
52
+ if (props.href) return h(Link$1, {
53
+ ...attrs,
54
+ href: props.href
55
+ }, slots);
56
+ if (!props.route) throw new Error("Either route or href prop is required for Link component");
57
+ const routeInfo = tuyau.getRoute(props.route, { params: props.params });
58
+ return h(Link$1, {
59
+ ...attrs,
60
+ href: routeInfo.url,
61
+ method: routeInfo.methods[0].toLowerCase()
62
+ }, slots);
63
+ };
64
+ }
65
+ });
66
+ const Form = defineComponent({
67
+ name: "TuyauForm",
68
+ inheritAttrs: false,
69
+ slots: Object,
70
+ props: {
71
+ route: {
72
+ type: String,
73
+ required: false
74
+ },
75
+ params: {
76
+ type: [Array, Object],
77
+ required: false
78
+ },
79
+ action: {
80
+ type: Object,
81
+ required: false
82
+ }
83
+ },
84
+ setup(props, { attrs, slots }) {
85
+ const tuyau = useTuyau();
86
+ return () => {
87
+ if (props.action) return h(Form$1, {
88
+ ...attrs,
89
+ action: props.action
90
+ }, slots);
91
+ if (!props.route) throw new Error("Either route or action prop is required for Form component");
92
+ const routeInfo = tuyau.getRoute(props.route, { params: props.params });
93
+ return h(Form$1, {
94
+ ...attrs,
95
+ action: {
96
+ url: routeInfo.url,
97
+ method: routeInfo.methods[0].toLowerCase()
98
+ }
99
+ }, slots);
100
+ };
101
+ }
102
+ });
103
+ export { Form, Link, TuyauProvider, useRouter, useTuyau };
@@ -0,0 +1,52 @@
1
+ import type { PropType } from 'vue';
2
+ import type { RouteParams, RouteParamsFormats, Routes } from '../common.ts';
3
+ /**
4
+ * Parameters required for route navigation with proper type safety.
5
+ */
6
+ export type LinkParams<Route extends keyof Routes> = RouteParams<Route>;
7
+ /**
8
+ * Type-safe Link component for Inertia.js navigation.
9
+ *
10
+ * Supports both route-based navigation with automatic URL resolution
11
+ * and direct href navigation for maximum flexibility.
12
+ *
13
+ * @example
14
+ * ```vue
15
+ * <!-- Route-based navigation -->
16
+ * <Link route="users.index">Users</Link>
17
+ * <Link route="users.show" :params="{ id: 1 }">View User</Link>
18
+ *
19
+ * <!-- Direct href navigation -->
20
+ * <Link href="/about">About</Link>
21
+ * <Link href="/logout" method="post">Logout</Link>
22
+ * ```
23
+ */
24
+ export declare const Link: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
25
+ route: {
26
+ type: PropType<keyof Routes>;
27
+ required: false;
28
+ };
29
+ params: {
30
+ type: PropType<RouteParamsFormats<keyof Routes>>;
31
+ required: false;
32
+ };
33
+ href: {
34
+ type: StringConstructor;
35
+ required: false;
36
+ };
37
+ }>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
38
+ [key: string]: any;
39
+ }>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
40
+ route: {
41
+ type: PropType<keyof Routes>;
42
+ required: false;
43
+ };
44
+ params: {
45
+ type: PropType<RouteParamsFormats<keyof Routes>>;
46
+ required: false;
47
+ };
48
+ href: {
49
+ type: StringConstructor;
50
+ required: false;
51
+ };
52
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
@@ -0,0 +1,62 @@
1
+ import { router as InertiaRouter } from '@inertiajs/vue3';
2
+ import type { UserRegistry, InferRoutes } from '@tuyau/core/types';
3
+ import type { LinkParams } from './link.ts';
4
+ /**
5
+ * Parameters for route-based visit
6
+ */
7
+ type VisitRouteParams<Route extends keyof InferRoutes<UserRegistry>> = LinkParams<Route> & {
8
+ href?: never;
9
+ };
10
+ /**
11
+ * Parameters for direct href visit - supports all Inertia visit parameters
12
+ */
13
+ type VisitHrefParams = {
14
+ href: Parameters<typeof InertiaRouter.visit>[0];
15
+ route?: never;
16
+ };
17
+ /**
18
+ * Union type for visit parameters - either route-based or direct href
19
+ */
20
+ type VisitParams<Route extends keyof InferRoutes<UserRegistry> = keyof InferRoutes<UserRegistry>> = VisitRouteParams<Route> | VisitHrefParams;
21
+ /**
22
+ * Composable providing type-safe navigation utilities for Inertia.js.
23
+ *
24
+ * Returns an enhanced router object with type-safe navigation methods
25
+ * that automatically resolve route URLs and HTTP methods based on
26
+ * your application's route definitions. Alternatively, you can use
27
+ * direct href for navigation.
28
+ *
29
+ * @returns Router object with type-safe navigation methods
30
+ */
31
+ export declare function useRouter(): {
32
+ /**
33
+ * Navigate to a route with type-safe parameters and options, or use
34
+ * direct href for navigation.
35
+ *
36
+ * When using route-based navigation, automatically resolves the route
37
+ * URL and HTTP method based on the route definition. When using direct
38
+ * href, passes through to Inertia's router.
39
+ *
40
+ * @param props - Route navigation parameters or direct href
41
+ * @param options - Optional Inertia visit options for controlling navigation behavior
42
+ *
43
+ * @example
44
+ * ```ts
45
+ * const router = useRouter()
46
+ *
47
+ * // Navigate to a simple route
48
+ * router.visit({ route: 'dashboard' })
49
+ *
50
+ * // Navigate with parameters
51
+ * router.visit({ route: 'user.edit', params: { id: userId } })
52
+ *
53
+ * // Navigate with direct href
54
+ * router.visit({ href: '/about' })
55
+ *
56
+ * // Navigate with direct href and method
57
+ * router.visit({ href: '/logout' }, { method: 'post' })
58
+ * ```
59
+ */
60
+ visit: <Route extends keyof InferRoutes<UserRegistry>>(props: VisitParams<Route>, options?: Parameters<typeof InertiaRouter.visit>[1]) => any;
61
+ };
62
+ export {};
@@ -18,5 +18,5 @@
18
18
  * NODE_DEBUG=adonisjs:inertia node server.js
19
19
  * ```
20
20
  */
21
- declare const _default: import("util").DebugLogger;
21
+ declare const _default: import("node:util").DebugLogger;
22
22
  export default _default;
@@ -7,6 +7,7 @@
7
7
  *
8
8
  * @param config - Configuration object specifying the frontend framework
9
9
  * @param config.framework - The frontend framework ('vue3' or 'react')
10
+ * @param config.source - The path to Inertia pages (default: inertia/pages)
10
11
  * @returns Assembler hook object with run method for generating page types
11
12
  *
12
13
  * @example
@@ -21,12 +22,42 @@
21
22
  */
22
23
  export declare const indexPages: (config: {
23
24
  framework: "vue3" | "react";
25
+ source?: string;
24
26
  }) => {
25
27
  /**
26
28
  * Executes the page indexing process to generate TypeScript definitions.
27
29
  *
28
30
  * @param _ - Unused first parameter (assembler context)
31
+ * @param __ - Unused second parameter (hooks instance)
29
32
  * @param indexGenerator - The index generator instance used to register the pages type generation
30
33
  */
31
- run(_: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator): void;
34
+ run(_: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, __: import("@poppinss/hooks").default<{
35
+ init: [[parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, hooks: import("@poppinss/hooks").default</*elided*/ any>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator], [parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner | import("@adonisjs/assembler").Bundler, hooks: import("@poppinss/hooks").default</*elided*/ any>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator]];
36
+ fileChanged: [[relativePath: string, absolutePath: string, info: {
37
+ source: "hot-hook" | "watcher";
38
+ hotReloaded: boolean;
39
+ fullReload: boolean;
40
+ }, parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, info: {
41
+ source: "hot-hook" | "watcher";
42
+ hotReloaded: boolean;
43
+ fullReload: boolean;
44
+ }, parent: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
45
+ fileAdded: [[relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
46
+ fileRemoved: [[relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner], [relativePath: string, absolutePath: string, server: import("@adonisjs/assembler").DevServer | import("@adonisjs/assembler").TestRunner]];
47
+ devServerStarting: [[server: import("@adonisjs/assembler").DevServer], [server: import("@adonisjs/assembler").DevServer]];
48
+ devServerStarted: [[server: import("@adonisjs/assembler").DevServer, info: {
49
+ port: number;
50
+ host: string;
51
+ }, uiInstructions: import("@poppinss/cliui").Instructions], [server: import("@adonisjs/assembler").DevServer, info: {
52
+ port: number;
53
+ host: string;
54
+ }, uiInstructions: import("@poppinss/cliui").Instructions]];
55
+ buildStarting: [[server: import("@adonisjs/assembler").Bundler], [server: import("@adonisjs/assembler").Bundler]];
56
+ buildFinished: [[server: import("@adonisjs/assembler").Bundler, uiInstructions: import("@poppinss/cliui").Instructions], [server: import("@adonisjs/assembler").Bundler, uiInstructions: import("@poppinss/cliui").Instructions]];
57
+ testsStarting: [[server: import("@adonisjs/assembler").TestRunner], [server: import("@adonisjs/assembler").TestRunner]];
58
+ testsFinished: [[server: import("@adonisjs/assembler").TestRunner], [server: import("@adonisjs/assembler").TestRunner]];
59
+ routesCommitted: [[parent: import("@adonisjs/assembler").DevServer, routes: Record<string, import("@adonisjs/assembler/types").RoutesListItem[]>], [parent: import("@adonisjs/assembler").DevServer, routes: Record<string, import("@adonisjs/assembler/types").RoutesListItem[]>]];
60
+ routesScanning: [[parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner], [parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner]];
61
+ routesScanned: [[parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner], [parent: import("@adonisjs/assembler").DevServer, routesScanner: import("@adonisjs/assembler/routes_scanner").RoutesScanner]];
62
+ }>, indexGenerator: import("@adonisjs/assembler/index_generator").IndexGenerator): void;
32
63
  };