import { type IBucket, type IInsightDefinition } from "@gooddata/sdk-model"; import { type IEmbeddingCodeContext } from "../../../interfaces/VisualizationDescriptor.js"; import { type InsightToPropsConverter, type PropMeta } from "../types.js"; /** * Describes a conversion from insight to a particular prop of a visualization. */ export interface IInsightToPropConversion { propName: TPropKey; propType: PropMeta; itemAccessor: (insight: IInsightDefinition, ctx: IEmbeddingCodeContext | undefined) => TReturnType; } /** * Conversion based on the whole {@link @gooddata/sdk-model#IInsightDefinition}. */ export declare function insightConversion(propName: TPropKey, propType: PropMeta, insightItemAccessor: (insight: IInsightDefinition, ctx: IEmbeddingCodeContext | undefined) => TReturnType): IInsightToPropConversion; /** * Conversion based on a single bucket. */ export declare function bucketConversion(propName: TPropKey, propType: PropMeta, bucketName: string, bucketItemAccessor: (bucket: IBucket) => TReturnType): IInsightToPropConversion; export type ConversionSpec = { [K in keyof TProps]: IInsightToPropConversion; }; /** * Creates an InsightToProps converter. * * @remarks * This makes the conversion as declarative as possible avoiding any explicit logic in the call sites, * rather using specialized object to describe parts of the conversion. * * @param conversionSpec - Specification of the insight to props conversion * @returns function that can be used to convert a given insight to props for some visualization type */ export declare function getInsightToPropsConverter(conversionSpec: ConversionSpec): InsightToPropsConverter; //# sourceMappingURL=convertor.d.ts.map