Skip to content

Commit c495284

Browse files
author
jarvisjiang
committed
update docs
1 parent e31c84b commit c495284

File tree

6 files changed

+22
-103
lines changed

6 files changed

+22
-103
lines changed

docs/functions/fetchT.md

Lines changed: 13 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
5555

5656
### Defined in
5757

58-
[fetch.ts:14](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L14)
58+
[fetch.ts:14](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L14)
5959

6060
## fetchT(url, init)
6161

@@ -92,7 +92,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
9292

9393
### Defined in
9494

95-
[fetch.ts:26](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L26)
95+
[fetch.ts:26](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L26)
9696

9797
## fetchT(url, init)
9898

@@ -129,7 +129,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
129129

130130
### Defined in
131131

132-
[fetch.ts:38](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L38)
132+
[fetch.ts:38](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L38)
133133

134134
## fetchT(url, init)
135135

@@ -172,7 +172,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
172172

173173
### Defined in
174174

175-
[fetch.ts:51](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L51)
175+
[fetch.ts:51](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L51)
176176

177177
## fetchT(url, init)
178178

@@ -209,7 +209,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
209209

210210
### Defined in
211211

212-
[fetch.ts:63](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L63)
212+
[fetch.ts:63](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L63)
213213

214214
## fetchT(url, init)
215215

@@ -246,7 +246,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
246246

247247
### Defined in
248248

249-
[fetch.ts:74](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L74)
249+
[fetch.ts:74](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L74)
250250

251251
## fetchT(url, init)
252252

@@ -283,7 +283,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
283283

284284
### Defined in
285285

286-
[fetch.ts:85](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L85)
286+
[fetch.ts:85](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L85)
287287

288288
## fetchT(url, init)
289289

@@ -326,7 +326,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
326326

327327
### Defined in
328328

329-
[fetch.ts:97](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L97)
329+
[fetch.ts:97](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L97)
330330

331331
## fetchT(url, init)
332332

@@ -363,12 +363,12 @@ Additional options for the fetch operation, including custom `FetchInit` propert
363363

364364
### Defined in
365365

366-
[fetch.ts:108](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L108)
366+
[fetch.ts:108](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L108)
367367

368-
## fetchT(url, init)
368+
## fetchT(url)
369369

370370
```ts
371-
function fetchT(url, init): FetchResponse<Response>
371+
function fetchT(url): FetchResponse<Response>
372372
```
373373

374374
Fetches a resource from the network and returns a `FetchResponse` representing the operation with a generic `Response`.
@@ -378,7 +378,6 @@ Fetches a resource from the network and returns a `FetchResponse` representing t
378378
| Parameter | Type | Description |
379379
| ------ | ------ | ------ |
380380
| `url` | `string` \| `URL` | The resource to fetch. Can be a URL object or a string representing a URL. |
381-
| `init` | [`FetchInit`](../interfaces/FetchInit.md) & \{ `abortable`: `false`; \} | Additional options for the fetch operation, indicating that the operation should not be abortable. |
382381

383382
### Returns
384383

@@ -400,59 +399,16 @@ Additional options for the fetch operation, including custom `FetchInit` propert
400399

401400
### Defined in
402401

403-
[fetch.ts:119](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L119)
402+
[fetch.ts:118](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L118)
404403

405404
## fetchT(url, init)
406405

407406
```ts
408407
function fetchT(url, init): FetchResponse<Response>
409408
```
410409

411-
Fetches a resource from the network and returns a `FetchResponse` representing the operation with a generic `Response`.
412-
413-
### Parameters
414-
415-
| Parameter | Type | Description |
416-
| ------ | ------ | ------ |
417-
| `url` | `string` \| `URL` | The resource to fetch. Can be a URL object or a string representing a URL. |
418-
| `init` | [`FetchInit`](../interfaces/FetchInit.md) & \{ `timeout`: `number`; \} | Additional options for the fetch operation, indicating that the operation should not be abortable. |
419-
420-
### Returns
421-
422-
[`FetchResponse`](../type-aliases/FetchResponse.md)\<`Response`\>
423-
424-
A `FetchTask` or `FetchResponse` depending on the provided options in `init`.
425-
426-
### Type Param
427-
428-
The expected type of the response data when not using a specific `responseType`.
429-
430-
### Param
431-
432-
The resource to fetch. Can be a URL object or a string representing a URL.
433-
434-
### Param
435-
436-
Additional options for the fetch operation, including custom `FetchInit` properties.
437-
438-
### Defined in
439-
440-
[fetch.ts:130](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L130)
441-
442-
## fetchT(url, init)
443-
444-
```ts
445-
function fetchT<T>(url, init): FetchTask<T> | FetchResponse<T>
446-
```
447-
448410
Fetches a resource from the network and returns a `FetchResponse` or `FetchTask` based on the provided options.
449411

450-
### Type Parameters
451-
452-
| Type Parameter | Description |
453-
| ------ | ------ |
454-
| `T` | The expected type of the response data when not using a specific `responseType`. |
455-
456412
### Parameters
457413

458414
| Parameter | Type | Description |
@@ -462,43 +418,6 @@ Fetches a resource from the network and returns a `FetchResponse` or `FetchTask`
462418

463419
### Returns
464420

465-
[`FetchTask`](../interfaces/FetchTask.md)\<`T`\> \| [`FetchResponse`](../type-aliases/FetchResponse.md)\<`T`\>
466-
467-
A `FetchTask` or `FetchResponse` depending on the provided options in `init`.
468-
469-
### Type Param
470-
471-
The expected type of the response data when not using a specific `responseType`.
472-
473-
### Param
474-
475-
The resource to fetch. Can be a URL object or a string representing a URL.
476-
477-
### Param
478-
479-
Additional options for the fetch operation, including custom `FetchInit` properties.
480-
481-
### Defined in
482-
483-
[fetch.ts:142](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L142)
484-
485-
## fetchT(url, init)
486-
487-
```ts
488-
function fetchT(url, init?): FetchResponse<Response>
489-
```
490-
491-
Fetches a resource from the network and returns a `FetchResponse` representing the operation.
492-
493-
### Parameters
494-
495-
| Parameter | Type | Description |
496-
| ------ | ------ | ------ |
497-
| `url` | `string` \| `URL` | The resource to fetch. Can be a URL object or a string representing a URL. |
498-
| `init`? | `RequestInit` | Standard `RequestInit` options for the fetch operation. |
499-
500-
### Returns
501-
502421
[`FetchResponse`](../type-aliases/FetchResponse.md)\<`Response`\>
503422

504423
A `FetchTask` or `FetchResponse` depending on the provided options in `init`.
@@ -517,4 +436,4 @@ Additional options for the fetch operation, including custom `FetchInit` propert
517436

518437
### Defined in
519438

520-
[fetch.ts:151](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/fetch.ts#L151)
439+
[fetch.ts:128](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/fetch.ts#L128)

docs/interfaces/FetchInit.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ Extends the standard `RequestInit` interface from the Fetch API to include addit
1616

1717
| Property | Type | Description | Defined in |
1818
| ------ | ------ | ------ | ------ |
19-
| `abortable?` | `boolean` | Indicates whether the fetch request should be abortable. | [defines.ts:42](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L42) |
20-
| `responseType?` | `"text"` \| `"arraybuffer"` \| `"blob"` \| `"json"` | Specifies the expected response type of the fetch request. | [defines.ts:47](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L47) |
21-
| `timeout?` | `number` | Specifies the maximum time in milliseconds to wait for the fetch request to complete. | [defines.ts:52](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L52) |
19+
| `abortable?` | `boolean` | Indicates whether the fetch request should be abortable. | [defines.ts:42](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L42) |
20+
| `responseType?` | `"text"` \| `"arraybuffer"` \| `"blob"` \| `"json"` | Specifies the expected response type of the fetch request. | [defines.ts:47](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L47) |
21+
| `timeout?` | `number` | Specifies the maximum time in milliseconds to wait for the fetch request to complete. | [defines.ts:52](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L52) |

docs/interfaces/FetchTask.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ Defines the structure and behavior of a fetch task, including the ability to abo
1818

1919
| Property | Type | Description | Defined in |
2020
| ------ | ------ | ------ | ------ |
21-
| `aborted` | `boolean` | Indicates whether the fetch task has been aborted. | [defines.ts:27](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L27) |
22-
| `response` | [`FetchResponse`](../type-aliases/FetchResponse.md)\<`T`\> | The response of the fetch task, represented as an `AsyncResult`. | [defines.ts:32](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L32) |
21+
| `aborted` | `boolean` | Indicates whether the fetch task has been aborted. | [defines.ts:27](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L27) |
22+
| `response` | [`FetchResponse`](../type-aliases/FetchResponse.md)\<`T`\> | The response of the fetch task, represented as an `AsyncResult`. | [defines.ts:32](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L32) |
2323

2424
## Methods
2525

@@ -43,4 +43,4 @@ Aborts the fetch task, optionally with a reason for the abortion.
4343
4444
#### Defined in
4545
46-
[defines.ts:22](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L22)
46+
[defines.ts:22](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L22)

docs/type-aliases/FetchResponse.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ Represents the response of a fetch operation, encapsulating the result data or a
2020

2121
## Defined in
2222

23-
[defines.ts:9](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L9)
23+
[defines.ts:9](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L9)

docs/variables/ABORT_ERROR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Name of abort error;
1414

1515
## Defined in
1616

17-
[defines.ts:58](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L58)
17+
[defines.ts:58](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L58)

docs/variables/TIMEOUT_ERROR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Name of timeout error;
1414

1515
## Defined in
1616

17-
[defines.ts:63](https://github.com/JiangJie/fetch-t/blob/c5e0121b76a0dea415931120c31c2d070cc2469d/src/fetch/defines.ts#L63)
17+
[defines.ts:63](https://github.com/JiangJie/fetch-t/blob/e31c84b39da301aedb3faeb020c606fa1a2c6bcb/src/fetch/defines.ts#L63)

0 commit comments

Comments
 (0)