import * as React from 'react'; import * as DismissableLayer from '@radix-ui/react-dismissable-layer'; import { Primitive } from '@radix-ui/react-primitive'; type Scope = { [scopeName: string]: React.Context[]; } | undefined; type ScopeHook = (scope: Scope) => { [__scopeProp: string]: Scope; }; interface CreateScope { scopeName: string; (): ScopeHook; } type SwipeDirection = 'up' | 'down' | 'left' | 'right'; declare const createToastScope: CreateScope; interface ToastProviderProps { children?: React.ReactNode; /** * An author-localized label for each toast. Used to help screen reader users * associate the interruption with a toast. * @defaultValue 'Notification' */ label?: string; /** * Time in milliseconds that each toast should remain visible for. * @defaultValue 5000 */ duration?: number; /** * Direction of pointer swipe that should close the toast. * @defaultValue 'right' */ swipeDirection?: SwipeDirection; /** * Distance in pixels that the swipe must pass before a close is triggered. * @defaultValue 50 */ swipeThreshold?: number; } declare const ToastProvider: React.FC; type PrimitiveOrderedListProps = React.ComponentPropsWithoutRef; interface ToastViewportProps extends PrimitiveOrderedListProps { /** * The keys to use as the keyboard shortcut that will move focus to the toast viewport. * @defaultValue ['F8'] */ hotkey?: string[]; /** * An author-localized label for the toast viewport to provide context for screen reader users * when navigating page landmarks. The available `{hotkey}` placeholder will be replaced for you. * @defaultValue 'Notifications ({hotkey})' */ label?: string; } declare const ToastViewport: React.ForwardRefExoticComponent>; type ToastElement = ToastImplElement; interface ToastProps extends Omit { open?: boolean; defaultOpen?: boolean; onOpenChange?(open: boolean): void; /** * Used to force mounting when more control is needed. Useful when * controlling animation with React animation libraries. */ forceMount?: true; } declare const Toast: React.ForwardRefExoticComponent>; type SwipeEvent = { currentTarget: EventTarget & ToastElement; } & Omit, 'currentTarget'>; type ToastImplElement = React.ElementRef; type DismissableLayerProps = React.ComponentPropsWithoutRef; type ToastImplPrivateProps = { open: boolean; onClose(): void; }; type PrimitiveListItemProps = React.ComponentPropsWithoutRef; interface ToastImplProps extends ToastImplPrivateProps, PrimitiveListItemProps { type?: 'foreground' | 'background'; /** * Time in milliseconds that toast should remain visible for. Overrides value * given to `ToastProvider`. */ duration?: number; onEscapeKeyDown?: DismissableLayerProps['onEscapeKeyDown']; onPause?(): void; onResume?(): void; onSwipeStart?(event: SwipeEvent): void; onSwipeMove?(event: SwipeEvent): void; onSwipeCancel?(event: SwipeEvent): void; onSwipeEnd?(event: SwipeEvent): void; } type PrimitiveDivProps = React.ComponentPropsWithoutRef; interface ToastTitleProps extends PrimitiveDivProps { } declare const ToastTitle: React.ForwardRefExoticComponent>; interface ToastDescriptionProps extends PrimitiveDivProps { } declare const ToastDescription: React.ForwardRefExoticComponent>; interface ToastActionProps extends ToastCloseProps { /** * A short description for an alternate way to carry out the action. For screen reader users * who will not be able to navigate to the button easily/quickly. * @example Upgrade * @example Undo */ altText: string; } declare const ToastAction: React.ForwardRefExoticComponent>; type PrimitiveButtonProps = React.ComponentPropsWithoutRef; interface ToastCloseProps extends PrimitiveButtonProps { } declare const ToastClose: React.ForwardRefExoticComponent>; declare const Provider: React.FC; declare const Viewport: React.ForwardRefExoticComponent>; declare const Root: React.ForwardRefExoticComponent>; declare const Title: React.ForwardRefExoticComponent>; declare const Description: React.ForwardRefExoticComponent>; declare const Action: React.ForwardRefExoticComponent>; declare const Close: React.ForwardRefExoticComponent>; export { Action, Close, Description, Provider, Root, Title, Toast, ToastAction, type ToastActionProps, ToastClose, type ToastCloseProps, ToastDescription, type ToastDescriptionProps, type ToastProps, ToastProvider, type ToastProviderProps, ToastTitle, type ToastTitleProps, ToastViewport, type ToastViewportProps, Viewport, createToastScope };