Skip to content

bookshelf: Replace typeof Model with ModelSubclass#19095

Merged
1 commit merged into
masterfrom
bookshelf
Aug 18, 2017
Merged

bookshelf: Replace typeof Model with ModelSubclass#19095
1 commit merged into
masterfrom
bookshelf

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Aug 17, 2017

typeof Model means a variable that satisfies the type of the static side of the class Model, in other words, Model itself or an identical implementation of it. This is probably not what you want; Array<typeof Model> would then be an array containing [Model, Model, Model, ...].
Based on the tests, the intent is for some subclass of Model to be passed in instead. (This was a compile error now thanks to microsoft/TypeScript#16368, as Model is a generic class and its subclasses aren't.)That wouldn't have many requirements except for new() returning a Model.
I'm not familiar with the library, so it's possible that ModelSubclass should require a few more members.

@dt-bot
Copy link
Copy Markdown
Member

dt-bot commented Aug 17, 2017

types/bookshelf/index.d.ts

to authors (@arcticwaters @vesse). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

Copy link
Copy Markdown
Contributor

@vesse vesse left a comment

Choose a reason for hiding this comment

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

Looks good to me. Note though, that I have no input on this:

[...] so it's possible that ModelSubclass should require a few more members

@typescript-bot
Copy link
Copy Markdown
Contributor

Approved by a listed owner. PR appears ready to merge pending express review by a maintainer.

@ghost ghost merged commit 35187e3 into master Aug 18, 2017
@ghost ghost deleted the bookshelf branch August 18, 2017 13:53
This pull request was closed.
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.

3 participants