Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
bug fix
问题描述
在使用时发现
typescript的类型推论无法正常运作,如下图可见泛型
M按规范传入之后,并未在Promise<M>中正确返回,并且在实际情况中,我看到返回都是any问题调查
sequelize/types/lib/promise.d.ts使用了@types/bluebird,这个描述文件覆写了Promise的描述sequelize/types/lib/model.d.ts中大量引入了sequelize/types/lib/promise.d.ts的Promise@types/bluebird时,sequelize/types/lib/promise.d.ts使用的Promise就会找不到,变成了any,也就重现了上图的情况解决途径
@types/bluebird依赖,并将其设置为dependencies,保证用户在使用此依赖时同时也安装@types/bluebird描述文件@types/bluebird,链接如下 sequelize-typescript#installation