UNPKG

@dbs-portal/core-api

Version:

HTTP client and API utilities for DBS Portal

65 lines 1.82 kB
/** * MSW browser setup for development and Storybook */ import { setupWorker } from 'msw/browser'; import type { RequestHandler } from 'msw'; import type { MockConfig } from './types'; /** * Setup MSW for browser environment */ export declare function setupBrowser(handlers: RequestHandler[], config: MockConfig): Promise<ReturnType<typeof setupWorker>>; /** * Initialize MSW service worker for browser * This should be called once during application startup */ export declare function initializeBrowserMocks(handlers?: RequestHandler[], options?: { serviceWorkerUrl?: string; quiet?: boolean; onUnhandledRequest?: 'bypass' | 'warn' | 'error'; }): Promise<void>; /** * Check if service worker is available */ export declare function isServiceWorkerSupported(): boolean; /** * Get service worker registration status */ export declare function getServiceWorkerStatus(): Promise<{ supported: boolean; registered: boolean; active: boolean; }>; /** * Install MSW service worker * This generates the service worker file in the public directory */ export declare function installServiceWorker(publicDir?: string): Promise<void>; /** * Browser-specific mock utilities */ export declare const browserMockUtils: { /** * Check if running in development mode */ isDevelopment(): boolean; /** * Check if running in Storybook */ isStorybook(): boolean; /** * Get current page URL info */ getPageInfo(): { hostname: string; pathname: string; search: string; hash: string; isDevelopment: boolean; isStorybook: boolean; } | null; /** * Show mock status in console */ logMockStatus(enabled: boolean, handlersCount: number): void; }; //# sourceMappingURL=browser.d.ts.map