@itwin/presentation-common
Version:
Common pieces for iModel.js presentation packages
105 lines • 3.31 kB
TypeScript
/** @packageDocumentation
* @module Content
*/
import { InstanceId, InstanceKey } from "../EC.js";
import { LabelDefinition } from "../LabelDefinition.js";
import { ValuesDictionary } from "../Utils.js";
/**
* Raw value type
* @public
*/
export type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | NavigationPropertyValue | NestedContentValue[];
/** @public */
export declare namespace Value {
/** Is the value a primitive */
function isPrimitive(value: Value): value is string | number | boolean | undefined;
/** Is the value an array */
function isArray(value: Value): value is ValuesArray;
/** Is the value a map / struct */
function isMap(value: Value): value is ValuesMap;
/** Is the value a nested content value */
function isNestedContent(value: Value): value is NestedContentValue[];
/** Is the value a navigation value */
function isNavigationValue(value: Value): value is NavigationPropertyValue;
}
/**
* A map of raw values
* @public
*/
export interface ValuesMap extends ValuesDictionary<Value> {
}
/**
* An array of raw values
* @public
*/
export interface ValuesArray extends Array<Value> {
}
/**
* Display value type.
* @public
*/
export type DisplayValue = string | undefined | DisplayValuesMap | DisplayValuesArray;
/** @public */
export declare namespace DisplayValue {
/** Is the value a primitive */
function isPrimitive(value: DisplayValue): value is string | undefined;
/** Is the value an array */
function isArray(value: DisplayValue): value is DisplayValuesArray;
/** Is the value a map / struct */
function isMap(value: DisplayValue): value is DisplayValuesMap;
}
/**
* A map of display values
* @public
*/
export interface DisplayValuesMap extends ValuesDictionary<DisplayValue> {
}
/**
* An array of display values
* @public
*/
export interface DisplayValuesArray extends Array<DisplayValue> {
}
/**
* Data structure that describes nested content value.
* @public
*/
export interface NestedContentValue {
/** Keys of instances whose content is contained in this value */
primaryKeys: InstanceKey[];
/** Content values map */
values: ValuesDictionary<Value>;
/** Content display values map */
displayValues: ValuesDictionary<DisplayValue>;
/** Names of fields whose values are merged */
mergedFieldNames: string[];
/**
* Label of the ECInstance that this `NestedContentValue` is based on.
* @deprecated in 5.0 - will not be removed until after 2026-06-13. Use [[label]] instead.
*/
labelDefinition?: LabelDefinition;
label?: LabelDefinition;
}
/**
* Data structure that describes value of the navigation property.
* @public
*/
export interface NavigationPropertyValue {
/** Label of target instance. */
label: LabelDefinition;
/** Full class name of target instance in format `SchemaName:ClassName` */
className: string;
/** Id of target instance. */
id: InstanceId;
}
/**
* A group of raw values and their common display value.
* @public
*/
export interface DisplayValueGroup {
/** Common display value for all grouped raw values */
displayValue: DisplayValue;
/** A list of grouped raw values */
groupedRawValues: Value[];
}
//# sourceMappingURL=Value.d.ts.map