/// <reference types="node" />
import type { DecodedUserToken, UsersApi } from '../api/generated/default';
import type { LoggerService } from '../services/Logger';
import { OAuthScope, IsWriteAccessGrantedRequest, WriteOnceParams, OAuthEnv } from './types';
export declare type LoginSuccessCallback = (profile: DecodedUserToken, encodedJwt: string) => void;
export declare type LoginErrorCallback = (errorMessage: string) => void;
export declare type ButtonOptions = Partial<{
    size: 'small' | 'medium' | 'large';
    corners: 'default' | 'pill';
    customText: string;
    disableHoverGrow: boolean;
    fullWidth: boolean;
}>;
declare type OAuthConfig = {
    appName?: string;
    apiKey?: string;
    usersApi: UsersApi;
    logger: LoggerService;
};
export declare class OAuth {
    private readonly config;
    activePopupWindow: null | Window;
    popupCheckInterval: NodeJS.Timeout | null;
    loginSuccessCallback: LoginSuccessCallback | null;
    loginErrorCallback: LoginErrorCallback | null;
    apiKey: string | null;
    env: OAuthEnv;
    logger: LoggerService;
    constructor(config: OAuthConfig);
    init({ successCallback, errorCallback, env }: {
        successCallback: LoginSuccessCallback;
        errorCallback?: LoginErrorCallback;
        env?: OAuthEnv;
    }): void;
    isWriteAccessGranted(params: IsWriteAccessGrantedRequest): Promise<boolean>;
    login({ scope, params }: {
        scope?: OAuthScope;
        params?: WriteOnceParams;
    }): void;
    renderButton({ element, scope, buttonOptions }: {
        element: HTMLElement;
        scope?: OAuthScope;
        buttonOptions?: ButtonOptions;
    }): void;
    /**
     * Verify if the given jwt ID token was signed by the subject (user) in the payload
     * @deprecated see `UsersApi.verifyIDToken`
     * @param token the token to verify
     * @returns
     */
    verifyToken(token: string): Promise<import("../api/generated/default").VerifyToken>;
    getCsrfToken(): string | null;
    _surfaceError(errorMessage: string): void;
    _clearPopupCheckInterval(): void;
    _receiveMessage(event: MessageEvent): Promise<void>;
}
export {};
