Packages > @fluidframework/tree > TreeNode

TreeNode Class

A non-leaf SharedTree node. Includes objects, arrays, and maps.

Signature

export declare abstract class TreeNode implements WithType

Implements: WithType

Remarks

Base type which all nodes implement.

This can be used as a type to indicate/document values which should be tree nodes. Runtime use of this class object (for example when used with instanceof or subclassed), is not supported: it may be replaced with an interface or union in the future.

Properties

Property Modifiers Type Description
[type] readonly string The type of a TreeNode. For moore information about the type, use Tree.schema(theNode) instead.

Property Details

[type]

The type of a TreeNode . For moore information about the type, use Tree.schema(theNode) instead.

Signature

abstract get [type](): string;

Remarks

This symbol mainly exists on nodes to allow TypeScript to provide more accurate type checking. Tree.is and Tree.schema provide a superset of this information in more friendly ways.

This symbol should not manually be added to objects as doing so allows the object to be invalidly used where nodes are expected. Instead construct a real node of the desired type using its constructor.