Fix Backbone types for model constructor/initialize.

Review Request #13845 — Created May 8, 2024 and submitted — Latest diff uploaded

Information

Spina
master

Reviewers

The type definitions for Backbone models were typing the attributes
argument to the model constructor, initialize, and preinitialize
functions as being the attributes type, rather than a partial. This
caused type errors any time a model was instantiated with a subset of
attributes specified.

Built the package and dropped the types file into my tree. Saw that I
was no longer getting errors about instantiating models while passing
attributes.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Fix Backbone types for model constructor/initialize.
The type definitions for Backbone models were typing the attributes argument to the model constructor, initialize, and preinitialize functions as being the attributes type, rather than a partial. This caused type errors any time a model was instantiated with a subset of attributes specified. Testing Done: Built the package and dropped the types file into my tree. Saw that I was no longer getting errors about instantiating models while passing attributes.
9c1d9967129badb755c9bde1265a57aa32b538d6 David Trowbridge
src/@types/backbone/index.d.ts
Loading...