EntityType.ts
EntityType.ts overview
Section titled “EntityType.ts overview”The EntityType module defines the branded string used to identify a kind of
entity in an Effect cluster. Entity type names are part of the cluster routing
identity: they distinguish one family of entities from another before an
individual entity id is considered.
Since v4.0.0
Exports Grouped by Category
Section titled “Exports Grouped by Category”constructors
Section titled “constructors”EntityType
Section titled “EntityType”Schema for branded string names that identify entity types in the cluster.
Signature
declare const EntityType: Schema.brand<Schema.String, "~effect/cluster/EntityType">Since v4.0.0
Brands a string as an EntityType.
When to use
Use to brand a stable entity family name before passing it to cluster APIs
that require an EntityType, such as entity addresses.
Details
The returned value is the same runtime string with the EntityType brand
applied by TypeScript.
Gotchas
make only applies the brand at the type level; it does not validate,
normalize, or check uniqueness. Use the EntityType schema when you need
schema-based decoding or validation, and keep names stable because the exact
string participates in routing identity.
See
EntityTypefor schema-based decoding, validation, and encoding of entity type names
Signature
declare const make: (value: string) => EntityTypeSince v4.0.0
models
Section titled “models”EntityType (type alias)
Section titled “EntityType (type alias)”Branded string type representing an entity type name.
Signature
type EntityType = typeof EntityType.TypeSince v4.0.0