@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
28 lines • 1.63 kB
TypeScript
/** @packageDocumentation
* @module Icon
*/
import type { IconSpec } from "./IconComponent.js";
/** Class used to return an icon. The icon is variable and can be changed in response to subscribed event ids.
* @public
* @deprecated in 4.16.0. Uses a deprecated {@link IconSpec} type. Use conditional rendering to render different icons.
*/
export declare class ConditionalIconItem {
readonly iconGetter: () => IconSpec;
readonly syncEventIds: string[];
private _value?;
/** Constructor for ConditionalIconItem
* @param iconGetter Function to retrieve the icon that matches the condition. Returns an IconSpec.
* @param syncEventIds The array of event ids to be monitored. These events are triggered when the condition(s) that control the icon change.
* @param value The default IconSpec. If this is not specified, the function is run to get the initial value.
*/
constructor(iconGetter: () => IconSpec, syncEventIds: string[], value?: IconSpec);
/** The current IconSpec according to conditions */
get value(): IconSpec;
/** Called to update the value by running the iconGetter */
refresh(): boolean;
/** A helper function that updates the IconSpec value when the specified events are triggered */
static refreshValue(conditionalValue: ConditionalIconItem | string | undefined, eventIds: Set<string>): boolean;
/** helper function to get the iconSpec from a ConditionIconItem as IconSpec | undefined*/
static getValue(conditionalValue: ConditionalIconItem | string | undefined): IconSpec | undefined;
}
//# sourceMappingURL=ConditionalIconItem.d.ts.map