@glandjs/http
Version:
A protocol adapter for HTTP built on top of the Gland architecture solution.
44 lines (43 loc) • 2.33 kB
TypeScript
import { HttpApplicationOptions } from './interface';
import { type ServerListening } from './types/app-options.types';
import type { HttpServerAdapter } from './adapter';
import type { CorsConfig, RouteAction } from './types';
export declare class HttpCore<TServer, TApp, TRequest, TResponse> {
private readonly _adapter;
constructor(_adapter: HttpServerAdapter<TServer, TApp, TRequest, TResponse>, options?: HttpApplicationOptions);
private initializeEvents;
get broker(): import("./adapter").HttpEventCore<import("./adapter").HttpGlandEvents>;
get id(): string;
get settings(): void;
listen(port: number, args?: ServerListening): void;
use(...args: any[]): void;
private _registerRoute;
get(path: string, action: RouteAction<TRequest, TResponse>): this;
post(path: string, action: RouteAction<TRequest, TResponse>): this;
put(path: string, action: RouteAction<TRequest, TResponse>): this;
delete(path: string, action: RouteAction<TRequest, TResponse>): this;
patch(path: string, action: RouteAction<TRequest, TResponse>): this;
head(path: string, action: RouteAction<TRequest, TResponse>): this;
options(path: string, action: RouteAction<TRequest, TResponse>): this;
all(path: string, action: RouteAction<TRequest, TResponse>): this;
search(path: string, action: RouteAction<TRequest, TResponse>): this;
propfind(path: string, action: RouteAction<TRequest, TResponse>): this;
proppatch(path: string, action: RouteAction<TRequest, TResponse>): this;
mkcol(path: string, action: RouteAction<TRequest, TResponse>): this;
copy(path: string, action: RouteAction<TRequest, TResponse>): this;
move(path: string, action: RouteAction<TRequest, TResponse>): this;
lock(path: string, action: RouteAction<TRequest, TResponse>): this;
unlock(path: string, action: RouteAction<TRequest, TResponse>): this;
enableCors(options: CorsConfig): void;
setViewEngine(engine: string): this;
setBaseViewsDir(path: string | string[]): this;
useStaticAssets(path: string): void;
setGlobalPrefix(prefix: string): void;
handleError(error: any, message: string): void;
json(options?: any): this;
urlencoded(options?: {
extended?: boolean;
}): this;
raw(options?: any): this;
text(options?: any): this;
}