UNPKG

@itwin/appui-abstract

Version:
28 lines 1.82 kB
/** @packageDocumentation * @module Item */ /** Class used to return a boolean value. The boolean value is refreshed by using the specified function. The syncEventIds define one or more * eventIds that would require the testFunc to be rerun. * @public */ export declare class ConditionalBooleanValue { readonly testFunc: () => boolean; readonly syncEventIds: string[]; private _value?; /** * Constructor for ConditionalBooleanValue. It is important that the same ConditionalBooleanValue instance is not used by multiple UI item definitions in order that the control's state is always rendered correctly. * @param testFunc 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(testFunc: () => boolean, syncEventIds: string[], value?: boolean); /** The current boolean value of the conditional. */ get value(): boolean; /** Called to update the value by running the testFunc */ refresh(): boolean; /** helper function to process properties defined as type ConditionalBooleanValue | boolean | undefined */ static refreshValue(conditionalValue: ConditionalBooleanValue | boolean | undefined, eventIds: Set<string>): boolean; /** helper function to get boolean from a ConditionalBooleanValue | boolean | undefined */ static getValue(conditionalValue: ConditionalBooleanValue | boolean | undefined): boolean; } //# sourceMappingURL=ConditionalBooleanValue.d.ts.map