-
Notifications
You must be signed in to change notification settings - Fork 7
[codex] rename overloaded constructors to from* names #255
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
03277f7
bcba34d
e149630
cae2810
78765e8
e518f6a
8345757
137a849
5345ceb
ceca97d
405c266
181df9c
55bfa28
b0404e9
8b4c4a8
9acbff8
1d5fb64
d23908e
8a41da1
6cb796d
07aaf50
1f43149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,16 +1,55 @@ | ||||||
| type domMatrix2DInit = WebApiDOM.Types.domMatrix2DInit | ||||||
|
|
||||||
| /** | ||||||
| `make()` | ||||||
|
|
||||||
| The Path2D() constructor creates a new empty Path2D object. | ||||||
|
|
||||||
| Source shape: | ||||||
| - no source input; this constructor creates a fresh MDN [Path2D](https://developer.mozilla.org/docs/Web/API/Path2D). | ||||||
|
|
||||||
| ```res | ||||||
| let path = Path2D.make() | ||||||
| ``` | ||||||
|
|
||||||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D) | ||||||
| */ | ||||||
| @new | ||||||
| external make: (~path: Types.path2D=?) => Types.path2D = "Path2D" | ||||||
| external make: unit => Types.path2D = "Path2D" | ||||||
|
|
||||||
| /** | ||||||
| `fromPath2D(path2D)` | ||||||
|
|
||||||
| The Path2D() constructor creates a new Path2D object by copying another Path2D source. | ||||||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The first part with
Suggested change
|
||||||
|
|
||||||
| Source shape: | ||||||
| - local [`Path2D.t`](#t) mapped to MDN [Path2D](https://developer.mozilla.org/docs/Web/API/Path2D). | ||||||
|
Comment on lines
+25
to
+26
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think any of these |
||||||
|
|
||||||
| ```res | ||||||
| let copiedPath = Path2D.fromPath2D(existingPath) | ||||||
| ``` | ||||||
|
|
||||||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D) | ||||||
| */ | ||||||
| @new | ||||||
| external fromPath2D: Types.path2D => Types.path2D = "Path2D" | ||||||
|
|
||||||
| /** | ||||||
| `fromString(string)` | ||||||
|
|
||||||
| The Path2D() constructor creates a new Path2D object from SVG path data text. | ||||||
|
|
||||||
| Source shape: | ||||||
| - ReScript [string](https://rescript-lang.org/docs/manual/primitive-types/#string) containing SVG path data accepted by MDN [Path2D()](https://developer.mozilla.org/docs/Web/API/Path2D/Path2D). | ||||||
|
|
||||||
| ```res | ||||||
| let path = Path2D.fromString("M0 0 L10 10") | ||||||
| ``` | ||||||
|
|
||||||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/Path2D) | ||||||
| */ | ||||||
| @new | ||||||
| external make2: (~path: string=?) => Types.path2D = "Path2D" | ||||||
| external fromString: string => Types.path2D = "Path2D" | ||||||
|
|
||||||
| /** | ||||||
| [Read more on MDN](https://developer.mozilla.org/docs/Web/API/CanvasRenderingContext2D/closePath) | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need the source shape callout that this function takes no input, that is clear from the type signature.