UNPKG

@oriun/next-api

Version:

Next.js API routes with Zod validation

4 lines (3 loc) 604 B
import { Any, CreateApiParams, ErrorHandler, Schemas } from './types'; export declare function API<Q extends Any = Any, P extends Any = Any, B extends Any = Any, C extends Any = Any>(schemas?: Schemas<Q, P, B, C>, errorHandlers?: ErrorHandler[]): (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => TypedPropertyDescriptor<any>; export declare function createAPIDecorator({ middlewares, errorHandlers }?: CreateApiParams): (schema?: Schemas, localErrorHandlers?: ErrorHandler[]) => (_target: any, _propertyKey: string, descriptor: PropertyDescriptor) => TypedPropertyDescriptor<any>;