import { CommonArgs } from "../index";
import { AuthConfig } from "./config-utils";
export type AuthData = {
    user: string;
    token: string;
};
export type CancellablePromise<T> = {
    promise: Promise<T>;
    cancel: () => void;
};
export declare function authByPolling(host: string, initToken: string): CancellablePromise<AuthData>;
export declare function startAuth(opts: Partial<CommonArgs> & {
    host: string;
}): Promise<void>;
export declare function readAuth(authFile: string): {
    host: string;
    user: string;
    token: string;
    basicAuthUser?: string;
    basicAuthPassword?: string;
};
export declare function getEnvAuth(): AuthConfig | undefined;
export declare function getCurrentAuth(authPath?: string): Promise<AuthConfig | undefined>;
export declare function getOrStartAuth(opts: CommonArgs & {
    host: string;
    enableSkipAuth?: boolean;
}): Promise<AuthConfig | undefined>;
export declare function findAuthFile(dir: string, opts: {
    traverseParents?: boolean;
}): string | undefined;
export declare function writeAuth(authFile: string, config: AuthConfig): Promise<void>;
