# CallDeclaration

> The CallDeclaration interface of the Room API is one call as call() declares it, with its args and reply types.

The **`CallDeclaration`** interface of the [Room API](/docs/room) is one call as [`call()`](/docs/room/call) declares it: the fields of its args, and the type of its reply. Pass it to [`defineCalls()`](/docs/room/definecalls).

## Instance properties

`CallDeclaration.fields`
: The fields of the args, as `call()` was given them. Read only.

## Instance methods

`CallDeclaration.returns()`
: Declares the reply's type, `returns<T>()`, and returns the declaration typed with it. Without it, the reply is `void`. It's only a type: the room doesn't check what a handler returns.

## Examples

### Typing a reply

```ts
// lookup.ts
import { call, defineCalls, defineRoom, defineSchema } from "@irtio/room";

const schema = defineSchema({
  calls: defineCalls({ whois: call({ player: "string" }).returns<{ online: boolean }>() }),
});

export default defineRoom({
  schema,
  calls: {
    whois: ({ player }, { room }) => ({ online: room.presence.get(player)?.connected ?? false }),
  },
});
```

## See also

- [`call()`](/docs/room/call)
- [Calls](/docs/room/guides/calls), the guide
