import * as t from 'io-ts'; import { CachedConf } from '../../cache'; import { UserError } from '../../shared'; import { Logger } from '../../ui'; import { UserRepository } from './user-repository'; export declare const EMAIL_KEY = "FORGE_EMAIL"; export declare const API_TOKEN_KEY = "FORGE_API_TOKEN"; export interface Keytar { getPassword(service: string, account: string): Promise; setPassword(service: string, account: string, password: string): Promise; deletePassword(service: string, account: string): Promise; } export declare const personalApiCredentialsShape: t.TypeC<{ email: t.StringC; token: t.StringC; }>; export declare const personalApiCredentialsValidatedShape: t.TypeC<{ email: t.StringC; token: t.StringC; accountId: t.StringC; }>; export declare type PersonalApiCredentials = t.TypeOf; export declare type PersonalApiCredentialsValidated = t.TypeOf; export declare class NoTokenInStoreError extends UserError { constructor(); } export declare class NoKeytarError extends UserError { constructor(); } export declare class KeytarAccessError extends UserError { } export interface CredentialGetter { getCredentials(): Promise; } export interface CredentialStore extends CredentialGetter { setCredentials(credentials: PersonalApiCredentialsValidated): Promise; deleteCredentials(): Promise; } export declare class CredentialStoreImpl implements CredentialStore { private readonly logger; private readonly instructionsURL; private readonly keytar; private readonly cachedConfig; private readonly userRepository; private keytarAccount; constructor(logger: Logger, instructionsURL: string, keytar: Keytar | null, cachedConfig: CachedConf, userRepository: UserRepository); private wrapKeytarError; decodeCredentials(credentialsString: string | null): PersonalApiCredentialsValidated; getCredentialsKeytar(keytar: Keytar): Promise; popInsecurePlaintextCredentials(): PersonalApiCredentialsValidated | undefined; deleteInsecurePlaintextCredentials(): void; getCredentials(): Promise; setCredentials(credentials: PersonalApiCredentialsValidated): Promise; deleteCredentials(): Promise; } export declare function getCredentialStore(logger: Logger, userRepository: UserRepository): CredentialStore; //# sourceMappingURL=credential-store.d.ts.map