Skip to content

Commit

Permalink
fix: export urllib types directly (#5128)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Jan 17, 2023
1 parent 65cbb9c commit 483bf1d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import {
HttpClientResponse as HttpClientResponseOld,
} from 'urllib';
import {
RequestURL,
RequestOptions as RequestOptionsNext,
HttpClientResponse as HttpClientResponseNext,
RequestURL as HttpClientRequestURL,
RequestOptions as HttpClientRequestOptions,
HttpClientResponse,
} from 'urllib-next';
import {
EggCoreBase,
Expand Down Expand Up @@ -60,10 +60,7 @@ declare module 'egg' {
// return await app.httpclient.request(url, options);
// }
// ```
export type HttpClientRequestURL = RequestURL;
export type HttpClientRequestOptions = RequestOptionsNext;
export type HttpClientResponse<T = any> = HttpClientResponseNext<T>;

export { HttpClientRequestURL, HttpClientRequestOptions, HttpClientResponse };
// Compatible with both urllib@2 and urllib@3 RequestOptions to request
export interface EggHttpClient extends EventEmitter {
request<T = any>(url: HttpClientRequestURL): Promise<HttpClientResponseOld<T> | HttpClientResponse<T>>;
Expand Down

0 comments on commit 483bf1d

Please sign in to comment.