@@ -72,7 +72,7 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
72
72
this . isFailoverable = ( options ?. replicaDiscoveryEnabled ?? true ) && isFailoverableEnv ( ) ;
73
73
}
74
74
75
- async getClients ( ) {
75
+ async getClients ( ) : Promise < ConfigurationClientWrapper [ ] > {
76
76
if ( ! this . isFailoverable ) {
77
77
return this . #staticClients;
78
78
}
@@ -163,10 +163,8 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
163
163
164
164
/**
165
165
* Query SRV records and return target hosts.
166
- * @param {string } host - The host to query.
167
- * @returns {Promise<string[]> } - A promise that resolves to an array of target hosts.
168
166
*/
169
- async function querySrvTargetHost ( host ) {
167
+ async function querySrvTargetHost ( host : string ) : Promise < string [ ] > {
170
168
const results : string [ ] = [ ] ;
171
169
let dns ;
172
170
@@ -227,13 +225,8 @@ async function querySrvTargetHost(host) {
227
225
228
226
/**
229
227
* Parses the connection string to extract the value associated with a specific token.
230
- *
231
- * @param {string } connectionString - The connection string containing tokens.
232
- * @param {string } token - The token whose value needs to be extracted.
233
- * @returns {string } The value associated with the token, or an empty string if not found.
234
- * @throws {Error } If the connection string is empty or the token is not found.
235
228
*/
236
- function parseConnectionString ( connectionString , token ) {
229
+ function parseConnectionString ( connectionString , token : string ) : string {
237
230
if ( ! connectionString ) {
238
231
throw new Error ( "connectionString is empty" ) ;
239
232
}
@@ -257,13 +250,8 @@ function parseConnectionString(connectionString, token) {
257
250
/**
258
251
* Builds a connection string from the given endpoint, secret, and id.
259
252
* Returns an empty string if either secret or id is empty.
260
- *
261
- * @param {string } endpoint - The endpoint to include in the connection string.
262
- * @param {string } secret - The secret to include in the connection string.
263
- * @param {string } id - The ID to include in the connection string.
264
- * @returns {string } - The formatted connection string or an empty string if invalid input.
265
253
*/
266
- function buildConnectionString ( endpoint , secret , id ) {
254
+ function buildConnectionString ( endpoint , secret , id : string ) : string {
267
255
if ( ! secret || ! id ) {
268
256
return "" ;
269
257
}
@@ -273,11 +261,8 @@ function buildConnectionString(endpoint, secret, id) {
273
261
274
262
/**
275
263
* Extracts a valid domain from the given endpoint URL based on trusted domain labels.
276
- *
277
- * @param {string } endpoint - The endpoint URL.
278
- * @returns {string } - The valid domain or an empty string if no valid domain is found.
279
264
*/
280
- export function getValidDomain ( endpoint ) {
265
+ export function getValidDomain ( endpoint : string ) : string {
281
266
try {
282
267
const url = new URL ( endpoint ) ;
283
268
const trustedDomainLabels = [ AzConfigDomainLabel , AppConfigDomainLabel ] ;
@@ -298,12 +283,8 @@ export function getValidDomain(endpoint) {
298
283
299
284
/**
300
285
* Checks if the given host ends with the valid domain.
301
- *
302
- * @param {string } host - The host to be validated.
303
- * @param {string } validDomain - The valid domain to check against.
304
- * @returns {boolean } - True if the host ends with the valid domain, false otherwise.
305
286
*/
306
- export function isValidEndpoint ( host , validDomain ) {
287
+ export function isValidEndpoint ( host : string , validDomain : string ) : boolean {
307
288
if ( ! validDomain ) {
308
289
return false ;
309
290
}
0 commit comments