• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16/**
17 * @file
18 * @kit ArkTS
19 */
20
21/**
22 * TreeSet is implemented based on TreeMap. In TreeSet, only value objects are processed.
23 * TreeSet can be used to store values, each of which must be unique.
24 *
25 * @syscap SystemCapability.Utils.Lang
26 * @since 8
27 */
28/**
29 * TreeSet is implemented based on TreeMap. In TreeSet, only value objects are processed.
30 * TreeSet can be used to store values, each of which must be unique.
31 *
32 * @syscap SystemCapability.Utils.Lang
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * TreeSet is implemented based on TreeMap. In TreeSet, only value objects are processed.
38 * TreeSet can be used to store values, each of which must be unique.
39 *
40 * @syscap SystemCapability.Utils.Lang
41 * @crossplatform
42 * @atomicservice
43 * @since arkts {'1.1':'12', '1.2':'20'}
44 * @arkts 1.1&1.2
45 */
46declare class TreeSet<T> {
47  /**
48   * A constructor used to create a TreeSet object.
49   *
50   * @param { function } [comparator] - comparator
51   * comparator (Optional) User-defined comparison functions.
52   * firstValue (required) previous element.
53   * secondValue (required) next element.
54   * @throws { BusinessError } 10200012 - The TreeSet's constructor cannot be directly invoked.
55   * @throws { BusinessError } 401 - Parameter error. Possible causes:
56   * 1.Incorrect parameter types;
57   * 2.Parameter verification failed.
58   * @syscap SystemCapability.Utils.Lang
59   * @since 8
60   */
61  /**
62   * A constructor used to create a TreeSet object.
63   *
64   * @param { function } [comparator] - comparator
65   * comparator (Optional) User-defined comparison functions.
66   * firstValue (required) previous element.
67   * secondValue (required) next element.
68   * @throws { BusinessError } 10200012 - The TreeSet's constructor cannot be directly invoked.
69   * @throws { BusinessError } 401 - Parameter error. Possible causes:
70   * 1.Incorrect parameter types;
71   * 2.Parameter verification failed.
72   * @syscap SystemCapability.Utils.Lang
73   * @crossplatform
74   * @since 10
75   */
76  /**
77   * A constructor used to create a TreeSet object.
78   *
79   * @param { function } [comparator] - comparator
80   * comparator (Optional) User-defined comparison functions.
81   * firstValue (required) previous element.
82   * secondValue (required) next element.
83   * @throws { BusinessError } 10200012 - The TreeSet's constructor cannot be directly invoked.
84   * @throws { BusinessError } 401 - Parameter error. Possible causes:
85   * 1.Incorrect parameter types;
86   * 2.Parameter verification failed.
87   * @syscap SystemCapability.Utils.Lang
88   * @crossplatform
89   * @atomicservice
90   * @since 12
91   */
92  constructor(comparator?: (firstValue: T, secondValue: T) => boolean);
93
94  /**
95   * A constructor used to create a TreeSet object.
96   *
97   * @param { TreeSetComparator<T> } [comparator] - comparator
98   * comparator (Optional) User-defined comparison functions.
99   * @syscap SystemCapability.Utils.Lang
100   * @crossplatform
101   * @atomicservice
102   * @since 20
103   * @arkts 1.2
104   */
105  constructor(comparator?: TreeSetComparator<T>);
106
107  /**
108   * Gets the element number of the TreeSet.
109   *
110   * @type { number }
111   * @syscap SystemCapability.Utils.Lang
112   * @since 8
113   */
114  /**
115   * Gets the element number of the TreeSet.
116   *
117   * @type { number }
118   * @syscap SystemCapability.Utils.Lang
119   * @crossplatform
120   * @since 10
121   */
122  /**
123   * Gets the element number of the TreeSet.
124   *
125   * @type { number }
126   * @syscap SystemCapability.Utils.Lang
127   * @crossplatform
128   * @atomicservice
129   * @since 12
130   */
131  length: number;
132
133  /**
134   * Gets the element number of the TreeSet.
135   *
136   * @type { number }
137   * @syscap SystemCapability.Utils.Lang
138   * @crossplatform
139   * @atomicservice
140   * @since 20
141   * @arkts 1.2
142   */
143  get length(): number;
144
145  /**
146   * Returns whether the Set object contains elements
147   *
148   * @returns { boolean } the boolean type
149   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
150   * @syscap SystemCapability.Utils.Lang
151   * @since 8
152   */
153  /**
154   * Returns whether the Set object contains elements
155   *
156   * @returns { boolean } the boolean type
157   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
158   * @syscap SystemCapability.Utils.Lang
159   * @crossplatform
160   * @since 10
161   */
162  /**
163   * Returns whether the Set object contains elements
164   *
165   * @returns { boolean } the boolean type
166   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
167   * @syscap SystemCapability.Utils.Lang
168   * @crossplatform
169   * @atomicservice
170   * @since arkts {'1.1':'12', '1.2':'20'}
171   * @arkts 1.1&1.2
172   */
173  isEmpty(): boolean;
174  /**
175   * Returns whether the Set object contain s the elements
176   *
177   * @param { T } value - value value need to determine whether to include the element
178   * @returns { boolean } the boolean type
179   * @throws { BusinessError } 10200011 - The has method cannot be bound.
180   * @syscap SystemCapability.Utils.Lang
181   * @since 8
182   */
183  /**
184   * Returns whether the Set object contain s the elements
185   *
186   * @param { T } value - value value need to determine whether to include the element
187   * @returns { boolean } the boolean type
188   * @throws { BusinessError } 10200011 - The has method cannot be bound.
189   * @syscap SystemCapability.Utils.Lang
190   * @crossplatform
191   * @since 10
192   */
193  /**
194   * Returns whether the Set object contain s the elements
195   *
196   * @param { T } value - value value need to determine whether to include the element
197   * @returns { boolean } the boolean type
198   * @throws { BusinessError } 10200011 - The has method cannot be bound.
199   * @syscap SystemCapability.Utils.Lang
200   * @crossplatform
201   * @atomicservice
202   * @since arkts {'1.1':'12', '1.2':'20'}
203   * @arkts 1.1&1.2
204   */
205  has(value: T): boolean;
206  /**
207   * If the set does not contain the element, the specified element is added
208   *
209   * @param { T } value - value value Added element
210   * @returns { boolean } the boolean type(Is there contain this element)
211   * @throws { BusinessError } 401 - Parameter error. Possible causes:
212   * 1.Mandatory parameters are left unspecified;
213   * 2.Incorrect parameter types;
214   * 3.Parameter verification failed.
215   * @throws { BusinessError } 10200011 - The add method cannot be bound.
216   * @syscap SystemCapability.Utils.Lang
217   * @since 8
218   */
219  /**
220   * If the set does not contain the element, the specified element is added
221   *
222   * @param { T } value - value value Added element
223   * @returns { boolean } the boolean type(Is there contain this element)
224   * @throws { BusinessError } 401 - Parameter error. Possible causes:
225   * 1.Mandatory parameters are left unspecified;
226   * 2.Incorrect parameter types;
227   * 3.Parameter verification failed.
228   * @throws { BusinessError } 10200011 - The add method cannot be bound.
229   * @syscap SystemCapability.Utils.Lang
230   * @crossplatform
231   * @since 10
232   */
233  /**
234   * If the set does not contain the element, the specified element is added
235   *
236   * @param { T } value - value value Added element
237   * @returns { boolean } the boolean type(Is there contain this element)
238   * @throws { BusinessError } 401 - Parameter error. Possible causes:
239   * 1.Mandatory parameters are left unspecified;
240   * 2.Incorrect parameter types;
241   * 3.Parameter verification failed.
242   * @throws { BusinessError } 10200011 - The add method cannot be bound.
243   * @syscap SystemCapability.Utils.Lang
244   * @crossplatform
245   * @atomicservice
246   * @since arkts {'1.1':'12', '1.2':'20'}
247   * @arkts 1.1&1.2
248   */
249  add(value: T): boolean;
250  /**
251   * Remove a specified element from a Set object
252   *
253   * @param { T } value - value value Target to be deleted
254   * @returns { boolean } the boolean type(Is there contain this element)
255   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
256   * @syscap SystemCapability.Utils.Lang
257   * @since 8
258   */
259  /**
260   * Remove a specified element from a Set object
261   *
262   * @param { T } value - value value Target to be deleted
263   * @returns { boolean } the boolean type(Is there contain this element)
264   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
265   * @syscap SystemCapability.Utils.Lang
266   * @crossplatform
267   * @since 10
268   */
269  /**
270   * Remove a specified element from a Set object
271   *
272   * @param { T } value - value value Target to be deleted
273   * @returns { boolean } the boolean type(Is there contain this element)
274   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
275   * @syscap SystemCapability.Utils.Lang
276   * @crossplatform
277   * @atomicservice
278   * @since arkts {'1.1':'12', '1.2':'20'}
279   * @arkts 1.1&1.2
280   */
281  remove(value: T): boolean;
282  /**
283   * Clears all element groups in a set
284   *
285   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
286   * @syscap SystemCapability.Utils.Lang
287   * @since 8
288   */
289  /**
290   * Clears all element groups in a set
291   *
292   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
293   * @syscap SystemCapability.Utils.Lang
294   * @crossplatform
295   * @since 10
296   */
297  /**
298   * Clears all element groups in a set
299   *
300   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
301   * @syscap SystemCapability.Utils.Lang
302   * @crossplatform
303   * @atomicservice
304   * @since arkts {'1.1':'12', '1.2':'20'}
305   * @arkts 1.1&1.2
306   */
307  clear(): void;
308  /**
309   * Gets the first elements in a set
310   *
311   * @returns { T } value or undefined
312   * @throws { BusinessError } 10200011 - The getFirstValue method cannot be bound.
313   * @syscap SystemCapability.Utils.Lang
314   * @since 8
315   */
316  /**
317   * Gets the first elements in a set
318   *
319   * @returns { T } value or undefined
320   * @throws { BusinessError } 10200011 - The getFirstValue method cannot be bound.
321   * @syscap SystemCapability.Utils.Lang
322   * @crossplatform
323   * @since 10
324   */
325  /**
326   * Gets the first elements in a set
327   *
328   * @returns { T } value or undefined
329   * @throws { BusinessError } 10200011 - The getFirstValue method cannot be bound.
330   * @syscap SystemCapability.Utils.Lang
331   * @crossplatform
332   * @atomicservice
333   * @since 12
334   */
335  getFirstValue(): T;
336  /**
337   * Gets the last elements in a set
338   *
339   * @returns { T } value or undefined
340   * @throws { BusinessError } 10200011 - The getLastValue method cannot be bound.
341   * @syscap SystemCapability.Utils.Lang
342   * @since 8
343   */
344  /**
345   * Gets the last elements in a set
346   *
347   * @returns { T } value or undefined
348   * @throws { BusinessError } 10200011 - The getLastValue method cannot be bound.
349   * @syscap SystemCapability.Utils.Lang
350   * @crossplatform
351   * @since 10
352   */
353  /**
354   * Gets the last elements in a set
355   *
356   * @returns { T } value or undefined
357   * @throws { BusinessError } 10200011 - The getLastValue method cannot be bound.
358   * @syscap SystemCapability.Utils.Lang
359   * @crossplatform
360   * @atomicservice
361   * @since 12
362   */
363  getLastValue(): T;
364  /**
365   * Returns the greatest element smaller than or equal to the specified key
366   * if the key does not exist, undefined is returned
367   *
368   * @param { T } key - key key Objective of comparison
369   * @returns { T } key or undefined
370   * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound.
371   * @throws { BusinessError } 401 - Parameter error. Possible causes:
372   * 1.Mandatory parameters are left unspecified;
373   * 2.Incorrect parameter types;
374   * 3.Parameter verification failed.
375   * @syscap SystemCapability.Utils.Lang
376   * @since 8
377   */
378  /**
379   * Returns the greatest element smaller than or equal to the specified key
380   * if the key does not exist, undefined is returned
381   *
382   * @param { T } key - key key Objective of comparison
383   * @returns { T } key or undefined
384   * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound.
385   * @throws { BusinessError } 401 - Parameter error. Possible causes:
386   * 1.Mandatory parameters are left unspecified;
387   * 2.Incorrect parameter types;
388   * 3.Parameter verification failed.
389   * @syscap SystemCapability.Utils.Lang
390   * @crossplatform
391   * @since 10
392   */
393  /**
394   * Returns the greatest element smaller than or equal to the specified key
395   * if the key does not exist, undefined is returned
396   *
397   * @param { T } key - key key Objective of comparison
398   * @returns { T } key or undefined
399   * @throws { BusinessError } 10200011 - The getLowerValue method cannot be bound.
400   * @throws { BusinessError } 401 - Parameter error. Possible causes:
401   * 1.Mandatory parameters are left unspecified;
402   * 2.Incorrect parameter types;
403   * 3.Parameter verification failed.
404   * @syscap SystemCapability.Utils.Lang
405   * @crossplatform
406   * @atomicservice
407   * @since 12
408   */
409  getLowerValue(key: T): T;
410  /**
411   * Returns the least element greater than or equal to the specified key
412   * if the key does not exist, undefined is returned
413   *
414   * @param { T } key - key key Objective of comparison
415   * @returns { T } key or undefined
416   * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound.
417   * @throws { BusinessError } 401 - Parameter error. Possible causes:
418   * 1.Mandatory parameters are left unspecified;
419   * 2.Incorrect parameter types;
420   * 3.Parameter verification failed.
421   * @syscap SystemCapability.Utils.Lang
422   * @since 8
423   */
424  /**
425   * Returns the least element greater than or equal to the specified key
426   * if the key does not exist, undefined is returned
427   *
428   * @param { T } key - key key Objective of comparison
429   * @returns { T } key or undefined
430   * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound.
431   * @throws { BusinessError } 401 - Parameter error. Possible causes:
432   * 1.Mandatory parameters are left unspecified;
433   * 2.Incorrect parameter types;
434   * 3.Parameter verification failed.
435   * @syscap SystemCapability.Utils.Lang
436   * @crossplatform
437   * @since 10
438   */
439  /**
440   * Returns the least element greater than or equal to the specified key
441   * if the key does not exist, undefined is returned
442   *
443   * @param { T } key - key key Objective of comparison
444   * @returns { T } key or undefined
445   * @throws { BusinessError } 10200011 - The getHigherValue method cannot be bound.
446   * @throws { BusinessError } 401 - Parameter error. Possible causes:
447   * 1.Mandatory parameters are left unspecified;
448   * 2.Incorrect parameter types;
449   * 3.Parameter verification failed.
450   * @syscap SystemCapability.Utils.Lang
451   * @crossplatform
452   * @atomicservice
453   * @since 12
454   */
455  getHigherValue(key: T): T;
456  /**
457   * Return and delete the first element, returns undefined if tree set is empty
458   *
459   * @returns { T } first value or undefined
460   * @throws { BusinessError } 10200011 - The popFirst method cannot be bound.
461   * @syscap SystemCapability.Utils.Lang
462   * @since 8
463   */
464  /**
465   * Return and delete the first element, returns undefined if tree set is empty
466   *
467   * @returns { T } first value or undefined
468   * @throws { BusinessError } 10200011 - The popFirst method cannot be bound.
469   * @syscap SystemCapability.Utils.Lang
470   * @crossplatform
471   * @since 10
472   */
473  /**
474   * Return and delete the first element, returns undefined if tree set is empty
475   *
476   * @returns { T } first value or undefined
477   * @throws { BusinessError } 10200011 - The popFirst method cannot be bound.
478   * @syscap SystemCapability.Utils.Lang
479   * @crossplatform
480   * @atomicservice
481   * @since 12
482   */
483  popFirst(): T;
484  /**
485   * Return and delete the last element, returns undefined if tree set is empty
486   *
487   * @returns { T } last value or undefined
488   * @throws { BusinessError } 10200011 - The popLast method cannot be bound.
489   * @syscap SystemCapability.Utils.Lang
490   * @since 8
491   */
492  /**
493   * Return and delete the last element, returns undefined if tree set is empty
494   *
495   * @returns { T } last value or undefined
496   * @throws { BusinessError } 10200011 - The popLast method cannot be bound.
497   * @syscap SystemCapability.Utils.Lang
498   * @crossplatform
499   * @since 10
500   */
501  /**
502   * Return and delete the last element, returns undefined if tree set is empty
503   *
504   * @returns { T } last value or undefined
505   * @throws { BusinessError } 10200011 - The popLast method cannot be bound.
506   * @syscap SystemCapability.Utils.Lang
507   * @crossplatform
508   * @atomicservice
509   * @since 12
510   */
511  popLast(): T;
512
513  /**
514   * Gets the first elements in a set
515   *
516   * @returns { T | undefined } the value of the first element if exists, undefined otherwise
517   * @syscap SystemCapability.Utils.Lang
518   * @crossplatform
519   * @atomicservice
520   * @since 20
521   * @arkts 1.2
522   */
523  getFirstValue(): T | undefined;
524
525  /**
526   * Gets the last elements in a set
527   *
528   * @returns { T | undefined } the value of the last element if exists, undefined otherwise
529   * @syscap SystemCapability.Utils.Lang
530   * @crossplatform
531   * @atomicservice
532   * @since 20
533   * @arkts 1.2
534   */
535  getLastValue(): T | undefined;
536
537  /**
538   * Returns the greatest element smaller than or equal to the specified key
539   * if the key does not exist, undefined is returned
540   *
541   * @param { T } key - key key Objective of comparison
542   * @returns { T | undefined } the lower value of the given key's element if exists, undefined otherwise
543   * @syscap SystemCapability.Utils.Lang
544   * @crossplatform
545   * @atomicservice
546   * @since 20
547   * @arkts 1.2
548   */
549  getLowerValue(key: T): T | undefined;
550
551  /**
552   * Returns the least element greater than or equal to the specified key
553   * if the key does not exist, undefined is returned
554   *
555   * @param { T } key - key key Objective of comparison
556   * @returns { T | undefined } the higher value of the given key's element if exists, undefined otherwise
557   * @syscap SystemCapability.Utils.Lang
558   * @crossplatform
559   * @atomicservice
560   * @since 20
561   * @arkts 1.2
562   */
563  getHigherValue(key: T): T | undefined;
564
565  /**
566   * Return and delete the first element, returns undefined if tree set is empty
567   *
568   * @returns { T | undefined} the value of the first element in the TreeSet if exists, undefined otherwise
569   * @syscap SystemCapability.Utils.Lang
570   * @crossplatform
571   * @atomicservice
572   * @since 20
573   * @arkts 1.2
574   */
575  popFirst(): T | undefined;
576
577  /**
578   * Return and delete the last element, returns undefined if tree set is empty
579   *
580   * @returns { T | undefined } the value of the last element in the TreeSet if exists, undefined otherwise
581   * @syscap SystemCapability.Utils.Lang
582   * @crossplatform
583   * @atomicservice
584   * @since 20
585   * @arkts 1.2
586   */
587  popLast(): T | undefined;
588
589  /**
590   * Executes a provided function once for each value in the Set object.
591   *
592   * @param { function } callbackFn - callbackFn
593   * callbackFn (required) A function that accepts up to three arguments.
594   * The function to be called for each element.
595   * @param { Object } [thisArg] - thisArg
596   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
597   * If thisArg is omitted, undefined is used as the this value.
598   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
599   * @throws { BusinessError } 401 - Parameter error. Possible causes:
600   * 1.Mandatory parameters are left unspecified;
601   * 2.Incorrect parameter types.
602   * @syscap SystemCapability.Utils.Lang
603   * @since 8
604   */
605  /**
606   * Executes a provided function once for each value in the Set object.
607   *
608   * @param { function } callbackFn - callbackFn
609   * callbackFn (required) A function that accepts up to three arguments.
610   * The function to be called for each element.
611   * @param { Object } [thisArg] - thisArg
612   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
613   * If thisArg is omitted, undefined is used as the this value.
614   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
615   * @throws { BusinessError } 401 - Parameter error. Possible causes:
616   * 1.Mandatory parameters are left unspecified;
617   * 2.Incorrect parameter types.
618   * @syscap SystemCapability.Utils.Lang
619   * @crossplatform
620   * @since 10
621   */
622  /**
623   * Executes a provided function once for each value in the Set object.
624   *
625   * @param { function } callbackFn - callbackFn
626   * callbackFn (required) A function that accepts up to three arguments.
627   * The function to be called for each element.
628   * @param { Object } [thisArg] - thisArg
629   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
630   * If thisArg is omitted, undefined is used as the this value.
631   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
632   * @throws { BusinessError } 401 - Parameter error. Possible causes:
633   * 1.Mandatory parameters are left unspecified;
634   * 2.Incorrect parameter types.
635   * @syscap SystemCapability.Utils.Lang
636   * @crossplatform
637   * @atomicservice
638   * @since 12
639   */
640  forEach(callbackFn: (value?: T, key?: T, set?: TreeSet<T>) => void, thisArg?: Object): void;
641
642  /**
643   * Executes a provided function once for each value in the Set object.
644   *
645   * @param { TreeSetForEachCb<T> } callbackFn - callbackFn
646   * @syscap SystemCapability.Utils.Lang
647   * @crossplatform
648   * @atomicservice
649   * @since 20
650   * @arkts 1.2
651   */
652  forEach(callbackFn: TreeSetForEachCb<T>): void;
653
654  /**
655   * Returns a new Iterator object that contains the values contained in this set
656   *
657   * @returns { IterableIterator<T> }
658   * @throws { BusinessError } 10200011 - The values method cannot be bound.
659   * @syscap SystemCapability.Utils.Lang
660   * @since 8
661   */
662  /**
663   * Returns a new Iterator object that contains the values contained in this set
664   *
665   * @returns { IterableIterator<T> }
666   * @throws { BusinessError } 10200011 - The values method cannot be bound.
667   * @syscap SystemCapability.Utils.Lang
668   * @crossplatform
669   * @since 10
670   */
671  /**
672   * Returns a new Iterator object that contains the values contained in this set
673   *
674   * @returns { IterableIterator<T> }
675   * @throws { BusinessError } 10200011 - The values method cannot be bound.
676   * @syscap SystemCapability.Utils.Lang
677   * @crossplatform
678   * @atomicservice
679   * @since arkts {'1.1':'12', '1.2':'20'}
680   * @arkts 1.1&1.2
681   */
682  values(): IterableIterator<T>;
683  /**
684   * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
685   *
686   * @returns { IterableIterator<[T, T]> }
687   * @throws { BusinessError } 10200011 - The entries method cannot be bound.
688   * @syscap SystemCapability.Utils.Lang
689   * @since 8
690   */
691  /**
692   * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
693   *
694   * @returns { IterableIterator<[T, T]> }
695   * @throws { BusinessError } 10200011 - The entries method cannot be bound.
696   * @syscap SystemCapability.Utils.Lang
697   * @crossplatform
698   * @since 10
699   */
700  /**
701   * Returns a new Iterator object that contains the [key, value] pairs for each element in the Set object in insertion order
702   *
703   * @returns { IterableIterator<[T, T]> }
704   * @throws { BusinessError } 10200011 - The entries method cannot be bound.
705   * @syscap SystemCapability.Utils.Lang
706   * @crossplatform
707   * @atomicservice
708   * @since arkts {'1.1':'12', '1.2':'20'}
709   * @arkts 1.1&1.2
710   */
711  entries(): IterableIterator<[T, T]>;
712  /**
713   * returns an ES6 iterator.Each item of the iterator is a Javascript Object
714   *
715   * @returns { IterableIterator<T> }
716   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
717   * @syscap SystemCapability.Utils.Lang
718   * @since 8
719   */
720  /**
721   * returns an ES6 iterator.Each item of the iterator is a Javascript Object
722   *
723   * @returns { IterableIterator<T> }
724   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
725   * @syscap SystemCapability.Utils.Lang
726   * @crossplatform
727   * @since 10
728   */
729  /**
730   * returns an ES6 iterator.Each item of the iterator is a Javascript Object
731   *
732   * @returns { IterableIterator<T> }
733   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
734   * @syscap SystemCapability.Utils.Lang
735   * @crossplatform
736   * @atomicservice
737   * @since 12
738   */
739  [Symbol.iterator](): IterableIterator<T>;
740
741  /**
742   * returns an ES6 iterator.Each item of the iterator is a Javascript Object
743   *
744   * @returns { IterableIterator<T> } an iterator for the TreeSet
745   * @syscap SystemCapability.Utils.Lang
746   * @crossplatform
747   * @atomicservice
748   * @since 20
749   * @arkts 1.2
750   */
751  $_iterator(): IterableIterator<T>;
752
753}
754
755/**
756 * The type of TreeSet callback function.
757 *
758 * @typedef { function } TreeSetForEachCb
759 * @param { T } value - The value of current element
760 * @param { T } key - The key of current element(same as value)
761 * @param { TreeSet<T> } set - The TreeSet instance being traversed
762 * @returns { void } This callback does not return a value
763 * @syscap SystemCapability.Utils.Lang
764 * @atomicservice
765 * @since 20
766 * @arkts 1.2
767 */
768type TreeSetForEachCb<T> = (value: T, key: T, set: TreeSet<T>) => void
769
770/**
771 * The type of TreeSet comparator.
772 *
773 * @typedef { function } TreeSetComparator
774 * @param { T } firstValue - The first value compared
775 * @param { T } secondValue - The second value compared
776 * @returns { number } - Comparison results
777 * @syscap SystemCapability.Utils.Lang
778 * @atomicservice
779 * @since 20
780 * @arkts 1.2
781 */
782type TreeSetComparator<T> = (firstValue: T, secondValue: T) => number
783
784export default TreeSet;
785