alepha
Version:
Alepha is a convention-driven TypeScript framework for building robust, end-to-end type-safe applications, from serverless APIs to full-stack React apps.
32 lines (31 loc) • 1.4 kB
TypeScript
import * as _alepha_core0 from "alepha";
import { HookDescriptor } from "alepha";
import { ServerResponse } from "alepha/server";
import { Transform } from "node:stream";
//#region src/providers/ServerCompressProvider.d.ts
declare class ServerCompressProvider {
compressors: Record<string, {
compress: (...args: any[]) => Promise<Buffer>;
stream: (options?: any) => Transform;
} | undefined>;
options: ServerCompressProviderOptions;
readonly onResponse: HookDescriptor<"server:onResponse">;
protected isAllowedContentType(contentType: string | undefined): boolean;
protected compress(encoding: keyof typeof (void 0).compressors, response: ServerResponse): Promise<void>;
protected getParams(encoding: keyof typeof (void 0).compressors): Record<number, any>;
protected setHeaders(response: ServerResponse, encoding: keyof typeof (void 0).compressors): void;
}
interface ServerCompressProviderOptions {
allowedContentTypes: string[];
}
//#endregion
//#region src/index.d.ts
/**
* Plugin for Alepha Server that provides server-side compression capabilities.
*
* Compresses responses using gzip, brotli, or zstd based on the `Accept-Encoding` header.
*/
declare const AlephaServerCompress: _alepha_core0.Service<_alepha_core0.Module>;
//#endregion
export { AlephaServerCompress, ServerCompressProvider, ServerCompressProviderOptions };
//# sourceMappingURL=index.d.ts.map