@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
29 lines • 1.16 kB
TypeScript
import { PrismaClient } from "./types-prisma";
import type { NextApiRequest, NextApiResponse } from "next";
import { NextHandler } from "next-connect";
import { NextAdminOptions } from "./types";
type CreateAppHandlerParams<P extends string = "nextadmin"> = {
/**
* `apiBasePath` is a string that represents the base path of the admin API route. (e.g. `/api`) - optional.
*/
apiBasePath: string;
/**
* Next-admin options
*/
options?: NextAdminOptions;
/**
* Prisma client instance
*/
prisma: PrismaClient;
/**
* A function that acts as a middleware. Useful to add authentication logic for example.
*/
onRequest?: (req: NextApiRequest, res: NextApiResponse, next: NextHandler) => Promise<void>;
paramKey?: P;
};
export declare const createHandler: <P extends string = "nextadmin">({ apiBasePath, options, prisma, paramKey, onRequest, }: CreateAppHandlerParams<P>) => {
run: (req: NextApiRequest, res: NextApiResponse) => Promise<unknown>;
router: import("next-connect/types/node").NodeRouter<NextApiRequest, NextApiResponse>;
};
export {};
//# sourceMappingURL=pageHandler.d.ts.map