-
-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#164 updated glam & bevy_ecs types to match their
serde
implementat…
…ion (#165) * #164 updated glam & bevy_ecs types to match their `serde` implementation * #164 fixed typo * #164 improved error message and removed WorldId (no serde implemented) * #164 fixed test * #164 updated array to tuple * #164 fixed to long tuple for Mat4 and added basic tests * #164 bumped bevy version * avoid string allocate when error not hit * small cleanup --------- Co-authored-by: Oscar Beaumont <[email protected]>
- Loading branch information
1 parent
7039fba
commit 3a3f4bf
Showing
6 changed files
with
64 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#[test] | ||
#[cfg(feature = "glam")] | ||
fn typescript_types_glam() { | ||
use crate::ts::assert_ts; | ||
|
||
assert_ts!(glam::DVec2, "[number, number]"); | ||
assert_ts!(glam::IVec2, "[number, number]"); | ||
assert_ts!(glam::DMat2, "[number, number, number, number]"); | ||
assert_ts!( | ||
glam::DAffine2, | ||
"[number, number, number, number, number, number]" | ||
); | ||
assert_ts!(glam::Vec2, "[number, number]"); | ||
assert_ts!(glam::Vec3, "[number, number, number]"); | ||
assert_ts!(glam::Vec3A, "[number, number, number]"); | ||
assert_ts!(glam::Vec4, "[number, number, number, number]"); | ||
assert_ts!(glam::Mat2, "[number, number, number, number]"); | ||
assert_ts!( | ||
glam::Mat3, | ||
"[number, number, number, number, number, number, number, number, number]" | ||
); | ||
assert_ts!( | ||
glam::Mat3A, | ||
"[number, number, number, number, number, number, number, number, number]" | ||
); | ||
assert_ts!(glam::Mat4, "[number, number, number, number, number, number, number, number, number, number, number, number, number, number, number, number]"); | ||
assert_ts!(glam::Quat, "[number, number, number, number]"); | ||
assert_ts!( | ||
glam::Affine2, | ||
"[number, number, number, number, number, number]" | ||
); | ||
assert_ts!(glam::Affine3A, "[number, number, number, number, number, number, number, number, number, number, number, number]"); | ||
} | ||
|
||
#[test] | ||
#[cfg(feature = "bevy_ecs")] | ||
fn typescript_types_bevy_ecs() { | ||
use specta::ts::ExportPath; | ||
|
||
use crate::ts::assert_ts; | ||
|
||
assert_ts!(error; bevy_ecs::entity::Entity, specta::ts::ExportError::BigIntForbidden(ExportPath::new_unsafe("bevy_ecs::entity::Entity -> u64"))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters