@payfit/unity-icons
Version:
24 lines (23 loc) • 957 B
TypeScript
import { ReactNode } from 'react';
interface IconsContextState {
isLoaded: boolean;
error: Error | null;
isLoading: boolean;
}
interface UnityIconsProviderProps {
/** The child nodes to be rendered within the provider */
children: ReactNode;
/** Optional callback to handle errors during sprite injection */
onError?: (error: Error) => void;
/** Optional fallback content to be displayed while loading or on error */
fallback?: ReactNode;
}
/**
* The `UnityIconsProvider` component is a context provider that ensures the Unity icon sprite sheet is loaded before rendering any icons, and exactly once for the current tree.
*/
export declare function UnityIconsProvider({ children, onError, fallback, }: UnityIconsProviderProps): import('react/jsx-runtime').JSX.Element;
export declare namespace UnityIconsProvider {
var displayName: string;
}
export declare function useIconsContext(): IconsContextState;
export {};