Skip to content

Commit 3ede892

Browse files
authored
Fix typings for credentials provider chain (#3510)
`Credentials[]|providers[]` means either an array with `Credentials` or an array with `providers`. But in reality it's a array with both.
1 parent 12caed2 commit 3ede892

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"type": "bugfix",
3+
"category": "Types",
4+
"description": "Update types for credential provider chain"
5+
}

lib/credentials/credential_provider_chain.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ export class CredentialProviderChain {
88
/**
99
* Resolves the provider chain by searching for the first set of credentials in providers.
1010
*/
11-
resolve(callback:(err: AWSError, credentials: Credentials) => void): CredentialProviderChain;
11+
resolve(callback:(err: AWSError|null, credentials?: Credentials) => void): CredentialProviderChain;
1212
/**
1313
* Return a Promise on resolve() function
1414
*/
1515
resolvePromise(): Promise<Credentials>;
1616
/**
1717
* Returns a list of credentials objects or functions that return credentials objects. If the provider is a function, the function will be executed lazily when the provider needs to be checked for valid credentials. By default, this object will be set to the defaultProviders.
1818
*/
19-
providers: Credentials[]|provider[];
19+
providers: Array<Credentials|provider>;
2020

2121
static defaultProviders: provider[]
2222
}

0 commit comments

Comments
 (0)