You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Update DOMMatrix, DOMMatrixReadOnly, Path2D, and ReadableStream single-source constructor overloads to take direct unlabeled arguments.
Refresh compile-coverage tests and contributor documentation to match the constructor naming convention.
Single-source constructor variants should take the source value directly without a label.
98
+
97
99
Keep `makeWith*` names for non-default convenience constructors that are not part of a source-type overload family.
98
100
99
101
Constructor naming is currently verified with compile-coverage tests. Runtime verification for these constructor families will be added later when the Vitest and happy-dom harness lands.
Constructor overloads should use the same structure, but make the differentiating input shape explicit.
50
50
Link ReScript stdlib types such as `string`, `array<'a>`, `ArrayBuffer.t`, and `DataView.t`, and link project-local records or aliases when the constructor takes one of those shapes.
51
+
If a constructor variant has a single source input, show it as a direct unlabeled argument in both the signature and example.
51
52
52
53
````ReScript
53
54
/*
54
-
`fromArray(~init: array<float>)`
55
+
`fromArray(array<float>)`
55
56
56
57
The DOMMatrix() constructor creates a new DOMMatrix from an array of matrix component values.
57
58
58
59
Source shape:
59
-
- `init`: ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrix()](https://developer.mozilla.org/docs/Web/API/DOMMatrix/DOMMatrix).
60
+
- ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrix()](https://developer.mozilla.org/docs/Web/API/DOMMatrix/DOMMatrix).
60
61
61
62
```res
62
-
let matrix = DOMMatrix.fromArray(~init=[1., 0., 0., 1., 0., 0.])
63
+
let matrix = DOMMatrix.fromArray([1., 0., 0., 1., 0., 0.])
63
64
```
64
65
65
66
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
The DOMMatrix() constructor creates a new DOMMatrix from an array of matrix component values.
39
39
40
40
Source shape:
41
-
- `init`: ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrix()](https://developer.mozilla.org/docs/Web/API/DOMMatrix/DOMMatrix).
41
+
- ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrix()](https://developer.mozilla.org/docs/Web/API/DOMMatrix/DOMMatrix).
42
42
43
43
```res
44
-
let matrix = DOMMatrix.fromArray(~init=[1., 0., 0., 1., 0., 0.])
44
+
let matrix = DOMMatrix.fromArray([1., 0., 0., 1., 0., 0.])
45
45
```
46
46
47
47
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrix)
The DOMMatrixReadOnly() constructor creates a new DOMMatrixReadOnly value from an array of matrix component values.
39
39
40
40
Source shape:
41
-
- `init`: ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrixReadOnly()](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/DOMMatrixReadOnly).
41
+
- ReScript [array](https://rescript-lang.org/docs/manual/api/stdlib/array) of numeric values accepted by MDN [DOMMatrixReadOnly()](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly/DOMMatrixReadOnly).
42
42
43
43
```res
44
-
let matrix = DOMMatrixReadOnly.fromArray(~init=[1., 0., 0., 1., 0., 0.])
44
+
let matrix = DOMMatrixReadOnly.fromArray([1., 0., 0., 1., 0., 0.])
45
45
```
46
46
47
47
[Read more on MDN](https://developer.mozilla.org/docs/Web/API/DOMMatrixReadOnly)
The ReadableStream() constructor creates a new ReadableStream from an underlying source definition.
27
27
28
28
Source shape:
29
29
- local [`underlyingSource<'t>`](../#underlyingSource) values accepted by MDN [ReadableStream()](https://developer.mozilla.org/docs/Web/API/ReadableStream/ReadableStream).
0 commit comments