Commit Graph

9 Commits

Author SHA1 Message Date
Miroslav Bajtoš b01cd74b19
fixup! improve comment for `this` & static members
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2020-03-02 13:04:01 +01:00
Miroslav Bajtoš c7b88e9b8e
Add ObserverMixin members to ModelBase typings
Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
2020-03-02 11:54:48 +01:00
Agnes Lin de4718d5b8 chore: update copyrights years (#1737) 2019-05-08 11:45:37 -04:00
Miroslav Bajtoš 81fc722b72
Improve Model type definitions
Define two new types: ModelSettings and ModelProperties to describe the
objects describing model properties and settings.

Add static property `base` and static method `extend` to the definition
of `ModelBase` class.

Add property `defaultModelBaseClass` to `ModelBuilder` class definition.

Fix `PropertyDefinition` interface: remove `name`, add optional `id`.
2019-01-24 16:27:40 +01:00
Miroslav Bajtoš 6f3675b13c
fixup! address code review comments 2018-06-29 08:35:22 +02:00
Miroslav Bajtoš 548379ca2a
Fix type definitions for PersistedModel API
Callback's first argument is an optional Error now. Was: required `any`.

PersistedModel methods return `PersistedModel` now. Before this change,
methods were returning `PersistedData` (`PersistedModel | AnyObject`).
The problem with `AnyObject` is that it does not contain any
`PersistedModel` instance data and cannot be assigned to functions
expecting `Partial<PersistedModel>`. As a result, consumers of this API
were forced to either cast the result to `PersistedModel` (which feels
wrong) or deal with the `AnyObject` case (which never happen at
runtime).

Fix definition of `ModelData<T>` to `T | Partial<T>`. Before this
change, `ModelData` allowed any values not related to the actual
model at all, for example arrays.
2018-06-28 13:09:47 +02:00
Raymond Feng d31c43bc09 Remove node ref 2018-05-11 09:09:31 -07:00
Raymond Feng 63f8b3b323 Fix typescript definitions to be compatible with LB4 2018-05-10 10:19:15 -07:00
Raymond Feng 77a2c9ab3b Add typescript type definitions 2018-05-09 12:47:27 -07:00