UNPKG

zents

Version:

ZenTS is a Node.js & TypeScript MVC-Framework for building rich web applications, released as free and open-source software under the MIT License. It is designed for building web applications with modern tools and design patterns.

27 lines (26 loc) 1.01 kB
/// <reference types="node" /> import type { IncomingMessage, ServerResponse } from 'http'; import type { IncomingParams, QueryString, RequestValidationError, Route } from '../types/interfaces'; import { Cookie } from './Cookie'; import type { JsonObject } from 'type-fest'; import { Request } from './Request'; import { Response } from './Response'; import { ResponseError } from './ResponseError'; export declare class Context { private container; private requestBodyValidationErrors; private isBuild; private isReqBodyValid; build(request: IncomingMessage, response: ServerResponse, params: IncomingParams, route: Route): Promise<void>; get req(): Request; get request(): Request; get res(): Response; get response(): Response; get body(): JsonObject; get query(): QueryString; get params(): IncomingParams; get cookie(): Cookie | null; get error(): ResponseError; get isValid(): boolean; get validationErrors(): RequestValidationError[]; }