axis icon indicating copy to clipboard operation
axis copied to clipboard

Created TypeScript Type definition file and added axis.type()

Open glitch452 opened this issue 5 years ago • 1 comments

Created an axis.d.ts TypeScript Type Definition file. This enables axis to be used in a typescript file using the recommended 'import' syntax, instead of using 'require'.
The Type Definition file allows TypeScript to recognize the functions available within axis.
Axis can be imported in TypeScript using: import axis from 'axis.js';

Added axis.type() as an internal function with minimal modifications thanks to agrublev (https://github.com/agrublev/).

The readme was updated with the new function and usage information.

Tests were added but not run automatically, but the code has been tested manually.

The axis.min.js file has not been updated.

glitch452 avatar Feb 24 '20 06:02 glitch452

Hi @glitch452, I created a Typescript version of this library that adds a getType method as well type predicates for coercing the unknown type after it's checked. https://github.com/schuchard/taap#type-assertion-and-predicate-taap. Hope it helps.

schuchard avatar Jul 10 '20 13:07 schuchard