Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Model type definitions #1685

Merged
merged 1 commit into from
Jan 24, 2019
Merged

Improve Model type definitions #1685

merged 1 commit into from
Jan 24, 2019

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

@@ -19,17 +19,17 @@ export type PropertyType =
* 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).

types/model.d.ts Outdated Show resolved Hide resolved
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