playwright-elements
Version:
This is Playwright extension.
25 lines (24 loc) • 997 B
TypeScript
import { FSWatcher } from 'chokidar';
export type Options = {
watch?: boolean;
cliLog?: boolean;
quotes?: '\'' | '"';
};
export interface WatcherManager {
watchers: FSWatcher[];
addWatcher: (watcher: FSWatcher) => void;
closeAll: () => Promise<void>;
}
/**
* Generates an `index.ts` file in the specified folder (and recursively in subdirectories)
* and, if watch mode is enabled, creates watchers in every folder.
*
* This implementation captures all FS watchers in a shared WatcherManager that is
* returned so that they can be canceled later.
*
* @param folder - The directory to generate the index file in.
* @param options - Options for watch mode, logging, and quote style.
* @param manager - (Optional) Shared watcher manager. If not provided, a new one is created.
* @returns A WatcherManager instance that can close all watchers.
*/
export declare function generateIndexFile(folder: string, options?: Options, manager?: WatcherManager): WatcherManager;