Type Reference
NotifinType
type NotifinType =
| "default"
| "error"
| "info"
| "loading"
| "success"
| "warning";NotifinFn
interface NotifinFn {
(title: string, options?: NotifinShowOptions): string;
success(title: string, options?: NotifinShowOptions): string;
error(title: string, options?: NotifinShowOptions): string;
warning(title: string, options?: NotifinShowOptions): string;
info(title: string, options?: NotifinShowOptions): string;
loading(title: string, options?: NotifinShowOptions): string;
update(id: string, options: NotifinUpdateOptions): void;
dismiss(id?: string): void;
promise<T>(
promise: Promise<T>,
messages: NotifinPromiseMessages<T>
): Promise<T>;
}NotifinShowOptions
interface NotifinShowOptions {
action?: NotifinAction;
allowEscapeClose?: boolean;
cancel?: NotifinAction;
description?: string;
dismissible?: boolean;
duration?: number;
id?: string;
onDismiss?: () => void;
title?: string;
}NotifinUpdateOptions
interface NotifinUpdateOptions extends Partial<NotifinShowOptions> {
title?: string;
type?: NotifinType;
}NotifinPromiseMessages<T>
interface NotifinPromiseMessages<TData = unknown> {
loading: NotifinShowOptions | string;
success: ((data: TData) => NotifinShowOptions | string) | string;
error: ((error: unknown) => NotifinShowOptions | string) | string;
}NotifinProps
interface NotifinProps {
colorScheme?: "system" | "light" | "dark";
motion?: "subtle" | "slide" | "scale" | "bounce" | "none";
showQueueCount?: boolean;
theme?: NotifinThemeConfig;
}NotifinThemeConfig
interface NotifinThemeConfig {
dialogToneClasses?: Partial<NotifinThemeClassMap>;
iconToneClasses?: Partial<NotifinThemeClassMap>;
icons?: Partial<NotifinThemeIcons>;
schemes?: Partial<Record<"light" | "dark", NotifinSchemeThemeConfig>>;
}Untuk penggunaan praktisnya, lihat:
Last updated on