Type Alias: MetaFieldValue
MetaFieldValue =
MetaFieldValuePrimitive|MetaFieldSetValue[]
Complete value type for metafields, supporting both simple and complex structures.
This type encompasses all possible values that can be stored in custom fields:
- For standard field types (TEXT, NUMBER, CHECKBOX, etc.), the value is a primitive
- For META_OBJECT fields, the value is an array of records, where each record is a collection of named fields with primitive values
META_OBJECT fields enable structured data storage, allowing multiple related fields to be grouped together. For example, a "dimensions" META_OBJECT might contain width, height, and depth as separate numeric fields within a single logical unit. In option sets, these are stored as arrays to support multiple instances of the same structured data.
Example
// Simple primitive value for a TEXT field
const textValue: MetaFieldValue = "Custom engraving text";
// META_OBJECT value for grouped specifications
const dimensionsValue: MetaFieldValue = [
{
width: 100,
height: 50,
depth: 25,
unit: "mm"
}
];