> ## Documentation Index
> Fetch the complete documentation index at: https://docs.reducto.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# @reductoai/pptx/collab

Shared editing. Guide: [Collaboration](https://docs.reducto.ai/office/pptx/recipes/collab.md).

## `PptxReplica`

Shared editing for decks: a session's edits as changes for a central
sequencer, and other writers' changes written back in. Pure and browser-safe.

Import from `@reductoai/pptx/collab`.

### PptxReplica properties

| Name | Type | Description |
| - | - | - |
| `client` | `CollabClient` | read-only |
| `session` | `PptxSession` | read-only |
| `pending` | `boolean` | read-only |
| `seq` | `number` | read-only |

### `PptxReplica.ack()`

```ts theme={null}
ack(seq: number): void
```

### `PptxReplica.commit()`

```ts theme={null}
commit(): CollabChange
```

Reads local edits since the last call and hands them to the client; returns what was read.

### `PptxReplica.parts()`

```ts theme={null}
parts(): string[]
```

Every part the mirror holds, for a convergence check.

### `PptxReplica.remote()`

```ts theme={null}
remote(change: CollabChange, seq: number): Set<string>
```

Another writer's change sequenced as `seq`; returns the parts it rewrote.

### `PptxReplica.resend()`

```ts theme={null}
resend(): void
```

## `PptxReplicaOptions`

Shared editing for decks: a session's edits as changes for a central
sequencer, and other writers' changes written back in. Pure and browser-safe.

Import from `@reductoai/pptx/collab`.

| Name | Type | Description |
| - | - | - |
| `block?` | `number` | This writer's id block (1 and up), unique among the writers of the deck; absent for a reader, who mints no ids. |
| `send` | `(out: Outgoing) => void` | |
| `seq` | `number` | Sequence number of the server change the session reflects. |

## `PptxEditorCollab`

Import from `@reductoai/pptx/collab`.

### PptxEditorCollab properties

| Name | Type | Description |
| - | - | - |
| `editor` | `PptxEditor` | read-only |
| `presence` | `PresenceTable<PptxPresence> \| undefined` | read-only |
| `replica` | `PptxReplica` | read-only |

### `PptxEditorCollab.ack()`

```ts theme={null}
ack(seq: number): void
```

### `PptxEditorCollab.apply()`

```ts theme={null}
apply(command: PptxCommand): Promise<EditorView>
```

### `PptxEditorCollab.external()`

```ts theme={null}
external<T>(run: () => Promise<T>): Promise<T>
```

An edit made on the presentation around the editor (a script, an agent).

### `PptxEditorCollab.leave()`

```ts theme={null}
leave(): void
```

Tells the others this writer left.

### `PptxEditorCollab.peers()`

```ts theme={null}
peers(): PeerMark[]
```

Every other writer whose page still exists, laid out on this editor's view.

### `PptxEditorCollab.publish()`

```ts theme={null}
publish(): void
```

### `PptxEditorCollab.receivePresence()`

```ts theme={null}
receivePresence(update: PresenceUpdate<PptxPresence>): boolean
```

Takes another writer's place; true when the marks changed.

### `PptxEditorCollab.remote()`

```ts theme={null}
remote(change: CollabChange, seq: number): Promise<EditorView>
```

### `PptxEditorCollab.resend()`

```ts theme={null}
resend(): void
```

### `PptxEditorCollab.settle()`

```ts theme={null}
settle(): void
```

Sends what the editor did outside `apply` (a host driving it directly) and its place.

## `PptxPresenceOptions`

Import from `@reductoai/pptx/collab`.

| Name | Type | Description |
| - | - | - |
| `peer` | `Peer` | |
| `send` | `(update: PresenceUpdate<PptxPresence>) => void` | |
