import React, { CSSProperties } from 'react'; import PropTypes from 'prop-types'; import { ToastListAdapter, ToastListProps, ToastListState } from '@douyinfe/semi-foundation/lib/cjs/toast/toastListFoundation'; import '@douyinfe/semi-foundation/lib/cjs/toast/toast.css'; import useToast from './useToast'; import { ConfigProps, ToastInstance, ToastProps, ToastState } from '@douyinfe/semi-foundation/lib/cjs/toast/toastFoundation'; export interface ToastReactProps extends ToastProps { id?: string; style?: CSSProperties; icon?: React.ReactNode; content: React.ReactNode; } export type { ConfigProps, ToastListProps, ToastListState, ToastState }; declare const createBaseToast: () => { new (props: ToastListProps): { stack: boolean; innerWrapperRef: React.RefObject; readonly adapter: ToastListAdapter; handleMouseEnter: (e: React.MouseEvent) => void; handleMouseLeave: (e: React.MouseEvent) => void; has(id: string): any; add(opts: ToastInstance): any; update(id: string, opts: ToastInstance): any; remove(id: string): any; destroyAll(): any; render(): React.JSX.Element; cache: any; foundation: any; componentDidMount(): void; componentWillUnmount(): void; isControlled: (key: any) => boolean; log(text: string, ...rest: any): any; getDataAttr(props?: any): {}; setStateAsync: (state: Partial) => Promise; context: unknown; setState(state: ToastListState | ((prevState: Readonly, props: Readonly) => ToastListState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; ref: { stack: boolean; innerWrapperRef: React.RefObject; readonly adapter: ToastListAdapter; handleMouseEnter: (e: React.MouseEvent) => void; handleMouseLeave: (e: React.MouseEvent) => void; has(id: string): any; add(opts: ToastInstance): any; update(id: string, opts: ToastInstance): any; remove(id: string): any; destroyAll(): any; render(): React.JSX.Element; cache: any; foundation: any; componentDidMount(): void; componentWillUnmount(): void; isControlled: (key: any) => boolean; log(text: string, ...rest: any): any; getDataAttr(props?: any): {}; setStateAsync: (state: Partial) => Promise; context: unknown; setState(state: ToastListState | ((prevState: Readonly, props: Readonly) => ToastListState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; useToast: typeof useToast; defaultOpts: ToastReactProps & { motion: boolean; }; propTypes: { content: PropTypes.Requireable; duration: PropTypes.Requireable; onClose: PropTypes.Requireable<(...args: any[]) => any>; icon: PropTypes.Requireable; direction: PropTypes.Requireable; stack: PropTypes.Requireable; }; defaultProps: {}; wrapperId: null | string; create(opts: ToastReactProps): string; close(id: string): void; destroyAll(): void; getWrapperId(): string; info(opts: Omit | string): string; warning(opts: Omit | string): string; error(opts: Omit | string): string; success(opts: Omit | string): string; config(opts: ConfigProps): void; contextType?: React.Context; }; export declare class ToastFactory { static create(config?: ConfigProps): ReturnType; } declare const _default: { new (props: ToastListProps): { stack: boolean; innerWrapperRef: React.RefObject; readonly adapter: ToastListAdapter; handleMouseEnter: (e: React.MouseEvent) => void; handleMouseLeave: (e: React.MouseEvent) => void; has(id: string): any; add(opts: ToastInstance): any; update(id: string, opts: ToastInstance): any; remove(id: string): any; destroyAll(): any; render(): React.JSX.Element; cache: any; foundation: any; componentDidMount(): void; componentWillUnmount(): void; isControlled: (key: any) => boolean; log(text: string, ...rest: any): any; getDataAttr(props?: any): {}; setStateAsync: (state: Partial) => Promise; context: unknown; setState(state: ToastListState | ((prevState: Readonly, props: Readonly) => ToastListState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; ref: { stack: boolean; innerWrapperRef: React.RefObject; readonly adapter: ToastListAdapter; handleMouseEnter: (e: React.MouseEvent) => void; handleMouseLeave: (e: React.MouseEvent) => void; has(id: string): any; add(opts: ToastInstance): any; update(id: string, opts: ToastInstance): any; remove(id: string): any; destroyAll(): any; render(): React.JSX.Element; cache: any; foundation: any; componentDidMount(): void; componentWillUnmount(): void; isControlled: (key: any) => boolean; log(text: string, ...rest: any): any; getDataAttr(props?: any): {}; setStateAsync: (state: Partial) => Promise; context: unknown; setState(state: ToastListState | ((prevState: Readonly, props: Readonly) => ToastListState | Pick) | Pick, callback?: () => void): void; forceUpdate(callback?: () => void): void; readonly props: Readonly; state: Readonly; refs: { [key: string]: React.ReactInstance; }; shouldComponentUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): boolean; componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void; getSnapshotBeforeUpdate?(prevProps: Readonly, prevState: Readonly): any; componentDidUpdate?(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; componentWillMount?(): void; UNSAFE_componentWillMount?(): void; componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; UNSAFE_componentWillReceiveProps?(nextProps: Readonly, nextContext: any): void; componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; UNSAFE_componentWillUpdate?(nextProps: Readonly, nextState: Readonly, nextContext: any): void; }; useToast: typeof useToast; defaultOpts: ToastReactProps & { motion: boolean; }; propTypes: { content: PropTypes.Requireable; duration: PropTypes.Requireable; onClose: PropTypes.Requireable<(...args: any[]) => any>; icon: PropTypes.Requireable; direction: PropTypes.Requireable; stack: PropTypes.Requireable; }; defaultProps: {}; wrapperId: string; create(opts: ToastReactProps): string; close(id: string): void; destroyAll(): void; getWrapperId(): string; info(opts: string | Omit): string; warning(opts: string | Omit): string; error(opts: string | Omit): string; success(opts: string | Omit): string; config(opts: ConfigProps): void; contextType?: React.Context; }; export default _default;