-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
src/index.d.ts
Outdated
@@ -12,5 +11,15 @@ export class UIEventObserver { | |||
|
|||
unsubscribeAll(): void; | |||
} | |||
export default new UIEventObserver(); | |||
declare module default_ { |
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.
ui-event-observer/src/index.js
Line 6 in 3483dad
module.exports.UIEventObserver = UIEventObserver; |
であるため、default_
は UIEventObserver
にしたいです。
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.
修正します
package.json
Outdated
@@ -10,7 +10,7 @@ | |||
"src/" | |||
], | |||
"name": "ui-event-observer", | |||
"version": "1.2.1", | |||
"version": "1.2.2", |
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.
バージョンはpublish時に上げるのでそのままでも大丈夫です。
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.
修正します
* version update is not required * rename sxported module name
@fukken Thanks! |
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以外での確認はしていません。