@rkosafo/cai.components
Version:
This package is under development and not ready for public use.
55 lines (54 loc) • 2.38 kB
TypeScript
import { toast as originalToast, type DefaultToastOptions, type Renderable, resolveValue, type ToastOptions, type ToastPosition, type ValueOrFunction } from 'svelte-french-toast';
export { CheckmarkIcon, ErrorIcon, LoaderIcon, ToastBar, ToastIcon, useToaster, useToasterStore } from 'svelte-french-toast';
export { resolveValue };
export type { DefaultToastOptions, IconTheme, Toast, ToastOptions, ToastPosition, ToastType, Renderable, ValueFunction, ValueOrFunction } from 'svelte-french-toast';
export type CustomToastOptions = ToastOptions;
export type ToastTheme = Record<string, never>;
export type ToastSoundPreset = 'chime' | 'ding' | 'bell' | 'soft' | 'pop' | 'pulse' | 'airy';
export interface ToasterProps {
position?: ToastPosition;
duration?: number;
toastOptions?: DefaultToastOptions;
reverseOrder?: boolean;
gutter?: number;
containerStyle?: string;
containerClassName?: string;
fireWithSound?: boolean;
/** Web Audio preset when `fireWithSound` is true. Default `chime`. */
soundPreset?: ToastSoundPreset;
className?: string;
theme?: ToastTheme;
richColors?: boolean;
customIcons?: boolean;
closeButton?: boolean;
pauseOnHover?: boolean;
visibleToasts?: number;
expand?: boolean;
gap?: number;
offset?: number | string;
}
export declare function updateToastConfig(config: {
duration?: number;
fireWithSound?: boolean;
soundPreset?: ToastSoundPreset;
theme?: ToastTheme;
richColors?: boolean;
}): void;
export declare const toast: ((message: Renderable, options?: ToastOptions) => string) & {
success: (message: Renderable, options?: ToastOptions) => string;
error: (message: Renderable, options?: ToastOptions) => string;
loading: (message: Renderable, options?: ToastOptions) => string;
promise: <T>(promise: Promise<T>, msgs: {
loading: Renderable;
success: ValueOrFunction<Renderable, T>;
error: ValueOrFunction<Renderable, any>;
}, opts?: DefaultToastOptions) => Promise<T>;
dismiss: (toastId?: string) => void;
remove: (toastId?: string) => void;
custom: (message: Renderable, options?: ToastOptions) => string;
};
export { originalToast };
export type { ToastOptions };
declare const Toast: import("svelte").Component<ToasterProps, {}, "">;
type Toast = ReturnType<typeof Toast>;
export default Toast;