Skip to content

Commit 377a596

Browse files
author
jarvisjiang
committed
update docs
1 parent 8806bee commit 377a596

File tree

9 files changed

+73
-20
lines changed

9 files changed

+73
-20
lines changed

docs/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44

55
# @happy-ts/fetch-t
66

7+
## Classes
8+
9+
| Class | Description |
10+
| ------ | ------ |
11+
| [FetchError](classes/FetchError.md) | Represents an error that occurred during a fetch operation when the response is not ok. |
12+
713
## Interfaces
814

915
| Interface | Description |

docs/classes/FetchError.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[**@happy-ts/fetch-t**](../README.md)**Docs**
2+
3+
***
4+
5+
[@happy-ts/fetch-t](../README.md) / FetchError
6+
7+
# Class: FetchError
8+
9+
Represents an error that occurred during a fetch operation when the response is not ok.
10+
11+
## Extends
12+
13+
- `Error`
14+
15+
## Constructors
16+
17+
### new FetchError()
18+
19+
```ts
20+
new FetchError(message, status): FetchError
21+
```
22+
23+
#### Parameters
24+
25+
| Parameter | Type |
26+
| ------ | ------ |
27+
| `message` | `string` |
28+
| `status` | `number` |
29+
30+
#### Returns
31+
32+
[`FetchError`](FetchError.md)
33+
34+
#### Overrides
35+
36+
`Error.constructor`
37+
38+
#### Defined in
39+
40+
[defines.ts:73](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L73)
41+
42+
## Properties
43+
44+
| Property | Type | Default value | Description | Overrides | Defined in |
45+
| ------ | ------ | ------ | ------ | ------ | ------ |
46+
| `name` | `string` | `'FetchError'` | The name of the error. | `Error.name` | [defines.ts:67](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L67) |
47+
| `status` | `number` | `0` | The status code of the response. | - | [defines.ts:71](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L71) |

docs/functions/fetchT.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ Additional options for the fetch operation, including custom `FetchInit` propert
5757

5858
### Defined in
5959

60-
[fetch.ts:14](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L14)
60+
[fetch.ts:14](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L14)
6161

6262
## fetchT(url, init)
6363

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

9797
### Defined in
9898

99-
[fetch.ts:26](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L26)
99+
[fetch.ts:26](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L26)
100100

101101
## fetchT(url, init)
102102

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

136136
### Defined in
137137

138-
[fetch.ts:38](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L38)
138+
[fetch.ts:38](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L38)
139139

140140
## fetchT(url, init)
141141

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

181181
### Defined in
182182

183-
[fetch.ts:51](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L51)
183+
[fetch.ts:51](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L51)
184184

185185
## fetchT(url, init)
186186

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

220220
### Defined in
221221

222-
[fetch.ts:63](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L63)
222+
[fetch.ts:63](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L63)
223223

224224
## fetchT(url, init)
225225

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

259259
### Defined in
260260

261-
[fetch.ts:74](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L74)
261+
[fetch.ts:74](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L74)
262262

263263
## fetchT(url, init)
264264

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

298298
### Defined in
299299

300-
[fetch.ts:85](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L85)
300+
[fetch.ts:85](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L85)
301301

302302
## fetchT(url, init)
303303

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

343343
### Defined in
344344

345-
[fetch.ts:97](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L97)
345+
[fetch.ts:97](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L97)
346346

347347
## fetchT(url, init)
348348

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

382382
### Defined in
383383

384-
[fetch.ts:108](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L108)
384+
[fetch.ts:108](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L108)
385385

386386
## fetchT(url, init)
387387

@@ -420,4 +420,4 @@ Additional options for the fetch operation, including custom `FetchInit` propert
420420

421421
### Defined in
422422

423-
[fetch.ts:120](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/fetch.ts#L120)
423+
[fetch.ts:120](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/fetch.ts#L120)

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:47](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L47) |
20-
| `responseType?` | [`FetchResponseType`](../type-aliases/FetchResponseType.md) | Specifies the expected response type of the fetch request. | [defines.ts:52](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L52) |
21-
| `timeout?` | `number` | Specifies the maximum time in milliseconds to wait for the fetch request to complete. | [defines.ts:57](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L57) |
19+
| `abortable?` | `boolean` | Indicates whether the fetch request should be abortable. | [defines.ts:47](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L47) |
20+
| `responseType?` | [`FetchResponseType`](../type-aliases/FetchResponseType.md) | Specifies the expected response type of the fetch request. | [defines.ts:52](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L52) |
21+
| `timeout?` | `number` | Specifies the maximum time in milliseconds to wait for the fetch request to complete. | [defines.ts:57](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L57) |

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 | Modifier | Type | Description | Defined in |
2020
| ------ | ------ | ------ | ------ | ------ |
21-
| `aborted` | `readonly` | `boolean` | Indicates whether the fetch task has been aborted. | [defines.ts:27](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L27) |
22-
| `response` | `readonly` | [`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/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L32) |
21+
| `aborted` | `readonly` | `boolean` | Indicates whether the fetch task has been aborted. | [defines.ts:27](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L27) |
22+
| `response` | `readonly` | [`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/8806bee244ff033abe18991d72f4e6f862cf2c99/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/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L22)
46+
[defines.ts:22](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/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/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L9)
23+
[defines.ts:9](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L9)

docs/type-aliases/FetchResponseType.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ Specifies the expected response type of the fetch request.
1414

1515
## Defined in
1616

17-
[defines.ts:38](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/defines.ts#L38)
17+
[defines.ts:38](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/defines.ts#L38)

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-
[constants.ts:4](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/constants.ts#L4)
17+
[constants.ts:4](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/constants.ts#L4)

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-
[constants.ts:9](https://github.com/JiangJie/fetch-t/blob/6db6e6bc264d2c2e0afd8a65220e2640b742b88b/src/fetch/constants.ts#L9)
17+
[constants.ts:9](https://github.com/JiangJie/fetch-t/blob/8806bee244ff033abe18991d72f4e6f862cf2c99/src/fetch/constants.ts#L9)

0 commit comments

Comments
 (0)