@@ -55,28 +55,28 @@ let y = "abc"
5555<: y.to_num()
5656```
5757
58- ### @(_ v_ : str).to_arr(): ` arr< str> `
58+ ### @(_ v_ : str).to_arr(): arr& lt ; str& gt ;
5959Splits the string into an array of grapheme clusters.
6060If the string contains no isolated surrogates, they are not returned.
6161
62- ### @(_ v_ : str).to_unicode_arr(): ` arr< str> `
62+ ### @(_ v_ : str).to_unicode_arr(): arr& lt ; str& gt ;
6363Splits the string into an array of Unicode code points.
6464Grapheme clusters are divided.
6565If the string contains no isolated surrogates, they are not returned.
6666
67- ### @(_ v_ : str).to_unicode_codepoint_arr(): ` arr< num> `
67+ ### @(_ v_ : str).to_unicode_codepoint_arr(): arr& lt ; num& gt ;
6868Splits the string into Unicode code points and returns their numeric values as an array.
6969If the string contains no isolated surrogates, they are not returned.
7070
71- ### @(_ v_ : str).to_char_arr(): ` arr< str> `
71+ ### @(_ v_ : str).to_char_arr(): arr& lt ; str& gt ;
7272Splits the string into an array of UTF-16 code units.
7373If the string contains surrogate pairs, both the high and low surrogates are returned separately.
7474
75- ### @(_ v_ : str).to_charcode_arr(): ` arr< num> `
75+ ### @(_ v_ : str).to_charcode_arr(): arr& lt ; num& gt ;
7676Splits the string into UTF-16 code units and returns their numeric values as an array.
7777If the string contains surrogate pairs, both the high and low surrogates are returned separately.
7878
79- ### @(_ v_ : str).to_utf8_byte_arr(): ` arr< num> `
79+ ### @(_ v_ : str).to_utf8_byte_arr(): arr& lt ; num& gt ;
8080Encodes the string into UTF-8 and returns an array of byte values (0–255).
8181
8282### @(_ v_ : str).pick(_ i_ : num): str | null
@@ -127,7 +127,7 @@ let x = "Hello World!"
127127<: x.slice(6, 11)
128128```
129129
130- ### @(_ v_ : str).split(_ splitter_ ?: str): ` arr< str> `
130+ ### @(_ v_ : str).split(_ splitter_ ?: str): arr& lt ; str& gt ;
131131Splits the string into an array based on the delimiter _ splitter_ . If _ splitter_ is omitted, splits the string into individual characters.
132132``` aiscript playground
133133let x = "Hey, how are you?"
@@ -152,7 +152,7 @@ let x = [1, 2, 3, 4, 5]
152152<: x.len
153153```
154154
155- ### @(_ v_ : arr).at(_ index_ : num, _ otherwise_ ?: value ): value
155+ ### @(_ v_ : arr& lt ; T & gt ; ).at(_ index_ : num, _ otherwise_ ?: T ): T | null
156156Returns the element at the position _ index_ in the array.\
157157If _ index_ is negative, it counts from the end.\
158158If _ index_ is out of range, it returns _ otherwise_ instead.\
@@ -167,7 +167,7 @@ let x = [1, 2, 3, 4, 5]
167167<: x.at(5, "Not Found")
168168```
169169
170- ### @(_ v_ : arr).push(_ i_ : value ): null
170+ ### @(_ v_ : arr& lt ; T & gt ; ).push(_ i_ : T ): null
171171** 【This operation mutates the array】**
172172Adds an element to the end of the array.
173173
@@ -178,7 +178,7 @@ x.push(8)
178178<: x
179179```
180180
181- ### @(_ v_ : arr).unshift(i: value ): null
181+ ### @(_ v_ : arr& lt ; T & gt ; ).unshift(i: T ): null
182182** 【This operation mutates the array】**
183183Adds an element to the beginning of the array.
184184
@@ -189,7 +189,7 @@ x.unshift(7)
189189<: x
190190```
191191
192- ### @(_ v_ : arr).pop(): value
192+ ### @(_ v_ : arr& lt ; T & gt ; ).pop(): T | null
193193** 【This operation mutates the array】**
194194Removes and returns the last element of the array.
195195
@@ -201,7 +201,7 @@ let popped = x.pop()
201201<: x
202202```
203203
204- ### @(_ v_ : arr).shift(): value
204+ ### @(_ v_ : arr& lt ; T & gt ; ).shift(): T | null
205205** 【This operation mutates the array】**
206206Removes and returns the first element of the array.
207207
@@ -213,7 +213,7 @@ let shifted = x.shift()
213213<: x
214214```
215215
216- ### @(_ a_ : arr).concat(_ b_ : arr): arr
216+ ### @(_ a_ : arr& lt ; T & gt ; ).concat(_ b_ : arr& lt ; T & gt ; ): arr& lt ; T & gt ;
217217Concatenates two arrays.
218218
219219``` aiscript playground
@@ -239,7 +239,7 @@ let x = ["Hello", "World", "!"]
239239<: x.join()
240240```
241241
242- ### @(_ v_ : arr).slice(_ begin_ : num, _ end_ : num): arr
242+ ### @(_ v_ : arr& lt ; T & gt ; ).slice(_ begin_ : num, _ end_ : num): arr& lt ; T & gt ;
243243Extracts a section of the array from _ begin_ to _ end_ .
244244
245245``` aiscript playground
@@ -248,7 +248,7 @@ let x = [1, 2, 3, 4, 5]
248248<: x.slice(1, 4)
249249```
250250
251- ### @(_ v_ : arr).incl(_ i_ : value ): bool
251+ ### @(_ v_ : arr& lt ; T & gt ; ).incl(_ i_ : T ): bool
252252Returns whether the specified value is present in the array.
253253
254254``` aiscript playground
@@ -258,7 +258,7 @@ let x = [1, 2, 3, 4, 5]
258258<: x.incl(6)
259259```
260260
261- ### @(_ v_ : arr).map(_ func_ : fn): arr
261+ ### @(_ v_ : arr& lt ; T & gt ; ).map(_ func_ : @(T, num) = & gt ; U): arr & lt ; U & gt ;
262262Asynchronously calls _ func_ on each element of the array.\
263263Returns a new array with elements replaced by the results of _ func_ .
264264
@@ -270,7 +270,7 @@ let x = ['Tanaka', 'Suzuki', 'Yamamoto']
270270})
271271```
272272
273- ### @(_ v_ : arr).filter(_ func_ : fn): arr
273+ ### @(_ v_ : arr& lt ; T & gt ; ).filter(_ func_ : @(T, num) = & gt ; bool): arr & lt ; T & gt ;
274274Extracts elements from the array where _ func_ returns true.\
275275The order is preserved.
276276
@@ -283,8 +283,8 @@ let x = [1, 2, 3, 4, 5]
283283})
284284```
285285
286- ### @(_ v_ : arr).reduce(_ func_ : Callback, _ initial_ : value ): value
287- ` Callback ` : @(_ acm_ : value , _ item_ : value , _ index_ : num): value
286+ ### @(_ v_ : arr& lt ; T & gt ; ).reduce& lt ; U & gt ; (_ func_ : Callback, _ initial_ : U ): U
287+ ` Callback ` : @(_ acm_ : U , _ item_ : T , _ index_ : num): U
288288Calls _ func_ for each element of the array in turn.
289289In each call, the previous result is passed as the first argument _ acm_ .
290290If _ initial_ is specified, the argument of the first call is (_ initial_ , _ v_ \[ 0] , 0),
@@ -300,7 +300,7 @@ let x = [1, 2, 3, 4, 5]
300300}, 0)
301301```
302302
303- ### @(_ v_ : arr).find(_ func_ : @(_ item_ : value , _ index_ : num) { bool } ): value
303+ ### @(_ v_ : arr& lt ; T & gt ; ).find(_ func_ : @(_ item_ : T , _ index_ : num) = & gt ; bool ): T | null
304304Find the first element in the array such that _ func_ returns true and returns their values.
305305
306306``` aiscript playground
@@ -312,7 +312,7 @@ let x = [1, 2, 3, 4, 5]
312312})
313313```
314314
315- ### @(_ v_ : arr).index_of(_ val_ : value , _ fromIndex_ ?: num): num
315+ ### @(_ v_ : arr& lt ; T & gt ; ).index_of(_ val_ : T , _ fromIndex_ ?: num): num
316316Searches the array for a value equal to _ val_ and returns its index.
317317If _ fromIndex_ is specified, the search starts at that position.
318318If _ fromIndex_ is negative, the position from the end (array length + _ fromIndex_ ) is used.
@@ -336,7 +336,7 @@ x.reverse()
336336<: x
337337```
338338
339- ### @(_ v_ : arr).copy(): arr
339+ ### @(_ v_ : arr& lt ; T & gt ; ).copy(): arr& lt ; T & gt ;
340340Generates a copy of the array.
341341It is a shallow copy, and array and object references are preserved.
342342
@@ -353,7 +353,7 @@ xCopy.push(6)
353353<: xCopy
354354```
355355
356- ### @(_ v_ : arr).sort(_ comp_ : @(_ a_ : value , _ b_ : value) ): arr
356+ ### @(_ v_ : arr& lt ; T & gt ; ).sort(_ comp_ : @(_ a_ : T , _ b_ : T) => num ): arr& lt ; T & gt ;
357357** 【This operation mutates the array】**
358358Sort an array. Pass the following comparison function as the first argument _ comp_ .
359359This operation is stable sort.
@@ -380,7 +380,7 @@ x.sort(@(a, b) {
380380<: x
381381```
382382
383- ### @(_ v_ : arr).fill(_ val_ ?: value , _ fromIndex_ ?: num, _ toIndex_ ?: num): arr
383+ ### @(_ v_ : arr& lt ; T & gt ; ).fill(_ val_ ?: T , _ fromIndex_ ?: num, _ toIndex_ ?: num): arr& lt ; T & gt ;
384384** 【This operation mutates the array】**
385385Replaces elements in the range _ fromIndex_ to _ toIndex_ of the array with _ val_ .
386386If _ val_ is omitted, it is replaced with ` null ` .
@@ -395,7 +395,7 @@ x.fill(0, 1, 4)
395395<: x
396396```
397397
398- ### @(_ v_ : arr).repeat(_ times_ : num): arr
398+ ### @(_ v_ : arr& lt ; T & gt ; ).repeat(_ times_ : num): arr& lt ; T & gt ;
399399Creates an array repeated _ times_ times.
400400Like ` arr.copy ` , it is a shallow copy, and array and object references are preserved.
401401_ times_ must be an integer value greater than or equal to 0. Otherwise, throws error.
@@ -406,7 +406,7 @@ let x = [1, 2, 3]
406406<: x.repeat(3)
407407```
408408
409- ### @(_ v_ : arr).splice(_ index_ : num, _ remove_count_ ?: num, _ items_ ?: arr\ & lt;value > ; ): arr\ & lt;value > ;
409+ ### @(_ v_ : arr& lt ; T & gt ; ).splice(_ index_ : num, _ remove_count_ ?: num, _ items_ ?: arr< ; T > ; ): arr< ; T > ;
410410** 【This operation mutates the array】**
411411Removes _ remove_count_ elements from the _ index_ array and inserts _ items_ elements in their place.
412412Returns an array of the elements removed as the return value.
@@ -436,7 +436,7 @@ let x = [1, [2, 3], [4, [5, 6]]]
436436<: x.flat(2)
437437```
438438
439- ### @(_ v_ : arr).flat_map(_ func_ : @(_ item_ : value , _ index_ : num) { value } ): arr
439+ ### @(_ v_ : arr& lt ; T & gt ; ).flat_map& lt ; U & gt ; (_ func_ : @(_ item_ : T , _ index_ : num) = & gt ; arr & lt ; U & gt ; | U ): arr& lt ; U & gt ;
440440After replacing each element of the array with the return value of _ func_ , a new array is created, flattened by one level.
441441_ func_ is called asynchronously.
442442
@@ -448,7 +448,7 @@ let x = [1, 2, 3]
448448})
449449```
450450
451- ### @(_ v_ : arr).insert(_ index_ : num, _ item_ : value ): null
451+ ### @(_ v_ : arr& lt ; T & gt ; ).insert(_ index_ : num, _ item_ : T ): null
452452** 【This operation mutates the array】**
453453Inserts _ item_ at the _ index_ position in the array.
454454If _ index_ is negative, count from the end.
@@ -463,7 +463,7 @@ x.insert(2, 6)
463463<: x
464464```
465465
466- ### @(_ v_ : arr).remove(_ index_ : num): value | null
466+ ### @(_ v_ : arr& lt ; T & gt ; ).remove(_ index_ : num): T | null
467467** 【This operation mutates the array】**
468468Removes the element at position _ index_ from the array and returns that element.
469469If _ index_ is negative, count from the end.
@@ -479,7 +479,7 @@ let removed = x.remove(2)
479479<: x
480480```
481481
482- ### @(_ v_ : arr).every(_ func_ : @(_ item_ : value , _ index_ : num) { bool } ): bool
482+ ### @(_ v_ : arr& lt ; T & gt ; ).every(_ func_ : @(_ item_ : T , _ index_ : num) = & gt ; bool ): bool
483483Returns true only if _ func_ returns true for all elements of the array. Always returns true for an empty array.
484484
485485``` aiscript playground
@@ -498,7 +498,7 @@ let y = [2, 4, 6, 7, 8]
498498<: judgeAllEven(y)
499499```
500500
501- ### @(_ v_ : arr).some(_ func_ : @(_ item_ : value , _ index_ : num) { bool } ): bool
501+ ### @(_ v_ : arr& lt ; T & gt ; ).some(_ func_ : @(_ item_ : T , _ index_ : num) = & gt ; bool): bool
502502Returns true only when there is an element for which _ func_ returns true for an array element.
503503
504504``` aiscript playground
0 commit comments