[API reference](https://evolu.dev/docs/api-reference) › [@evolu/common](https://evolu.dev/docs/api-reference/common) › [local‑first/Protocol](https://evolu.dev/docs/api-reference/common/local-first/Protocol) › ApplyProtocolMessageAsClientNoResponse

Defined in: [packages/common/src/local-first/Protocol.ts:930](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/local-first/Protocol.ts#L930)

A TypeScript interface with a literal `type` property.

Use `Typed` for both domain objects in discriminated unions and plain domain
errors returned by [Result](https://evolu.dev/docs/api-reference/common/Result/type-aliases/Result). Name a domain error interface `XError`.
When `X` already describes a failure, use `X` for its `type` discriminant
because `Error` describes the interface's role rather than the runtime error
kind. Keep `Error` when it is needed to make the discriminant unambiguous,
such as `TimeoutError`.

Typed unions model mutually exclusive states as separate variants instead of
combinations of flags and optional properties. TypeScript narrows a union by
its literal `type` property. To enforce exhaustive handling, return from
every case of a value-producing switch or assert that the remaining value is
`never` in the `default` case of a side-effecting switch.

### Example

```ts
import {
  assertErr,
  assertOk,
  err,
  ok,
  type Result,
  type Typed,
} from "@evolu/common";

interface User extends Typed<"User"> {
  readonly id: string;
}

const getUser = (id: string): Result<User, UserNotFoundError> =>
  id === "user-1"
    ? ok({ type: "User", id })
    : err({ type: "UserNotFound", id });

interface UserNotFoundError extends Typed<"UserNotFound"> {
  readonly id: string;
}

assertOk(getUser("user-1"), { type: "User", id: "user-1" });
assertErr(getUser("missing"), { type: "UserNotFound", id: "missing" });
```

## Extends

- [`Typed`](https://evolu.dev/docs/api-reference/common/Type/interfaces/Typed)\<`"NoResponse"`\>

## Properties

<a id="type"></a>

### type

```ts
readonly type: "NoResponse";
```

Defined in: [packages/common/src/Type.ts:11986](https://github.com/evoluhq/evolu/blob/037c390af081e9944d616ff298a729515c5c5ab7/packages/common/src/Type.ts#L11986)

#### Inherited from

[`Typed`](https://evolu.dev/docs/api-reference/common/Type/interfaces/Typed).[`type`](https://evolu.dev/docs/api-reference/common/Type/interfaces/Typed#type)