### createStreamType · function

Creates a stream type for reactive model streaming to clients with automatic updates.

Specify which fields to include; when they change, updates are pushed to subscribed clients.
Supports nested linked models and type-safe field selection.

**Signature:** `<T, S extends FieldSelection<T>>(Model: object & ModelClassRuntime<any, readonly any[], any, any> & (new (initial?: Partial<any>, txn?: Transaction) => any) & (new (...args: any[]) => T), selection: S & ValidateSelection<...>, options?: { ...; }) => { ...; }`

**Type Parameters:**

- `T`
- `S extends FieldSelection<T>`

**Parameters:**

- `Model: E.AnyModelClass & (new (...args: any[]) => T)` - - The Edinburgh model class
- `selection: S & ValidateSelection<T, S>` - - Field selection: `true` for simple fields, nested object for linked models
- `options?: { cache?: number }` - - Optional settings

**Returns:** Stream type class to instantiate in API functions

**Examples:**

```ts
const Person = E.defineModel('Person', class {
  name = E.field(E.string);
  age = E.field(E.number);
  password = E.field(E.string);
  friends = E.field(E.array(E.link(() => Person)));
}, { pk: 'name' });

// Exclude password, include friends' names; cache 30s
const PersonStream = createStreamType(Person, {
  name: true,
  age: true,
  friends: { name: true }
}, { cache: 30 });

export function streamPerson() {
  const person = Person.get('Alice')!;
  return new PersonStream(person);
}
```
