forked from diaafares/inertia-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.d.ts
43 lines (36 loc) · 1.22 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import * as Inertia from '@inertiajs/inertia'
import { Component, FunctionalComponentOptions } from 'vue'
interface AppData<PageProps extends Inertia.PageProps = Inertia.PageProps> {
component: Component | null
key: number | null
props: PageProps | {}
}
interface AppProps<
PagePropsBeforeTransform extends Inertia.PagePropsBeforeTransform = Inertia.PagePropsBeforeTransform,
PageProps extends Inertia.PageProps = Inertia.PageProps
> {
initialPage: Inertia.Page<PageProps>
resolveComponent: (name: string) => Component | Promise<Component>
transformProps?: (props: PagePropsBeforeTransform) => PageProps
}
type App<
PagePropsBeforeTransform extends Inertia.PagePropsBeforeTransform = Inertia.PagePropsBeforeTransform,
PageProps extends Inertia.PageProps = Inertia.PageProps
> = Component<
AppData<PageProps>,
never,
never,
AppProps<PagePropsBeforeTransform, PageProps>
>
interface InertiaLinkProps {
data?: object
href: string
method?: string
onClick?: (event: MouseEvent | KeyboardEvent) => void
preserveScroll?: boolean
preserveState?: boolean
replace?: boolean
}
type InertiaLink = FunctionalComponentOptions<InertiaLinkProps>
export const InertiaLink: InertiaLink
export const InertiaApp: App