@@ -498,19 +498,15 @@ export class Router {
498
498
}
499
499
}
500
500
501
- public get (
502
- url : URL | string ,
503
- data : RequestPayload = { } ,
504
- options : Exclude < VisitOptions , 'method' | 'data' > = { } ,
505
- ) : void {
501
+ public get ( url : URL | string , data : RequestPayload = { } , options : Omit < VisitOptions , 'method' | 'data' > = { } ) : void {
506
502
return this . visit ( url , { ...options , method : 'get' , data } )
507
503
}
508
504
509
- public reload ( options : Exclude < VisitOptions , 'preserveScroll' | 'preserveState' > = { } ) : void {
505
+ public reload ( options : Omit < VisitOptions , 'preserveScroll' | 'preserveState' > = { } ) : void {
510
506
return this . visit ( window . location . href , { ...options , preserveScroll : true , preserveState : true } )
511
507
}
512
508
513
- public replace ( url : URL | string , options : Exclude < VisitOptions , 'replace' > = { } ) : void {
509
+ public replace ( url : URL | string , options : Omit < VisitOptions , 'replace' > = { } ) : void {
514
510
console . warn (
515
511
`Inertia.replace() has been deprecated and will be removed in a future release. Please use Inertia.${
516
512
options . method ?? 'get'
@@ -519,31 +515,23 @@ export class Router {
519
515
return this . visit ( url , { preserveState : true , ...options , replace : true } )
520
516
}
521
517
522
- public post (
523
- url : URL | string ,
524
- data : RequestPayload = { } ,
525
- options : Exclude < VisitOptions , 'method' | 'data' > = { } ,
526
- ) : void {
518
+ public post ( url : URL | string , data : RequestPayload = { } , options : Omit < VisitOptions , 'method' | 'data' > = { } ) : void {
527
519
return this . visit ( url , { preserveState : true , ...options , method : 'post' , data } )
528
520
}
529
521
530
- public put (
531
- url : URL | string ,
532
- data : RequestPayload = { } ,
533
- options : Exclude < VisitOptions , 'method' | 'data' > = { } ,
534
- ) : void {
522
+ public put ( url : URL | string , data : RequestPayload = { } , options : Omit < VisitOptions , 'method' | 'data' > = { } ) : void {
535
523
return this . visit ( url , { preserveState : true , ...options , method : 'put' , data } )
536
524
}
537
525
538
526
public patch (
539
527
url : URL | string ,
540
528
data : RequestPayload = { } ,
541
- options : Exclude < VisitOptions , 'method' | 'data' > = { } ,
529
+ options : Omit < VisitOptions , 'method' | 'data' > = { } ,
542
530
) : void {
543
531
return this . visit ( url , { preserveState : true , ...options , method : 'patch' , data } )
544
532
}
545
533
546
- public delete ( url : URL | string , options : Exclude < VisitOptions , 'method' > = { } ) : void {
534
+ public delete ( url : URL | string , options : Omit < VisitOptions , 'method' > = { } ) : void {
547
535
return this . visit ( url , { preserveState : true , ...options , method : 'delete' } )
548
536
}
549
537
0 commit comments