Skip to main content

Type Alias: EntityType<Model>

EntityType<Model>: Model extends EntityModel<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>;

Defined in

packages/verse-core/src/verse.ts:124