11import {
22 ActiveVisit ,
3- CacheForOption ,
4- CancelTokenCallback ,
5- GlobalEventCallback ,
63 isUrlMethodPair ,
74 LinkComponentBaseProps ,
85 LinkPrefetchOption ,
@@ -29,107 +26,107 @@ const Link: InertiaLink = defineComponent({
2926 name : 'Link' ,
3027 props : {
3128 as : {
32- type : [ String , Object ] as PropType < string | Component > ,
29+ type : [ String , Object ] as PropType < InertiaLinkProps [ 'as' ] > ,
3330 default : 'a' ,
3431 } ,
3532 data : {
36- type : Object ,
33+ type : Object as PropType < InertiaLinkProps [ 'data' ] > ,
3734 default : ( ) => ( { } ) ,
3835 } ,
3936 href : {
4037 type : [ String , Object ] as PropType < InertiaLinkProps [ 'href' ] > ,
4138 default : '' ,
4239 } ,
4340 method : {
44- type : String as PropType < Method > ,
41+ type : String as PropType < InertiaLinkProps [ 'method' ] > ,
4542 default : 'get' ,
4643 } ,
4744 replace : {
48- type : Boolean ,
45+ type : Boolean as PropType < InertiaLinkProps [ 'replace' ] > ,
4946 default : false ,
5047 } ,
5148 preserveScroll : {
52- type : Boolean ,
49+ type : [ Boolean , String , Function ] as PropType < InertiaLinkProps [ 'preserveScroll' ] > ,
5350 default : false ,
5451 } ,
5552 preserveState : {
56- type : Boolean ,
53+ type : [ Boolean , String , Function ] as PropType < InertiaLinkProps [ 'preserveState' ] > ,
5754 default : null ,
5855 } ,
5956 preserveUrl : {
60- type : Boolean ,
57+ type : Boolean as PropType < InertiaLinkProps [ 'preserveUrl' ] > ,
6158 default : false ,
6259 } ,
6360 only : {
64- type : Array < string > ,
61+ type : Array as PropType < InertiaLinkProps [ 'only' ] > ,
6562 default : ( ) => [ ] ,
6663 } ,
6764 except : {
68- type : Array < string > ,
65+ type : Array as PropType < InertiaLinkProps [ 'except' ] > ,
6966 default : ( ) => [ ] ,
7067 } ,
7168 headers : {
72- type : Object ,
69+ type : Object as PropType < InertiaLinkProps [ 'headers' ] > ,
7370 default : ( ) => ( { } ) ,
7471 } ,
7572 queryStringArrayFormat : {
76- type : String as PropType < 'brackets' | 'indices' > ,
73+ type : String as PropType < InertiaLinkProps [ 'queryStringArrayFormat' ] > ,
7774 default : 'brackets' ,
7875 } ,
7976 async : {
80- type : Boolean ,
77+ type : Boolean as PropType < InertiaLinkProps [ 'async' ] > ,
8178 default : false ,
8279 } ,
8380 prefetch : {
84- type : [ Boolean , String , Array ] as PropType < boolean | LinkPrefetchOption | LinkPrefetchOption [ ] > ,
81+ type : [ Boolean , String , Array ] as PropType < InertiaLinkProps [ 'prefetch' ] > ,
8582 default : false ,
8683 } ,
8784 cacheFor : {
88- type : [ Number , String , Array ] as PropType < CacheForOption | CacheForOption [ ] > ,
85+ type : [ Number , String , Array ] as PropType < InertiaLinkProps [ 'cacheFor' ] > ,
8986 default : 0 ,
9087 } ,
9188 onStart : {
92- type : Function as PropType < GlobalEventCallback < 'start' > > ,
89+ type : Function as PropType < InertiaLinkProps [ 'onStart' ] > ,
9390 default : noop ,
9491 } ,
9592 onProgress : {
96- type : Function as PropType < GlobalEventCallback < 'progress' > > ,
93+ type : Function as PropType < InertiaLinkProps [ 'onProgress' ] > ,
9794 default : noop ,
9895 } ,
9996 onFinish : {
100- type : Function as PropType < GlobalEventCallback < 'finish' > > ,
97+ type : Function as PropType < InertiaLinkProps [ 'onFinish' ] > ,
10198 default : noop ,
10299 } ,
103100 onBefore : {
104- type : Function as PropType < GlobalEventCallback < 'before' > > ,
101+ type : Function as PropType < InertiaLinkProps [ 'onBefore' ] > ,
105102 default : noop ,
106103 } ,
107104 onCancel : {
108- type : Function as PropType < GlobalEventCallback < 'cancel' > > ,
105+ type : Function as PropType < InertiaLinkProps [ 'onCancel' ] > ,
109106 default : noop ,
110107 } ,
111108 onSuccess : {
112- type : Function as PropType < GlobalEventCallback < 'success' > > ,
109+ type : Function as PropType < InertiaLinkProps [ 'onSuccess' ] > ,
113110 default : noop ,
114111 } ,
115112 onError : {
116- type : Function as PropType < GlobalEventCallback < 'error' > > ,
113+ type : Function as PropType < InertiaLinkProps [ 'onError' ] > ,
117114 default : noop ,
118115 } ,
119116 onCancelToken : {
120- type : Function as PropType < CancelTokenCallback > ,
117+ type : Function as PropType < InertiaLinkProps [ 'onCancelToken' ] > ,
121118 default : noop ,
122119 } ,
123120 onPrefetching : {
124- type : Function as PropType < GlobalEventCallback < 'prefetching' > > ,
121+ type : Function as PropType < InertiaLinkProps [ 'onPrefetching' ] > ,
125122 default : noop ,
126123 } ,
127124 onPrefetched : {
128- type : Function as PropType < GlobalEventCallback < 'prefetched' > > ,
125+ type : Function as PropType < InertiaLinkProps [ 'onPrefetched' ] > ,
129126 default : noop ,
130127 } ,
131128 cacheTags : {
132- type : [ String , Array ] as PropType < string | string [ ] > ,
129+ type : [ String , Array ] as PropType < InertiaLinkProps [ 'cacheTags' ] > ,
133130 default : ( ) => [ ] ,
134131 } ,
135132 viewTransition : {
0 commit comments