Skip to content

Commit 685e87d

Browse files
committed
docs(Agent Configuration): Add typedoc notes
1 parent 7d367f7 commit 685e87d

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

lib/agent.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ interface StringMap {
1515
[key: string]: string;
1616
}
1717

18+
/**
19+
* GotConfig
20+
*
21+
* An optional configuration object which is passed to the underlying got http
22+
* client
23+
*/
1824
export type GotConfig = Partial<GotJSONOptions>;
1925

2026
// Converts a Got header object to one that can be used by the client

lib/client.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ interface Config extends Partial<CoreConfig> {
1616
}
1717

1818
export class Client extends CoreInterface {
19+
/**
20+
* Client constructor extends CoreInterface by also accepting an optional got
21+
* configuration object as the second argument.
22+
*
23+
* got is the underlying HTTP client that powers core-node. Be careful when
24+
* configuring gotConfig so as not to manually override critical request
25+
* attributes like method, query, header, etc.
26+
*/
1927
constructor(config: Config, gotConfig: GotConfig = {}) {
2028
const agent = new Agent(gotConfig);
2129
const header = { "User-Agent": userAgent };

0 commit comments

Comments
 (0)