Stricter typescript + some cleanups #3570
Merged
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.
This increases the typescript strictness, and makes the exceptions that we need explicit (this will also opt us in to any future TS strictness checks by default). In addition to that, the following changes were made:
Error
. With strict checks, TS insists that these areunknown
._deserialize
from Tweak some typings #3554: After deserialization, we know we have a dict of something, but have no idea about what is in it, since deserializers can return anything. Ideally we should also make it explicit inISerializers
that the return type is unknown, but this might be a breaking change.. ?unpack_models
so that it is compatible withISerializers
(newly included strictness check will also complain if not). This is because theISerlializers
make all argument optional to allow them to ignore arguments they don't care about, even if the arguments must always be passed by a caller. This is chosen to be the lesser of two evils, but this might be open for discussion.ICallbacks
callbacks. Also not clear whether this is an ok change or not.