1
0
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:
Patrick Naughton
2024-04-30 13:14:07 -07:00
committed by GitHub
parent 4e5371083c
commit f9610283b2
2 changed files with 4 additions and 2 deletions

View File

@@ -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';

View File

@@ -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>>;