-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.d.ts
34 lines (26 loc) · 897 Bytes
/
index.d.ts
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
import type { SvelteComponent } from 'svelte';
interface NotificationsProps {
item?: SvelteComponent;
withoutStyles?: boolean;
zIndex?: string | number;
}
export default class Notifications extends SvelteComponent {
$$prop_def: NotificationsProps;
}
export type Position = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
interface DefaultNotificationOptions {
id?: string;
text?: string;
position: Position;
type?: string;
removeAfter?: number;
}
type addNotification = (notification: DefaultNotificationOptions | Record<string, any>) => void;
type removeNotification = (notificationId: string) => void
type clearNotifications = () => void;
export function getNotificationsContext(): {
subscribe: any;
addNotification: addNotification;
removeNotification: removeNotification;
clearNotifications: clearNotifications;
};