@blueprintjs/icons
Version:
Components, fonts, icons, and css files for creating and displaying icons.
29 lines (28 loc) • 1.24 kB
TypeScript
import * as React from "react";
import type { IconName } from "./iconNames";
import type { SVGIconProps } from "./svgIconProps";
export type SVGIconContainerProps<T extends Element> = Omit<SVGIconProps<T>, "children"> & {
/**
* Icon name.
*/
iconName: IconName;
/**
* Icon contents, loaded via `IconLoader` and specified as `<path>` elements.
*/
children: React.JSX.Element | React.JSX.Element[];
};
/**
* Generic icon container component type. This is essentially a type hack required to make forwardRef work with generic
* components. Note that this slows down TypeScript compilation, but it better than the alternative of globally
* augmenting "@types/react".
*
* @see https://stackoverflow.com/a/73795494/7406866
*/
export interface SVGIconContainerComponent extends React.FC<SVGIconContainerProps<Element>> {
/**
* ReturnType here preserves type compatability with React 16 while we migrate to React 18.
* see: https://github.com/palantir/blueprint/pull/7142/files#r1915691062
*/
<T extends Element = Element>(props: SVGIconContainerProps<T>): ReturnType<React.FC<SVGIconContainerProps<Element>>> | null;
}
export declare const SVGIconContainer: SVGIconContainerComponent;