/**
 * Edge-Compatible Middleware Module
 *
 * This module provides middleware utilities that are compatible with Edge Runtime.
 * It exports functions that don't depend on Node.js-only modules like 'pg' or 'crypto'.
 *
 * IMPORTANT: This module must remain edge-compatible. Do NOT import from:
 * - ./services (barrel export that includes database services)
 * - ./db
 * - ./auth (full auth module)
 * - Any module that uses 'pg', 'crypto', or other Node.js modules
 *
 * SAFE TO IMPORT:
 * - @nextsparkjs/registries/* (pure data, no Node.js dependencies)
 * - next/server
 * - @better-fetch/fetch
 */
import { NextRequest, NextResponse } from 'next/server';
import { type MiddlewareRegistryEntry, type ThemeName } from '@nextsparkjs/registries/middleware-registry';
export type { MiddlewareRegistryEntry, ThemeName };
/**
 * Minimal session user type for middleware headers
 * This avoids importing the full auth module which has Node.js dependencies
 */
export interface SessionUser {
    id: string;
    email?: string;
    role?: string;
    [key: string]: unknown;
}
/**
 * Check if a theme has middleware defined
 * @complexity O(1)
 */
export declare function hasThemeMiddleware(themeName: string): boolean;
/**
 * Execute theme middleware with error handling
 * @complexity O(1) + async execution time
 */
export declare function executeThemeMiddleware(themeName: string, request: NextRequest, coreSession?: SessionUser | null): Promise<NextResponse | null>;
/**
 * Get app config for a theme
 * @complexity O(1)
 */
export declare function getThemeAppConfig(themeName: string): any | undefined;
/**
 * Redirect to login with callback URL
 * Use for unauthenticated users trying to access protected routes
 * @complexity O(1)
 */
export declare function redirectWithoutSession(request: NextRequest, targetPath?: string): NextResponse;
/**
 * Redirect authenticated user to target path
 * Use for authenticated users trying to access login/signup pages
 * @complexity O(1)
 */
export declare function redirectWithSession(request: NextRequest, targetPath?: string): NextResponse;
/**
 * Add user headers to request for downstream processing
 * Adds x-user-id, x-user-email, and x-pathname headers
 * @complexity O(1)
 */
export declare function addUserHeaders(request: NextRequest, sessionUser: SessionUser | null): NextResponse;
//# sourceMappingURL=index.d.ts.map