zyf-server
Version:
A modern HTTP static file server with Vue SSR directory listing, built for developers
33 lines • 874 B
TypeScript
/**
* 文件服务类
* 处理所有文件系统相关操作
*/
import { type Stats } from 'fs';
import { type IncomingMessage, type ServerResponse } from 'http';
import type { DirectoryItem } from '../types';
export declare class FileService {
/**
* 检查文件或目录是否存在
*/
exists(path: string): Promise<boolean>;
/**
* 获取文件统计信息
*/
stat(path: string): Promise<Stats>;
/**
* 读取目录内容
*/
readDirectory(dirPath: string): Promise<DirectoryItem[]>;
/**
* 发送文件内容
*/
sendFile(filePath: string, _req: IncomingMessage, res: ServerResponse, range?: {
start: number;
end: number;
} | null): Promise<void>;
/**
* 获取文件MIME类型
*/
getMimeType(filePath: string): string;
}
//# sourceMappingURL=FileService.d.ts.map