A cluster describes a set of related functionality.

Hierarchy (view full)

Implements

Constructors

Properties

asOf?: `${number}.${number}`

The first Matter specification in which this element appears.

classification?: Classification

Encodes both classification and scope from the Matter specification.

description?: string

A short summary of the element.

details?: string

A paragraph summary of the element.

errors?: DefinitionError[]
id: number

The ID of the element per Matter specification, either global or context-specific. A "machine appropriate" semantic differentiator.

isSeed?: boolean

Is this a "seed" element? These are global types and cluster elements defined in the core specification, without which we are fairly incapacitated.

isType?: boolean

Indicates that an element defines a datatype.

isTypeScope: boolean

Indicates that an element may have type definitions as children.

name: string

The key used for storing this element. A "human appropriate" semantic differentiator.

operationalBase?: Model<BaseElement>

Normally base performs lookup based on type. If instead a model is installed it is used as the base.

The operational base also enables resolution from the operational base's tree. This enables resolution on operational models that are not installed in a parent hierarchy.

pics?: string

The cluster's PICS code.

tag: Cluster
type?: string

If an element derives from another element, the name of the parent element goes here.

until?: `${number}.${number}`

The Matter specification revision in which this element was removed.

Reference to Matter specification document.

types: {
    [type: string]: (new (definition: any) => Model);
}

Factory support. Populated by derivatives upon definition.

Accessors

  • get allowedBaseTags(): ElementTag[]
  • The set of tags from which this model may derive.

    Returns ElementTag[]

  • get base(): undefined | Model<BaseElement>
  • Get a model for my base type as defined by type, if any.

    Returns undefined | Model<BaseElement>

  • get children(): Children<Child>
  • Children of models are always models.

    Returns Children<Child>

  • set children(children): void
  • Children of models are always models.

    Parameters

    • children: InputIterable<Child>

    Returns void

  • get diagnostics(): undefined | boolean
  • Returns undefined | boolean

  • get discriminator(): undefined | string
  • Obtain a discriminator that differentiates different models with the same name

    Returns undefined | string

  • get effectiveAccess(): Access
  • Returns Access

  • get effectiveId(): undefined | number
  • Allows subclasses to pull a working ID from an alternate source.

    Returns undefined | number

  • get effectiveMetatype(): Metatype
  • Returns Metatype

  • get effectiveQuality(): Quality
  • Returns Quality

  • get effectiveType(): undefined | string
  • In some circumstances the base type can be inferred. This inference happens here.

    Does not recurse so only returns the direct base type.

    Returns undefined | string

  • get effectiveXref(): undefined | CrossReference
  • A local or parent xref.

    Returns undefined | CrossReference

  • get events(): EventModel[]
  • Returns EventModel[]

  • get featureNames(): FeatureSet
  • Returns FeatureSet

  • get globalBase(): undefined | Model<BaseElement>
  • Get the first global base type. This may have semantic meaning more specific than the base primitive type.

    Returns undefined | Model<BaseElement>

  • get isGlobal(): boolean
  • Determine if this model resides in the global namespace.

    Returns boolean

  • get key(): undefined | string
  • Get a string that uniquely identifies this model. This is normally the effective ID but some models require a generated identifier.

    Returns undefined | string

  • get parent(): undefined | Model<BaseElement>
  • The structural parent. This is the model for the element that contains this element's definition.

    Returns undefined | Model<BaseElement>

  • set parent(parent): void
  • Parameters

    Returns void

  • get path(): string
  • The path ("." delimited) in the Matter tree.

    This is informational and generally tries to adhere to JS API conventions.

    Returns string

  • get quality(): Quality
  • Other qualities.

    Quality flags allowed for clusters are "I" (singleton) and "K" (diagnostics). The spec as of 1.3 does not appear to use the singleton flag, however.

    Returns Quality

  • set quality(definition): void
  • Other qualities.

    Quality flags allowed for clusters are "I" (singleton) and "K" (diagnostics). The spec as of 1.3 does not appear to use the singleton flag, however.

    Parameters

    Returns void

  • get revision(): number
  • Returns number

  • get shadow(): undefined | Model<BaseElement>
  • Get shadow model, if any. A "shadow" is an element in my parent's inheritance hierarchy that I override.

    Returns undefined | Model<BaseElement>

  • get supportedFeatures(): FeatureSet
  • Returns FeatureSet

  • set supportedFeatures(features): void
  • Parameters

    Returns void

  • get valid(): boolean
  • Did validation find errors?

    Returns boolean

Methods

  • Retrieve all models of a specific element type from local scope.

    Type Parameters

    Parameters

    • type: Type<T>

      model class or a predicate object

    • Optionalkey: string | number

      filters to models matching a specific type

    Returns T[]

  • Determine whether this element applies to a specific revision.

    Parameters

    • revision: `${number}.${number}`

    Returns boolean

  • Clone the model. This deep copies all descendant child models but not other properties.

    Type Parameters

    Parameters

    Returns This

  • Record a validation error for this model.

    Parameters

    • code: string
    • message: string

    Returns void

  • Create an operational extension of the model. This creates a new model that inherits from this model for operational purposes.

    Type Parameters

    Parameters

    Returns This

  • Freeze the model hierarchy rooted at this model.

    When using a model as operational schema we implement various optimizations that assume the schema is immutable. This function enforces that assumption.

    To make changes to a frozen model use clone.

    Returns void

  • Retrieve a specific child by ID or name.

    Type Parameters

    Parameters

    • type: Type<T>
    • key: string | number

    Returns undefined | T

  • Does this model derive from another?

    Parameters

    Returns boolean

  • Search the inheritance chain for a child property.

    Parameters

    Returns undefined | Model<BaseElement>

  • Retrieve a model of a specific type from the ownership hierarchy.

    Type Parameters

    Parameters

    Returns undefined | T

  • Returns string

  • Apply a function to all tree elements.

    Parameters

    Returns undefined | boolean