/*! * CMMV Server Static * Copyright(c) 2024 Andre Ferreira * MIT Licensed */ import * as zlib from 'node:zlib'; export interface StaticOptions { root?: string; prefix?: string; maxAge?: number; cacheControl?: boolean; dotfiles?: 'allow' | 'deny' | 'ignore'; serverDotfiles?: boolean; index?: string | boolean; fallthrough?: boolean; redirect?: boolean; immutable?: boolean; lastModified?: boolean; etag?: boolean; extensions?: any; acceptRanges?: boolean; preCompressed?: boolean; allowedPath?: any; setHeaders?: (res: any, path: any, stat: any) => void; } export declare class ServerStaticMiddleware { middlewareName: string; private app; private root; private options; constructor(root: string | string[], options?: StaticOptions); process(server: any, done: any): Promise; onCall(): Promise; setUpHeadAndGet(routeOpts: any, route: any, file: any, rootPath: any): void; serveFileHandler(req: any, res: any): Promise; pumpSendToReply(req: any, res: any, pathname: any, rootPath: any, rootPathOffset?: number, pumpOptions?: any, checkedEncodings?: any): Promise; streamToBuffer(stream: any): Promise; compressData(inputBuffer: Buffer, compressionStream: zlib.Gzip | zlib.Deflate): Promise; createNotFoundDirectoryListener(): (this: any) => void; createRedirectDirectoryListener(): (this: any, res: any) => void; getContentType(path: any): string; getEncodingHeader(headers: any, checked: any): string; getEncodingExtension(encoding: any): "gz" | "br"; findIndexFile(pathname: any, root: any, indexFiles?: string[]): string | false; } export default function (root: string, options?: StaticOptions): Promise<(server: any, done: any) => Promise>; export declare const serveStatic: (root: string, options?: StaticOptions) => (server: any, done: any) => Promise;