---
url: 'https://adk.nht.io/api/@nhtio/adk/batteries/functions/method.md'
---

# Function: method()

```ts
function method<A, R>(opts?: MethodOptions): MethodDescriptor<A, R>;
```

Defined in: [src/batteries/isolation/types.ts:108](https://github.com/NHTIO/ADK/blob/v1.20260713.1/src/src/batteries/isolation/types.ts#L108)

Declare a request/response method on an isolated service's spec — the host gets a
`(...args) => Promise<R>` facade method; the guest implementation returns (or resolves to) `R`
directly (or throws/rejects, crossing back as a rejected promise on the host).

## Type Parameters

| Type Parameter            | Description                                                         |
| ------------------------- | ------------------------------------------------------------------- |
| `A` *extends* `unknown`\[] | The method's argument tuple, e.g. `[MyArgs]` or `[string, number]`. |
| `R`                       | The method's resolved result type.                                  |

## Parameters

| Parameter | Type                                              | Description                                                                                                     |
| --------- | ------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- |
| `opts`    | [`MethodOptions`](../interfaces/MethodOptions.md) | See [MethodOptions](../interfaces/MethodOptions.md). `opts.signal` opts this method into abort-signal plumbing. |

## Returns

[`MethodDescriptor`](../interfaces/MethodDescriptor.md)<`A`, `R`>
