UNPKG

@breautek/storm

Version:

Object-Oriented REST API framework

39 lines (38 loc) 1.27 kB
import * as express from 'express'; import { IncomingHttpHeaders } from 'http'; import { Writable } from 'stream'; import { IFormData } from './IFormData'; import { IAuthTokenData } from './IAuthTokenData'; import { IDatabasePosition } from './IDatabasePosition'; export interface IParameterMap { [key: string]: string; } export declare class Request<TBody = any, TAuthToken extends IAuthTokenData = IAuthTokenData> { private $request; constructor(request: express.Request); getBody(): TBody; getForm(): Promise<IFormData>; getHeaders(): IncomingHttpHeaders; getHeader(name: string): string; getQueryVariables(): any; getParams(): IParameterMap; getParam(name: string): string; getIP(): string; getForwardedIP(): string; getHostname(): string; getMethod(): string; getURL(): string; isSecure(): boolean; pipe(destination: Writable): Writable; unpipe(source: Writable): void; getRequestSource(): express.Request; /** * Reads the Page/Position DB headers if present * Will return null if headers are not parseable. * * @since 9.1.0 * @returns {IDatabasePosition} */ getDatabasePosition(): IDatabasePosition; getAuthenticationToken(): Promise<TAuthToken>; }