web-dev-server
Version:
Node.js simple http server for common development or training purposes.
37 lines (36 loc) • 1.17 kB
TypeScript
export declare class DirItem {
static readonly TYPE_UNKNOWN = 0;
static readonly TYPE_DIR = 1;
static readonly TYPE_FILE = 2;
static readonly TYPE_SYMLINK = 4;
static readonly TYPE_SOCKET = 8;
static readonly TYPE_BLOCK_DEVICE = 16;
static readonly TYPE_CHARACTER_DEVICE = 32;
static readonly TYPE_FIFO = 64;
type: number;
path: string;
code: string;
static SortByPath(a: DirItem, b: DirItem): 0 | 1 | -1;
/**
* @summary Return found index JS stripts for server side execution or index HTML static files.
*/
static FindIndex(dirItems: string[], indexScripts: Map<string, number>, indexFiles: Map<string, number>): {
scripts: string[];
files: string[];
};
protected static indexScriptsFoundSort(a: {
index: number;
dir: string;
}, b: {
index: number;
dir: string;
}): number;
protected static indexFilesFoundSort(a: {
index: number;
file: string;
}, b: {
index: number;
file: string;
}): number;
constructor(type: number, path: string, code: string);
}