import type { Page, Route } from 'playwright'; import type { NetworkRegisterPayload, NetworkUnregisterPayload, UnmatchedRequest } from './types.js'; /** * Handles network mock commands in the Node Playwright process. * Manages active route interception, CORS options, and unmatched request observability. */ export declare class NetworkCommand { private page; private routeStore; private ignoreCors; private isNetworkMockingEnabled; private unmatchedRequests; private readonly maxUnmatchedRequests; /** * @param page Playwright page to register on */ constructor(page: Page); /** * Whether network mocking is currently active or enabled. */ get isMockingEnabled(): boolean; /** * Sets whether network mocking is enabled. * * @param enabled Boolean indicating active mocking status. */ setMockingEnabled(enabled: boolean): void; /** * Returns a copy of recent unmatched intercepted requests for diagnostics. */ getUnmatchedRequests(): readonly UnmatchedRequest[]; /** * Clears the in-memory ring buffer of unmatched requests for the active test. */ clearUnmatchedRequests(): void; /** * Handle network:mock:register command */ register(payload: NetworkRegisterPayload): Promise; /** * Handle network:mock:unregister command */ unregister(payload: NetworkUnregisterPayload): Promise; /** * Set the ignoreCors flag. */ setIgnoreCors(ignore: boolean): void; /** * Reset the network command state. */ reset(): void; /** * Records an unmatched request into the fixed-size ring buffer. */ private recordUnmatchedRequest; /** * The actual interceptor that bounces the request down to the browser context * for evaluation of any active mocks. */ onRoute(route: Route): Promise; }