@itwin/core-react
Version:
A react component library of iTwin.js UI general purpose components
27 lines • 1.58 kB
TypeScript
/** @packageDocumentation
* @module Utilities
*/
import * as React from "react";
import { ConditionalStringValue } from "@itwin/appui-abstract";
import type { IconSpec } from "../icons/IconComponent.js";
import { ConditionalIconItem } from "../icons/ConditionalIconItem.js";
/** Icon Helper Class used to store the data needed to generate an <Icon> for use in any control that shows an icon.
* @public
* @deprecated in 4.15.0. Used internally.
*/
export declare class IconHelper {
static get reactIconKey(): string;
static get conditionalIconItemKey(): string;
/** Returns an <Icon> ReactNode from the many ways an icon can be specified.
* @param icon abstract icon specification.
* @param internalData a map that may hold a React.ReactNode stored in an abstract item definition.
*/
static getIconReactNode(icon: string | ConditionalStringValue | React.ReactNode | ConditionalIconItem, internalData?: Map<string, any>): React.ReactNode;
/** Returns an icon definition that can be stored in an abstract item definition. If the iconSpec specifies a ReactNode
* then the react data is stored in the internalData map and the key to the react data is returned.
* @param iconSpec any supported variations of how an icon can be defined in an abstract item or IconProps.
* @param internalData a map supplied by the caller to store away react element if React.ReactNode
*/
static getIconData(iconSpec: IconSpec, internalData?: Map<string, any>): string | ConditionalStringValue;
}
//# sourceMappingURL=IconHelper.d.ts.map