UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

55 lines 2.37 kB
import type { NotificationType } from "@metamask/snaps-sdk"; import type { PayloadAction } from "@reduxjs/toolkit"; /** * A notification object. * * @property id - A unique ID for the notification. * @property message - The notification message. * @property type - The notification type. * @property title - The notification title (expanded view). * @property content - The notification JSX content (expanded view). * @property footerLink - The notification footer (expanded view). */ export type Notification = { id: string; message: string; type: NotificationType; title?: string; content?: string; footerLink?: { text: string; href: string; }; }; /** * The notifications state. * * @property notifications - An array of notifications. */ export type NotificationsState = { notifications: Notification[]; }; export declare const notificationsSlice: import("@reduxjs/toolkit").Slice<NotificationsState, { addNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<Notification>) => void; removeNotification: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>, action: PayloadAction<string>) => void; clearNotifications: (state: import("immer/dist/internal.js").WritableDraft<NotificationsState>) => void; }, "notifications">; export declare const addNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<Notification, "notifications/addNotification">, removeNotification: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "notifications/removeNotification">, clearNotifications: import("@reduxjs/toolkit").ActionCreatorWithoutPayload<"notifications/clearNotifications">; /** * Get the notifications from the state. * * @param state - The application state. * @returns An array of notifications. */ export declare const getNotifications: ((state: { mocks: import("./mocks.cjs").MocksState; notifications: NotificationsState; state: import("./state.cjs").State; trackables: import("./trackables.cjs").TrackablesState; ui: import("./ui.cjs").UiState; }) => Notification[]) & import("reselect").OutputSelectorFields<(args_0: NotificationsState) => Notification[], { clearCache: () => void; }> & { clearCache: () => void; }; //# sourceMappingURL=notifications.d.cts.map