Enhance Spina class typing and expose utility types.

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

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.

Summary ID
Enhance Spina class typing and expose utility types.
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.
6b8cfd9aa1bef207ed1b855b740e1c8b67333977
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to master (58a41c4)