import type { AlertStatus } from '@chakra-ui/alert'; import { AlertIconProps } from '@chakra-ui/react'; import { ColorMode, useChakra } from '@chakra-ui/system'; import * as React from 'react'; import { RenderProps, ToastId, ToastOptions } from './toast.types'; export interface UseToastOptions { /** * The placement of the toast * * @default bottom */ position?: ToastOptions['position']; /** * The delay before the toast hides (in milliseconds) If set to `null`, toast will never dismiss. * * @default 5000 ( = 5000ms ) */ duration?: ToastOptions['duration']; /** Render a component toast component. Any component passed will receive 2 props: `id` and `onClose`. */ render?(props: RenderProps): React.ReactNode; /** The title of the toast */ title?: React.ReactNode; /** The description of the toast */ description?: React.ReactNode; /** If `true`, toast will show a close button */ isClosable?: boolean; /** The alert component `variant` to use */ variant?: string; /** The status of the toast. */ status?: AlertStatus; /** * The `id` of the toast. * * Mostly used when you need to prevent duplicate. By default, we generate a unique `id` for each toast */ id?: ToastId; /** Callback function to run side effects after the toast has closed. */ onCloseComplete?: () => void; /** 图标属性 */ iconProps?: AlertIconProps; } export declare type IToast = UseToastOptions; export declare type CreateStandAloneToastParam = Partial<{ setColorMode: (value: ColorMode) => void; } & ReturnType & { defaultOptions: UseToastOptions; }>; export declare const defaultStandaloneParam: Required; /** Create a toast from outside of React Components */ export declare function createStandaloneToast({ theme, colorMode, toggleColorMode, setColorMode, defaultOptions, }?: CreateStandAloneToastParam): { (options?: UseToastOptions | undefined): import("@chakra-ui/react").ToastId | undefined; close: (id: import("@chakra-ui/react").ToastId) => void; closeAll: (options?: import("@chakra-ui/react").CloseAllToastsOptions | undefined) => void; update(id: ToastId, options: Omit): void; isActive: (id: import("@chakra-ui/react").ToastId) => boolean | undefined; }; /** React hook used to create a function that can be used to show toasts in an application. */ export declare function useToast(options?: UseToastOptions): { (options?: UseToastOptions | undefined): import("@chakra-ui/react").ToastId | undefined; close: (id: import("@chakra-ui/react").ToastId) => void; closeAll: (options?: import("@chakra-ui/react").CloseAllToastsOptions | undefined) => void; update(id: ToastId, options: Omit): void; isActive: (id: import("@chakra-ui/react").ToastId) => boolean | undefined; }; export default useToast;