import * as http from 'http';
import { Auth0Client, UserInfo as Auth0UserInfo } from './auth0-client.js';
import { EntraClient, UserInfo as EntraUserInfo } from './entra-client.js';
export type UserInfo = Auth0UserInfo | EntraUserInfo;
export interface AuthenticatedRequest extends http.IncomingMessage {
    user?: UserInfo;
    scopes?: string[];
    token?: string;
    trackexApiKey?: string;
}
export interface OAuthMiddlewareConfig {
    provider: 'auth0' | 'entra';
    auth0Domain: string;
    auth0Audience: string;
    entraTenantId: string;
    entraClientId: string;
    entraClientSecret: string;
    entraAuthority: string;
    requiredScopes?: string[];
    skipPaths?: string[];
}
export declare class OAuthMiddleware {
    private auth0Client?;
    private entraClient?;
    private config;
    constructor(config: OAuthMiddlewareConfig);
    /**
     * Middleware function to authenticate requests
     */
    authenticate(req: http.IncomingMessage, _res: http.ServerResponse): Promise<{
        authenticated: boolean;
        user?: UserInfo;
        scopes?: string[];
        error?: string;
    }>;
    /**
     * Send authentication error response
     */
    sendAuthError(res: http.ServerResponse, error: string, statusCode?: number): void;
    /**
     * Get Auth0 client instance (legacy method)
     */
    getAuth0Client(): Auth0Client | undefined;
    /**
     * Get MS Entra client instance
     */
    getEntraClient(): EntraClient | undefined;
    /**
     * Get the active OAuth client based on provider
     */
    getOAuthClient(): Auth0Client | EntraClient | undefined;
}
//# sourceMappingURL=middleware.d.ts.map