UNPKG

arrest

Version:

OpenAPI v3 compliant REST framework for Node.js, with support for MongoDB and JSON-Schema

16 lines (15 loc) 691 B
import { NextFunction } from 'express'; import { OpenAPIV3 } from 'openapi-police'; import { Operation } from './operation.js'; import { APIRequest, APIResponse } from './types.js'; export declare function rpc(target: JSONRPC, propertyKey: string): void; export declare class JSONRPCError extends Error { code: number; data?: any; constructor(code: number, message: string, data?: any); } export declare abstract class JSONRPC extends Operation { protected getCustomInfo(): OpenAPIV3.OperationObject; handler(req: APIRequest, res: APIResponse, next: NextFunction): any; protected errorHandler(err: any, req: APIRequest, res: APIResponse, next: NextFunction): void; }