Skip to content
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

feat(types): Add bounds types #12

Merged
merged 6 commits into from
Jul 26, 2024
Merged

feat(types): Add bounds types #12

merged 6 commits into from
Jul 26, 2024

Conversation

ibgreen
Copy link
Contributor

@ibgreen ibgreen commented Jul 25, 2024

@coveralls
Copy link

coveralls commented Jul 25, 2024

Pull Request Test Coverage Report for Build 10115209487

Details

  • 17 of 46 (36.96%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.1%) to 85.203%

Changes Missing Coverage Covered Lines Changed/Added Lines %
modules/types/src/bounds-types.ts 0 29 0.0%
Totals Coverage Status
Change from base Build 10096289553: -0.1%
Covered Lines: 14569
Relevant Lines: 17243

💛 - Coveralls

| [[number, number], [number, number]]
| [[number, number, number], [number, number, number]];

Any javascript typed array, or any javascript array containing numbers
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JavaScript seems to be more common that javascript in our docs

export type Bounds3D = [[number, number, number], [number, number, number]];

/** 2 or 3 dimensional bounds [[minX, minY], [maxX, maxY]] or [[minX, minY, minZ], [maxX, maxY, maxZ]] */
export type Bounds =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not type Bounds = Bounds2D | Bounds3D?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not type Bounds = Bounds2D | Bounds3D?

Yes, this is due to one of my personal preferences. I really like being able to see the actual type definition when I hover over a type in vscode.

By referencing intermediary types, things get obscured and I need to chase down the definition of those types, so if it is easy to type it out I usually do.

But the trend is towards ever more sophisticated typescript types so I am probably on the losing side of history here.

docs/modules/types/api-reference/bounds.md Outdated Show resolved Hide resolved
docs/modules/types/api-reference/bounds.md Outdated Show resolved Hide resolved
@ibgreen ibgreen merged commit eabaa1f into master Jul 26, 2024
1 check passed
@ibgreen ibgreen deleted the ib/bounds-types branch July 26, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants