import { ReqUser } from "./ReqUser"; import { Request as RestifyRequest, Response as RestifyResponse, Next as RestifyNext } from "restify"; export interface Request, UrlParams = Record, QueryParams = any> extends RestifyRequest { body: BodyParams; params: UrlParams; user: ReqUser; query: QueryParams; } export interface Next extends RestifyNext { (err?: any): void; } export interface Response> extends RestifyResponse { /** * short hand method for: * res.contentType = 'json'; * res.send({hello: 'world'}); * @param code http status code * @param body value to json.stringify * @param [headers] headers to set on the response */ json(code: number, body: Body, headers?: { [header: string]: string; }): any; /** * short hand method for: * res.contentType = 'json'; * res.send({hello: 'world'}); * @param code http status code */ json(code: number): any; /** * short hand method for: * res.contentType = 'json'; * res.send({hello: 'world'}); * @param body value to json.stringify * @param [headers] headers to set on the response */ json(body: Body, headers?: { [header: string]: string; }): any; /** * sends the response object. pass through to internal __send that uses a * formatter based on the content-type header. * @param [code] http status code * @param [body] the content to send * @param [headers] any add'l headers to set * @returns the response object */ send(code?: number, body?: Body, headers?: { [header: string]: string; }): any; /** * sends the response object. pass through to internal __send that uses a * formatter based on the content-type header. * @param [body] the content to send * @param [headers] any add'l headers to set * @returns the response object */ send(body?: Body, headers?: { [header: string]: string; }): any; }