From bfcbf9d42e3e94ea56ca3d6a6de08934b0860510 Mon Sep 17 00:00:00 2001 From: pzh Date: Fri, 7 Jun 2024 15:26:13 +0800 Subject: [PATCH] fix(type): The parameter types for the 'get', 'post', and 'put' methods of the httpClient are incorrect. --- index.d.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/index.d.ts b/index.d.ts index 908edfd..ee2bcfc 100644 --- a/index.d.ts +++ b/index.d.ts @@ -643,17 +643,17 @@ export declare namespace httpc { middlewares?: middleware.Middleware[]; } - interface GetOptions extends ReqOpts { + interface GetOptions extends Omit, 'urllibOptions'> { params: Record; headers: Record; } - interface PostOptions extends ReqOpts { + interface PostOptions extends Omit, 'urllibOptions'> { data: string | Buffer | Readable; headers: Record; } - interface PutOptions extends ReqOpts { + interface PutOptions extends Omit, 'urllibOptions'> { data: string | Buffer | Readable; headers: Record } @@ -664,9 +664,9 @@ export declare namespace httpc { middlewares: middleware.Middleware[]; constructor(options: HttpClientOptions) sendRequest(requestOptions: ReqOpts): Promise - get(getOptions: GetOptions): Promise - post(postOptions: PostOptions): Promise - put(putOptions: PutOptions): Promise + get(getOptions: GetOptions, urllibOptions?: RequestOptions): Promise + post(postOptions: PostOptions, urllibOptions?: RequestOptions): Promise + put(putOptions: PutOptions, urllibOptions?: RequestOptions): Promise } // endpoint.js