/** * ============================================================================ * EXPRESS ROUTE FACTORY * ============================================================================ * * Factory for creating Express route handlers with minimal boilerplate. * Supports full TypeScript generics for body, params, query, and response types. * Provides access to injected Core services (db, storage, notifications, cache). * * @example Basic usage * ```typescript * import { createExpressRoute } from '@plyaz/core/frameworks/express'; * * const userRoutes = createExpressRoute({ * service: 'users', * handlers: { * GET: async (service, ctx) => service.getAll(), * POST: async (service, ctx) => service.create(ctx.body), * }, * }); * * app.use('/api/users', userRoutes.handler); * // OR mount individual handlers * app.get('/api/users', userRoutes.GET); * app.post('/api/users', userRoutes.POST); * ``` * * @example With typed body and params * ```typescript * interface CreateUserBody { name: string; email: string; } * interface UserParams { id: string; } * * const userRoutes = createExpressRoute< * UserService, * { GET: { params: UserParams }; POST: { body: CreateUserBody } } * >({ * service: 'users', * handlers: { * GET: async (service, { params }) => service.getById(params.id), * POST: async (service, { body }) => service.create(body), * }, * }); * ``` */ import type { HandlersTypeMap, CoreExpressRouteConfig, CoreExpressRouteExports } from '@plyaz/types/core'; /** * Create Express route handlers with full type safety. * See file header for usage examples. * * @param config - Route configuration * @returns Object with handler middleware and individual method handlers */ export declare function createExpressRoute(config: CoreExpressRouteConfig): CoreExpressRouteExports; //# sourceMappingURL=route-factory.d.ts.map