Type Alias: EntityType<Model>
EntityType<
Model
>:Model
extendsEntityModel
<infer Properties> ?UnwrapProperties
<Properties
> :never
A type that can infer an entity type from an EntityModel when used in conjunction with the typeof operator.
Type Parameters
Type Parameter |
---|
Model extends EntityModel |
Example
const db = verse({
config: // ...
model: {
entities: {
customers: entity(
// ...
)
},
},
});
type Customer = EntityType<typeof db.entities.customers>;