update typescript definitions and the export syntax in javascript#74
update typescript definitions and the export syntax in javascript#74dcodeIO merged 2 commits intodcodeIO:masterfrom
Conversation
|
@dcodeIO Can you please review the PR? Help this get merged and publish the package as well? |
|
@MattiasBuelens - Can you please review this PR? I saw you had some comments on #66. This is not solving the problem in that PR. However this PR will ensure that the library is usable in TS land. |
index.d.ts
Outdated
|
|
||
| /** | ||
| * Creates a Long from its little endian byte representation. | ||
| * Creates a Long from its big endian byte representation. |
There was a problem hiding this comment.
Why has this been switched? fromBytesLE = little endian, fromBytesbE = big endian
There was a problem hiding this comment.
Sorry wanted to update documentation for the other function. Have fixed it.
index.d.ts
Outdated
| xor(other: Long | number | string): Long; | ||
| } | ||
|
|
||
| export { Long }; No newline at end of file |
There was a problem hiding this comment.
Does the type definition still support import * as Long from "long" for backwards compatibility?
There was a problem hiding this comment.
Nope it does not. Just saw the type definition in @types/long package. If people are already using that then this will be a breaking change. Will keep the same design for backwards compatibility.
|
@dcodeIO - Can you please review the updated changes? |
|
Thanks, looking good. Still not sure how to proceed with #66 though :/ |
|
@dcodeIO - Thanks for merging the PR. Any idea when will the new package be published to npm? |
Longclass along with thedefaultexportdefaultandLongas properties onmodule.exports. This does not cause any breaking changes and also ensure that someone can import the packages in TypeScript as followsimport Long from "long";import { Long } from "long";