Skip to content

Commit 4e6bd57

Browse files
jmagaramzth
authored andcommitted
All specific typed arrays
1 parent 2d1097a commit 4e6bd57

11 files changed

+479
-76
lines changed

src/typed-arrays/Core__BigInt64Array.res

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,46 @@ module Constants = {
99
external bytesPerElement: int = "BigInt64Array.BYTES_PER_ELEMENT"
1010
}
1111

12-
/** `fromArray` creates a `BitInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
12+
/** `fromArray` creates a `BigInt64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
1313
*/
1414
@new
1515
external fromArray: array<Core__BigInt.t> => t = "BigInt64Array"
1616

17-
/** `fromBuffer` creates a `BitInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
17+
/** `fromBuffer` creates a `BigInt64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
1818
1919
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2020
*/
2121
@new
2222
external fromBuffer: Core__ArrayBuffer.t => t = "BigInt64Array"
2323

24-
/** `fromBufferToEnd` creates a `BitInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
24+
/** `fromBufferToEnd` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
2525
2626
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
2727
*/
2828
@new
2929
external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "BigInt64Array"
3030

31-
/** `fromBufferWithRange` creates a `BitInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
31+
/** `fromBufferWithRange` creates a `BigInt64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
3232
3333
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
3434
*/
3535
@new
3636
external fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
3737
"BigInt64Array"
3838

39-
/** `fromLength` creates a zero-initialized `BitInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
39+
/** `fromLength` creates a zero-initialized `BigInt64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt64Array/BigInt64Array)
4040
4141
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
4242
*/
4343
@new
4444
external fromLength: int => t = "BigInt64Array"
4545

46-
/** `fromArrayLikeOrIterable` creates a `BitInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
46+
/** `fromArrayLikeOrIterable` creates a `BigInt64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
4747
*/
4848
@val
4949
external fromArrayLikeOrIterable: 'a => t = "BigInt64Array.from"
5050

51-
/** `fromArrayLikeOrIterableWithMap` creates a `BitInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
51+
/** `fromArrayLikeOrIterableWithMap` creates a `BigInt64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
5252
*/
5353
@val
5454
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t =
Lines changed: 47 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
1+
/** The `BigUint64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [BigUint64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array)
2+
*/
13
type t = Core__TypedArray.t<Core__BigInt.t>
24

35
module Constants = {
4-
@val external bytesPerElement: int = "BigUint64Array.BYTES_PER_ELEMENT"
6+
/**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)
7+
*/
8+
@val
9+
external bytesPerElement: int = "BigUint64Array.BYTES_PER_ELEMENT"
510
}
611

7-
@new external make: array<int> => t = "BigUint64Array"
8-
@new external fromBuffer: Core__ArrayBuffer.t => t = "BigUint64Array"
9-
@new external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "BigUint64Array"
12+
/** `fromArray` creates a `BigUint64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
13+
*/
14+
@new
15+
external fromArray: array<Core__BigInt.t> => t = "BigUint64Array"
16+
17+
/** `fromBuffer` creates a `BigUint64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
18+
19+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
20+
*/
21+
@new
22+
external fromBuffer: Core__ArrayBuffer.t => t = "BigUint64Array"
23+
24+
/** `fromBufferToEnd` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
25+
26+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
27+
*/
28+
@new
29+
external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "BigUint64Array"
30+
31+
/** `fromBufferWithRange` creates a `BigUint64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
32+
33+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
34+
*/
1035
@new
1136
external fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
1237
"BigUint64Array"
13-
@new external fromLength: int => t = "BigUint64Array"
14-
@val external from: 'a => t = "BigUint64Array.from"
38+
39+
/** `fromLength` creates a zero-initialized `BigUint64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/BigUint64Array/BigUint64Array)
40+
41+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
42+
*/
43+
@new
44+
external fromLength: int => t = "BigUint64Array"
45+
46+
/** `fromArrayLikeOrIterable` creates a `BigUint64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
47+
*/
48+
@val
49+
external fromArrayLikeOrIterable: 'a => t = "BigUint64Array.from"
50+
51+
/** `fromArrayLikeOrIterableWithMap` creates a `BigUint64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
52+
*/
53+
@val
54+
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t =
55+
"BigUint64Array.from"
Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
1-
type t = Core__TypedArray.t<float>
1+
/** The `Float32Array` typed array represents an array of 64-bit signed integers in platform byte order. See [Float32Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array)
2+
*/
3+
type t = Core__TypedArray.t<Core__BigInt.t>
24

35
module Constants = {
4-
@val external bytesPerElement: int = "Float32Array.BYTES_PER_ELEMENT"
6+
/**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)
7+
*/
8+
@val
9+
external bytesPerElement: int = "Float32Array.BYTES_PER_ELEMENT"
510
}
611

7-
@new external make: array<float> => t = "Float32Array"
8-
@new external fromBuffer: Core__ArrayBuffer.t => t = "Float32Array"
9-
@new external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "Float32Array"
12+
/** `fromArray` creates a `Float32Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
13+
*/
14+
@new
15+
external fromArray: array<Core__BigInt.t> => t = "Float32Array"
16+
17+
/** `fromBuffer` creates a `Float32Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
18+
19+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
20+
*/
21+
@new
22+
external fromBuffer: Core__ArrayBuffer.t => t = "Float32Array"
23+
24+
/** `fromBufferToEnd` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
25+
26+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
27+
*/
28+
@new
29+
external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "Float32Array"
30+
31+
/** `fromBufferWithRange` creates a `Float32Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
32+
33+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
34+
*/
1035
@new
1136
external fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
1237
"Float32Array"
13-
@new external fromLength: int => t = "Float32Array"
14-
@val external from: 'a => t = "Float32Array.from"
38+
39+
/** `fromLength` creates a zero-initialized `Float32Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float32Array/Float32Array)
40+
41+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
42+
*/
43+
@new
44+
external fromLength: int => t = "Float32Array"
45+
46+
/** `fromArrayLikeOrIterable` creates a `Float32Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
47+
*/
48+
@val
49+
external fromArrayLikeOrIterable: 'a => t = "Float32Array.from"
50+
51+
/** `fromArrayLikeOrIterableWithMap` creates a `Float32Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
52+
*/
53+
@val
54+
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t =
55+
"Float32Array.from"
Lines changed: 48 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,55 @@
1-
type t = Core__TypedArray.t<float>
1+
/** The `Float64Array` typed array represents an array of 64-bit signed integers in platform byte order. See [Float64Array on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array)
2+
*/
3+
type t = Core__TypedArray.t<Core__BigInt.t>
24

35
module Constants = {
4-
@val external bytesPerElement: int = "Float64Array.BYTES_PER_ELEMENT"
6+
/**`bytesPerElement` returns the element size. See [BYTES_PER_ELEMENT on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/BYTES_PER_ELEMENT)
7+
*/
8+
@val
9+
external bytesPerElement: int = "Float64Array.BYTES_PER_ELEMENT"
510
}
611

7-
@new external make: array<float> => t = "Float64Array"
8-
@new external fromBuffer: Core__ArrayBuffer.t => t = "Float64Array"
9-
@new external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "Float64Array"
12+
/** `fromArray` creates a `Float64Array` from an array of values. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
13+
*/
14+
@new
15+
external fromArray: array<Core__BigInt.t> => t = "Float64Array"
16+
17+
/** `fromBuffer` creates a `Float64Array` from an `ArrayBuffer.t`. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
18+
19+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
20+
*/
21+
@new
22+
external fromBuffer: Core__ArrayBuffer.t => t = "Float64Array"
23+
24+
/** `fromBufferToEnd` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and continuing through to the end. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
25+
26+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
27+
*/
28+
@new
29+
external fromBufferToEnd: (Core__ArrayBuffer.t, ~byteOffset: int) => t = "Float64Array"
30+
31+
/** `fromBufferWithRange` creates a `Float64Array` from an `ArrayBuffer.t`, starting at a particular offset and consuming `length` **bytes**. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
32+
33+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
34+
*/
1035
@new
1136
external fromBufferWithRange: (Core__ArrayBuffer.t, ~byteOffset: int, ~length: int) => t =
1237
"Float64Array"
13-
@new external fromLength: int => t = "Float64Array"
14-
@val external from: 'a => t = "Float64Array.from"
38+
39+
/** `fromLength` creates a zero-initialized `Float64Array` to hold the specified count of numbers; this is **not** a byte length. See [TypedArray constructor on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Float64Array/Float64Array)
40+
41+
**Note:** This is a potentially unsafe operation. Ensure the buffer is large enough and only accessed within its bounds.
42+
*/
43+
@new
44+
external fromLength: int => t = "Float64Array"
45+
46+
/** `fromArrayLikeOrIterable` creates a `Float64Array` from an array-like or iterable object. See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
47+
*/
48+
@val
49+
external fromArrayLikeOrIterable: 'a => t = "Float64Array.from"
50+
51+
/** `fromArrayLikeOrIterableWithMap` creates a `Float64Array` from an array-like or iterable object and applies the mapping function to each item. The mapping function expects (value, index). See [TypedArray.from on MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/from)
52+
*/
53+
@val
54+
external fromArrayLikeOrIterableWithMap: ('a, ('b, int) => Core__BigInt.t) => t =
55+
"Float64Array.from"

0 commit comments

Comments
 (0)