/** * @param {[sourceFilePath: string, info: { type: string, jsDependencies?: string[], webSockets?: Set }][]} taskQueue * @returns {[sourceFilePath: string, info: { type: string, jsDependencies?: string[], webSockets?: Set }][]} */ export function sortTaskQueue(taskQueue: [sourceFilePath: string, info: { type: string; jsDependencies?: string[]; webSockets?: Set; }][]): [sourceFilePath: string, info: { type: string; jsDependencies?: string[]; webSockets?: Set; }][]; export class Watcher { /** * @type {Map }>} */ pages: Map; }>; acceptPageUpdates: boolean; /** * @type {Set} */ _filesToIgnore: Set; /** * @type {Map }>} */ _taskQueue: Map; }>; inputDir: string; /** * @param {string} initDir * @param {{ ignore: string[], inputDir: string }} options */ init(initDir: string, { ignore, inputDir }: { ignore: string[]; inputDir: string; }): Promise; subscription: watcher.AsyncSubscription | undefined; /** * @param {string} sourceFilePath */ addUpdateTask(sourceFilePath: string): Promise; /** * @param {string} sourceFilePath */ addCreateTask(sourceFilePath: string): Promise; /** * @param {string} sourceFilePath */ addDeleteTask(sourceFilePath: string): Promise; executeTaskQueue(): Promise; /** * @param {string} sourceFilePath */ updatePage(sourceFilePath: string): Promise; /** * @param {string} sourceFilePath * @param {import('@web/dev-server-core').WebSocket} webSocket */ addWebSocketToPage(sourceFilePath: string, webSocket: import('@web/dev-server-core').WebSocket): void; /** * @param {import('@web/dev-server-core').WebSocket} webSocket */ removeWebSocket(webSocket: import('@web/dev-server-core').WebSocket): void; /** * @param {string} sourceFilePath */ createPage(sourceFilePath: string, options?: {}): Promise<{ /** @type {string[]} */ jsDependencies: string[]; }>; /** * @param {string} sourceFilePath */ deletePage(sourceFilePath: string): Promise; /** * @param {string[]} sourceFilePaths */ addPages(sourceFilePaths: string[]): Promise; /** * @param {object} callbacks * @param {function} callbacks.onPageSavedOrOpenedTabAndServerDependencyChanged Gets called when a page is saved OR when a the page is open in a tab and a page dependency is changed * @param {function} callbacks.onPageServerDependencySaved Gets called when a page has a server dependency that has been saved * @param {function} callbacks.onPageDeleted * @param {function} callbacks.onDone */ watchPages(callbacks: { onPageSavedOrOpenedTabAndServerDependencyChanged: Function; onPageServerDependencySaved: Function; onPageDeleted: Function; onDone: Function; }): Promise; callbacks: { onPageSavedOrOpenedTabAndServerDependencyChanged: Function; onPageServerDependencySaved: Function; onPageDeleted: Function; onDone: Function; } | undefined; cleanup(): Promise; /** * @param {string} filePath */ addFileToIgnore(filePath: string): void; /** * @param {string} filePath */ removeFileToIgnore(filePath: string): void; /** * @param {string} filePath * @returns {boolean} */ isIgnoredFile(filePath: string): boolean; } import watcher from "@parcel/watcher"; //# sourceMappingURL=Watcher.d.ts.map