Migrate math module to TypeScript#906
Conversation
23c23d9 to
7d14ba1
Compare
math module to TypeScriptmath module to TypeScript
7d14ba1 to
27dc057
Compare
EzraBrooks
left a comment
There was a problem hiding this comment.
GitHub tip: if you made this PR be based on your prior PR, it would deduplicate the diff - and when that PR is merged it would automatically retarget this one to the new base branch.
Yeah, the 3 PRs I made are in a direct chain with each other, the branches continue from the previous one. I just mean github still shows all the commits until the previous one is merged. You can absolutely start reviewing at the first relevant commit though |
1bcb187 to
29a19d0
Compare
|
@EzraBrooks this one should also be ready |
EzraBrooks
left a comment
There was a problem hiding this comment.
In modern typescript do we actually need the interfaces here or can we just import the class type as a type? I thought we could import type MyClass now 🤔
We can, the constructors define object types for their options though, so it made sense to make a type for it to also inherit. Either that or I'd have to define a type anyway for the constructor since I'm trying not to change any API semantics. const q: Quaternion = new Quaternion({
x: 1,
y: 1,
z: 1,
w: 1
});
// Without the interface type
q.multiply(new Quaternion({
x: 1,
y: 1,
z: 1,
w: 1
}));
// With type interface
q.multiply({
x: 1,
y: 1,
z: 1,
w: 1
});You can still pass in a Quaternion instance, but it provides more flexibility |
Signed-off-by: Drew Hoener <drewhoener@gmail.com>
This commit will have lint/compile errors but is necessary for git continuity. Without it, git will think the files have been deleted and recreated because of the diff. Signed-off-by: Drew Hoener <drewhoener@gmail.com>
…ce to represent structure and type methods. Signed-off-by: Drew Hoener <drewhoener@gmail.com>
…nterface to represent structure and type methods. Signed-off-by: Drew Hoener <drewhoener@gmail.com>
Signed-off-by: Drew Hoener <drewhoener@gmail.com>
…erface to represent structure and type methods. Signed-off-by: Drew Hoener <drewhoener@gmail.com>
…represent structure and type methods. Signed-off-by: Drew Hoener <drewhoener@gmail.com>
29a19d0 to
07c0d12
Compare
EzraBrooks
left a comment
There was a problem hiding this comment.
Makes sense to me. I guess I'm just out of the object-oriented mindset 😆
Public API Changes
None
Description
Overview
This PR migrates the classes in the
mathmodule to Typescript. As I mentioned in #904, this PR is largely trivial and just requires adding the types described in the JSDoc.Contents
I<Type>to each so math modules can reference each other without introducing circular imports.Depends on #905
GitHub doesn't have "dependent PRs" so all previous commits are included here. Might not be worth reviewing until dependencies are merged