import React from 'react'; import PropTypes from 'prop-types'; export interface IconProviderProps { children?: React.ReactNode; /** * * `duplicateRepeatedIcons` implements an alternative rendering approach where a `use` tag is * rendered to duplicate subsequent renders of the same icon. This may improve performance on * renders of recurrent icons in a localized area of an application. * * This feature does not work with Enterprise icons. * * For example, here the `IconProvider` renders a single instance of the `` icons paths, * then renders the subsequent icons with a `` tag to allow the browser to duplicate * the icon. * * ```jsx * return ( * * * * * * ); * ``` */ duplicateRepeatedIcons?: boolean; } export interface IconContextType { toRender: boolean; addIcon: (iconName: string, svgPath: React.ReactNode) => boolean; getIconExists: (iconName: string) => boolean; } export type IconType = Map; declare const IconContext: React.Context; /** * IconProvider enables experimental features across icons that may change at any time * and does not follow the semantic-versioning of the package. * * To use, wrap icons from '@splunk/react-icons/{icon}'. */ declare const IconProvider: { ({ children, duplicateRepeatedIcons }: IconProviderProps): React.JSX.Element; propTypes: { children: PropTypes.Requireable; duplicateRepeatedIcons: PropTypes.Requireable; }; }; export { IconContext, IconProvider }; export default IconProvider;