### Connection · class

WebSocket connection to a Lowlander server with type-safe RPC, automatic reconnection,
and reactive updates.

**Type Parameters:**

- `T`

**Examples:**

```ts
import type * as API from './server/api.js';
const conn = new Connection<typeof API>('ws://localhost:8080/');

// Simple RPC - returns PromiseProxy
const sum = conn.api.add(1, 2);

// Server proxy for stateful APIs
const auth = conn.api.authenticate('token');
const secret = auth.serverProxy.getSecret();

// Streaming with callbacks
conn.api.streamData(data => console.log(data));

// Use within Aberdeen reactive scopes
$(() => {
  dump(conn.isOnline());
  dump(sum);
});
```

**Constructor Parameters:**

- `url`: - WebSocket URL (e.g., 'ws://localhost:8080/'), or a fake WebSocket object for testing

#### connection.[A.OPAQUE] · getter

**Type:** `true`

#### connection.api · property

Type-safe proxy to the server-side API. Methods return `PromiseProxy` objects
that work reactively in Aberdeen scopes. `ServerProxy` returns include a
`.serverProxy` property for accessing stateful server APIs.

**Type:** `ClientProxyObject<T>`

#### connection.isOnline · method

Returns the current connection status. Reactive in Aberdeen scopes.

**Signature:** `() => boolean`

#### connection.getError · method

Returns the last WebSocket error message, or `undefined` if there is none.
Clears automatically when the connection comes online. Reactive in Aberdeen scopes.

**Signature:** `() => string`
