import { AnyJson, JsonMap, Optional } from '@salesforce/ts-types';
import { ConfigFile } from './configFile';
import { ConfigValue } from './configStore';
export declare enum SfInfoKeys {
    ORGS = "orgs",
    TOKENS = "tokens"
}
export declare type Timestamp = {
    timestamp: string;
};
export declare type SfEntry = JsonMap;
export declare type SfOrg = {
    alias: Optional<string>;
    username: Optional<string>;
    orgId: Optional<string>;
    instanceUrl: Optional<string>;
    accessToken?: string;
    oauthMethod?: 'jwt' | 'web' | 'token' | 'unknown';
    error?: string;
} & SfEntry;
export interface SfOrgs {
    [key: string]: SfOrg & Timestamp;
}
export declare type SfToken = {
    token: string;
    url: string;
    user?: string;
} & SfEntry;
export interface SfTokens {
    [key: string]: SfToken & Timestamp;
}
export declare type SfInfo = {
    [SfInfoKeys.ORGS]: SfOrgs;
    [SfInfoKeys.TOKENS]: SfTokens;
};
export declare function deepCopy<T extends AnyJson>(data: T): T;
export declare class GlobalInfo extends ConfigFile<ConfigFile.Options, SfInfo> {
    protected static encryptedKeys: RegExp[];
    private static EMPTY_DATA_MODEL;
    private static instance;
    private sfdxHandler;
    static get emptyDataModel(): SfInfo;
    static getInstance(): Promise<GlobalInfo>;
    /**
     * Clear the cache to force reading from disk.
     *
     * *NOTE: Only call this method if you must and you know what you are doing.*
     */
    static clearInstance(): void;
    static getFileName(): string;
    /**
     * Gets default options for the SfConfig
     */
    static getDefaultOptions(): ConfigFile.Options;
    getOrgs(decrypt?: boolean): SfOrgs;
    getOrg(username: string, decrypt?: boolean): Optional<SfOrg & Timestamp>;
    hasOrg(username: string): boolean;
    setOrg(username: string, org: SfOrg): void;
    updateOrg(username: string, authorization: Partial<SfOrg>): void;
    unsetOrg(username: string): void;
    getTokens(decrypt?: boolean): SfTokens;
    getToken(name: string, decrypt?: boolean): Optional<SfToken & Timestamp>;
    hasToken(name: string): boolean;
    setToken(name: string, token: SfToken): void;
    updateToken(name: string, token: Partial<SfToken>): void;
    unsetToken(name: string): void;
    set(key: string, value: ConfigValue): void;
    write(newContents?: SfInfo): Promise<SfInfo>;
    protected init(): Promise<void>;
    private timestamp;
    private loadSfData;
    private mergeWithSfdxData;
}
