Skip to content

Commit b24271e

Browse files
committed
fix ts errors
1 parent e4453f2 commit b24271e

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

packages/vue3/src/link.ts

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import {
22
CacheForOption,
3+
FormDataConvertible,
34
LinkPrefetchOption,
45
mergeDataIntoQueryString,
56
Method,
6-
PageProps,
77
PendingVisit,
8+
PreserveStateOption,
89
Progress,
910
router,
1011
shouldIntercept,
@@ -13,23 +14,24 @@ import { defineComponent, DefineComponent, h, onMounted, onUnmounted, PropType,
1314

1415
export interface InertiaLinkProps {
1516
as?: string
16-
data?: object
17+
data?: Record<string, FormDataConvertible>
1718
href: string
1819
method?: Method
19-
headers?: object
20+
headers?: Record<string, string>
2021
onClick?: (event: MouseEvent) => void
21-
preserveScroll?: boolean | ((props: PageProps) => boolean)
22-
preserveState?: boolean | ((props: PageProps) => boolean) | null
22+
preserveScroll?: PreserveStateOption
23+
preserveState?: PreserveStateOption
2324
replace?: boolean
2425
only?: string[]
2526
except?: string[]
2627
onCancelToken?: (cancelToken: import('axios').CancelTokenSource) => void
2728
onBefore?: () => void
28-
onStart?: () => void
29+
onStart?: (visit: PendingVisit) => void
2930
onProgress?: (progress: Progress) => void
30-
onFinish?: () => void
31+
onFinish?: (visit: PendingVisit) => void
3132
onCancel?: () => void
3233
onSuccess?: () => void
34+
onError?: () => void
3335
queryStringArrayFormat?: 'brackets' | 'indices'
3436
async?: boolean
3537
prefetch?: boolean | LinkPrefetchOption | LinkPrefetchOption[]
@@ -98,12 +100,9 @@ const Link: InertiaLink = defineComponent({
98100
type: [Number, String, Array] as PropType<CacheForOption | CacheForOption[]>,
99101
default: 0,
100102
},
101-
// @ts-ignore
102103
onStart: {
103-
// @ts-ignore
104104
type: Function as PropType<(visit: PendingVisit) => void>,
105-
// @ts-ignore
106-
default: (visit) => {},
105+
default: (_visit: PendingVisit) => {},
107106
},
108107
onProgress: {
109108
type: Function as PropType<(progress: Progress) => void>,

0 commit comments

Comments
 (0)