/** @packageDocumentation * @module Content */ import { InstanceKey, InstanceKeyJSON } from "../EC"; import { ValuesDictionary } from "../Utils"; /** * Raw value type * @public */ export declare type Value = string | number | boolean | undefined | ValuesMap | ValuesArray | 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[]; /** Serialize [[Value]] to JSON */ function fromJSON(json: ValueJSON): Value; /** Deserialize [[Value]] from JSON */ function toJSON(value: Value): ValueJSON; } /** * A map of raw values * @public */ export interface ValuesMap extends ValuesDictionary { } /** * An array of raw values * @public */ export interface ValuesArray extends Array { } /** * Display value type. * @public */ export declare 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; /** Serialize [[DisplayValue]] to JSON */ function fromJSON(json: DisplayValueJSON): DisplayValue; /** Deserialize [[DisplayValue]] from JSON */ function toJSON(value: DisplayValue): DisplayValueJSON; } /** * A map of display values * @public */ export interface DisplayValuesMap extends ValuesDictionary { } /** * An array of display values * @public */ export interface DisplayValuesArray extends Array { } /** * 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; /** Content display values map */ displayValues: ValuesDictionary; /** Names of fields whose values are merged */ mergedFieldNames: string[]; } /** @public */ export declare namespace NestedContentValue { /** Serialize [[NestedContentValue]] to JSON */ function toJSON(json: NestedContentValue): NestedContentValueJSON; /** Deserialize [[NestedContentValue]] from JSON */ function fromJSON(json: NestedContentValueJSON): NestedContentValue; } /** * JSON representation of [[Value]] * @public */ export declare type ValueJSON = string | number | boolean | null | ValuesMapJSON | ValuesArrayJSON | NestedContentValueJSON[]; /** * JSON representation of [[ValuesMap]] * @public */ export interface ValuesMapJSON extends ValuesDictionary { } /** * JSON representation of [[ValuesArray]] * @public */ export interface ValuesArrayJSON extends Array { } /** * JSON representation of [[DisplayValue]] * @public */ export declare type DisplayValueJSON = string | null | DisplayValuesMapJSON | DisplayValuesArrayJSON; /** * JSON representation of [[DisplayValuesMap]] * @public */ export interface DisplayValuesMapJSON extends ValuesDictionary { } /** * JSON representation of [[DisplayValuesArray]] * @public */ export interface DisplayValuesArrayJSON extends Array { } /** * JSON representation of [[NestedContentValue]] * @public */ export interface NestedContentValueJSON { primaryKeys: InstanceKeyJSON[]; values: ValuesDictionary; displayValues: ValuesDictionary; mergedFieldNames: string[]; } /** * 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[]; } /** * JSON representation of [[DisplayValueGroup]]. * @public */ export interface DisplayValueGroupJSON { displayValue: DisplayValueJSON; groupedRawValues: ValueJSON[]; } /** @public */ export declare namespace DisplayValueGroup { /** Serialize [[DisplayValueGroup]] to JSON */ function toJSON(group: DisplayValueGroup): DisplayValueGroupJSON; /** Deserialize [[DisplayValueGroup]] from JSON */ function fromJSON(json: DisplayValueGroupJSON): DisplayValueGroup; } //# sourceMappingURL=Value.d.ts.map