Skip to content

Commit 33f033e

Browse files
authored
add TSdoc for public API and types (#32)
1 parent 8d4187d commit 33f033e

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

src/AzureAppConfigurationOptions.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,21 @@ export interface AzureAppConfigurationOptions {
2828
* Backslash `\` character is reserved and must be escaped using another backslash `\`.
2929
*/
3030
selectors?: { keyFilter: string, labelFilter?: string }[];
31+
32+
/**
33+
* Specifies prefixes to be trimmed from the keys of all key-values retrieved from Azure App Configuration.
34+
* This is useful when you want to remove a common prefix from all keys to avoid repetition.
35+
* The provided prefixes will be sorted in descending order and the longest matching prefix will be trimmed first.
36+
*/
3137
trimKeyPrefixes?: string[];
38+
39+
/**
40+
* Specifies custom options to be used when creating the AppConfigurationClient.
41+
*/
3242
clientOptions?: AppConfigurationClientOptions;
43+
44+
/**
45+
* Specifies options used to resolve Vey Vault references.
46+
*/
3347
keyVaultOptions?: AzureAppConfigurationKeyVaultOptions;
3448
}

src/keyvault/AzureAppConfigurationKeyVaultOptions.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,24 @@
44
import { TokenCredential } from "@azure/identity";
55
import { SecretClient } from "@azure/keyvault-secrets";
66

7+
/**
8+
* Options used to resolve Key Vault references.
9+
*/
710
export interface AzureAppConfigurationKeyVaultOptions {
11+
/**
12+
* Specifies the Key Vault secret client used for resolving Key Vault references.
13+
*/
814
secretClients?: SecretClient[];
15+
16+
/**
17+
* Specifies the credentials used to authenticate to key vaults that have no applied SecretClient.
18+
*/
919
credential?: TokenCredential;
20+
21+
/**
22+
* Specifies the callback used to resolve key vault references that have no applied SecretClient.
23+
* @param keyVaultReference The Key Vault reference to resolve.
24+
* @returns The secret value.
25+
*/
1026
secretResolver?: (keyVaultReference: URL) => string | Promise<string>;
1127
}

src/load.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,18 @@ import { AzureAppConfigurationImpl } from "./AzureAppConfigurationImpl";
88
import { AzureAppConfigurationOptions, MaxRetries, MaxRetryDelayInMs } from "./AzureAppConfigurationOptions";
99
import * as RequestTracing from "./requestTracing/constants";
1010

11+
/**
12+
* Loads the data from Azure App Configuration service and returns an instance of AzureAppConfiguration.
13+
* @param connectionString The connection string for the App Configuration store.
14+
* @param options Optional parameters.
15+
*/
1116
export async function load(connectionString: string, options?: AzureAppConfigurationOptions): Promise<AzureAppConfiguration>;
17+
/**
18+
* Loads the data from Azure App Configuration service and returns an instance of AzureAppConfiguration.
19+
* @param endpoint The URL to the App Configuration store.
20+
* @param credential The credential to use to connect to the App Configuration store.
21+
* @param options Optional parameters.
22+
*/
1223
export async function load(endpoint: URL | string, credential: TokenCredential, options?: AzureAppConfigurationOptions): Promise<AzureAppConfiguration>;
1324
export async function load(
1425
connectionStringOrEndpoint: string | URL,

0 commit comments

Comments
 (0)