# TopologyEntityBinding

`import { TopologyEntityBinding } from "destack:topology/binding";`

Topology entity binding family.

```ds title="TopologyEntityBinding"
export interface TopologyEntityBinding {
    defineKind(world: WorldHandle, kind: EntityKindRecord): Result<void, HostError>;
    undefineKind(world: WorldHandle, kind: EntityKind): Result<void, HostError>;
    upsert(world: WorldHandle, entity: EntityRecord): Result<EntityId, HostError>;
    remove(world: WorldHandle, entity: EntityId): Result<boolean, HostError>;
    list(world: WorldHandle, selector?: EntitySelector | undefined): Result<[EntityRecord], HostError>;
}
```

[language/library/src/topology/binding/entity.ds:7:47](https://github.com/destack-sh/destack/blob/main/language/library/src/topology/binding/entity.ds#L7-L47)

## Members

### `defineKind(world: WorldHandle, kind: EntityKindRecord): Result<void, HostError>`

Define one runtime topology entity kind.

### `undefineKind(world: WorldHandle, kind: EntityKind): Result<void, HostError>`

Undefine one runtime topology entity kind.

### `upsert(world: WorldHandle, entity: EntityRecord): Result<EntityId, HostError>`

Upsert one runtime topology entity.

### `remove(world: WorldHandle, entity: EntityId): Result<boolean, HostError>`

Remove one runtime topology entity.

### `list(world: WorldHandle, selector?: EntitySelector | undefined): Result<[EntityRecord], HostError>`

Return runtime topology entities.
