import express from 'express';
import { OAuthAuthenticator, OAuthAuthenticatorResult } from './types';
import { OAuthCookieManager } from './OAuthCookieManager';
import { OAuthState } from './state';
import { Config } from '@backstage/config';
export declare class CookieScopeManager {
    private readonly scopeTransform;
    private readonly cookieManager?;
    static create(options: {
        config?: Config;
        additionalScopes?: string[];
        authenticator: OAuthAuthenticator<any, any>;
        cookieManager: OAuthCookieManager;
    }): CookieScopeManager;
    private constructor();
    start(req: express.Request): Promise<{
        scopeState?: Partial<OAuthState>;
        scope: string;
    }>;
    handleCallback(req: express.Request, ctx: {
        result: OAuthAuthenticatorResult<any>;
        state: OAuthState;
        origin?: string;
    }): Promise<string>;
    clear(req: express.Request): Promise<void>;
    refresh(req: express.Request): Promise<{
        scope: string;
        scopeAlreadyGranted?: boolean;
        commit(result: OAuthAuthenticatorResult<any>): Promise<string>;
    }>;
}
