mirror of
https://github.com/tabler/tabler-icons.git
synced 2025-09-02 18:33:18 +02:00
add TablerIcon type (#1058)
This commit is contained in:
@@ -4,4 +4,4 @@ export * as iconsList from './icons-list';
|
|||||||
export * from './aliases';
|
export * from './aliases';
|
||||||
export { default as createReactComponent } from './createReactComponent';
|
export { default as createReactComponent } from './createReactComponent';
|
||||||
|
|
||||||
export type { Icon, IconNode, IconProps } from './types';
|
export type { Icon, IconNode, IconProps, TablerIcon } from './types';
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
import { FunctionComponent, ReactSVG } from 'react';
|
import { ForwardRefExoticComponent, FunctionComponent, RefAttributes, ReactSVG } from 'react';
|
||||||
export type { ReactNode } from 'react';
|
export type { ReactNode } from 'react';
|
||||||
|
|
||||||
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
|
export type IconNode = [elementName: keyof ReactSVG, attrs: Record<string, string>][];
|
||||||
@@ -10,3 +10,5 @@ export interface IconProps extends Partial<Omit<React.SVGProps<SVGSVGElement>, '
|
|||||||
}
|
}
|
||||||
|
|
||||||
export type Icon = FunctionComponent<IconProps>;
|
export type Icon = FunctionComponent<IconProps>;
|
||||||
|
|
||||||
|
export type TablerIcon = ForwardRefExoticComponent<Omit<IconProps, "ref"> & RefAttributes<Icon>>;
|
||||||
|
Reference in New Issue
Block a user