import { Semantics } from '../annotations'; import { Dimension, ISlicer, Measure, Member } from '../types'; import { CalculationProperty, RestrictedMeasureProperty } from './calculated'; import { AggregationRole, EntityProperty, PropertyAttributes } from './property'; import { Cube, DimensionUsage, EntitySet, EntityType, ParameterProperty, Property, PropertyDimension, PropertyHierarchy, PropertyLevel, PropertyMeasure, Schema, VariableProperty } from './sdl'; export declare function serializeUniqueName(dimension: string, hierarchy?: string, level?: string, intrinsic?: string): string; /** * Get dimension property by field name or dimension configuration */ export declare function getEntityProperty(entityType: EntityType, path: Dimension | Measure | string): T; /** * Get not only the specific attribute fields of dimension, such as level hierarchy parameter measure, etc. * while {@link getEntityProperty} only gets dimension and measure fields * * @param entityType * @param path * @returns */ export declare function getEntityProperty2(entityType: EntityType, path: Dimension | Measure | string): T; /** * Get dimensions in entity type, filterd by is `visible` or **empty** * * @param entityType * @returns */ export declare function getEntityDimensions(entityType: EntityType): Property[]; export declare function getEntityDimensionAndHierarchies(entityType: EntityType): Property[]; /** * Get measures in entity type, filtered by is visible or empty * * @param entityType * @returns */ export declare function getEntityMeasures(entityType: EntityType): PropertyMeasure[]; /** * Get all indicator type measures in entity type, filtered by is visible or empty * * @param entityType * @returns */ export declare function getEntityIndicators(entityType: EntityType): RestrictedMeasureProperty[]; /** * Get default measure in entity type or first measure property * * @param entityType * @returns */ export declare function getEntityDefaultMeasure(entityType: EntityType): Property | PropertyMeasure; /** * Get visiable hierarchies from dimension property * * @param dimension * @returns */ export declare function getDimensionHierarchies(dimension: PropertyDimension): PropertyHierarchy[]; /** * Get visiable levels from hierarchy property * * @param hierarchy * @returns */ export declare function getHierarchyLevels(hierarchy: PropertyHierarchy): PropertyLevel[]; /** * Get hierarchy proeprty from EntityType: * * ```javascript * getEntityHierarchy(entityType, {dimension: '[Time]', hierarchy: '[Time.byWeek]'}) * * getEntityHierarchy(entityType, {hierarchy: '[Time.byWeek]'}) * * getEntityHierarchy(entityType, {dimension: '[Time]'}) * * getEntityHierarchy(entityType, '[Time.byWeek]') * ``` * * @param entityType * @param hierarchy * @returns */ export declare function getEntityHierarchy(entityType: EntityType, params: Dimension | string): PropertyHierarchy; export declare function getEntityLevel(entityType: EntityType, dimension: Dimension): PropertyLevel; export declare function getEntityCalculations(entityType: EntityType): CalculationProperty[]; export declare function getEntityParameters(entityType: EntityType): T[]; export declare function getEntityVariables(entityType: EntityType): VariableProperty[]; /** * 查找 Hierarchy 里的 levels 下的 property * * @param hierarchy * @param name * @returns */ export declare function getHierarchyProperty(hierarchy: PropertyHierarchy, name: string): any; export declare function _getPropertyCaption(property: Property): string; export declare function getDimensionMemberCaption(dimension: Dimension, entityType?: EntityType): string; export declare function getDimensionDisplayBehaviour(dimension: Dimension): import("../types").DisplayBehaviour; export declare function getPropertyUnitName(property: Property): string; /** * @deprecated use {@link getMemberKey} */ export declare function getMemberValue(member: Member): string; export declare function getMemberKey(member: Member): string; export declare function hasLevel(dimension: Dimension | string): boolean; /** * The property is Calendar Semantic * * @param property * @returns */ export declare function isSemanticCalendar(property: EntityProperty): boolean; /** * 可以比较两个 PropertyPath 对象作为 Property 是否相同 * * > 目前 level 属性中存储的就是全称, 不排除未来改为只有 level 的信息 * * @param path * @returns */ export declare function stringifyProperty(path: Dimension | Measure | string): string; /** * Convert string name to dimension structure * * @param name * @param entityType * @returns */ export declare function parseDimension(name: string, entityType: EntityType): Dimension; /** * @deprecated use {@link parseDimension} * * @param path * @param entityType * @returns */ export declare function propertyPath2Dimension(path: string | Dimension, entityType: EntityType): Dimension; /** * Find the Hierarchy from the Cube by ID * * @param cube * @param id * @returns */ export declare function getHierarchyById(cube: Cube, id: string): PropertyHierarchy; export declare function getLevelById(cube: Cube, id: string): PropertyLevel; export declare function getCubeProperty(cube: Cube, role: AggregationRole, id: string): Property | PropertyHierarchy | PropertyLevel | PropertyMeasure; /** * 获取维度列表中指定层级 ID 所属层级结构 * * @param dimensions 维度列表 * @param id 层级的 ID * @returns 层级所属的层级结构 */ export declare function getLevelsHierarchy(dimensions: PropertyDimension[], id: string): PropertyHierarchy; export declare function isVisible(property: PropertyAttributes): boolean; /** * Get the calendar level in the entity type. If no level name is specified, the default level is used. * * @param entityType * @param param1 * @returns */ export declare function getEntityCalendarHierarchy(entityType: EntityType, { dimension, hierarchy }: Dimension): PropertyHierarchy; export declare function mergeEntityType(a: EntityType, b: EntityType): EntityType; export declare function mergeEntitySets(a: { [key: string]: EntitySet; }, b: { [key: string]: EntitySet; }): { [key: string]: EntitySet; }; /** * 暂时只有 merge entityType * * @param a * @param b * @returns */ export declare function mergeEntitySet(a: EntitySet, b: EntitySet): EntitySet; /** * @deprecated * * @param a * @param b * @returns */ export declare function mergeSDLSchema(a: Schema, b: Schema): { name: string; cubes?: Cube[]; virtualCubes?: import("./sdl").VirtualCube[]; dimensions?: Property[]; annotations?: any[]; functions?: any[]; indicators?: import("./indicator").Indicator[]; entitySets?: { [key: string]: EntitySet; }; }; /** * @deprecated See where else it can be used? * * @param entityType * @param cube * @returns */ export declare function mergeEntityTypeCube(entityType: EntityType, cube: Cube): { properties: { [x: string]: Property; }; keys?: string[]; parameters?: { [name: string]: ParameterProperty; }; indicators?: import("./indicator").Indicator[]; dialect?: any; syntax?: import("../types").Syntax; semantics?: import("./sdl").EntitySemantics; defaultMeasure?: string; cube?: Cube; catalog?: string; name: string; caption?: string; visible?: boolean; description?: string; }; /** * Convert slicer (include or exclude members) to dimension type * * @param slicer * @returns */ export declare function convertSlicerToDimension(slicer: ISlicer): Dimension; export declare function convertDimensionToSlicer(dimension: Dimension): ISlicer; export declare function mapEntityTypeHierarchy2Tree(entityType: EntityType): { value: string; label: string; children: { value: string; label: string; isLeaf: boolean; }[]; }[]; export declare function getMemberFromRow(row: unknown, dimension: Dimension, entityType?: EntityType): { key: any; value: any; label: any; caption: any; }; export declare function getDefaultHierarchy(property: Property): PropertyHierarchy; export declare function getHierarchySemanticLevel(hierarchy: PropertyHierarchy, semantic: Semantics): PropertyLevel; export declare function isWrapBrackets(name: string): RegExpMatchArray; export declare function wrapBrackets(name: string): string; export declare function unwrapBrackets(name: string): string; /** * * Extract hierarchy name from MDX Member unique name or Level unique name * For example: * - "[Time].[1998].[01]" => "[Time]" * - "[Time].[byWeek].[1998]" => "[Time]" * - "[Time].[byWeek].[LEVEL_UNIQUE_NAME]" => "[Time]" * * @param uniqueName * @returns */ export declare function extractHierarchyFromUniqueName(uniqueName: string): string; /** * 将 Hierarchy 和其 Member 的值拼接成 MDX 语句中的 Member 唯一标识形式 */ export declare function wrapHierarchyValue(hierarchy: string, value: string): string; export declare function wrapLevelUniqueName(hierarchy: string): string; export declare function wrapMemberCaption(hierarchy: string): string; export declare function wrapLevelNumber(hierarchy: string): string; export declare const isDimensionUsage: (toBe: any) => toBe is DimensionUsage; export declare const isPropertyDimension: (toBe: unknown) => toBe is Property; export declare const isPropertyHierarchy: (toBe: any) => toBe is PropertyHierarchy; export declare const isPropertyLevel: (toBe: any) => toBe is PropertyLevel; export declare const isPropertyMeasure: (toBe: any) => toBe is PropertyMeasure; export declare const isEntityType: (toBe: any) => toBe is EntityType; export declare const isEntitySet: (toBe: any) => toBe is EntitySet;