import type { GlobalConfigStore } from "../config-store/global"; import type { Log } from "../logger/log-entry"; import { apiClient } from "./trpc"; /** * The Cloud API client. * * Is only initialized if the user is actually logged in. */ export declare class CloudApi { private intervalId; private intervalMsec; private log; readonly domain: string; readonly distroName: string; readonly api: typeof apiClient; private globalConfigStore; private authToken; constructor({ log, domain, globalConfigStore, authToken, }: { log: Log; domain: string; globalConfigStore: GlobalConfigStore; authToken: string; }); /** * Initialize the Cloud API. * * Returns null if the user is not logged in. * * Throws if the user is logged in but the token is invalid and can't be refreshed. * * Optionally skip logging during initialization. Useful for noProject commands that need to use the class * without all the "flair". */ static factory({ log, cloudDomain, globalConfigStore, skipLogging, }: { log: Log; cloudDomain: string; globalConfigStore: GlobalConfigStore; skipLogging?: boolean; }): Promise; private startInterval; close(): void; private refreshTokenIfExpired; }