import type { Handler, Request, Response } from 'express'; import { AdapterBaseOptions } from '../types'; /** * Express middleware options */ export interface MiddlewareOptions extends AdapterBaseOptions { /** * Callback for getting a PrismaClient for the given request */ getPrisma: (req: Request, res: Response) => unknown | Promise; /** * Controls if the middleware directly sends a response. If set to false, * the response is stored in the `res.locals` object and then the middleware * calls the `next()` function to pass the control to the next middleware. * Subsequent middleware or request handlers need to make sure to send * a response. * * Defaults to true; */ sendResponse?: boolean; } /** * Creates an Express middleware for handling CRUD requests. */ declare const factory: (options: MiddlewareOptions) => Handler; export default factory; export { factory as ZenStackMiddleware };