Skip to content

Commit

Permalink
docs(Agent Configuration): Add typedoc notes
Browse files Browse the repository at this point in the history
  • Loading branch information
cblanc committed Jul 16, 2019
1 parent 7d367f7 commit 685e87d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<GotJSONOptions>;

// Converts a Got header object to one that can be used by the client
Expand Down
8 changes: 8 additions & 0 deletions lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,14 @@ interface Config extends Partial<CoreConfig> {
}

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 };
Expand Down

0 comments on commit 685e87d

Please sign in to comment.