loopback-datasource-juggler/types
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
..
common.d.ts Fix type definitions for PersistedModel API 2018-06-28 13:09:47 +02:00
connector.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
datasource.d.ts Fix datasource state management 2018-05-22 10:46:45 -07:00
inclusion-mixin.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
kv-model.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
model.d.ts Fix type definitions for PersistedModel API 2018-06-28 13:09:47 +02:00
observer-mixin.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
persisted-model.d.ts Fix type definitions for PersistedModel API 2018-06-28 13:09:47 +02:00
query.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
relation-mixin.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
relation.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
scope.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
transaction-mixin.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00
validation-mixin.d.ts Add typescript type definitions 2018-05-09 12:47:27 -07:00