Enhance Spina class typing and expose utility types.

Review Request #13524 — Created Feb. 6, 2024 and submitted — Latest diff uploaded

Information

Spina
master

Reviewers

This change improves typing support throughout Spina, helping to cement
some patterns, improve code maintenance, and correct typing issues in
derived classes.

SpinaClass is now a generic SpinaClass<TBase>, which takes in the
class being typed, merges with it, and sets the prototype to it. This
replaces the SpinaClass & TBase we had internally in several places,
and gives us a proper up-front type to avoid some casting. Untyped, it
behaves like it did before.

__super__ is now mapped to any instead of object, avoiding type
errors when looking for attributes/functions on parents.

Backbone's _Result<T> is now exported in Spina as Result<T>, giving
us a non-private, stable type we can use when we need to reference a
type or callable returning the type.

Unit tests pass.

Commits

Files