import { Request, Response } from 'express'; export { Request, Response } from 'express'; export type ParamFrom = 'req' | 'res' | 'user' | 'auth' | 'query' | 'param' | 'body' | 'full-body'; export type PropBinding = { index: number; from: ParamFrom; name: string | symbol | undefined; type?: any; opt?: boolean; }; export interface HttpAction { method: string; url: string; params: PropBinding[]; /** Name of the required permission, or `true` if authorization needed, or `false` if public */ permission?: string | boolean; middlewares: ((req: Request, res: Response, next: Function) => void)[]; } export interface HttpActionProperty { (req: Request, res: Response): any; action: HttpAction; } export declare class WebError extends Error { static requestErrorTransformer: (error: WebError, message: string, statusCode: number, errorCode?: number | string) => void; statusCode: number; code?: number | string; text?: string; json?: Object | Array; constructor(message: string); constructor(message: string, statusCode: number); constructor(message: string, settings: { /** HTTP status code to return */ statusCode?: number; /** Error code to return within the body */ errorCode?: number | string; }); } export interface Validator { /** Type constructor */ type: any; /** Property checker */ check(value: any): boolean; /** Optional: for parsing items from query */ parse(value: string): any; /** Optional: to indicate that this binding disables requrest autoclose */ disableAutoClose?: boolean; } export interface RequestWithUserOrAuth extends Request { user: { hasPermission?(permission: string): boolean | Promise; roles?: string[]; }; auth: { hasPermission?(permission: string): boolean | Promise; roles?: string[]; }; } export declare function getAllFuncs(obj: any): string[];