Packages > @fluidframework/tree > TreeMapNode

TreeMapNode Interface

A map of string keys to tree objects.

Signature

export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode

Extends: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes <T>>, TreeNode

Type Parameters

Parameter Constraint Default Description
T ImplicitAllowedTypes ImplicitAllowedTypes

Methods

Method Return Type Description
delete(key) void Removes the specified element from this map by its key.
set(key, value) void Adds or updates an entry in the map with a specified key and a value.

Method Details

delete

Removes the specified element from this map by its key.

Signature

delete(key: string): void;

Remarks

Note: unlike JavaScript’s Map API, this method does not return a flag indicating whether or not the value was deleted.

Parameters

Parameter Type Description
key string The key of the element to remove from the map.

set

Adds or updates an entry in the map with a specified key and a value.

Signature

set(key: string, value: InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined): void;

Remarks

Setting the value at a key to undefined is equivalent to calling delete(key) with that key.

Parameters

Parameter Type Description
key string The key of the element to add to the map.
value InsertableTreeNodeFromImplicitAllowedTypes<T> | undefined The value of the element to add to the map.