import { Config } from "@oclif/core"; import { MittwaldAPIV2Client } from "@mittwald/api-client"; import ContextProvider from "./ContextProvider.js"; export type ContextNames = "project" | "server" | "org" | "installation" | "domain" | "dnszone" | "mailaddress" | "maildeliverybox" | "conversation" | "backup" | "stack" | "container"; export type ContextKey = `${N}-id`; export type ContextMap = Partial>; export type ContextMapUpdate = Partial>; export type ContextValueSource = { type: string; identifier: string; }; export type ContextValue = { value: string; source: ContextValueSource; }; export declare const contextIDNormalizers: { [k in ContextKey]?: (apiClient: MittwaldAPIV2Client, id: string, ctx: Context) => Promise; }; export interface ContextOptions { onInitError: (err: unknown) => void; } export default class Context { private readonly contextData; private readonly apiClient; private readonly opts; readonly providers: ContextProvider[]; constructor(apiClient: MittwaldAPIV2Client, config: Config, opts?: Partial); private initializeContextData; reset(): Promise; private persist; private setContextValue; mustGetContextValue(key: ContextKey): Promise; getContextValue(key: ContextKey): Promise; setProjectId: (id: string) => Promise; setServerId: (id: string) => Promise; setOrgId: (id: string) => Promise; setAppInstallationId: (id: string) => Promise; setStackId: (id: string) => Promise; projectId: () => Promise; serverId: () => Promise; orgId: () => Promise; appInstallationId: () => Promise; stackId: () => Promise; }