UNPKG

st-bundle

Version:

CLI for watching and bundling SpringType projects.

44 lines (43 loc) 1.74 kB
import { Context } from '../core/Context'; import { WatchOptions } from 'chokidar'; declare type IChokidarEventType = 'add' | 'change' | 'unlink' | 'addDir' | 'unlinkDir' | 'error' | 'ready'; export interface IWatcherExternalProps { paths?: any; skipRecommendedIgnoredPaths?: boolean; ignored?: Array<string | RegExp>; banned?: Array<string>; chokidar?: WatchOptions; } export declare function attachChokidar(props: { root?: string; chokidarOptions?: WatchOptions; ignored?: Array<string | RegExp>; cb: (event: IChokidarEventType, path: string) => void; }): void; export declare function ignoredPath2Regex(input: string): RegExp; export interface IWatcherProps { ctx: Context; onEvent: (action: WatcherAction, file?: string) => void; } export declare enum WatcherAction { FATAL_ERROR = "FATAL_ERROR", RELOAD_TS_CONFIG = "RELOAD_TS_CONFIG", RELOAD_ONE_FILE = "RELOAD_ONE_FILE", HARD_RELOAD_MODULES = "HARD_RELOAD_MODULES", SOFT_RELOAD_FILES = "SOFT_RELOAD_FILES", HARD_RELOAD_ALL = "HARD_RELOAD_ALL", RESTART_PROCESS = "RESTART_PROCESS" } export declare function detectAction(file: string, homeDir: string): WatcherAction; export declare function getEventData(props: { input: { event: IChokidarEventType; path: string; }; ctx: Context; }): WatcherAction; export declare function getRelevantEvent(actions: Array<WatcherAction>): WatcherAction.RELOAD_TS_CONFIG | WatcherAction.RELOAD_ONE_FILE | WatcherAction.HARD_RELOAD_MODULES | WatcherAction.SOFT_RELOAD_FILES | WatcherAction.RESTART_PROCESS; export interface Watcher { } export declare function createWatcher(props: IWatcherProps, externalProps?: IWatcherExternalProps): void; export {};