import type { RuntimeAdapter } from "../../platform/adapters/base.js"; import { type MiddlewareFunction } from "../dev-server/middleware.js"; import type { HandlerContext } from "../../types/index.js"; type MiddlewareLoader = (projectDir: string, adapter: RuntimeAdapter, allowHostProjectCodeExecution: boolean) => Promise; interface ProjectMiddlewareRuntimeOptions { maxEntries?: number; loadMiddleware?: MiddlewareLoader; registryName?: string; } export interface ProjectMiddlewareRuntimeContext { request: Request; handlerContext: HandlerContext; isSharedProxy: boolean; next: () => Promise; /** Signals before project middleware can perform request-scoped side effects. */ onMiddlewareStart?: () => void; } /** Run one request phase inside the filesystem's authenticated tenant context. */ export declare function runInProjectFilesystemContext(ctx: HandlerContext, isSharedProxy: boolean, operation: () => Promise): Promise; /** Request-scoped root middleware loader for every project runtime. */ export declare class ProjectMiddlewareRuntime { #private; constructor(options?: ProjectMiddlewareRuntimeOptions); get size(): number; invalidateProject(projectIdentity: string): number; clear(): void; execute(input: ProjectMiddlewareRuntimeContext): Promise; } export declare const projectMiddlewareRuntime: ProjectMiddlewareRuntime; export declare function invalidateProjectMiddlewareCache(projectSlug: string, projectId?: string): number; export {}; //# sourceMappingURL=project-middleware.d.ts.map