packageDocumentation module public export class ConditionalStringValue { private _value ? : string ; param stringGetter param syncEventIds param value constructor ( public readonly stringGetter , public readonly syncEventIds , value ? ) { this . _value = value ; } /** The current boolean value of the conditional. */ public get value ( ) : string { if ( undefined !== this . _value ) return this . _value ; this . _value = this . stringGetter ( ) ; return this . _value ; } /** Called to update the value by running the stringGetter */ public refresh ( ) { const newValue = this . stringGetter ( ) ; if ( newValue !== this . _value ) { this . _value = newValue ; return true ; } return false ; } /** helper function to process properties defined as type ConditionalStringValue | string | undefined
     * Return true if the value was updated.
     */ public static refreshValue ( conditionalValue , eventIds ) { if ( undefined === conditionalValue || ! ( conditionalValue instanceof ConditionalStringValue ) ) return false ; if ( conditionalValue . syncEventIds . some ( ( value ) : boolean => eventIds . has ( value . toLowerCase ( ) ) ) ) return conditionalValue . refresh ( ) ; return false ; } /** helper function to get string from a ConditionalStringValue | string | undefined */ public static getValue ( conditionalValue ) { if ( undefined === conditionalValue ) return undefined ; if ( conditionalValue instanceof ConditionalStringValue ) return conditionalValue . value ; return conditionalValue ; } }