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.
Example
const db = verse({
config: // ...
model: {
entities: {
customers: entity(
// ...
)
},
},
});
type Customer = EntityType<typeof db.entities.customers>;
Type parameters
Type parameter |
---|
Model extends EntityModel |