UNPKG

981 BTypeScriptView Raw
1import React from 'react';
2import { Theme, ToastProps, TypeOptions } from '../types';
3/**
4 * Used when providing custom icon
5 */
6export interface IconProps {
7 theme: Theme;
8 type: TypeOptions;
9 isLoading?: boolean;
10}
11export type BuiltInIconProps = React.SVGProps<SVGSVGElement> & IconProps;
12declare function Warning(props: BuiltInIconProps): React.JSX.Element;
13declare function Info(props: BuiltInIconProps): React.JSX.Element;
14declare function Success(props: BuiltInIconProps): React.JSX.Element;
15declare function Error(props: BuiltInIconProps): React.JSX.Element;
16declare function Spinner(): React.JSX.Element;
17export declare const Icons: {
18 info: typeof Info;
19 warning: typeof Warning;
20 success: typeof Success;
21 error: typeof Error;
22 spinner: typeof Spinner;
23};
24export type IconParams = Pick<ToastProps, 'theme' | 'icon' | 'type' | 'isLoading'>;
25export declare function getIcon({ theme, type, isLoading, icon }: IconParams): React.ReactNode;
26export {};