Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] add typescript definitions#3

Open
clhenrick wants to merge 2 commits into
master from
typescript-defs
Open

[WIP] add typescript definitions #3
clhenrick wants to merge 2 commits into
master from
typescript-defs

Conversation

@clhenrick

@clhenrick clhenrick commented Oct 12, 2018

Copy link
Copy Markdown

to resolve #2

Copy link
Copy Markdown
Author

@Fil I need to test this out still, so not ready to merge yet.

Copy link
Copy Markdown
Author

Seems to work for me when I import this branch into a Typescript project:

import versor = require("versor");
const v0 = versor([ 0, 0, 0 ]);
const v1 = versor([ 90, 0, 0 ]);
const delta = versor.delta(v0, v1);
const delta2 = versor.delta(v0, v1, 0.5);
const cartesian = versor.cartesian([-80, 44]);
const rotation = versor.rotation([10, 30, 40, 4]);
const multiply = versor.multiply([10, 20, 30, 40], [0, 20, 30, 50]);
// typescript yells at this for example
versor.delta("a", "b");
// it also yells about this
versor("a");
// and this
versor.multiply([0, 1, 2]);

clhenrick commented Oct 12, 2018
edited
Loading

Copy link
Copy Markdown
Author

in Typescript if you use the import * as versor from "versor" method then you need to use versor.default() to do the equivalent of versor() as when using common js var versor = require("versor").

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Request for type definition file

1 participant

AltStyle によって変換されたページ (->オリジナル) /