/** * @license Apache-2.0 * @copyright Cube Dev, Inc. * @fileoverview * prepareAnnotation function and related types definition. */ import { MetaConfig, MetaConfigMap } from './to-config-map'; import { MemberType } from '../types/strings'; import { MemberExpression } from '../types/query'; type GranularityMeta = { name: string; title: string; interval: string; offset?: string; origin?: string; }; /** * Annotation item for cube's member. */ type ConfigItem = { title: string; shortTitle: string; description: string; type: string; format: string; /** ISO 4217 currency code in uppercase (e.g. USD, EUR) */ currency?: string; meta: any; drillMembers?: any[]; drillMembersGrouped?: any; granularities?: GranularityMeta[]; }; /** * The member of the data model a member path names, when the path goes * through joins: `orders.customer.city` is `users.city`. */ type MemberTarget = (path: string) => string | undefined; /** * Returns annotations by MetaConfigMap and cube's member type. */ declare const annotation: (configMap: MetaConfigMap, memberType: MemberType, memberTarget?: MemberTarget) => (member: string | MemberExpression) => undefined | [string, ConfigItem]; /** * Returns annotations object by MetaConfigs and query. */ declare function prepareAnnotation(metaConfig: MetaConfig[], query: any, memberTarget?: MemberTarget): { measures: { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; }; dimensions: { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; }; segments: { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; }; timeDimensions: { [x: string]: unknown; [x: number]: unknown; [x: symbol]: unknown; }; }; export default prepareAnnotation; export { type ConfigItem, type MemberTarget, type GranularityMeta, annotation, prepareAnnotation, }; //# sourceMappingURL=prepare-annotation.d.ts.map