Skip to content

TypeScript - #22

Merged
Fil merged 3 commits into
mainfrom
fil/typescript
Nov 26, 2026
Merged

Fil merged 3 commits into
mainfrom
fil/typescript

Conversation

@Fil

@Fil Fil commented Nov 26, 2026

Copy link
Copy Markdown
Member

Port the source and tests to TypeScript; the package now ships its type declarations (dist/index.d.ts, also exported as the "types" condition).

  • Exported types: Quaternion, Angles, Cartesian, Spherical, and VersorFunction (the default export, with documented helpers).
  • Build: @rollup/plugin-typescript for the bundles, tsc -p tsconfig.build.json for the declarations; target ES2019. CI also runs tsc and prepublishOnly, as in Plot.
  • Lint: typescript-eslint, with the rules Plot uses.
  • The bundles compute the same results as 0.2.2 (480,000 compared calls). One edge case changes: versor.delta(v0, v1, undefined) now uses alpha = 1 (it returned NaN), since the type allows an undefined alpha.

Fixes #2. Supersedes #3 (thanks @clhenrick for the original definitions).

Fil added 3 commits November 26, 2026 19:18
Port the source and tests to TypeScript; the package now ships its type
declarations (dist/index.d.ts, also exported as the "types" condition).

- Exported types: Quaternion, Angles, Cartesian, Spherical, and VersorFunction
  (the default export, with documented helpers).
- Build: @rollup/plugin-typescript for the bundles, tsc -p tsconfig.build.json
  for the declarations; target ES2019. CI also runs tsc and
  prepublishOnly, as in Plot.
- Lint: typescript-eslint, with the rules Plot uses.
- The bundles compute the same results as 0.2.2 (480,000 compared calls).
  One edge case changes: versor.delta(v0, v1, undefined) now uses alpha = 1
  (it returned NaN), since the type allows an undefined alpha.

Fixes #2. Supersedes #3 (thanks @clhenrick for the original definitions).
versor has been ISC since 0.2.0 (49590cc); the GPL-3 text was a leftover from
e0addde and was still included in the npm package.
@Fil
Fil merged commit 4733b9b into main Nov 26, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Request for type definition file

1 participant