export interface OAuthProviderConfig {
    readonly authUrl: string;
    readonly tokenUrl: string;
    readonly clientId: string;
    readonly redirectUri: string;
    readonly manualRedirectUri?: string;
    readonly scopes?: readonly string[];
    readonly audience?: string;
    readonly usePkce?: boolean;
    readonly authParams?: Readonly<Record<string, string>>;
    readonly tokenRequestEncoding?: 'form' | 'json';
    readonly includeStateInTokenRequest?: boolean;
    readonly tokenRequestExtras?: Readonly<Record<string, string | number | boolean>>;
    readonly refreshRequestEncoding?: 'form' | 'json';
    readonly refreshRequestExtras?: Readonly<Record<string, string | number | boolean>>;
    readonly refreshScopes?: readonly string[];
    readonly overrideAmbientApiKeys?: boolean;
    readonly localCallback?: {
        readonly host?: string;
        readonly port?: number;
        readonly path?: string;
        readonly autoComplete?: boolean;
    };
}
export interface PendingSubscriptionLogin {
    readonly provider: string;
    readonly state: string;
    readonly verifier: string;
    readonly redirectUri: string;
    readonly createdAt: number;
}
export interface ProviderSubscription {
    readonly provider: string;
    readonly accessToken: string;
    readonly refreshToken?: string;
    readonly tokenType: string;
    readonly expiresAt?: number;
    readonly scopes?: readonly string[];
    readonly authMode: 'oauth';
    readonly overrideAmbientApiKeys: boolean;
    readonly createdAt: number;
    readonly updatedAt: number;
}
export declare class SubscriptionManager {
    private readonly path;
    constructor(path: string);
    private read;
    private write;
    list(): ProviderSubscription[];
    listPending(): PendingSubscriptionLogin[];
    get(provider: string): ProviderSubscription | null;
    getAccessToken(provider: string): string | null;
    resolveAccessToken(provider: string, config: OAuthProviderConfig): Promise<string | null>;
    beginOAuthLogin(provider: string, config: OAuthProviderConfig): {
        authorizationUrl: string;
        pending: PendingSubscriptionLogin;
    };
    completeOAuthLogin(provider: string, config: OAuthProviderConfig, code: string): Promise<ProviderSubscription>;
    refreshOAuthToken(provider: string, config: OAuthProviderConfig): Promise<ProviderSubscription>;
    logout(provider: string): boolean;
    getPending(provider: string): PendingSubscriptionLogin | null;
    savePending(pending: PendingSubscriptionLogin): void;
    clearPending(provider: string): void;
    saveSubscription(subscription: ProviderSubscription): ProviderSubscription;
}
//# sourceMappingURL=subscriptions.d.ts.map