From 685e87dfb767d5c830b51a5743efb2c8a6ec6345 Mon Sep 17 00:00:00 2001 From: Christopher Blanchard Date: Tue, 16 Jul 2019 15:33:39 +0200 Subject: [PATCH] docs(Agent Configuration): Add typedoc notes --- lib/agent.ts | 6 ++++++ lib/client.ts | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/agent.ts b/lib/agent.ts index 2a4180a9..7bfc6aef 100644 --- a/lib/agent.ts +++ b/lib/agent.ts @@ -15,6 +15,12 @@ interface StringMap { [key: string]: string; } +/** + * GotConfig + * + * An optional configuration object which is passed to the underlying got http + * client + */ export type GotConfig = Partial; // Converts a Got header object to one that can be used by the client diff --git a/lib/client.ts b/lib/client.ts index a607e214..90dfe629 100644 --- a/lib/client.ts +++ b/lib/client.ts @@ -16,6 +16,14 @@ interface Config extends Partial { } export class Client extends CoreInterface { + /** + * Client constructor extends CoreInterface by also accepting an optional got + * configuration object as the second argument. + * + * got is the underlying HTTP client that powers core-node. Be careful when + * configuring gotConfig so as not to manually override critical request + * attributes like method, query, header, etc. + */ constructor(config: Config, gotConfig: GotConfig = {}) { const agent = new Agent(gotConfig); const header = { "User-Agent": userAgent };