1
1
import { invokeTauriCommand } from './helpers/tauri'
2
2
3
3
export interface ClientOptions {
4
- maxRedirections : boolean
4
+ maxRedirections : number
5
5
connectTimeout : number
6
6
}
7
7
@@ -115,7 +115,7 @@ export class Client {
115
115
*
116
116
* @return promise resolving to the response
117
117
*/
118
- async get < T > ( url : string , options : RequestOptions ) : Promise < Response < T > > {
118
+ async get < T > ( url : string , options ? : RequestOptions ) : Promise < Response < T > > {
119
119
return this . request ( {
120
120
method : 'GET' ,
121
121
url,
@@ -134,8 +134,8 @@ export class Client {
134
134
*/
135
135
async post < T > (
136
136
url : string ,
137
- body : Body ,
138
- options : RequestOptions
137
+ body ? : Body ,
138
+ options ? : RequestOptions
139
139
) : Promise < Response < T > > {
140
140
return this . request ( {
141
141
method : 'POST' ,
@@ -156,8 +156,8 @@ export class Client {
156
156
*/
157
157
async put < T > (
158
158
url : string ,
159
- body : Body ,
160
- options : RequestOptions
159
+ body ? : Body ,
160
+ options ? : RequestOptions
161
161
) : Promise < Response < T > > {
162
162
return this . request ( {
163
163
method : 'PUT' ,
@@ -175,7 +175,7 @@ export class Client {
175
175
*
176
176
* @return promise resolving to the response
177
177
*/
178
- async patch < T > ( url : string , options : RequestOptions ) : Promise < Response < T > > {
178
+ async patch < T > ( url : string , options ? : RequestOptions ) : Promise < Response < T > > {
179
179
return this . request ( {
180
180
method : 'PATCH' ,
181
181
url,
@@ -191,7 +191,7 @@ export class Client {
191
191
*
192
192
* @return promise resolving to the response
193
193
*/
194
- async delete < T > ( url : string , options : RequestOptions ) : Promise < Response < T > > {
194
+ async delete < T > ( url : string , options ? : RequestOptions ) : Promise < Response < T > > {
195
195
return this . request ( {
196
196
method : 'DELETE' ,
197
197
url,
0 commit comments