import { ProjectScopedMiddleware } from "./authz-meta.js";
import { createRoute } from "@hono/zod-openapi";
import { ZodType } from "zod";
import { MiddlewareHandler } from "hono";

//#region src/middleware/create-protected-route.d.ts
type CreateRouteParams = Parameters<typeof createRoute>[0];
declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
  permission: ProjectScopedMiddleware<any>;
  entitlement?: MiddlewareHandler;
  request: {
    params: ZodType<{
      projectId: string;
    }>;
  };
}): T;
declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
  permission: ProjectScopedMiddleware<any>;
  entitlement?: MiddlewareHandler;
  request: {
    params: ZodType<{
      id: string;
    }>;
  };
}): T;
declare function createProtectedRoute<T extends CreateRouteParams>(config: T & {
  permission: MiddlewareHandler & {
    __projectScoped?: never;
  };
  entitlement?: MiddlewareHandler;
}): T;
//#endregion
export { createProtectedRoute };