Types contain information about the combinations of attributes allowed for features in the dataset. Each feature in the dataset can have a type, indicated in its typeIdField, which is used in LayerDefinition.

See https://developers.arcgis.com/web-map-specification/objects/type/ https://developers.arcgis.com/web-scene-specification/objects/type/.

interface TypeJson {
    domains?: Record<string, DomainJson>;
    id?: string | number;
    name?: string;
    templates?: TemplateJson[];
}

Properties

domains?: Record<string, DomainJson>

A set of domain objects for each domain in the type.

id?: string | number

A unique numerical ID for the type.

name?: string

A string containing a user-friendly name for the type. This might be shown on a menu of feature types that editors can create in the collection.

templates?: TemplateJson[]

An array of template objects describing features that can be created in this layer. Templates are used with map notes, other feature collections, and editable web-based CSV layers. They are not used with ArcGIS feature services, which already have feature templates defined in the service.

Templates are defined as a property of the layer definition when there are no types defined; otherwise, templates are defined as properties of the types.

You might have more than one template per type if the attributes of available features vary slightly. For example, you might have a type named Copper pipe containing two templates: one whose DIAMETER property is 12 and another whose DIAMETER property is 10.