egg 3.30.0 → 3.30.1
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/index.d.ts +6 -4
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -19,9 +19,9 @@ import {
|
|
|
19
19
|
HttpClientResponse as HttpClientResponseOld,
|
|
20
20
|
} from 'urllib';
|
|
21
21
|
import {
|
|
22
|
-
RequestURL
|
|
23
|
-
RequestOptions
|
|
24
|
-
HttpClientResponse,
|
|
22
|
+
RequestURL,
|
|
23
|
+
RequestOptions,
|
|
24
|
+
HttpClientResponse as HttpClientResponseNext,
|
|
25
25
|
} from 'urllib-next';
|
|
26
26
|
import {
|
|
27
27
|
EggCoreBase,
|
|
@@ -60,7 +60,9 @@ declare module 'egg' {
|
|
|
60
60
|
// return await app.httpclient.request(url, options);
|
|
61
61
|
// }
|
|
62
62
|
// ```
|
|
63
|
-
export
|
|
63
|
+
export type HttpClientRequestURL = RequestURL;
|
|
64
|
+
export type HttpClientRequestOptions = RequestOptions;
|
|
65
|
+
export type HttpClientResponse<T = any> = HttpClientResponseNext<T>;
|
|
64
66
|
// Compatible with both urllib@2 and urllib@3 RequestOptions to request
|
|
65
67
|
export interface EggHttpClient extends EventEmitter {
|
|
66
68
|
request<T = any>(url: HttpClientRequestURL): Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
|