import type { IntlShape } from "react-intl"; import type { IAnalyticalBackend } from "@gooddata/sdk-backend-spi"; import type { IExecutionConfig } from "@gooddata/sdk-model"; import { type DataViewFacade, type GoodDataSdkError, type UseCancelablePromiseStatus } from "@gooddata/sdk-ui"; import type { IGeoAdapterContext, IGeoLayerOutput } from "../../layers/registry/adapterTypes.js"; import type { IGeoChartConfig } from "../../types/config/unified.js"; import type { ILayerExecutionRecord } from "../../types/props/geoChart/internal.js"; /** * Prepared output for a single layer. * * @internal */ export interface ILayerPreparedData { /** * Layer ID for reference. */ layerId: string; /** * DataViewFacade from execution. */ dataView: DataViewFacade; /** * Prepared layer output (features, legend, colorStrategy, etc.). * Null if layer preparation returned no data. */ output: IGeoLayerOutput | null; } /** * Result of preparing all layer outputs. * * @internal */ export interface ILayersPrepareResult { /** * Map of layerId to prepared layer data. * Can contain partial results when some layers fail. */ layerOutputs: Map; /** * Combined preparation status for all layers. * - "pending" if no dataViews provided or dataViews not ready * - "loading" while any preparation is in progress * - "success" when the primary layer is prepared successfully * - "error" when the primary layer fails to prepare */ status: UseCancelablePromiseStatus; /** * First error encountered, if any. */ error?: GoodDataSdkError; } /** * Context needed for layer preparation. * * @internal */ export interface ILayersPrepareContext { backend: IAnalyticalBackend; workspace: string; config?: IGeoChartConfig; execConfig?: IExecutionConfig; intl: IntlShape; } /** * Prepares a single layer using its adapter. * * @internal */ export declare function prepareSingleLayer(layerExecution: ILayerExecutionRecord, layerDataViews: Map, adapterContext: IGeoAdapterContext): Promise; /** * Hook that prepares all layer outputs in parallel once dataViews are available. * * @remarks * Calls adapter's `prepareLayer` for each layer simultaneously using Promise.allSettled. * Runs when useLayersData returns "success" (the primary layer dataView is available). * * @param layerExecutions - Array of layer execution records * @param layerDataViews - Map of layerId to DataViewFacade (from useLayersData) * @param dataStatus - Status from useLayersData ("success" when ready) * @param context - Context for layer preparation * @returns Prepared layer outputs, status, and error * * @internal */ export declare function useLayersPrepare(layerExecutions: ILayerExecutionRecord[], layerDataViews: Map, dataStatus: UseCancelablePromiseStatus, context: ILayersPrepareContext): ILayersPrepareResult; //# sourceMappingURL=useLayersPrepare.d.ts.map