UNPKG

@dazejs/framework

Version:

Daze.js - A powerful web framework for Node.js

121 lines (120 loc) 3.66 kB
/// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> /// <reference types="node" /> import accepts from 'accepts'; import Cookies from 'cookies'; import http from 'http'; import * as qs from 'querystring'; import { URL } from 'url'; import { Route } from '../router/route'; import { Session } from '../session'; export interface BodyData { fields?: any; files?: any; } export declare class Request { private app; private _params; private _body; private _cookies; private _session; private _req; private _res; private _cachedURL?; private _accepts?; private _route?; private _uuid; private _originUrl; [key: string]: any; constructor(req: http.IncomingMessage, res: http.ServerResponse); private proxy; initialize(route?: Route): Promise<void>; getUUID(): string; get req(): http.IncomingMessage; get res(): http.ServerResponse; getReq(): http.IncomingMessage; getRes(): http.ServerResponse; get body(): any; getBody(): any; get routeParams(): string[] | undefined; getRouteParams(): string[] | undefined; get files(): any; getFiles(): any; get isHttp2(): boolean; get header(): http.IncomingHttpHeaders; get headers(): any; set headers(val: any); setHeaders(val: object): this; get url(): string; set url(val: string); get originUrl(): string; getUrl(): string; setUrl(val: string): this; get origin(): string; getOrigin(): string; get href(): string; getHref(): string; get method(): string | undefined; getMethod(): string | undefined; get path(): string; getPath(): string; get query(): qs.ParsedUrlQuery; getQuery(name?: string): string | string[] | qs.ParsedUrlQuery | undefined; get querystring(): any; getQuerystring(): any; get search(): string; getSearch(): string; get host(): string; getHost(): string; get hostname(): string; getHostname(): string; get URL(): URL | undefined; getURL(): URL | undefined; get socket(): import("net").Socket; getSocket(): import("net").Socket; get length(): number | undefined; getLength(): number | undefined; get protocol(): string; getProtocol(): string; get secure(): boolean; getSecure(): boolean; get ips(): string[]; getIps(): string[]; get ip(): string; getIp(): string; get accept(): accepts.Accepts; getAccept(): accepts.Accepts; accepts(...params: string[]): string | false | string[]; acceptsTypes(...params: string[]): string | false | string[]; acceptsEncodings(...params: string[]): string | false; acceptsCharsets(...params: string[]): string | false; acceptsLanguages(...params: string[]): string | false; is(...types: any[]): string | false; get(name: string): string | string[]; getHeader(field: string): string | string[]; getHeaders(): any; get type(): string; getType(): string; get cookies(): Cookies; cookieValue(key: string, options?: any): string | undefined; session(): Session; sessionValue(key: string): any; get isAjax(): boolean; isOptions(): boolean; isHead(): boolean; isGet(): boolean; isPost(): boolean; isPut(): boolean; isPatch(): boolean; isDelete(): boolean; private get mergedParams(); getParam(name: string, defaultValue?: any): any; getParams(): { [key: string]: any; }; only(...args: any[]): any; except(...args: any[]): any; hasParam(name: string): boolean; validate(validator: any, message?: string): void; }