Skip to content

Improve Model type definitions#1685

Merged
bajtos merged 1 commit intomasterfrom
fix/type-defs
Jan 24, 2019
Merged

Improve Model type definitions#1685
bajtos merged 1 commit intomasterfrom
fix/type-defs

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Jan 24, 2019

  • 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.

These issues were discovered while working on loopbackio/loopback-next#2274.

Checklist

  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style
    guide

* Property definition
*/
export interface PropertyDefinition extends AnyObject {
name: string;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICT, the property name is always stored as the key in property map (name => definition).

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`.
@bajtos
Copy link
Member Author

bajtos commented Jan 24, 2019

@raymondfeng LGTY now?

@bajtos bajtos merged commit 928747f into master Jan 24, 2019
@bajtos bajtos deleted the fix/type-defs branch January 24, 2019 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants