import { ErrorRequestHandler, RequestHandler, Response } from 'express'; import multer from 'multer'; import { IBakkuHttpError, Identifier, IdentifyOption, TypeHandleInjectedMethod } from '../basic'; import { IArraySchema, IEnumSchema, IFileSchema, ISchemaCore, ISchemaGeneral, IValidationError } from '../validation'; export interface IControllerInjectedParams extends IdentifyOption { path: string; description?: string; hideInDoc?: boolean; } export type TypeRequestMethod = 'get' | 'post' | 'put' | 'patch' | 'delete'; export declare const AllRequestMethods: TypeRequestMethod[]; export interface IRequestInjectedParams { /** 'get' | 'post' | 'put' | 'patch' | 'delete' */ type: TypeRequestMethod; /** api path */ path: string; /** description for api*/ description?: string; /** define content type in body when make request: application/json, application/xml, application/octet-stream, multipart/form-data... */ bodyContentType?: string; /** API is not show in document */ hideInDoc?: boolean; middlewares?: MiddlewareInjectData; multer?: IMulterInjectedParams; customSuccessHandler?: ResponseDataHandler; successSchema?: ISchemaGeneral; customErrorHandler?: ErrorRequestHandler; errorSchema?: ISchemaGeneral; errorData?: IBakkuHttpError | IBakkuHttpError[]; customValidation?: TypeValidateFunctionInjectedParams; } export declare const RequestMethodApiKey: unique symbol; type TypeRequestParameterFrom = 'request' | 'response' | 'body' | 'headers' | 'params' | 'query'; export type RequestParamInjectedParams = { from: TypeRequestParameterFrom | string; schema?: ISchemaCore; }; export declare const RequestParamApiKey: unique symbol; export interface IResponseInjectedParams { description?: string; dataSchema?: ISchemaCore; error?: IBakkuHttpError | IBakkuHttpError[]; errorSchema?: ISchemaCore; } export declare const ResponseDataSchemaAPiKey: unique symbol; type TypeExtraDataPropertyInjectedParams = { sample?: T; description?: string; }; export type IDataPropertyInjectedParams = TypeExtraDataPropertyInjectedParams & ISchemaGeneral; export declare const DataPropertyApiKey: unique symbol; export type IEnumPropertyInjectedParams = TypeExtraDataPropertyInjectedParams & IEnumSchema; export type IArrayPropertyInjectedParams = TypeExtraDataPropertyInjectedParams & IArraySchema; export type IFilePropertyInjectedParams = TypeExtraDataPropertyInjectedParams & IFileSchema; export interface IMulterFileOption { name: string; } export interface IMulterMultiFileOption extends IMulterFileOption { maxCount?: number; } export interface IMulterInjectedParams { single?: IMulterFileOption; array?: IMulterMultiFileOption; fields?: IMulterMultiFileOption[]; options?: multer.Options; } export type TypeGetRequestHandle = () => RequestHandler; export interface IBeforeInjectedParams { type?: string; requestHandle?: RequestHandler; getRequestHandle?: TypeGetRequestHandle; } export declare const RequestHandleMulterKey: unique symbol; export type MiddlewareInjectData = RequestHandler | RequestHandler[]; export declare const ResponseHandleErrorApiKey: unique symbol; export type ResponseDataHandler = (data: any, res: Response) => void; export declare const ResponseCustomHandleApiKey: unique symbol; export type TypeValidateFunctionInjectedParams = (...args: any[]) => (IValidationError | undefined) | Promise; export type TypeHandleMethodDecorator = (metadataMethodKey: Identifier) => TypeHandleInjectedMethod; export type TypeServerOptions = { host?: string; port?: number; }; export {}; //# sourceMappingURL=core.definition.d.ts.map