packages/react-components/react-toast/library/etc/react-toast.api.md
Do not edit this file. It is a report generated by API Extractor.
import { ARIAButtonResultProps } from '@fluentui/react-aria';
import { ARIAButtonType } from '@fluentui/react-aria';
import { BackgroundAppearanceContextValue } from '@fluentui/react-shared-contexts';
import type { ComponentProps } from '@fluentui/react-utilities';
import type { ComponentState } from '@fluentui/react-utilities';
import type { ForwardRefComponent } from '@fluentui/react-utilities';
import type { JSXElement } from '@fluentui/react-utilities';
import type { PortalProps } from '@fluentui/react-portal';
import * as React_2 from 'react';
import type { Slot } from '@fluentui/react-utilities';
import type { SlotClassNames } from '@fluentui/react-utilities';
import type { TriggerProps } from '@fluentui/react-utilities';
// @public
export const renderToast_unstable: (state: ToastState, contextValues: ToastContextValues) => JSXElement;
// @public
export const renderToastBody_unstable: (state: ToastBodyState) => JSXElement;
// @public
export const renderToaster_unstable: (state: ToasterState) => JSXElement;
// @public
export const renderToastFooter_unstable: (state: ToastFooterState) => JSXElement;
// @public
export const renderToastTitle_unstable: (state: ToastTitleState) => JSXElement;
// @public
export const renderToastTrigger_unstable: (state: ToastTriggerState) => JSXElement | null;
// @public
export const Toast: ForwardRefComponent<ToastProps>;
// @public
export const ToastBody: ForwardRefComponent<ToastBodyProps>;
// @public (undocumented)
export const toastBodyClassNames: SlotClassNames<ToastBodySlots>;
// @public
export type ToastBodyProps = ComponentProps<ToastBodySlots> & {};
// @public (undocumented)
export type ToastBodySlots = {
root: Slot<'div'>;
subtitle?: Slot<'div'>;
};
// @public
export type ToastBodyState = ComponentState<ToastBodySlots> & {
backgroundAppearance: BackgroundAppearanceContextValue;
};
// @public (undocumented)
export const toastClassNames: SlotClassNames<ToastSlots>;
// @public (undocumented)
export const toastContainerClassNames: SlotClassNames<ToastContainerSlots>;
// @public
export type ToastContainerState = ComponentState<ToastContainerSlots> & Pick<ToastContainerProps, 'remove' | 'close' | 'updateId' | 'visible' | 'intent'> & Pick<ToastContainerContextValue, 'titleId' | 'bodyId'> & {
transitionTimeout: number;
timerTimeout: number;
running: boolean;
onTransitionEntering: () => void;
nodeRef: React_2.Ref<HTMLDivElement>;
onMotionFinish?: (event: null, data: {
direction: 'enter' | 'exit';
}) => void;
};
// @public
export const Toaster: React_2.FC<ToasterProps>;
// @public (undocumented)
export const toasterClassNames: SlotClassNames<ToasterSlots>;
// @public
export type ToasterProps = Omit<ComponentProps<ToasterSlots>, 'children'> & Partial<ToasterOptions> & Pick<PortalProps, 'mountNode'> & {
announce?: Announce;
inline?: boolean;
};
// @public (undocumented)
export type ToasterSlots = {
root: Slot<'div'>;
};
// @public
export type ToasterState = ComponentState<ToasterSlotsInternal> & Pick<AriaLiveProps, 'announceRef'> & Pick<PortalProps, 'mountNode'> & Pick<Required<ToasterProps>, 'announce' | 'inline'> & {
offset: ToasterOptions['offset'] | undefined;
renderAriaLive: boolean;
dir: 'rtl' | 'ltr';
};
// @public
export const ToastFooter: ForwardRefComponent<ToastFooterProps>;
// @public (undocumented)
export const toastFooterClassNames: SlotClassNames<ToastFooterSlots>;
// @public
export type ToastFooterProps = ComponentProps<ToastFooterSlots> & {};
// @public (undocumented)
export type ToastFooterSlots = {
root: Slot<'div'>;
};
// @public
export type ToastFooterState = ComponentState<ToastFooterSlots>;
// @public (undocumented)
export type ToastId = string;
// @public (undocumented)
export type ToastIntent = 'info' | 'success' | 'error' | 'warning';
// @public (undocumented)
export type ToastOffset = Partial<Record<ToastPosition, ToastOffsetObject>> | ToastOffsetObject;
// @public (undocumented)
export type ToastPoliteness = 'assertive' | 'polite';
// @public (undocumented)
export type ToastPosition = 'top-end' | 'top-start' | 'bottom-end' | 'bottom-start' | 'top' | 'bottom';
// @public
export type ToastProps = ComponentProps<ToastSlots> & {
appearance?: BackgroundAppearanceContextValue;
};
// @public (undocumented)
export type ToastSlots = {
root: Slot<'div'>;
};
// @public
export type ToastState = ComponentState<ToastSlots> & {
backgroundAppearance: BackgroundAppearanceContextValue;
intent?: ToastIntent | undefined;
};
// @public (undocumented)
export type ToastStatus = 'queued' | 'visible' | 'dismissed' | 'unmounted';
// @public
export const ToastTitle: ForwardRefComponent<ToastTitleProps>;
// @public (undocumented)
export const toastTitleClassNames: SlotClassNames<ToastTitleSlots>;
// @public
export type ToastTitleProps = ComponentProps<ToastTitleSlots> & {};
// @public (undocumented)
export type ToastTitleSlots = {
root: NonNullable<Slot<'div'>>;
media?: Slot<'div'>;
action?: Slot<'div'>;
};
// @public
export type ToastTitleState = ComponentState<ToastTitleSlots> & Pick<ToastContainerContextValue, 'intent'> & {
backgroundAppearance: BackgroundAppearanceContextValue;
};
// @public
export const ToastTrigger: React_2.FC<ToastTriggerProps>;
// @public
export type ToastTriggerChildProps<Type extends ARIAButtonType = ARIAButtonType, Props = {}> = ARIAButtonResultProps<Type, Props>;
// @public (undocumented)
export type ToastTriggerProps = TriggerProps<ToastTriggerChildProps> & {
disableButtonEnhancement?: boolean;
};
// @public (undocumented)
export type ToastTriggerState = {
children: React_2.ReactElement | null;
};
// @public
export const useToast_unstable: (props: ToastProps, ref: React_2.Ref<HTMLElement>) => ToastState;
// @public
export const useToastBody_unstable: (props: ToastBodyProps, ref: React_2.Ref<HTMLElement>) => ToastBodyState;
// @public
export const useToastBodyStyles_unstable: (state: ToastBodyState) => ToastBodyState;
// @public (undocumented)
export function useToastController(toasterId?: ToasterId): {
dispatchToast: (content: React_2.ReactNode, options?: DispatchToastOptions) => void;
dismissToast: (toastId: ToastId) => void;
dismissAllToasts: () => void;
updateToast: (options: UpdateToastOptions) => void;
pauseToast: (toastId: ToastId) => void;
playToast: (toastId: ToastId) => void;
};
// @public
export const useToaster_unstable: (props: ToasterProps) => ToasterState;
// @public
export const useToasterStyles_unstable: (state: ToasterState) => ToasterState;
// @public
export const useToastFooter_unstable: (props: ToastFooterProps, ref: React_2.Ref<HTMLElement>) => ToastFooterState;
// @public
export const useToastFooterStyles_unstable: (state: ToastFooterState) => ToastFooterState;
// @public
export const useToastStyles_unstable: (state: ToastState) => ToastState;
// @public
export const useToastTitle_unstable: (props: ToastTitleProps, ref: React_2.Ref<HTMLElement>) => ToastTitleState;
// @public
export const useToastTitleStyles_unstable: (state: ToastTitleState) => ToastTitleState;
// @public
export const useToastTrigger_unstable: (props: ToastTriggerProps) => ToastTriggerState;
// (No @packageDocumentation comment for this package)