@@ -72,7 +72,7 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
7272 this . isFailoverable = ( options ?. replicaDiscoveryEnabled ?? true ) && isFailoverableEnv ( ) ;
7373 }
7474
75- async getClients ( ) {
75+ async getClients ( ) : Promise < ConfigurationClientWrapper [ ] > {
7676 if ( ! this . isFailoverable ) {
7777 return this . #staticClients;
7878 }
@@ -163,10 +163,8 @@ export class ConfigurationClientManager implements IConfigurationClientManager {
163163
164164/**
165165 * 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.
168166 */
169- async function querySrvTargetHost ( host ) {
167+ async function querySrvTargetHost ( host : string ) : Promise < string [ ] > {
170168 const results : string [ ] = [ ] ;
171169 let dns ;
172170
@@ -227,13 +225,8 @@ async function querySrvTargetHost(host) {
227225
228226/**
229227 * 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.
235228 */
236- function parseConnectionString ( connectionString , token ) {
229+ function parseConnectionString ( connectionString , token : string ) : string {
237230 if ( ! connectionString ) {
238231 throw new Error ( "connectionString is empty" ) ;
239232 }
@@ -257,13 +250,8 @@ function parseConnectionString(connectionString, token) {
257250/**
258251 * Builds a connection string from the given endpoint, secret, and id.
259252 * 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.
265253 */
266- function buildConnectionString ( endpoint , secret , id ) {
254+ function buildConnectionString ( endpoint , secret , id : string ) : string {
267255 if ( ! secret || ! id ) {
268256 return "" ;
269257 }
@@ -273,11 +261,8 @@ function buildConnectionString(endpoint, secret, id) {
273261
274262/**
275263 * 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.
279264 */
280- export function getValidDomain ( endpoint ) {
265+ export function getValidDomain ( endpoint : string ) : string {
281266 try {
282267 const url = new URL ( endpoint ) ;
283268 const trustedDomainLabels = [ AzConfigDomainLabel , AppConfigDomainLabel ] ;
@@ -298,12 +283,8 @@ export function getValidDomain(endpoint) {
298283
299284/**
300285 * 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.
305286 */
306- export function isValidEndpoint ( host , validDomain ) {
287+ export function isValidEndpoint ( host : string , validDomain : string ) : boolean {
307288 if ( ! validDomain ) {
308289 return false ;
309290 }
0 commit comments