import { IComponentConfig, IUserFlow } from "../common"; export declare class CloudRepository { private _baseUrl; private static _main; static get Main(): CloudRepository; private variants; private preloadedComponents; private userFlows; private _defaultEnv; private _envExplicitlySet; private _staticMode; private _queryParams; constructor(_baseUrl?: string); /** * Enable static mode for self-hosted component registries. * In static mode, URLs are constructed as file paths instead of query params: * ${baseUrl}/components/${componentId}/${env}.json */ enableStaticMode(): void; /** * Set query parameters to append to all fetch URLs (e.g. for CDN cache busting). * Example: `setQueryParams({ lastupdate: '11112026' })` */ setQueryParams(params: Record): void; /** * Set the default environment for this CloudRepository instance */ setEnvironment(env: string): void; /** * Get the current default environment */ getDefaultEnvironment(): string; /** * Check if a component is already cached/preloaded (v2) * If env and preview are not provided, checks if ANY version is preloaded */ isPreloaded(componentId: string, env?: string, preview?: boolean): boolean; /** * Get the preloaded params for a component (if preloaded) * Returns undefined if not preloaded */ getPreloadedParams(componentId: string): { env: string; preview: boolean; } | undefined; /** * Fetch a v2 component config * If env/preview not specified and component was preloaded, uses preloaded params */ fetchComponentV2(componentId: string, environmentIdentifier?: string, preview?: boolean): Promise; /** * Synchronous version of fetchComponentV2 — returns the config only if * the fetch already completed, null otherwise. * * Uses the same `this.variants` cache that fetchComponentV2/preloadComponents * populate. Each cached Promise is tagged with a `.resolved` property when * it settles — this method just reads that property. No separate cache. * * Why this exists: React Native needs the config at render time to embed it * in the WebView HTML (can't await in useState). If preloadComponents ran * earlier and the fetch completed, this returns the result synchronously, * skipping the WEBVIEW_READY → fetch → inject round trip entirely. */ getResolvedConfig(componentId: string, env?: string, preview?: boolean): IComponentConfig | null; /** * Fetch a v1 component from a flow */ fetchComponentV1(componentId: string, flowId?: string): Promise; fetchAutoFlow(componentId: string): Promise; fetchFlow(flowId: string): Promise; /** * @deprecated Use fetchComponentV2 or fetchComponentV1 explicitly * Defaults to v1 behavior for backward compatibility with existing code */ fetchComponent(componentId: string, flowId?: string): Promise; } /** * @deprecated Use CloudRepository instead */ export declare const v2_CloudRepository: typeof CloudRepository;