Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/client/src/client.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ declare class Client {
/**
* Set default request
*/
setDefaultRequest<K extends keyof ClientRequest>(key: K | ClientRequest, value ?: ClientRequest[K]): this;
setDefaultRequest<K extends keyof ClientRequest>(key: K | Partial<ClientRequest>, value ?: ClientRequest[K]): this;

/**
* Create headers for request
Expand Down
11 changes: 8 additions & 3 deletions test/typescript/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,14 @@ Client.setDefaultHeader({
}).setDefaultHeader("X-Testing", "yes");

// Test setDefaultRequest() method
Client.setDefaultRequest({
url: "/test",
}).setDefaultRequest("method", "POST")
Client
.setDefaultRequest({
url: "/test",
})
.setDefaultRequest({
httpsAgent: new https.Agent(),
})
.setDefaultRequest("method", "POST")
.setDefaultRequest('httpsAgent', new https.Agent())

// Test createHeaders() method
Expand Down