geoiq-frontend-ui-kit
Version:
This project is a UI kit for GeoIQ's frontend. It's built with React, TypeScript, and Vite.
39 lines (38 loc) • 1.13 kB
TypeScript
import { ToasterToastProps } from './toast.types';
declare const actionTypes: {
readonly ADD_TOAST: "ADD_TOAST";
readonly UPDATE_TOAST: "UPDATE_TOAST";
readonly DISMISS_TOAST: "DISMISS_TOAST";
readonly REMOVE_TOAST: "REMOVE_TOAST";
};
type ActionType = typeof actionTypes;
type Action = {
type: ActionType['ADD_TOAST'];
toast: ToasterToastProps;
} | {
type: ActionType['UPDATE_TOAST'];
toast: Partial<ToasterToastProps>;
} | {
type: ActionType['DISMISS_TOAST'];
toastId?: ToasterToastProps['id'];
} | {
type: ActionType['REMOVE_TOAST'];
toastId?: ToasterToastProps['id'];
};
interface State {
toasts: ToasterToastProps[];
}
export declare const reducer: (state: State, action: Action) => State;
type Toast = Omit<ToasterToastProps, 'id'>;
declare function toast({ ...props }: Toast): {
id: string;
dismiss: () => void;
update: (props: ToasterToastProps) => void;
};
declare function useToast(): {
toast: typeof toast;
dismiss: (toastId?: string) => void;
toasts: ToasterToastProps[];
};
export { useToast, toast };
//# sourceMappingURL=use-toast.d.ts.map