@ahoo-wang/fetcher 0.8.6 → 0.8.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fetchRequest.d.ts +31 -5
- package/dist/fetchRequest.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/fetchRequest.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { TimeoutCapable } from './timeout';
|
|
2
2
|
import { UrlParams } from './urlBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Interface for objects that can have a base URL
|
|
5
|
+
*
|
|
6
|
+
* This interface defines a baseURL property that can be used to set a base URL
|
|
7
|
+
* for HTTP requests. When the baseURL is empty, it means no base URL is set.
|
|
8
|
+
*/
|
|
3
9
|
export interface BaseURLCapable {
|
|
4
10
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
11
|
+
* The base URL for requests
|
|
12
|
+
* When empty, indicates no base URL is set. Default is undefined.
|
|
7
13
|
*/
|
|
8
14
|
baseURL: string;
|
|
9
15
|
}
|
|
10
16
|
/**
|
|
11
|
-
* HTTP
|
|
17
|
+
* HTTP method enumeration constants
|
|
18
|
+
*
|
|
19
|
+
* Defines the standard HTTP methods that can be used for requests.
|
|
20
|
+
* Each method is represented as a string literal type.
|
|
12
21
|
*/
|
|
13
22
|
export declare enum HttpMethod {
|
|
14
23
|
GET = "GET",
|
|
@@ -24,12 +33,23 @@ export declare enum ContentTypeValues {
|
|
|
24
33
|
APPLICATION_JSON = "application/json",
|
|
25
34
|
TEXT_EVENT_STREAM = "text/event-stream"
|
|
26
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Request headers interface
|
|
38
|
+
*
|
|
39
|
+
* Defines common HTTP headers that can be sent with requests.
|
|
40
|
+
* Allows for additional custom headers through index signature.
|
|
41
|
+
*/
|
|
27
42
|
export interface RequestHeaders {
|
|
28
43
|
'Content-Type'?: string;
|
|
29
|
-
|
|
30
|
-
|
|
44
|
+
Accept?: string;
|
|
45
|
+
Authorization?: string;
|
|
31
46
|
[key: string]: string | undefined;
|
|
32
47
|
}
|
|
48
|
+
/**
|
|
49
|
+
* Interface for objects that can have request headers
|
|
50
|
+
*
|
|
51
|
+
* This interface defines an optional headers property for HTTP requests.
|
|
52
|
+
*/
|
|
33
53
|
export interface RequestHeadersCapable {
|
|
34
54
|
/**
|
|
35
55
|
* Request headers
|
|
@@ -86,6 +106,12 @@ export interface FetchRequestInit extends TimeoutCapable, RequestHeadersCapable,
|
|
|
86
106
|
*/
|
|
87
107
|
body?: BodyInit | Record<string, any> | string | null;
|
|
88
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Fetcher request interface
|
|
111
|
+
*
|
|
112
|
+
* Extends FetchRequestInit with a required URL property.
|
|
113
|
+
* Represents a complete request configuration ready to be executed.
|
|
114
|
+
*/
|
|
89
115
|
export interface FetchRequest extends FetchRequestInit {
|
|
90
116
|
/**
|
|
91
117
|
* The URL for this request
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetchRequest.d.ts","sourceRoot":"","sources":["../src/fetchRequest.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED
|
|
1
|
+
{"version":3,"file":"fetchRequest.d.ts","sourceRoot":"","sources":["../src/fetchRequest.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;GAKG;AACH,oBAAY,UAAU;IACpB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAA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