/** @packageDocumentation * @module Content */ import { ClassInfo, ClassInfoJSON, InstanceKey, InstanceKeyJSON } from "../EC"; import { LabelDefinition, LabelDefinitionJSON } from "../LabelDefinition"; import { ValuesDictionary } from "../Utils"; import { DisplayValue, DisplayValueJSON, Value, ValueJSON } from "./Value"; /** * Serialized [[Item]] JSON representation. * @public */ export interface ItemJSON { /** @beta */ inputKeys?: InstanceKeyJSON[]; primaryKeys: InstanceKeyJSON[]; labelDefinition: LabelDefinitionJSON; imageId: string; classInfo?: ClassInfoJSON; values: ValuesDictionary; displayValues: ValuesDictionary; mergedFieldNames: string[]; extendedData?: { [key: string]: any; }; } /** * A data structure that represents a single content record. * @public */ export declare class Item { /** * Keys of input instances that caused this item to be included in content. * @beta */ inputKeys?: InstanceKey[]; /** Keys of instances whose data is contained in this item */ primaryKeys: InstanceKey[]; /** Display label of the item */ label: LabelDefinition; /** ID of the image associated with this item */ imageId: string; /** For cases when item consists only of same class instances, information about the ECClass */ classInfo?: ClassInfo; /** Raw values dictionary */ values: ValuesDictionary; /** Display values dictionary */ displayValues: ValuesDictionary; /** List of field names whose values are merged (see [Merging values]($docs/learning/presentation/Content/Terminology#value-merging)) */ mergedFieldNames: string[]; /** Extended data injected into this content item */ extendedData?: { [key: string]: any; }; /** * Creates an instance of Item. * @param primaryKeys Keys of instances whose data is contained in this item * @param label Display label of the item * @param imageId ID of the image associated with this item * @param classInfo For cases when item consists only of same class instances, information about the ECClass * @param values Raw values dictionary * @param displayValues Display values dictionary * @param mergedFieldNames List of field names whose values are merged (see [Merging values]($docs/learning/presentation/Content/Terminology#value-merging)) * @param extendedData Extended data injected into this content item */ constructor(primaryKeys: InstanceKey[], label: string | LabelDefinition, imageId: string, classInfo: ClassInfo | undefined, values: ValuesDictionary, displayValues: ValuesDictionary, mergedFieldNames: string[], extendedData?: { [key: string]: any; }); /** * Is value of field with the specified name merged in this record. */ isFieldMerged(fieldName: string): boolean; /** Serialize this object to JSON */ toJSON(): ItemJSON; /** Deserialize [[Item]] from JSON */ static fromJSON(json: ItemJSON | string | undefined): Item | undefined; /** * Reviver function that can be used as a second argument for * `JSON.parse` method when parsing Item objects. * * @internal */ static reviver(key: string, value: any): any; } //# sourceMappingURL=Item.d.ts.map