A Matter Node.

In Matter, a "node" is an individually addressable top-level network resource.

Type Parameters

Hierarchy (view full)

Constructors

Accessors

  • get [label](): (string | Diagnostic)[]
  • Returns (string | Diagnostic)[]

  • get [value](): unknown
  • Hierarchical diagnostics of endpoint and children.

    Returns unknown

  • get agentType(): Type<T>
  • Create an Agent.Type for the endpoint.

    Returns Type<T>

  • get behaviors(): Behaviors
  • Access the pool of behaviors supported by this endpoint.

    Returns Behaviors

  • get diagnosticDict(): Record<string, unknown> & Diagnostic
  • Diagnostic information regarding endpoint state.

    Returns Record<string, unknown> & Diagnostic

  • get env(): Environment
  • The endpoint's environment. Endpoint implementations use the environment to access platform components such as storage and network components.

    Returns Environment

  • get events(): EventsOf<T["behaviors"]>
  • Events for all behaviors keyed by behavior ID.

    Returns EventsOf<T["behaviors"]>

  • get hasParts(): boolean
  • Is this a parent Endpoint?

    Returns boolean

  • get id(): string
  • A string that uniquely identifies an endpoint.

    This ID must be unique amongst all Parts with the same owner.

    Returns string

  • set id(id): void
  • Parameters

    • id: string

    Returns void

  • get lifecycle(): NodeLifecycle
  • Endpoint information that varies as the endpoint initializes.

    Returns NodeLifecycle

  • get maybeId(): undefined | string
  • The endpoint ID or undefined if not yet assigned.

    Returns undefined | string

  • get maybeNumber(): undefined | EndpointNumber
  • The endpoint number or undefined if not yet assigned.

    Returns undefined | EndpointNumber

  • get number(): EndpointNumber
  • The Matter EndpointNumber of the endpoint. This uniquely identifies the Endpoint in the scope of the Matter node.

    Returns EndpointNumber

  • set number(number): void
  • Parameters

    • number: number

    Returns void

  • get owner(): undefined | Endpoint<Empty>
  • The owner of the endpoint.

    Every endpoint but the root endpoint (the "server node") is owned by another endpoint.

    Returns undefined | Endpoint<Empty>

  • set owner(owner): void
  • Parameters

    Returns void

  • get parts(): Parts
  • Access child parts.

    Returns Parts

  • get path(): DataModelPath
  • Path identifying the endpoint in the Matter data model.

    Returns DataModelPath

  • get state(): Immutable<StateOf<T["behaviors"]>>
  • Current state values for all behaviors, keyed by behavior ID. This view is read-only.

    Returns Immutable<StateOf<T["behaviors"]>>

  • get type(): EndpointType
  • The type of endpoint this endpoint implements.

    Returns EndpointType

Methods

  • Returns Promise<void>

  • Returns Promise<void>

  • Execute a function against an Agent for the endpoint.

    Agents provide the highest-leve API for interacting with endpoints. The agent is a composite object with properties for each supported behavior.

    State changes made by actor are atomic and made permanent only when the actor exits unless you commit the transaction manually.

    actor runs in an "offline" context where ACLs are ignored and all state is read/write.

    The Agent is destroyed after actor exits so you should not maintain references to the agent, its behaviors or associated state.

    actor may be async. If so, the acting context will remain open until the returned Promise resolves.

    Type Parameters

    • R

    Parameters

    Returns MaybePromise<R>

  • Version of act without explicit diagnostic purpose.

    Type Parameters

    • R

    Parameters

    Returns MaybePromise<R>

  • Ensure requirements for construction are met.

    Returns void

  • Returns Promise<void>

    use start

  • Take the node offline but leave state and structure intact. Happens automatically on close.

    Once the node is offline you may use start to bring the node online again.

    Returns Promise<void>

  • Returns Promise<void>

  • Create the network runtime.

    Returns NetworkRuntime

  • Erase all persisted data and destroy the node.

    Returns Promise<void>

  • Perform "hard" reset of the endpoint, reverting all in-memory and persistent state to uninitialized.

    Returns Promise<void>

  • Events for a specific behavior.

    Type Parameters

    Parameters

    • type: T

    Returns InstanceType<T["Events"]>

  • Asynchronous initialization.

    Derivatives may override to perform async construction prior to full initialization.

    Returns MaybePromise

  • Search for the owner of a specific type.

    Returns undefined if this owner is not found on the way up to the root endpoint.

    Type Parameters

    Parameters

    • type: T

    Returns undefined | Endpoint<T>

  • Returns Promise<void>

  • Perform "soft" reset of the endpoint, reverting all in-memory structures to uninitialized.

    Returns Promise<void>

  • Run the node in standalone mode. Returns when the node is closed.

    Returns Promise<void>

  • Update state values. This is a patch operation; it only modifies properties in values.

    values is an object with a Behavior.id as the key and state values as sub-objects.

    Input values must adhere to the Behavior.schema of the target Behavior. If not, set will throw an error.

    This is a transactional operation. An error results in no change. The endpoint will wait for exclusive access before applying changes.

    Parameters

    Returns Promise<void>

  • Update state values for a single behavior.

    The patch semantics used here are identical to set.

    Type Parameters

    Parameters

    Returns Promise<void>

  • Bring the node online.

    Returns Promise<void>

  • Current state for a specific behavior.

    Type Parameters

    Parameters

    • type: T

    Returns Immutable<InstanceType<T["State"]>>

  • Parameters

    • message: string

    Returns void

  • Returns string

  • Apply a depth-first visitor function to myself and all descendents.

    Type Parameters

    • T extends void | PromiseLike<void>

    Parameters

    Returns T