File size: 2,246 Bytes
bc20498
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/// <reference types="svelte" />
import type { MeltActionReturn } from '../../internal/types.js';
import type { ToastEvents } from './events.js';
import type { AddToastProps, CreateToasterProps, Toast } from './types.js';
export declare function createToaster<T = object>(props?: CreateToasterProps): {
    elements: {
        content: import("../../internal/helpers/index.js").MeltElement<import("svelte/store").Writable<Map<string, Toast<T>>>, (node: HTMLElement) => MeltActionReturn<ToastEvents['content']>, ($toasts: Map<string, Toast<T>>) => (id: string) => {
            id: string;
            role: string;
            'aria-describedby': string;
            'aria-labelledby': string;
            'aria-live': "assertive" | "polite";
            tabindex: number;
        } | null, string>;
        title: import("../../internal/helpers/index.js").MeltElement<import("svelte/store").Writable<Map<string, Toast<T>>>, import("svelte/action").Action<any, any, Record<never, any>>, ($toasts: Map<string, Toast<T>>) => (id: string) => {
            id: string;
        } | null, string>;
        description: import("../../internal/helpers/index.js").MeltElement<import("svelte/store").Writable<Map<string, Toast<T>>>, import("svelte/action").Action<any, any, Record<never, any>>, ($toasts: Map<string, Toast<T>>) => (id: string) => {
            id: string;
        } | null, string>;
        close: import("../../internal/helpers/index.js").MeltElement<import("svelte/store").Stores | undefined, (node: HTMLElement) => MeltActionReturn<ToastEvents['close']>, () => (id: string) => {
            type: "button";
            'data-id': string;
        }, string>;
    };
    states: {
        toasts: import("svelte/store").Readable<Toast<T>[]>;
    };
    helpers: {
        addToast: (props: AddToastProps<T>) => Toast<T>;
        removeToast: (id: string) => void;
        updateToast: (id: string, data: T) => void;
    };
    actions: {
        portal: import("svelte/action").Action<HTMLElement, import("../../internal/actions/index.js").PortalConfig, Record<never, any>>;
    };
    options: import("../../internal/helpers/index.js").ToWritableStores<{
        closeDelay: number;
        type: "background" | "foreground";
    }>;
};