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.
Basic fixes for Typescript 2.7, tests passing.
The only problem seems to be with getSnapshot (and other stuff that uses ISnapshottable), which for new versions have to be manually typecasted to typeof Model.SnapshotType (e.g.
getSnapshot<typeof Model.SnapshotType>(node)
)This is basically because of this: microsoft/TypeScript#19513
ISnapshottable is basically now "merged" and lost into the new types, quoting:
Since ISnapshottable is basically an empty interface it eventually gets lost. Probably there could be a way around this by adding some info that makes the interface unique, such as:
And while that made the type be applied again and not be lost, it couldn't be inferred on this check:
export function getSnapshot<S>(target: ISnapshottable<S>): S
, probably due to this:On the good side the changes don't change how old versions of TS behave.