@@ -98,18 +98,18 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
9898 #sentinels: Map < WatchedSetting , SettingWatcher > = new Map ( ) ;
9999 #watchAll: boolean = false ;
100100 #kvRefreshInterval: number = DEFAULT_REFRESH_INTERVAL_IN_MS ;
101- #kvRefreshTimer: RefreshTimer ;
101+ #kvRefreshTimer: RefreshTimer | undefined = undefined ;
102102
103103 // Feature flags
104104 #featureFlagEnabled: boolean = false ;
105105 #featureFlagRefreshEnabled: boolean = false ;
106106 #ffRefreshInterval: number = DEFAULT_REFRESH_INTERVAL_IN_MS ;
107- #ffRefreshTimer: RefreshTimer ;
107+ #ffRefreshTimer: RefreshTimer | undefined = undefined ;
108108
109109 // Key Vault references
110110 #secretRefreshEnabled: boolean = false ;
111111 #secretReferences: ConfigurationSetting [ ] = [ ] ; // cached key vault references
112- #secretRefreshTimer: RefreshTimer ;
112+ #secretRefreshTimer: RefreshTimer | undefined = undefined ;
113113 #resolveSecretsInParallel: boolean = false ;
114114
115115 /**
@@ -126,7 +126,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
126126
127127 constructor (
128128 clientManager : ConfigurationClientManager ,
129- options : AzureAppConfigurationOptions | undefined ,
129+ options ? : AzureAppConfigurationOptions ,
130130 ) {
131131 this . #options = options ;
132132 this . #clientManager = clientManager ;
@@ -415,7 +415,8 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
415415 postAttempts += 1 ;
416416 backoffDuration = getExponentialBackoffDuration ( postAttempts ) ;
417417 }
418- console . warn ( `Failed to load. Error message: ${ error . message } . Retrying in ${ backoffDuration } ms.` ) ;
418+ const errorMessage = error instanceof Error ? error . message : String ( error ) ;
419+ console . warn ( `Failed to load. Error message: ${ errorMessage } . Retrying in ${ backoffDuration } ms.` ) ;
419420 await new Promise ( resolve => setTimeout ( resolve , backoffDuration ) ) ;
420421 }
421422 } while ( ! abortSignal . aborted ) ;
@@ -690,7 +691,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
690691 */
691692 async #refreshFeatureFlags( ) : Promise < boolean > {
692693 // if still within refresh interval/backoff, return
693- if ( this . #ffRefreshInterval === undefined || ! this . #ffRefreshTimer. canRefresh ( ) ) {
694+ if ( this . #ffRefreshInterval === undefined || ! this . #ffRefreshTimer! . canRefresh ( ) ) {
694695 return Promise . resolve ( false ) ;
695696 }
696697
@@ -699,7 +700,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
699700 await this . #loadFeatureFlags( ) ;
700701 }
701702
702- this . #ffRefreshTimer. reset ( ) ;
703+ this . #ffRefreshTimer! . reset ( ) ;
703704 return Promise . resolve ( needRefresh ) ;
704705 }
705706
@@ -728,7 +729,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
728729 * @returns true if key-value collection has changed, false otherwise.
729730 */
730731 async #checkConfigurationSettingsChange( selectors : PagedSettingsWatcher [ ] ) : Promise < boolean > {
731- const funcToExecute = async ( client ) => {
732+ const funcToExecute = async ( client : AppConfigurationClient ) => {
732733 for ( const selector of selectors ) {
733734 if ( selector . snapshotName ) { // skip snapshot selector
734735 continue ;
@@ -765,7 +766,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
765766 * Gets a configuration setting by key and label.If the setting is not found, return undefine instead of throwing an error.
766767 */
767768 async #getConfigurationSetting( configurationSettingId : ConfigurationSettingId , getOptions ?: GetConfigurationSettingOptions ) : Promise < GetConfigurationSettingResponse | undefined > {
768- const funcToExecute = async ( client ) => {
769+ const funcToExecute = async ( client : AppConfigurationClient ) => {
769770 return getConfigurationSettingWithTrace (
770771 this . #requestTraceOptions,
771772 client ,
@@ -788,7 +789,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
788789 }
789790
790791 async #listConfigurationSettings( listOptions : ListConfigurationSettingsOptions ) : Promise < { items : ConfigurationSetting [ ] ; pageWatchers : SettingWatcher [ ] } > {
791- const funcToExecute = async ( client ) => {
792+ const funcToExecute = async ( client : AppConfigurationClient ) => {
792793 const pageWatchers : SettingWatcher [ ] = [ ] ;
793794 const pageIterator = listConfigurationSettingsWithTrace (
794795 this . #requestTraceOptions,
@@ -808,7 +809,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
808809 }
809810
810811 async #getSnapshot( snapshotName : string , getOptions ?: GetSnapshotOptions ) : Promise < GetSnapshotResponse | undefined > {
811- const funcToExecute = async ( client ) => {
812+ const funcToExecute = async ( client : AppConfigurationClient ) => {
812813 return getSnapshotWithTrace (
813814 this . #requestTraceOptions,
814815 client ,
@@ -831,7 +832,7 @@ export class AzureAppConfigurationImpl implements AzureAppConfiguration {
831832 }
832833
833834 async #listConfigurationSettingsForSnapshot( snapshotName : string , listOptions ?: ListConfigurationSettingsForSnapshotOptions ) : Promise < ConfigurationSetting [ ] > {
834- const funcToExecute = async ( client ) => {
835+ const funcToExecute = async ( client : AppConfigurationClient ) => {
835836 const pageIterator = listConfigurationSettingsForSnapshotWithTrace (
836837 this . #requestTraceOptions,
837838 client ,
0 commit comments