import { APIGatewayProxyEvent } from "aws-lambda"; import { Response } from './response'; import { MultipartBody } from "request"; export declare type C4CApiHandler = (req: C4CApiRequest, res: C4CApiResponse, next: () => void, options?: Record) => Promise; export declare type AddRoutes = (sr: Router) => {}; export declare type ContinueFlag = { result?: any; next: boolean; }; export { Simulator } from "./simulator"; export * as bodyParser from './middlewares/body.parser'; export * as staticHandler from './middlewares/static.handler'; export * as cookieParser from './middlewares/cookie.parser'; export * as protocolMiddleware from './middlewares/protocol.middleware'; export interface C4CApiRequest extends APIGatewayProxyEvent { params?: Record; _body?: MultipartBody; cookies?: Record; sd?: Record; } export interface C4CApiResponse extends Response { multiValueHeaders?: Record; } export interface C4CScfContext extends Record { } export declare class Router { private readonly _handlers; private readonly _request; private readonly options; _response: Response; constructor(request: C4CApiRequest, options?: Record); add(paths: C4CApiHandler | string | string[], handler?: C4CApiHandler, method?: string): void; extends(prefix: string | AddRoutes, addRoute?: AddRoutes | string): void; put(paths: string | C4CApiHandler, handler?: C4CApiHandler): void; get(paths: string | C4CApiHandler, handler?: C4CApiHandler): void; post(paths: string | C4CApiHandler, handler?: C4CApiHandler): void; del(paths: string | C4CApiHandler, handler?: C4CApiHandler): void; use(paths: string | C4CApiHandler, handler?: C4CApiHandler): void; executeHandler(handler: { func: C4CApiHandler; params: Record; }, flags: ContinueFlag): Promise<{ continue: boolean; result?: any; }>; /** * start the route server */ serve(): Promise; }