-
-
Notifications
You must be signed in to change notification settings - Fork 206
update typescript definitions and the export syntax in javascript #74
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
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
@@ -87,7 +85,7 @@ declare class Long { | |||
static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long; | |||
|
|||
/** | |||
* 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has this been switched? fromBytesLE = little endian, fromBytesbE = big endian
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry wanted to update documentation for the other function. Have fixed it.
index.d.ts
Outdated
@@ -404,3 +402,5 @@ declare class Long { | |||
*/ | |||
xor(other: Long | number | string): Long; | |||
} | |||
|
|||
export { Long }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the type definition still support import * as Long from "long"
for backwards compatibility?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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? |
Long
class along with thedefault
exportdefault
andLong
as 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";