UNPKG

@itwin/presentation-common

Version:

Common pieces for iModel.js presentation packages

45 lines 1.62 kB
/** @packageDocumentation * @module Core */ import { Field } from "./content/Fields.js"; import { Item } from "./content/Item.js"; import { InstanceKey } from "./EC.js"; import { Ruleset } from "./rules/Ruleset.js"; /** * A factory class that can be used to create presentation rulesets targeted towards * specific use cases. * * @public */ export declare class RulesetsFactory { private createSimilarInstancesRulesetInfo; /** * Create a ruleset with content rules for getting instances are of the * same ECClass and have the same property value as the provided `record`. * @param field A field identifying which property of the record we should use * @param record A record whose similar instances should be found * @param computeDisplayValue Optional callback function to calculate display value that's * used in ruleset's description. If not provided, display value from record is used instead. */ createSimilarInstancesRuleset(field: Field, record: Item, computeDisplayValue?: ComputeDisplayValueCallback): Promise<{ ruleset: Ruleset; description: string; }>; } /** * Definition of a function for calculating a display value. * @public */ export type ComputeDisplayValueCallback = (type: string, value: PrimitivePropertyValue, displayValue: string) => Promise<string>; /** * Value of a primitive property. * @public */ export type PrimitivePropertyValue = string | number | boolean | Point | InstanceKey | undefined; type Point = { x: number; y: number; z?: number; }; export {}; //# sourceMappingURL=RulesetsFactory.d.ts.map