import type { Page } from "@playwright/test"; export declare enum NotificationPageType { SpendingCap = "spending-cap", Signature = "signature", Transaction = "transaction", RemoveSpendCap = "remove-spend-cap" } export declare class NotificationPage { readonly page: Page; private cachedNotificationPage; constructor(page: Page); /** * Helper method to get notification page URL */ private getNotificationUrl; /** * Helper method to wait for notification page. * Reuses the cached page from identifyNotificationType if still alive. * * Wraps waitForPage with a timeout so a hung lookup doesn't burn the * entire 300s test timeout. waitForPage itself handles the TOCTOU race * (event listener + polling), and action handlers now wait for page * close so stale pages are no longer in context.pages(). */ private getNotificationPage; connectToDapp(extensionId: string): Promise; approveNewNetwork(extensionId: string): Promise; rejectNewNetwork(extensionId: string): Promise; approveSwitchNetwork(extensionId: string): Promise; rejectSwitchNetwork(extensionId: string): Promise; approveAddNetwork(extensionId: string): Promise; rejectAddNetwork(extensionId: string): Promise; /** * Run an action on the notification page with a single retry. * If the first attempt fails with "Target page, context or browser has been * closed", waits 1 second for the stale page to detach, then looks for a * fresh notification page directly in context.pages(). * * The retry does NOT use waitForPage because its waitForEvent('page') * fallback hangs forever — MetaMask reuses popups rather than opening * new page events. */ private withRetry; confirmTransaction(extensionId: string): Promise; rejectTransaction(extensionId: string): Promise; approveTokenPermission(extensionId: string): Promise; rejectTokenPermission(extensionId: string): Promise; confirmSpendingCapRemoval(extensionId: string): Promise; rejectSpendingCapRemoval(extensionId: string): Promise; addNewToken(extensionId: string): Promise; identifyNotificationType(extensionId: string, globalTimeout?: number, pollInterval?: number): Promise; }