/// <reference types="node" />
import { ParsedUrlQuery } from 'querystring';
/**
 * Security context that keeps track of current authentication token.
 * It's not recommended you instantiate this class on your own but rather inherit your commands from [[CommandBase]].
 */
export default class SecurityContext {
    private readonly clientId;
    private readonly devopsResourceId;
    private readonly tenant;
    private readonly authorityUrl;
    private readonly redirectUri;
    private readonly resource;
    private readonly _accessTokenPath;
    private readonly _pca;
    private readonly _cryptoProvider;
    private _verifier;
    private _challenge;
    /**
     * Initializes [[SecurityContext]] with config directory where access token JSON will be stored.
     * @param configDir Directory where CLI configuration is stored
     */
    constructor(configDir: string);
    /**
     * Get the accessTokenPath, as it is a private variable
     * @returns {string} Returns access token path
     */
    getTokenPath(): string;
    /**
     * Contacts authority server, fetches and saves the authentication token to be used in subsequent requests.
     *
     * @param code Authorization code used to fetch the token.
     * @returns [[Promise<TokenResponse>]]
     */
    getLoginUrl(): Promise<string>;
    /**
     * Retrieves the refresh token from the MSAL (Microsoft Authentication Library) token cache.
     *
     * @returns {string} The refresh token.
     *
     * @example
     * const refreshToken = getRefreshToken();
     * console.log(refreshToken);
     *
     * @description
     * The `getRefreshToken` function extracts the refresh token from the serialized token cache
     * managed by the MSAL library. This function first serializes the token cache, parses it into
     * a JSON object, and then retrieves the refresh token from the parsed object.
     *
     * @throws {Error} If there are issues with parsing the token cache or accessing the refresh token.
     */
    getRefreshToken(): string;
    /**
     * Gets the current authentication token.
     * This function will also automatically try to refresh token if expired.
     *
     * @throws Error when authentication failed and/or call to login is needed
     * @returns Promise that resolves bearer authentication token
     */
    getToken(): Promise<string>;
    /**
     * Contacts authority server, fetches and saves the authentication token to be used in subsequent requests.
     *
     * @param query Authorization query used to fetch the token.
     * @returns [[Promise<TokenResponse>]]
     */
    acquireToken(query: ParsedUrlQuery): Promise<string>;
    /**
     * Acquires token using device flow.
     *
     * @returns [[Promise<TokenResponse>]]
     */
    acquireTokenDeviceFlow(): Promise<void>;
    /**
     * Get NPM token for adinsure npm repositories
     *
     * @returns [[Promise<string>]]
     */
    getNPMToken(): Promise<string>;
}
