UNPKG

@ima/core

Version:

IMA.js framework for isomorphic javascript application

66 lines 1.82 kB
import { Request as ExpressRequest } from 'express'; /** * Wrapper for the ExpressJS request, exposing only the necessary minimum. */ export declare class Request { /** * The current ExpressJS request object, or `null` if running at * the client side. */ protected _request?: ExpressRequest; static get $dependencies(): never[]; /** * Initializes the request using the provided ExpressJS request object. * * @param request The ExpressJS request object * representing the current request. Use `null` at the client * side. */ init(request: ExpressRequest): void; /** * Returns the path part of the URL to which the request was made. * * @return The path to which the request was made. */ getPath(): string; /** * Returns the `Cookie` HTTP header value. * * @return The value of the `Cookie` header. */ getCookieHeader(): string | undefined; /** * Returns uploaded file to server and meta information. */ getFile(): any; /** * Returns uploaded files to server with their meta information. */ getFiles(): any; /** * Returns body of request. */ getBody(): any; /** * Returns the specified HTTP request header. */ getHeader(header: string): string | null; /** * Returns the remote IP address of the request. */ getIP(): string | null; /** * Returns array of IP addresses specified in the “X-Forwarded-For” * request header. */ getIPs(): string[]; /** * Returns the HTTP method of the request. */ getMethod(): string; /** * Returns the raw request. */ getRequest(): ExpressRequest | undefined; } //# sourceMappingURL=Request.d.ts.map