Skip to content

EntityType

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.

3 exports Added in v4.0.0 Source

Constructors

EntityType

Added in v4.0.0 Source

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

Signature

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

make

Added in v4.0.0 Source

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 function make(value: string): string & Brand<"~effect/cluster/EntityType">;

Models

EntityType type

Added in v4.0.0 Source

Branded string type representing an entity type name.

Signature

type EntityType = typeof EntityType.Type;