Skip to content

EntityType.ts

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



Schema for branded string names that identify entity types in the cluster.

Signature

declare const EntityType: Schema.brand<Schema.String, "~effect/cluster/EntityType">

Source

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

  • EntityType for schema-based decoding, validation, and encoding of entity type names

Signature

declare const make: (value: string) => EntityType

Source

Since v4.0.0

Branded string type representing an entity type name.

Signature

type EntityType = typeof EntityType.Type

Source

Since v4.0.0