@yamada-ui/react
Version:
React UI components of the Yamada, by the Yamada, for the Yamada built with React and Emotion
69 lines (68 loc) • 2.01 kB
TypeScript
import { NoticeConfig } from "../../core/system/index.types.js";
import { HTMLStyledProps } from "../../core/components/index.types.js";
import "../../core/index.js";
import { StatusScheme } from "../status/status.js";
import { AlertDescriptionProps, AlertIconProps, AlertLoadingProps, AlertRootProps, AlertTitleProps } from "../alert/alert.js";
import { CloseButtonProps } from "../close-button/close-button.js";
import { ReactNode } from "react";
//#region src/components/notice/use-notice.d.ts
interface UseNoticeOptions extends Omit<NoticeConfig, "expand">, Omit<AlertRootProps, "direction" | "id" | "status" | "title">, Pick<AlertLoadingProps, "loadingScheme"> {
/**
* Unique identifier for the notice.
*/
id?: number | string;
/**
* The description of the notice.
*/
description?: ReactNode;
/**
* The status of the notice.
*/
status?: StatusScheme;
/**
* The title of the notice.
*/
title?: ReactNode;
/**
* If `true`, shows an icon.
*/
withIcon?: boolean;
/**
* Props for the close button.
*/
closeButtonProps?: CloseButtonProps;
/**
* Props for the content container.
*/
contentProps?: HTMLStyledProps;
/**
* Props for the description.
*/
descriptionProps?: AlertDescriptionProps;
/**
* Props for the icon.
*/
iconProps?: AlertIconProps;
/**
* Props for the loading component.
*/
loadingProps?: AlertLoadingProps;
/**
* Props for the title.
*/
titleProps?: AlertTitleProps;
}
/**
* `useNotice` is a custom hook that controls the notifications of the application using Sonner.
*
* @see https://yamada-ui.com/docs/hooks/use-notice
*/
declare const useNotice: (options?: UseNoticeOptions) => {
(options?: UseNoticeOptions): string | number;
close(id: number | string): string | number;
closeAll(): string | number;
update(id: number | string, options: UseNoticeOptions): string | number;
};
//#endregion
export { UseNoticeOptions, useNotice };
//# sourceMappingURL=use-notice.d.ts.map