import { type Snippet } from 'svelte'; import { type Readable, type Writable } from 'svelte/store'; import { type BannerVariantType } from '../banner'; /** Internal notification context. */ export interface NotifyContext { state: NotifyState; notify: Notify; } export interface NotifyOptions { persist?: boolean; onDismiss?: VoidFunction; content?: Snippet; } export type NotifyFunction = (title: string, message?: string, options?: NotifyOptions) => { dismiss: VoidFunction; }; /** Notification sender. */ export interface Notify { /** Push an info notification. */ info: NotifyFunction; /** Push a warning notification. */ warn: NotifyFunction; /** Push a danger notification. */ danger: NotifyFunction; /** Push a success notification. */ success: NotifyFunction; } /** Internal notification state. */ export interface NotifyState { notifications: Readable; pageIsVisible: Writable; } /** Internal notification item state and actions. */ export interface Notification { id: string; title: string; message: string | undefined; variant: BannerVariantType; progress: Readable; content?: Snippet; pause: () => void; resume: () => void; dismiss: () => void; } /** Create the internal notification state and context object. */ export declare const createNotifyContext: () => NotifyContext; /** Provide notification state to a component tree. */ export declare const provideNotify: (context?: NotifyContext) => void; /** Get access to the notification sender in a component. */ export declare const useNotify: () => Notify; /** Get access to the internal notification state. */ export declare const useNotifyState: () => NotifyState;