restifyx.js
Version:
Advanced API endpoint handler system with automatic documentation
51 lines (50 loc) • 1.44 kB
TypeScript
import type { RestifyXApp } from "../core/RestifyXApp";
import type { ResolvedConfig } from "../types/options";
declare enum ItemType {
FILE = 0,
DIRECTORY = 1,
SYMLINK = 2,
UNKNOWN = 3
}
/**
* HotReloader class for watching and reloading endpoint files
* @class
* @param {RestifyXApp} app - The RestifyX application instance
* @param {ResolvedConfig} config - The resolved configuration object
* @property {string} endpointsDir - The directory where endpoint files are located
* @property {string} pattern - The pattern to match endpoint files
*/
export declare class HotReloader {
private app;
private endpointsDir;
private pattern;
private watchers;
private logger;
private reloadDebounceTimeout;
private reloadQueue;
private isReloading;
private config;
private watchedFiles;
private watchedDirs;
private initialScan;
constructor(app: RestifyXApp, config: ResolvedConfig);
/**
* Start the hot reload watcher
* @returns {Promise<void>}
*/
start(): Promise<void>;
/**
* Stop the hot reload watcher and clear all watchers
* @returns {void}
*/
stop(): void;
private initialScanDirectories;
private watchDirectory;
private shouldIgnore;
private matchesPattern;
private isEndpointRelatedFile;
private queueReload;
private reloadEndpoints;
getItemType(file: string): ItemType;
}
export {};