Skip to main content

TreeMapNode Interface

A map of string keys to tree objects. \

Sealed

This type is "sealed," meaning that code outside of the library defining it should not implement or extend it. Future versions of this type may add members or make typing of readonly members more specific.

Signature

/** @sealed */
export interface TreeMapNode<T extends ImplicitAllowedTypes = ImplicitAllowedTypes> extends ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>, TreeNode

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

Type Parameters

ParameterConstraintDefaultDescription
TImplicitAllowedTypesImplicitAllowedTypes

Methods

MethodReturn TypeDescription
delete(key)voidRemoves the specified element from this map by its key.
entries()IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>Returns an iterable of key, value pairs for every entry in the map.
forEach(callbackfn, thisArg)voidExecutes the provided function once per each key/value pair in this map.
keys()IterableIterator<string>Returns an iterable of keys in the map.
set(key, value)voidAdds or updates an entry in the map with a specified key and a value.
values()IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>Returns an iterable of values in the map.

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

ParameterTypeDescription
keystringThe key of the element to remove from the map.

entries

Returns an iterable of key, value pairs for every entry in the map.

Signature

entries(): IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>;

Remarks

Note: no guarantees are made regarding the order of the entries returned. If your usage scenario depends on consistent ordering, you will need to sort these yourself.

Returns

Return type: IterableIterator<[string, TreeNodeFromImplicitAllowedTypes<T>]>

forEach

Executes the provided function once per each key/value pair in this map.

Signature

forEach(callbackfn: (value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void, thisArg?: any): void;

Remarks

Note: no guarantees are made regarding the order in which the function is called with respect to the map's entries. If your usage scenario depends on consistent ordering, you will need to account for this.

Parameters

ParameterModifiersTypeDescription
callbackfn(value: TreeNodeFromImplicitAllowedTypes<T>, key: string, map: ReadonlyMap<string, TreeNodeFromImplicitAllowedTypes<T>>) => void
thisArgoptionalany

keys

Returns an iterable of keys in the map.

Signature

keys(): IterableIterator<string>;

Remarks

Note: no guarantees are made regarding the order of the keys returned. If your usage scenario depends on consistent ordering, you will need to sort these yourself.

Returns

Return type: IterableIterator<string>

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

ParameterTypeDescription
keystringThe key of the element to add to the map.
valueInsertableTreeNodeFromImplicitAllowedTypes<T> | undefinedThe value of the element to add to the map.

values

Returns an iterable of values in the map.

Signature

values(): IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>;

Remarks

Note: no guarantees are made regarding the order of the values returned. If your usage scenario depends on consistent ordering, you will need to sort these yourself.

Returns

Return type: IterableIterator<TreeNodeFromImplicitAllowedTypes<T>>