Skip to content
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

update d.ts for ts2.6 breaking change #3

Merged
merged 2 commits into from
Nov 15, 2017
Merged

update d.ts for ts2.6 breaking change #3

merged 2 commits into from
Nov 15, 2017

Conversation

fukken
Copy link
Contributor

@fukken fukken commented Nov 15, 2017

see https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#arbitrary-expressions-are-forbidden-in-export-assignments-in-ambient-contexts

declaration files に任意の式を書けていたのが、2.6で書けなくなるため、 declare などに置き換えます。
dts-gen で生成すると、prototypeが二重定義になっている、と怒られるため、手書きしました。
過去のバージョンのtsでも問題なく動くのではないかと思いますが、2.6以外での確認はしていません。

src/index.d.ts Outdated
@@ -12,5 +11,15 @@ export class UIEventObserver {

unsubscribeAll(): void;
}
export default new UIEventObserver();
declare module default_ {
Copy link
Owner

@azu azu Nov 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module.exports.UIEventObserver = UIEventObserver;

であるため、default_UIEventObserver にしたいです。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正します

package.json Outdated
@@ -10,7 +10,7 @@
"src/"
],
"name": "ui-event-observer",
"version": "1.2.1",
"version": "1.2.2",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

バージョンはpublish時に上げるのでそのままでも大丈夫です。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修正します

* version update is not required

* rename sxported module name
@azu azu merged commit 9ce6315 into azu:master Nov 15, 2017
@azu
Copy link
Owner

azu commented Nov 15, 2017

@fukken Thanks!

@azu
Copy link
Owner

azu commented Nov 15, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants