@public-ui/components
Version:
Contains all web components that belong to KoliBri - The accessible HTML-Standard.
36 lines (35 loc) • 1.27 kB
TypeScript
import type { Generic } from 'adopted-style-sheets';
import type { LabelPropType } from '../props';
import type { AlertType, AlertVariant } from './alert';
declare const toastStatusOptions: readonly ["adding", "settled", "removing"];
type ToastStatus = (typeof toastStatusOptions)[number];
export type ToastRenderFunction = (nodeRef: HTMLElement, options: {
close: () => void;
}) => void;
export type Toast = {
description?: string;
render?: ToastRenderFunction;
label: LabelPropType;
type: AlertType;
alertVariant?: AlertVariant;
variant?: AlertVariant;
};
export type ToastState = {
toast: Toast;
status: ToastStatus;
id: string;
};
export type ToasterOptions = {
defaultAlertVariant: AlertVariant;
defaultVariant: AlertVariant;
};
type RequiredProps = NonNullable<unknown>;
type OptionalProps = NonNullable<unknown>;
type RequiredStates = RequiredProps & {
toastStates: ToastState[];
};
type OptionalStates = OptionalProps;
export type ToasterProps = Generic.Element.Members<RequiredProps, OptionalProps>;
export type ToasterStates = Generic.Element.Members<RequiredStates, OptionalStates>;
export type ToasterAPI = Generic.Element.ComponentApi<RequiredProps, OptionalProps, RequiredStates, OptionalStates>;
export {};