UNPKG

msw-mock-gen

Version:

A Vite plugin that automatically generates MSW (Mock Service Worker) handlers from your API calls by watching TypeScript/JavaScript files and parsing URL patterns. Supports Vite 2+ and Node.js 12+ for maximum compatibility.

18 lines (17 loc) 878 B
import { MSWMockGenConfig } from "./types"; /** * Deletes a file if it exists * @param filePath - Path to the file to delete * @param log - Logging function */ export declare const deleteFileIfExists: (filePath: string, log: (...args: string[]) => void) => void; /** * Sterilizes all output directories by deleting old generated files * @param root - Project root directory * @param configs - Array of configurations * @param mergeHandlers - Whether merging is enabled * @param topLevelOutputFolder - Top-level output folder for merged handlers * @param topLevelOutputFileName - Top-level output file name for merged handlers * @param log - Logging function */ export declare const sterilize: (root: string, configs: MSWMockGenConfig[], mergeHandlers: boolean, topLevelOutputFolder: string, topLevelOutputFileName: string, log: (...args: string[]) => void) => void;