UNPKG

@itwin/appui-abstract

Version:
30 lines 1.89 kB
/** @packageDocumentation * @module Item */ /** Class used to return a string value. The string value is refreshed by using the specified function. The syncEventIds define one or more * eventIds that would require the stringGetter function to be rerun. * @public */ export declare class ConditionalStringValue { readonly stringGetter: () => string; readonly syncEventIds: string[]; private _value?; /** * Constructor for ConditionalStringValue. It is important that the same ConditionalStringValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly. * @param stringGetter Function to run to retrieve the value for the conditional. This function is run when refresh method is called or if the value is not defined in the constructor. * @param syncEventIds An array of eventId that should be monitored to determine when to run the refresh method. * @param value The default value for the conditional value. If not specified then the function is run to set the value when the value is retrieved. */ constructor(stringGetter: () => string, syncEventIds: string[], value?: string); /** The current boolean value of the conditional. */ get value(): string; /** Called to update the value by running the stringGetter */ refresh(): boolean; /** helper function to process properties defined as type ConditionalStringValue | string | undefined * Return true if the value was updated. */ static refreshValue(conditionalValue: ConditionalStringValue | string | undefined, eventIds: Set<string>): boolean; /** helper function to get string from a ConditionalStringValue | string | undefined */ static getValue(conditionalValue: ConditionalStringValue | string | undefined): string | undefined; } //# sourceMappingURL=ConditionalStringValue.d.ts.map