# LiveDataSourceOptions (@salmonui/data/stream)

> The LiveDataSourceOptions interface of @salmonui/data/stream.

Canonical: https://salmonui.dev/docs/reference/data/stream/LiveDataSourceOptions

```ts
import type { LiveDataSourceOptions } from '@salmonui/data/stream';
```

Also exported from `@salmonui/data`.

Entry index: https://salmonui.dev/docs/reference/data/stream (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/data/stream.md).

## Reference

Kind: interface

```ts
interface LiveDataSourceOptions<Row> {
    readonly initial: DataSource<Row>;
    readonly getRowId: (row: Row) => RowId;
    readonly connect: (query: DataQuery, emit: LiveEmitter<Row>, signal: AbortSignalLike) => void | (() => void);
    readonly reconnect?: {
        readonly attempts: number;
        readonly delayMs: number | ((attempt: number) => number);
    };
    readonly fields?: readonly string[];
    readonly scheduler?: Scheduler;
    readonly onConflict?: (conflict: ConflictSnapshot<Row>) => void;
    readonly onError?: (error: unknown) => void;
}
```

Members (8):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `initial` | `readonly initial: DataSource<Row>;` |  | Snapshot read (local or remote). |
| `getRowId` | `readonly getRowId: (row: Row) => RowId;` |  |  |
| `connect` | `readonly connect: (query: DataQuery, emit: LiveEmitter<Row>, signal: AbortSignalLike) => void \| (() => void);` |  | Opens the stream for a query; return a cleanup function. Re-called per structural query. |
| `reconnect` | `readonly reconnect?: {     readonly attempts: number;     readonly delayMs: number \| ((attempt: number) => number); };` | optional |  |
| `fields` | `readonly fields?: readonly string[];` | optional | Tuple header for `message()`: rows stay tuples in this order. Omit for object rows. |
| `scheduler` | `readonly scheduler?: Scheduler;` | optional |  |
| `onConflict` | `readonly onConflict?: (conflict: ConflictSnapshot<Row>) => void;` | optional |  |
| `onError` | `readonly onError?: (error: unknown) => void;` | optional |  |
