import { NextApiRequest, NextApiResponse } from "next"; import type { User } from "../app/store/types"; export interface Auth extends User { id: string; } export interface WithAuth { auth?: Auth; } export declare type Handler = (req: NextApiRequest & WithAuth, res: NextApiResponse) => Promise; export interface NextContext { req: NextApiRequest & WithAuth; res: NextApiResponse; } export interface Context { auth: Auth; } export declare function withAuth(ctx: NextContext): Context; export declare function adminOnly(auth: Auth, next: () => R): R;