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.
11 lines (10 loc) • 517 B
TypeScript
import { ParsedQueryMutation } from "./types";
/**
* Parses TypeScript/JavaScript files to extract query and mutation hook information
*
* @param content - The source code content to parse
* @param filePath - The full path to the file being parsed
* @param excludePatterns - Array of patterns to exclude from parsing
* @returns Array of parsed query/mutation information
*/
export declare function parseQueryMutationFiles(content: string, filePath: string, _excludePatterns?: string[]): ParsedQueryMutation[];