fluentui-system-icons
fluentui-system-icons copied to clipboard
Can @fluentui/react-icons produce a custom .d.ts file which is more performant?
Hi all - in profiling our typescript compile, we can see that processing & adding the types for this package takes about 5 seconds

This is because index.d.ts looks like (below), which forces typescript to crawl the file system to find all these icons and add them to the project.

Changing the .d.ts file to look like (below) is functionally equivalent, but much more performant:
/// <reference types="react" />
import { IFluentIconsProps } from './utils/IFluentIconsProps.types';
type IconFunction = (iconProps: IFluentIconsProps) => JSX.Element;
export const AccessTime24Filled: IconFunction;
export const AccessTime24Regular: IconFunction;
export const Accessibility16Filled: IconFunction;
...
export const ZoomOut24Regular: IconFunction;
export { IFluentIconsProps } from './utils/IFluentIconsProps.types';
export { default as wrapIcon } from './utils/wrapIcon';
Thanks!