linked-list-typed 1.54.0 → 1.54.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/LICENSE +1 -1
  2. package/coverage/lcov-report/index.ts.html +2 -2
  3. package/dist/data-structures/binary-tree/avl-tree-counter.d.ts +213 -0
  4. package/dist/data-structures/binary-tree/avl-tree-counter.js +407 -0
  5. package/dist/data-structures/binary-tree/avl-tree-multi-map.d.ts +71 -177
  6. package/dist/data-structures/binary-tree/avl-tree-multi-map.js +135 -340
  7. package/dist/data-structures/binary-tree/avl-tree.d.ts +102 -57
  8. package/dist/data-structures/binary-tree/avl-tree.js +110 -47
  9. package/dist/data-structures/binary-tree/binary-indexed-tree.d.ts +3 -0
  10. package/dist/data-structures/binary-tree/binary-indexed-tree.js +3 -0
  11. package/dist/data-structures/binary-tree/binary-tree.d.ts +240 -190
  12. package/dist/data-structures/binary-tree/binary-tree.js +269 -240
  13. package/dist/data-structures/binary-tree/bst.d.ts +145 -112
  14. package/dist/data-structures/binary-tree/bst.js +180 -129
  15. package/dist/data-structures/binary-tree/index.d.ts +2 -0
  16. package/dist/data-structures/binary-tree/index.js +2 -0
  17. package/dist/data-structures/binary-tree/red-black-tree.d.ts +100 -82
  18. package/dist/data-structures/binary-tree/red-black-tree.js +115 -79
  19. package/dist/data-structures/binary-tree/tree-counter.d.ts +212 -0
  20. package/dist/data-structures/binary-tree/tree-counter.js +444 -0
  21. package/dist/data-structures/binary-tree/tree-multi-map.d.ts +78 -174
  22. package/dist/data-structures/binary-tree/tree-multi-map.js +142 -377
  23. package/dist/data-structures/graph/directed-graph.d.ts +3 -0
  24. package/dist/data-structures/graph/directed-graph.js +3 -0
  25. package/dist/data-structures/graph/map-graph.d.ts +3 -0
  26. package/dist/data-structures/graph/map-graph.js +3 -0
  27. package/dist/data-structures/graph/undirected-graph.d.ts +3 -0
  28. package/dist/data-structures/graph/undirected-graph.js +3 -0
  29. package/dist/data-structures/linked-list/singly-linked-list.d.ts +3 -0
  30. package/dist/data-structures/linked-list/singly-linked-list.js +3 -0
  31. package/dist/data-structures/linked-list/skip-linked-list.d.ts +3 -0
  32. package/dist/data-structures/linked-list/skip-linked-list.js +3 -0
  33. package/dist/data-structures/matrix/matrix.d.ts +3 -0
  34. package/dist/data-structures/matrix/matrix.js +3 -0
  35. package/dist/data-structures/matrix/navigator.d.ts +3 -0
  36. package/dist/data-structures/matrix/navigator.js +3 -0
  37. package/dist/data-structures/priority-queue/max-priority-queue.d.ts +3 -0
  38. package/dist/data-structures/priority-queue/max-priority-queue.js +3 -0
  39. package/dist/data-structures/priority-queue/min-priority-queue.d.ts +3 -0
  40. package/dist/data-structures/priority-queue/min-priority-queue.js +3 -0
  41. package/dist/data-structures/trie/trie.d.ts +0 -4
  42. package/dist/data-structures/trie/trie.js +0 -4
  43. package/dist/index.d.ts +2 -2
  44. package/dist/index.js +2 -2
  45. package/dist/interfaces/binary-tree.d.ts +8 -8
  46. package/dist/types/data-structures/binary-tree/avl-tree-counter.d.ts +2 -0
  47. package/dist/types/data-structures/binary-tree/avl-tree-multi-map.d.ts +1 -4
  48. package/dist/types/data-structures/binary-tree/avl-tree.d.ts +0 -3
  49. package/dist/types/data-structures/binary-tree/binary-tree.d.ts +0 -3
  50. package/dist/types/data-structures/binary-tree/bst.d.ts +3 -3
  51. package/dist/types/data-structures/binary-tree/index.d.ts +3 -1
  52. package/dist/types/data-structures/binary-tree/index.js +3 -1
  53. package/dist/types/data-structures/binary-tree/red-black-tree.d.ts +3 -0
  54. package/dist/types/data-structures/binary-tree/red-black-tree.js +2 -0
  55. package/dist/types/data-structures/binary-tree/tree-counter.d.ts +2 -0
  56. package/dist/types/data-structures/binary-tree/tree-counter.js +2 -0
  57. package/dist/types/data-structures/binary-tree/tree-multi-map.d.ts +2 -5
  58. package/package.json +3 -3
  59. package/src/data-structures/binary-tree/avl-tree-counter.ts +463 -0
  60. package/src/data-structures/binary-tree/avl-tree-multi-map.ts +155 -393
  61. package/src/data-structures/binary-tree/avl-tree.ts +144 -93
  62. package/src/data-structures/binary-tree/binary-indexed-tree.ts +3 -0
  63. package/src/data-structures/binary-tree/binary-tree.ts +433 -405
  64. package/src/data-structures/binary-tree/bst.ts +261 -239
  65. package/src/data-structures/binary-tree/index.ts +2 -0
  66. package/src/data-structures/binary-tree/red-black-tree.ts +163 -134
  67. package/src/data-structures/binary-tree/tree-counter.ts +504 -0
  68. package/src/data-structures/binary-tree/tree-multi-map.ts +161 -429
  69. package/src/data-structures/graph/directed-graph.ts +3 -0
  70. package/src/data-structures/graph/map-graph.ts +3 -0
  71. package/src/data-structures/graph/undirected-graph.ts +3 -0
  72. package/src/data-structures/linked-list/singly-linked-list.ts +3 -0
  73. package/src/data-structures/linked-list/skip-linked-list.ts +3 -0
  74. package/src/data-structures/matrix/matrix.ts +3 -0
  75. package/src/data-structures/matrix/navigator.ts +3 -0
  76. package/src/data-structures/priority-queue/max-priority-queue.ts +3 -0
  77. package/src/data-structures/priority-queue/min-priority-queue.ts +3 -0
  78. package/src/data-structures/trie/trie.ts +0 -4
  79. package/src/index.ts +2 -2
  80. package/src/interfaces/binary-tree.ts +10 -24
  81. package/src/types/data-structures/binary-tree/avl-tree-counter.ts +3 -0
  82. package/src/types/data-structures/binary-tree/avl-tree-multi-map.ts +1 -6
  83. package/src/types/data-structures/binary-tree/avl-tree.ts +0 -5
  84. package/src/types/data-structures/binary-tree/binary-tree.ts +0 -5
  85. package/src/types/data-structures/binary-tree/bst.ts +5 -5
  86. package/src/types/data-structures/binary-tree/index.ts +3 -1
  87. package/src/types/data-structures/binary-tree/red-black-tree.ts +5 -0
  88. package/src/types/data-structures/binary-tree/tree-counter.ts +3 -0
  89. package/src/types/data-structures/binary-tree/tree-multi-map.ts +2 -7
  90. package/dist/types/data-structures/binary-tree/rb-tree.d.ts +0 -6
  91. package/src/types/data-structures/binary-tree/rb-tree.ts +0 -10
  92. /package/dist/types/data-structures/binary-tree/{rb-tree.js → avl-tree-counter.js} +0 -0
@@ -5,198 +5,102 @@
5
5
  * @copyright Copyright (c) 2022 Pablo Zeng <zrwusa@gmail.com>
6
6
  * @license MIT License
7
7
  */
8
- import type { BinaryTreeDeleteResult, BSTNOptKeyOrNode, BTNRep, EntryCallback, IterationType, RBTNColor, TreeMultiMapNested, TreeMultiMapNodeNested, TreeMultiMapOptions } from '../../types';
9
- import { IBinaryTree } from '../../interfaces';
8
+ import type { BTNRep, OptNodeOrNull, TreeMultiMapOptions } from '../../types';
10
9
  import { RedBlackTree, RedBlackTreeNode } from './red-black-tree';
11
- export declare class TreeMultiMapNode<K = any, V = any, NODE extends TreeMultiMapNode<K, V, NODE> = TreeMultiMapNodeNested<K, V>> extends RedBlackTreeNode<K, V, NODE> {
12
- /**
13
- * The constructor function initializes a Red-Black Tree node with a key, value, count, and color.
14
- * @param {K} key - The key parameter represents the key of the node in the Red-Black Tree. It is
15
- * used to identify and locate the node within the tree.
16
- * @param {V} [value] - The `value` parameter is an optional parameter that represents the value
17
- * associated with the key in the Red-Black Tree node. It is not required and can be omitted when
18
- * creating a new node.
19
- * @param [count=1] - The `count` parameter represents the number of occurrences of a particular key
20
- * in the Red-Black Tree. It is an optional parameter with a default value of 1.
21
- * @param {RBTNColor} [color=BLACK] - The `color` parameter is used to specify the color of the node
22
- * in a Red-Black Tree. It is optional and has a default value of `'BLACK'`.
23
- */
24
- constructor(key: K, value?: V, count?: number, color?: RBTNColor);
10
+ import { IBinaryTree } from '../../interfaces';
11
+ export declare class TreeMultiMapNode<K = any, V = any> extends RedBlackTreeNode<K, V[]> {
12
+ /**
13
+ * This TypeScript constructor initializes an object with a key of type K and an array of values of
14
+ * type V.
15
+ * @param {K} key - The `key` parameter is typically used to store a unique identifier or key for the
16
+ * data being stored in the data structure. It helps in quickly accessing or retrieving the
17
+ * associated value in the data structure.
18
+ * @param {V[]} value - The `value` parameter in the constructor represents an array of values of
19
+ * type `V`.
20
+ */
21
+ constructor(key: K, value: V[]);
22
+ parent?: TreeMultiMapNode<K, V>;
23
+ _left?: OptNodeOrNull<TreeMultiMapNode<K, V>>;
24
+ get left(): OptNodeOrNull<TreeMultiMapNode<K, V>>;
25
+ set left(v: OptNodeOrNull<TreeMultiMapNode<K, V>>);
26
+ _right?: OptNodeOrNull<TreeMultiMapNode<K, V>>;
27
+ get right(): OptNodeOrNull<TreeMultiMapNode<K, V>>;
28
+ set right(v: OptNodeOrNull<TreeMultiMapNode<K, V>>);
25
29
  }
26
- export declare class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object, NODE extends TreeMultiMapNode<K, V, NODE> = TreeMultiMapNode<K, V, TreeMultiMapNodeNested<K, V>>, TREE extends TreeMultiMap<K, V, R, MK, MV, MR, NODE, TREE> = TreeMultiMap<K, V, R, MK, MV, MR, NODE, TreeMultiMapNested<K, V, R, MK, MV, MR, NODE>>> extends RedBlackTree<K, V, R, MK, MV, MR, NODE, TREE> implements IBinaryTree<K, V, R, MK, MV, MR, NODE, TREE> {
27
- /**
28
- * The constructor function initializes a TreeMultiMap object with optional initial data.
29
- * @param keysNodesEntriesOrRaws - The parameter `keysNodesEntriesOrRaws` is an
30
- * iterable that can contain keys, nodes, entries, or raw elements. It is used to initialize the
31
- * TreeMultiMap with initial data.
32
- * @param [options] - The `options` parameter is an optional object that can be used to customize the
33
- * behavior of the `TreeMultiMap` constructor. It can include properties such as `compareKeys` and
34
- * `compareValues`, which are functions used to compare keys and values respectively.
35
- */
36
- constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V, NODE>>, options?: TreeMultiMapOptions<K, V, R>);
37
- protected _count: number;
38
- /**
39
- * The function calculates the sum of the count property of all nodes in a tree structure.
40
- * @returns the sum of the count property of all nodes in the tree.
41
- */
42
- get count(): number;
43
- /**
44
- * Time Complexity: O(n)
45
- * Space Complexity: O(1)
46
- *
47
- * The function calculates the sum of the count property of all nodes in a tree using depth-first
48
- * search.
49
- * @returns the sum of the count property of all nodes in the tree.
50
- */
51
- getComputedCount(): number;
52
- /**
53
- * The function creates a new TreeMultiMapNode with the specified key, value, color, and count.
54
- * @param {K} key - The key parameter represents the key of the node being created. It is of type K,
55
- * which is a generic type representing the type of keys in the tree.
56
- * @param {V} [value] - The `value` parameter is an optional parameter that represents the value
57
- * associated with the key in the node. It is of type `V`, which can be any data type.
58
- * @param {RBTNColor} [color=BLACK] - The color parameter is used to specify the color of the node in
59
- * a Red-Black Tree. It can have two possible values: 'RED' or 'BLACK'. The default value is 'BLACK'.
60
- * @param {number} [count] - The `count` parameter represents the number of occurrences of a key in
61
- * the tree. It is an optional parameter and is used to keep track of the number of values associated
62
- * with a key in the tree.
63
- * @returns A new instance of the TreeMultiMapNode class, casted as NODE.
64
- */
65
- createNode(key: K, value?: V, color?: RBTNColor, count?: number): NODE;
66
- /**
67
- * The function creates a new instance of a TreeMultiMap with the specified options and returns it.
68
- * @param [options] - The `options` parameter is an optional object that contains additional
69
- * configuration options for creating the `TreeMultiMap`. It is of type `TreeMultiMapOptions<K, V,
70
- * R>`.
71
- * @returns a new instance of the `TreeMultiMap` class, with the provided options merged with the
72
- * existing `iterationType` property. The returned value is casted as `TREE`.
73
- */
74
- createTree(options?: TreeMultiMapOptions<K, V, R>): TREE;
75
- /**
76
- * The function `keyValueNodeEntryRawToNodeAndValue` takes in a key, value, and count and returns a
77
- * node based on the input.
78
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
79
- * `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
80
- * @param {V} [value] - The `value` parameter is an optional value that represents the value
81
- * associated with the key in the node. It is used when creating a new node or updating the value of
82
- * an existing node.
83
- * @param [count=1] - The `count` parameter is an optional parameter that specifies the number of
84
- * times the key-value pair should be added to the data structure. If not provided, it defaults to 1.
85
- * @returns either a NODE object or undefined.
86
- */
87
- protected _keyValueNodeEntryRawToNodeAndValue(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): [NODE | undefined, V | undefined];
88
- /**
89
- * The function checks if the input is an instance of the TreeMultiMapNode class.
90
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The parameter
91
- * `keyNodeEntryOrRaw` can be of type `R` or `BTNRep<K, V, NODE>`.
92
- * @returns a boolean value indicating whether the input parameter `keyNodeEntryOrRaw` is
93
- * an instance of the `TreeMultiMapNode` class.
94
- */
95
- isNode(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R): keyNodeEntryOrRaw is NODE;
30
+ /**
31
+ *
32
+ * @example
33
+ * // Find elements in a range
34
+ * const tmm = new TreeMultiMap<number>([10, 5, 15, 3, 7, 12, 18]);
35
+ * console.log(tmm.search(new Range(5, 10))); // [5, 10, 7]
36
+ * console.log(tmm.search(new Range(4, 12))); // [5, 10, 12, 7]
37
+ * console.log(tmm.search(new Range(15, 20))); // [15, 18]
38
+ */
39
+ export declare class TreeMultiMap<K = any, V = any, R = object, MK = any, MV = any, MR = object> extends RedBlackTree<K, V[], R, MK, MV[], MR> implements IBinaryTree<K, V[], R, MK, MV, MR> {
96
40
  /**
97
- * Time Complexity: O(log n)
98
- * Space Complexity: O(1)
99
- *
100
- * The function overrides the add method of a class and adds a new node to a data structure, updating
101
- * the count and returning a boolean indicating success.
102
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The
103
- * `keyNodeEntryOrRaw` parameter can accept one of the following types:
104
- * @param {V} [value] - The `value` parameter represents the value associated with the key in the
105
- * data structure. It is an optional parameter, so it can be omitted if not needed.
106
- * @param [count=1] - The `count` parameter represents the number of times the key-value pair should
107
- * be added to the data structure. By default, it is set to 1, meaning that if no value is provided
108
- * for `count`, the key-value pair will be added once.
109
- * @returns The method is returning a boolean value. It returns true if the addition of the new node
110
- * was successful, and false otherwise.
41
+ * The constructor initializes an TreeMultiMap with the provided keys, nodes, entries, or raw data
42
+ * and options.
43
+ * @param keysNodesEntriesOrRaws - The `keysNodesEntriesOrRaws` parameter in the constructor is an
44
+ * iterable that can contain either key-value pairs represented as `BTNRep<K, V[],
45
+ * TreeMultiMapNode<K, V>>` or raw data represented as `R`. This parameter is used to initialize
46
+ * the RedBlackTreeMulti
47
+ * @param [options] - The `options` parameter in the constructor is of type
48
+ * `TreeMultiMapOptions<K, V[], R>`. It is an optional parameter that allows you to specify
49
+ * additional options for configuring the TreeMultiMap instance.
111
50
  */
112
- add(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, value?: V, count?: number): boolean;
51
+ constructor(keysNodesEntriesOrRaws?: Iterable<BTNRep<K, V[], TreeMultiMapNode<K, V>> | R>, options?: TreeMultiMapOptions<K, V[], R>);
113
52
  /**
114
- * Time Complexity: O(log n)
53
+ * Time Complexity: O(1)
115
54
  * Space Complexity: O(1)
116
55
  *
117
- * The function `delete` in TypeScript overrides the deletion operation in a binary tree data
118
- * structure, handling cases where nodes have children and maintaining balance in the tree.
119
- * @param {BTNRep<K, V, NODE> | R} keyNodeEntryOrRaw - The `predicate`
120
- * parameter in the `delete` method is used to specify the condition or key based on which a node
121
- * should be deleted from the binary tree. It can be a key, a node, or an entry.
122
- * @param [ignoreCount=false] - The `ignoreCount` parameter in the `override delete` method is a
123
- * boolean flag that determines whether to ignore the count of nodes when performing deletion. If
124
- * `ignoreCount` is set to `true`, the method will delete the node regardless of its count. If
125
- * `ignoreCount` is `false
126
- * @returns The `override delete` method returns an array of `BinaryTreeDeleteResult<NODE>` objects.
56
+ * The `createTree` function in TypeScript overrides the default implementation to create a new
57
+ * TreeMultiMap with specified options.
58
+ * @param [options] - The `options` parameter in the `createTree` method is of type
59
+ * `TreeMultiMapOptions<K, V[], R>`. This parameter allows you to pass additional configuration
60
+ * options when creating a new `TreeMultiMap` instance. It includes properties such as
61
+ * `iterationType`, `specifyComparable
62
+ * @returns A new instance of `TreeMultiMap` is being returned, with an empty array as the initial
63
+ * data and the provided options merged with the existing properties of the current object.
127
64
  */
128
- delete(keyNodeEntryOrRaw: BTNRep<K, V, NODE> | R, ignoreCount?: boolean): BinaryTreeDeleteResult<NODE>[];
65
+ createTree(options?: TreeMultiMapOptions<K, V[], R>): TreeMultiMap<K, V, R, MK, MV, MR>;
129
66
  /**
130
67
  * Time Complexity: O(1)
131
68
  * Space Complexity: O(1)
132
69
  *
133
- * The "clear" function overrides the parent class's "clear" function and also resets the count to
134
- * zero.
70
+ * The function `createNode` overrides the method to create a new `TreeMultiMapNode` with a specified
71
+ * key and an empty array of values.
72
+ * @param {K} key - The `key` parameter in the `createNode` method represents the key of the node
73
+ * that will be created in the TreeMultiMap data structure.
74
+ * @returns A new instance of `TreeMultiMapNode<K, V>` is being returned, with the specified key and
75
+ * an empty array as its value.
135
76
  */
136
- clear(): void;
77
+ createNode(key: K): TreeMultiMapNode<K, V>;
78
+ add(node: BTNRep<K, V[], TreeMultiMapNode<K, V>>): boolean;
79
+ add(key: K, value: V): boolean;
137
80
  /**
138
- * Time Complexity: O(n log n)
81
+ * Time Complexity: O(log n)
139
82
  * Space Complexity: O(log n)
140
83
  *
141
- * The `perfectlyBalance` function takes a sorted array of nodes and builds a balanced binary search
142
- * tree using either a recursive or iterative approach.
143
- * @param {IterationType} iterationType - The `iterationType` parameter is an optional parameter that
144
- * specifies the type of iteration to use when building the balanced binary search tree. It has a
145
- * default value of `this.iterationType`, which means it will use the iteration type specified by the
146
- * `iterationType` property of the current object.
147
- * @returns The function `perfectlyBalance` returns a boolean value. It returns `true` if the
148
- * balancing operation is successful, and `false` if there are no nodes to balance.
149
- */
150
- perfectlyBalance(iterationType?: IterationType): boolean;
151
- /**
152
- * Time complexity: O(n)
153
- * Space complexity: O(n)
154
- *
155
- * The function overrides the clone method to create a deep copy of a tree object.
156
- * @returns The `clone()` method is returning a cloned instance of the `TREE` object.
157
- */
158
- clone(): TREE;
159
- /**
160
- * Time Complexity: O(1)
161
- * Space Complexity: O(1)
162
- *
163
- * The `_swapProperties` function swaps the properties (key, value, count, color) between two nodes
164
- * in a binary search tree.
165
- * @param {R | BSTNOptKeyOrNode<K, NODE>} srcNode - The `srcNode` parameter represents the source node
166
- * that will be swapped with the `destNode`. It can be either an instance of the `R` class or an
167
- * instance of the `BSTNOptKeyOrNode<K, NODE>` class.
168
- * @param {R | BSTNOptKeyOrNode<K, NODE>} destNode - The `destNode` parameter represents the destination
169
- * node where the properties will be swapped with the source node.
170
- * @returns The method is returning the `destNode` after swapping its properties with the `srcNode`.
171
- * If either `srcNode` or `destNode` is undefined, it returns undefined.
172
- */
173
- protected _swapProperties(srcNode: R | BSTNOptKeyOrNode<K, NODE>, destNode: R | BSTNOptKeyOrNode<K, NODE>): NODE | undefined;
84
+ * The function `deleteValue` removes a specific value from a key in a TreeMultiMap data structure
85
+ * and deletes the entire node if no values are left for that key.
86
+ * @param {BTNRep<K, V[], TreeMultiMapNode<K, V>> | K} keyNodeOrEntry - The `keyNodeOrEntry`
87
+ * parameter in the `deleteValue` function can be either a `BTNRep` object containing a key and an
88
+ * array of values, or just a key itself.
89
+ * @param {V} value - The `value` parameter in the `deleteValue` function represents the specific
90
+ * value that you want to remove from the multi-map data structure associated with a particular key.
91
+ * The function checks if the value exists in the array of values associated with the key, and if
92
+ * found, removes it from the array.
93
+ * @returns The `deleteValue` function returns a boolean value - `true` if the specified `value` was
94
+ * successfully deleted from the values associated with the `keyNodeOrEntry`, and `false` otherwise.
95
+ */
96
+ deleteValue(keyNodeOrEntry: BTNRep<K, V[], TreeMultiMapNode<K, V>> | K, value: V): boolean;
174
97
  /**
175
- * Time Complexity: O(1)
176
- * Space Complexity: O(1)
98
+ * Time Complexity: O(n)
99
+ * Space Complexity: O(n)
177
100
  *
178
- * The function replaces an old node with a new node and updates the count property of the new node.
179
- * @param {NODE} oldNode - The `oldNode` parameter is the node that you want to replace in the data
101
+ * The function `clone` overrides the default cloning behavior to create a deep copy of a tree
180
102
  * structure.
181
- * @param {NODE} newNode - The `newNode` parameter is an instance of the `NODE` class.
182
- * @returns The method is returning the result of calling the `_replaceNode` method from the
183
- * superclass, which is of type `NODE`.
184
- */
185
- protected _replaceNode(oldNode: NODE, newNode: NODE): NODE;
186
- /**
187
- * The `map` function in TypeScript overrides the default behavior to create a new TreeMultiMap with
188
- * modified entries based on a provided callback.
189
- * @param callback - The `callback` parameter is a function that will be called for each entry in the
190
- * map. It takes four arguments:
191
- * @param [options] - The `options` parameter in the `override map` function is of type
192
- * `TreeMultiMapOptions<MK, MV, MR>`. This parameter allows you to provide additional configuration
193
- * options when creating a new `TreeMultiMap` instance within the `map` function. These options could
194
- * include things like
195
- * @param {any} [thisArg] - The `thisArg` parameter in the `override map` function is used to specify
196
- * the value of `this` when executing the `callback` function. It allows you to set the context
197
- * (value of `this`) for the callback function when it is called within the `map` function. This
198
- * @returns A new TreeMultiMap instance is being returned, which is populated with entries generated
199
- * by the provided callback function.
103
+ * @returns The `cloned` object is being returned.
200
104
  */
201
- map(callback: EntryCallback<K, V | undefined, [MK, MV]>, options?: TreeMultiMapOptions<MK, MV, MR>, thisArg?: any): TreeMultiMap<MK, MV, MR>;
105
+ clone(): TreeMultiMap<K, V, R, MK, MV, MR>;
202
106
  }