bookshelf: Replace typeof Model with ModelSubclass#19095
Merged
Conversation
Member
|
types/bookshelf/index.d.ts to authors (@arcticwaters @vesse). Could you review this PR? Checklist
|
vesse
approved these changes
Aug 18, 2017
Contributor
vesse
left a comment
There was a problem hiding this comment.
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
Contributor
|
Approved by a listed owner. PR appears ready to merge pending express review by a maintainer. |
This pull request was closed.
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.
typeof Modelmeans a variable that satisfies the type of the static side of the classModel, in other words,Modelitself 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
Modelto be passed in instead. (This was a compile error now thanks to microsoft/TypeScript#16368, asModelis a generic class and its subclasses aren't.)That wouldn't have many requirements except fornew()returning aModel.I'm not familiar with the library, so it's possible that
ModelSubclassshould require a few more members.