mihawk
Version:
A tiny & simple mock server tool, support json,js,cjs,ts(typescript).
15 lines (14 loc) • 684 B
TypeScript
import * as chokidar from 'chokidar';
import type { MihawkRC, Loosify } from '../../src/com-types';
/**
* 刷新模块的 require cache
* @param {string} filePath 需要被刷新的模块的绝对路径
*/
export declare function refreshModule(filePath: string, allowLogicFileExt: 'js' | 'cjs' | 'ts' | ''): void;
export type WatchEventType = 'add' | 'addDir' | 'change' | 'unlink' | 'unlinkDir';
/**
* 初始化一个文件监听器()
* @param {Loosify<MihawkRC>} config
* @returns {chokidar.FSWatcher} watcher
*/
export declare function createWatcher(config: Loosify<MihawkRC>, callback?: (eventName: string | WatchEventType, ...args: any[]) => any): chokidar.FSWatcher;