• 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 * List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
23 * When querying an element, the system traverses the list from the beginning.
24 *
25 * @syscap SystemCapability.Utils.Lang
26 * @since 8
27 */
28/**
29 * List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
30 * When querying an element, the system traverses the list from the beginning.
31 *
32 * @syscap SystemCapability.Utils.Lang
33 * @crossplatform
34 * @since 10
35 */
36/**
37 * List is implemented based on the singly linked list. Each node has a reference pointing to the next element.
38 * When querying an element, the system traverses the list from the beginning.
39 *
40 * @syscap SystemCapability.Utils.Lang
41 * @crossplatform
42 * @atomicservice
43 * @since 12
44 */
45declare class List<T> {
46  /**
47   * A constructor used to create a List object.
48   *
49   * @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
50   * @syscap SystemCapability.Utils.Lang
51   * @since 8
52   */
53  /**
54   * A constructor used to create a List object.
55   *
56   * @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
57   * @syscap SystemCapability.Utils.Lang
58   * @crossplatform
59   * @since 10
60   */
61  /**
62   * A constructor used to create a List object.
63   *
64   * @throws { BusinessError } 10200012 - The List's constructor cannot be directly invoked.
65   * @syscap SystemCapability.Utils.Lang
66   * @crossplatform
67   * @atomicservice
68   * @since 12
69   */
70  constructor();
71  /**
72   * Gets the element number of the List. This is a number one higher than the highest index in the list.
73   *
74   * @type { number }
75   * @syscap SystemCapability.Utils.Lang
76   * @since 8
77   */
78  /**
79   * Gets the element number of the List. This is a number one higher than the highest index in the list.
80   *
81   * @type { number }
82   * @syscap SystemCapability.Utils.Lang
83   * @crossplatform
84   * @since 10
85   */
86  /**
87   * Gets the element number of the List. This is a number one higher than the highest index in the list.
88   *
89   * @type { number }
90   * @syscap SystemCapability.Utils.Lang
91   * @crossplatform
92   * @atomicservice
93   * @since 12
94   */
95  length: number;
96  /**
97   * Appends the specified element to the end of this list.
98   *
99   * @param { T } element - element element to be appended to this list
100   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
101   * @throws { BusinessError } 10200011 - The add method cannot be bound.
102   * @syscap SystemCapability.Utils.Lang
103   * @since 8
104   */
105  /**
106   * Appends the specified element to the end of this list.
107   *
108   * @param { T } element - element element to be appended to this list
109   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
110   * @throws { BusinessError } 10200011 - The add method cannot be bound.
111   * @syscap SystemCapability.Utils.Lang
112   * @crossplatform
113   * @since 10
114   */
115  /**
116   * Appends the specified element to the end of this list.
117   *
118   * @param { T } element - element element to be appended to this list
119   * @returns { boolean } the boolean type, returns true if the addition is successful, and returns false if it fails.
120   * @throws { BusinessError } 10200011 - The add method cannot be bound.
121   * @syscap SystemCapability.Utils.Lang
122   * @crossplatform
123   * @atomicservice
124   * @since 12
125   */
126  add(element: T): boolean;
127  /**
128   * Inserts the specified element at the specified position in this list.
129   *
130   * @param { T } element - element element element to be inserted
131   * @param { number } index - index index index at which the specified element is to be inserted
132   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
133   * @throws { BusinessError } 10200001 - The value of index is out of range.
134   * @throws { BusinessError } 401 - Parameter error. Possible causes:
135   * 1.Mandatory parameters are left unspecified;
136   * 2.Incorrect parameter types;
137   * 3.Parameter verification failed.
138   * @syscap SystemCapability.Utils.Lang
139   * @since 8
140   */
141  /**
142   * Inserts the specified element at the specified position in this list.
143   *
144   * @param { T } element - element element element to be inserted
145   * @param { number } index - index index index at which the specified element is to be inserted
146   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
147   * @throws { BusinessError } 10200001 - The value of index is out of range.
148   * @throws { BusinessError } 401 - Parameter error. Possible causes:
149   * 1.Mandatory parameters are left unspecified;
150   * 2.Incorrect parameter types;
151   * 3.Parameter verification failed.
152   * @syscap SystemCapability.Utils.Lang
153   * @crossplatform
154   * @since 10
155   */
156  /**
157   * Inserts the specified element at the specified position in this list.
158   *
159   * @param { T } element - element element element to be inserted
160   * @param { number } index - index index index at which the specified element is to be inserted
161   * @throws { BusinessError } 10200011 - The insert method cannot be bound.
162   * @throws { BusinessError } 10200001 - The value of index is out of range.
163   * @throws { BusinessError } 401 - Parameter error. Possible causes:
164   * 1.Mandatory parameters are left unspecified;
165   * 2.Incorrect parameter types;
166   * 3.Parameter verification failed.
167   * @syscap SystemCapability.Utils.Lang
168   * @crossplatform
169   * @atomicservice
170   * @since 12
171   */
172  insert(element: T, index: number): void;
173  /**
174   * Returns the element at the specified position in this list,
175   * or returns undefined if this list is empty
176   *
177   * @param { number } index - index index specified position
178   * @returns { T } the T type
179   * @throws { BusinessError } 10200011 - The get method cannot be bound.
180   * @throws { BusinessError } 401 - Parameter error. Possible causes:
181   * 1.Mandatory parameters are left unspecified;
182   * 2.Incorrect parameter types.
183   * @syscap SystemCapability.Utils.Lang
184   * @since 8
185   */
186  /**
187   * Returns the element at the specified position in this list,
188   * or returns undefined if this list is empty
189   *
190   * @param { number } index - index index specified position
191   * @returns { T } the T type
192   * @throws { BusinessError } 10200011 - The get method cannot be bound.
193   * @throws { BusinessError } 401 - Parameter error. Possible causes:
194   * 1.Mandatory parameters are left unspecified;
195   * 2.Incorrect parameter types.
196   * @syscap SystemCapability.Utils.Lang
197   * @crossplatform
198   * @since 10
199   */
200  /**
201   * Returns the element at the specified position in this list,
202   * or returns undefined if this list is empty
203   *
204   * @param { number } index - index index specified position
205   * @returns { T } the T type
206   * @throws { BusinessError } 10200011 - The get method cannot be bound.
207   * @throws { BusinessError } 401 - Parameter error. Possible causes:
208   * 1.Mandatory parameters are left unspecified;
209   * 2.Incorrect parameter types.
210   * @syscap SystemCapability.Utils.Lang
211   * @crossplatform
212   * @atomicservice
213   * @since 12
214   */
215  get(index: number): T;
216  /**
217   * Check if list contains the specified element
218   *
219   * @param { T } element - element element element to be contained
220   * @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
221   * @throws { BusinessError } 10200011 - The has method cannot be bound.
222   * @syscap SystemCapability.Utils.Lang
223   * @since 8
224   */
225  /**
226   * Check if list contains the specified element
227   *
228   * @param { T } element - element element element to be contained
229   * @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
230   * @throws { BusinessError } 10200011 - The has method cannot be bound.
231   * @syscap SystemCapability.Utils.Lang
232   * @crossplatform
233   * @since 10
234   */
235  /**
236   * Check if list contains the specified element
237   *
238   * @param { T } element - element element element to be contained
239   * @returns { boolean } the boolean type,if list contains the specified element,return true,else return false
240   * @throws { BusinessError } 10200011 - The has method cannot be bound.
241   * @syscap SystemCapability.Utils.Lang
242   * @crossplatform
243   * @atomicservice
244   * @since 12
245   */
246  has(element: T): boolean;
247  /**
248   * Returns the index of the first occurrence of the specified element
249   * in this list, or -1 if this list does not contain the element.
250   *
251   * @param { T } element - element element element to be contained
252   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
253   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
254   * @syscap SystemCapability.Utils.Lang
255   * @since 8
256   */
257  /**
258   * Returns the index of the first occurrence of the specified element
259   * in this list, or -1 if this list does not contain the element.
260   *
261   * @param { T } element - element element element to be contained
262   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
263   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
264   * @syscap SystemCapability.Utils.Lang
265   * @crossplatform
266   * @since 10
267   */
268  /**
269   * Returns the index of the first occurrence of the specified element
270   * in this list, or -1 if this list does not contain the element.
271   *
272   * @param { T } element - element element element to be contained
273   * @returns { number } the number type ,returns the lowest index such that or -1 if there is no such index.
274   * @throws { BusinessError } 10200011 - The getIndexOf method cannot be bound.
275   * @syscap SystemCapability.Utils.Lang
276   * @crossplatform
277   * @atomicservice
278   * @since 12
279   */
280  getIndexOf(element: T): number;
281  /**
282   * Find the corresponding element according to the index.
283   *
284   * @param { number } index - index index the index in the list
285   * @returns { T } the T type ,returns undefined if list is empty,If the index is
286   * out of bounds (greater than or equal to length or less than 0), throw an exception
287   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
288   * @throws { BusinessError } 10200001 - The value of index is out of range.
289   * @throws { BusinessError } 401 - Parameter error. Possible causes:
290   * 1.Mandatory parameters are left unspecified;
291   * 2.Incorrect parameter types.
292   * @syscap SystemCapability.Utils.Lang
293   * @since 8
294   */
295  /**
296   * Find the corresponding element according to the index.
297   *
298   * @param { number } index - index index the index in the list
299   * @returns { T } the T type ,returns undefined if list is empty,If the index is
300   * out of bounds (greater than or equal to length or less than 0), throw an exception
301   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
302   * @throws { BusinessError } 10200001 - The value of index is out of range.
303   * @throws { BusinessError } 401 - Parameter error. Possible causes:
304   * 1.Mandatory parameters are left unspecified;
305   * 2.Incorrect parameter types.
306   * @syscap SystemCapability.Utils.Lang
307   * @crossplatform
308   * @since 10
309   */
310  /**
311   * Find the corresponding element according to the index.
312   *
313   * @param { number } index - index index the index in the list
314   * @returns { T } the T type ,returns undefined if list is empty,If the index is
315   * out of bounds (greater than or equal to length or less than 0), throw an exception
316   * @throws { BusinessError } 10200011 - The removeByIndex method cannot be bound.
317   * @throws { BusinessError } 10200001 - The value of index is out of range.
318   * @throws { BusinessError } 401 - Parameter error. Possible causes:
319   * 1.Mandatory parameters are left unspecified;
320   * 2.Incorrect parameter types.
321   * @syscap SystemCapability.Utils.Lang
322   * @crossplatform
323   * @atomicservice
324   * @since 12
325   */
326  removeByIndex(index: number): T;
327  /**
328   * Removes the first occurrence of the specified element from this list,
329   * if it is present.  If the list does not contain the element, it is
330   * unchanged.  More formally, removes the element with the lowest index
331   *
332   * @param { T } element - element element element to remove
333   * @returns { boolean } the boolean type ,If there is no such element, return false
334   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
335   * @syscap SystemCapability.Utils.Lang
336   * @since 8
337   */
338  /**
339   * Removes the first occurrence of the specified element from this list,
340   * if it is present.  If the list does not contain the element, it is
341   * unchanged.  More formally, removes the element with the lowest index
342   *
343   * @param { T } element - element element element to remove
344   * @returns { boolean } the boolean type ,If there is no such element, return false
345   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
346   * @syscap SystemCapability.Utils.Lang
347   * @crossplatform
348   * @since 10
349   */
350  /**
351   * Removes the first occurrence of the specified element from this list,
352   * if it is present.  If the list does not contain the element, it is
353   * unchanged.  More formally, removes the element with the lowest index
354   *
355   * @param { T } element - element element element to remove
356   * @returns { boolean } the boolean type ,If there is no such element, return false
357   * @throws { BusinessError } 10200011 - The remove method cannot be bound.
358   * @syscap SystemCapability.Utils.Lang
359   * @crossplatform
360   * @atomicservice
361   * @since 12
362   */
363  remove(element: T): boolean;
364  /**
365   * Returns in the index of the last occurrence of the specified element in this list ,
366   * or -1 if the list does not contain the element.
367   *
368   * @param { T } element - element element element to find
369   * @returns { number } the number type
370   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
371   * @syscap SystemCapability.Utils.Lang
372   * @since 8
373   */
374  /**
375   * Returns in the index of the last occurrence of the specified element in this list ,
376   * or -1 if the list does not contain the element.
377   *
378   * @param { T } element - element element element to find
379   * @returns { number } the number type
380   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
381   * @syscap SystemCapability.Utils.Lang
382   * @crossplatform
383   * @since 10
384   */
385  /**
386   * Returns in the index of the last occurrence of the specified element in this list ,
387   * or -1 if the list does not contain the element.
388   *
389   * @param { T } element - element element element to find
390   * @returns { number } the number type
391   * @throws { BusinessError } 10200011 - The getLastIndexOf method cannot be bound.
392   * @syscap SystemCapability.Utils.Lang
393   * @crossplatform
394   * @atomicservice
395   * @since 12
396   */
397  getLastIndexOf(element: T): number;
398  /**
399   * Returns the first element (the item at index 0) of this list.
400   * or returns undefined if list is empty
401   *
402   * @returns { T } the T type ,returns undefined if list is empty
403   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
404   * @syscap SystemCapability.Utils.Lang
405   * @since 8
406   */
407  /**
408   * Returns the first element (the item at index 0) of this list.
409   * or returns undefined if list is empty
410   *
411   * @returns { T } the T type ,returns undefined if list is empty
412   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
413   * @syscap SystemCapability.Utils.Lang
414   * @crossplatform
415   * @since 10
416   */
417  /**
418   * Returns the first element (the item at index 0) of this list.
419   * or returns undefined if list is empty
420   *
421   * @returns { T } the T type ,returns undefined if list is empty
422   * @throws { BusinessError } 10200011 - The getFirst method cannot be bound.
423   * @syscap SystemCapability.Utils.Lang
424   * @crossplatform
425   * @atomicservice
426   * @since 12
427   */
428  getFirst(): T;
429  /**
430   * Returns the Last element (the item at index length-1) of this list.
431   * or returns undefined if list is empty
432   *
433   * @returns { T } the T type ,returns undefined if list is empty
434   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
435   * @syscap SystemCapability.Utils.Lang
436   * @since 8
437   */
438  /**
439   * Returns the Last element (the item at index length-1) of this list.
440   * or returns undefined if list is empty
441   *
442   * @returns { T } the T type ,returns undefined if list is empty
443   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
444   * @syscap SystemCapability.Utils.Lang
445   * @crossplatform
446   * @since 10
447   */
448  /**
449   * Returns the Last element (the item at index length-1) of this list.
450   * or returns undefined if list is empty
451   *
452   * @returns { T } the T type ,returns undefined if list is empty
453   * @throws { BusinessError } 10200011 - The getLast method cannot be bound.
454   * @syscap SystemCapability.Utils.Lang
455   * @crossplatform
456   * @atomicservice
457   * @since 12
458   */
459  getLast(): T;
460  /**
461   * Replaces the element at the specified position in this List with the specified element
462   *
463   * @param { number } index - index index index to find
464   * @param { T } element - element element replaced element
465   * @returns { T } the T type
466   * @throws { BusinessError } 10200011 - The set method cannot be bound.
467   * @throws { BusinessError } 10200001 - The value of index is out of range.
468   * @throws { BusinessError } 401 - Parameter error. Possible causes:
469   * 1.Mandatory parameters are left unspecified;
470   * 2.Incorrect parameter types.
471   * @syscap SystemCapability.Utils.Lang
472   * @since 8
473   */
474  /**
475   * Replaces the element at the specified position in this List with the specified element
476   *
477   * @param { number } index - index index index to find
478   * @param { T } element - element element replaced element
479   * @returns { T } the T type
480   * @throws { BusinessError } 10200011 - The set method cannot be bound.
481   * @throws { BusinessError } 10200001 - The value of index is out of range.
482   * @throws { BusinessError } 401 - Parameter error. Possible causes:
483   * 1.Mandatory parameters are left unspecified;
484   * 2.Incorrect parameter types.
485   * @syscap SystemCapability.Utils.Lang
486   * @crossplatform
487   * @since 10
488   */
489  /**
490   * Replaces the element at the specified position in this List with the specified element
491   *
492   * @param { number } index - index index index to find
493   * @param { T } element - element element replaced element
494   * @returns { T } the T type
495   * @throws { BusinessError } 10200011 - The set method cannot be bound.
496   * @throws { BusinessError } 10200001 - The value of index is out of range.
497   * @throws { BusinessError } 401 - Parameter error. Possible causes:
498   * 1.Mandatory parameters are left unspecified;
499   * 2.Incorrect parameter types.
500   * @syscap SystemCapability.Utils.Lang
501   * @crossplatform
502   * @atomicservice
503   * @since 12
504   */
505  set(index: number, element: T): T;
506  /**
507   * Compares the specified object with this list for equality.if the object are the same as this list
508   * return true, otherwise return false.
509   *
510   * @param { Object } obj - obj obj Compare objects
511   * @returns { boolean } the boolean type
512   * @throws { BusinessError } 10200011 - The equal method cannot be bound.
513   * @syscap SystemCapability.Utils.Lang
514   * @since 8
515   */
516  /**
517   * Compares the specified object with this list for equality.if the object are the same as this list
518   * return true, otherwise return false.
519   *
520   * @param { Object } obj - obj obj Compare objects
521   * @returns { boolean } the boolean type
522   * @throws { BusinessError } 10200011 - The equal method cannot be bound.
523   * @syscap SystemCapability.Utils.Lang
524   * @crossplatform
525   * @since 10
526   */
527  /**
528   * Compares the specified object with this list for equality.if the object are the same as this list
529   * return true, otherwise return false.
530   *
531   * @param { Object } obj - obj obj Compare objects
532   * @returns { boolean } the boolean type
533   * @throws { BusinessError } 10200011 - The equal method cannot be bound.
534   * @syscap SystemCapability.Utils.Lang
535   * @crossplatform
536   * @atomicservice
537   * @since 12
538   */
539  equal(obj: Object): boolean;
540  /**
541   * Replaces each element of this list with the result of applying the operator to that element.
542   *
543   * @param { function } callbackFn - callbackFn
544   * callbackFn (required) A function that accepts up to three arguments.
545   * The function to be called for each element.
546   * @param { Object } [thisArg] - thisArg
547   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
548   * If thisArg is omitted, undefined is used as the this value.
549   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
550   * @throws { BusinessError } 401 - Parameter error. Possible causes:
551   * 1.Mandatory parameters are left unspecified;
552   * 2.Incorrect parameter types.
553   * @syscap SystemCapability.Utils.Lang
554   * @since 8
555   */
556  /**
557   * Replaces each element of this list with the result of applying the operator to that element.
558   *
559   * @param { function } callbackFn - callbackFn
560   * callbackFn (required) A function that accepts up to three arguments.
561   * The function to be called for each element.
562   * @param { Object } [thisArg] - thisArg
563   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
564   * If thisArg is omitted, undefined is used as the this value.
565   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
566   * @throws { BusinessError } 401 - Parameter error. Possible causes:
567   * 1.Mandatory parameters are left unspecified;
568   * 2.Incorrect parameter types.
569   * @syscap SystemCapability.Utils.Lang
570   * @crossplatform
571   * @since 10
572   */
573  /**
574   * Replaces each element of this list with the result of applying the operator to that element.
575   *
576   * @param { function } callbackFn - callbackFn
577   * callbackFn (required) A function that accepts up to three arguments.
578   * The function to be called for each element.
579   * @param { Object } [thisArg] - thisArg
580   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
581   * If thisArg is omitted, undefined is used as the this value.
582   * @throws { BusinessError } 10200011 - The forEach method cannot be bound.
583   * @throws { BusinessError } 401 - Parameter error. Possible causes:
584   * 1.Mandatory parameters are left unspecified;
585   * 2.Incorrect parameter types.
586   * @syscap SystemCapability.Utils.Lang
587   * @crossplatform
588   * @atomicservice
589   * @since 12
590   */
591  forEach(callbackFn: (value: T, index?: number, List?: List<T>) => void, thisArg?: Object): void;
592  /**
593   * Sorts this list according to the order induced by the specified comparator
594   *
595   * @param { function } comparator - comparator
596   * comparator (required) A function that accepts up to two arguments.
597   * Specifies the sort order. Must be a function,return number type,If it returns firstValue
598   * minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
599   * minus firstValue, it returns an list sorted in descending order;
600   * @throws { BusinessError } 401 - Parameter error. Possible causes:
601   * 1.Mandatory parameters are left unspecified;
602   * 2.Incorrect parameter types.
603   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
604   * @syscap SystemCapability.Utils.Lang
605   * @since 8
606   */
607  /**
608   * Sorts this list according to the order induced by the specified comparator
609   *
610   * @param { function } comparator - comparator
611   * comparator (required) A function that accepts up to two arguments.
612   * Specifies the sort order. Must be a function,return number type,If it returns firstValue
613   * minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
614   * minus firstValue, it returns an list sorted in descending order;
615   * @throws { BusinessError } 401 - Parameter error. Possible causes:
616   * 1.Mandatory parameters are left unspecified;
617   * 2.Incorrect parameter types.
618   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
619   * @syscap SystemCapability.Utils.Lang
620   * @crossplatform
621   * @since 10
622   */
623  /**
624   * Sorts this list according to the order induced by the specified comparator
625   *
626   * @param { function } comparator - comparator
627   * comparator (required) A function that accepts up to two arguments.
628   * Specifies the sort order. Must be a function,return number type,If it returns firstValue
629   * minus secondValue, it returns an list sorted in ascending order;If it returns secondValue
630   * minus firstValue, it returns an list sorted in descending order;
631   * @throws { BusinessError } 401 - Parameter error. Possible causes:
632   * 1.Mandatory parameters are left unspecified;
633   * 2.Incorrect parameter types.
634   * @throws { BusinessError } 10200011 - The sort method cannot be bound.
635   * @syscap SystemCapability.Utils.Lang
636   * @crossplatform
637   * @atomicservice
638   * @since 12
639   */
640  sort(comparator: (firstValue: T, secondValue: T) => number): void;
641  /**
642   * Removes all of the elements from this list.The list will
643   * be empty after this call returns.length becomes 0
644   *
645   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
646   * @syscap SystemCapability.Utils.Lang
647   * @since 8
648   */
649  /**
650   * Removes all of the elements from this list.The list will
651   * be empty after this call returns.length becomes 0
652   *
653   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
654   * @syscap SystemCapability.Utils.Lang
655   * @crossplatform
656   * @since 10
657   */
658  /**
659   * Removes all of the elements from this list.The list will
660   * be empty after this call returns.length becomes 0
661   *
662   * @throws { BusinessError } 10200011 - The clear method cannot be bound.
663   * @syscap SystemCapability.Utils.Lang
664   * @crossplatform
665   * @atomicservice
666   * @since 12
667   */
668  clear(): void;
669  /**
670   * Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
671   *
672   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
673   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
674   * @returns { List<T> }
675   * @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
676   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
677   * @throws { BusinessError } 401 - Parameter error. Possible causes:
678   * 1.Mandatory parameters are left unspecified;
679   * 2.Incorrect parameter types.
680   * @syscap SystemCapability.Utils.Lang
681   * @since 8
682   */
683  /**
684   * Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
685   *
686   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
687   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
688   * @returns { List<T> }
689   * @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
690   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
691   * @throws { BusinessError } 401 - Parameter error. Possible causes:
692   * 1.Mandatory parameters are left unspecified;
693   * 2.Incorrect parameter types.
694   * @syscap SystemCapability.Utils.Lang
695   * @crossplatform
696   * @since 10
697   */
698  /**
699   * Returns a view of the portion of this list between the specified fromIndex,inclusive,and toIndex,exclusive
700   *
701   * @param { number } fromIndex - fromIndex fromIndex The starting position of the index, containing the value at that index position
702   * @param { number } toIndex - toIndex toIndex the end of the index, excluding the value at that index
703   * @returns { List<T> }
704   * @throws { BusinessError } 10200011 - The getSubList method cannot be bound.
705   * @throws { BusinessError } 10200001 - The value of fromIndex or toIndex is out of range.
706   * @throws { BusinessError } 401 - Parameter error. Possible causes:
707   * 1.Mandatory parameters are left unspecified;
708   * 2.Incorrect parameter types.
709   * @syscap SystemCapability.Utils.Lang
710   * @crossplatform
711   * @atomicservice
712   * @since 12
713   */
714  getSubList(fromIndex: number, toIndex: number): List<T>;
715  /**
716   * Replaces each element of this list with the result of applying the operator to that element.
717   *
718   * @param { function } callbackFn - callbackFn
719   * callbackFn (required) A function that accepts up to three arguments.
720   * The function to be called for each element.
721   * @param { Object } [thisArg] - thisArg
722   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
723   * If thisArg is omitted, undefined is used as the this value.
724   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
725   * @throws { BusinessError } 401 - Parameter error. Possible causes:
726   * 1.Mandatory parameters are left unspecified;
727   * 2.Incorrect parameter types.
728   * @syscap SystemCapability.Utils.Lang
729   * @since 8
730   */
731  /**
732   * Replaces each element of this list with the result of applying the operator to that element.
733   *
734   * @param { function } callbackFn - callbackFn
735   * callbackFn (required) A function that accepts up to three arguments.
736   * The function to be called for each element.
737   * @param { Object } [thisArg] - thisArg
738   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
739   * If thisArg is omitted, undefined is used as the this value.
740   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
741   * @throws { BusinessError } 401 - Parameter error. Possible causes:
742   * 1.Mandatory parameters are left unspecified;
743   * 2.Incorrect parameter types.
744   * @syscap SystemCapability.Utils.Lang
745   * @crossplatform
746   * @since 10
747   */
748  /**
749   * Replaces each element of this list with the result of applying the operator to that element.
750   *
751   * @param { function } callbackFn - callbackFn
752   * callbackFn (required) A function that accepts up to three arguments.
753   * The function to be called for each element.
754   * @param { Object } [thisArg] - thisArg
755   * thisArg (Optional) The value to be used as this value for when callbackFn is called.
756   * If thisArg is omitted, undefined is used as the this value.
757   * @throws { BusinessError } 10200011 - The replaceAllElements method cannot be bound.
758   * @throws { BusinessError } 401 - Parameter error. Possible causes:
759   * 1.Mandatory parameters are left unspecified;
760   * 2.Incorrect parameter types.
761   * @syscap SystemCapability.Utils.Lang
762   * @crossplatform
763   * @atomicservice
764   * @since 12
765   */
766  replaceAllElements(callbackFn: (value: T, index?: number, list?: List<T>) => T, thisArg?: Object): void;
767  /**
768   * convert list to array
769   *
770   * @returns { Array<T> } the Array type
771   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
772   * @syscap SystemCapability.Utils.Lang
773   * @since 8
774   */
775  /**
776   * convert list to array
777   *
778   * @returns { Array<T> } the Array type
779   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
780   * @syscap SystemCapability.Utils.Lang
781   * @crossplatform
782   * @since 10
783   */
784  /**
785   * convert list to array
786   *
787   * @returns { Array<T> } the Array type
788   * @throws { BusinessError } 10200011 - The convertToArray method cannot be bound.
789   * @syscap SystemCapability.Utils.Lang
790   * @crossplatform
791   * @atomicservice
792   * @since 12
793   */
794  convertToArray(): Array<T>;
795  /**
796   * Determine whether list is empty and whether there is an element
797   *
798   * @returns { boolean } the boolean type
799   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
800   * @syscap SystemCapability.Utils.Lang
801   * @since 8
802   */
803  /**
804   * Determine whether list is empty and whether there is an element
805   *
806   * @returns { boolean } the boolean type
807   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
808   * @syscap SystemCapability.Utils.Lang
809   * @crossplatform
810   * @since 10
811   */
812  /**
813   * Determine whether list is empty and whether there is an element
814   *
815   * @returns { boolean } the boolean type
816   * @throws { BusinessError } 10200011 - The isEmpty method cannot be bound.
817   * @syscap SystemCapability.Utils.Lang
818   * @crossplatform
819   * @atomicservice
820   * @since 12
821   */
822  isEmpty(): boolean;
823  /**
824   * returns an iterator.Each item of the iterator is a Javascript Object
825   *
826   * @returns { IterableIterator<T> }
827   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
828   * @syscap SystemCapability.Utils.Lang
829   * @since 8
830   */
831  /**
832   * returns an iterator.Each item of the iterator is a Javascript Object
833   *
834   * @returns { IterableIterator<T> }
835   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
836   * @syscap SystemCapability.Utils.Lang
837   * @crossplatform
838   * @since 10
839   */
840  /**
841   * returns an iterator.Each item of the iterator is a Javascript Object
842   *
843   * @returns { IterableIterator<T> }
844   * @throws { BusinessError } 10200011 - The Symbol.iterator method cannot be bound.
845   * @syscap SystemCapability.Utils.Lang
846   * @crossplatform
847   * @atomicservice
848   * @since 12
849   */
850  [Symbol.iterator](): IterableIterator<T>;
851}
852
853export default List;
854