DocumentService
Defined in: relay-sdks/ts/src/document-service.ts:40
Serves a state-shaped track whose document the application replaces, such as the media timeline. Create one with createDocumentService.
Extends
Section titled “Extends”Properties
Section titled “Properties”document
Section titled “document”readonly document: Uint8Array<ArrayBufferLike> | undefined;Defined in: relay-sdks/ts/src/document-service.ts:44
The latest document, or undefined before the first.
failures
Section titled “failures”readonly failures: number;Defined in: relay-sdks/ts/src/document-service.ts:33
Writes that failed while the track stayed open, each followed by a retry or by lost demand.
Inherited from
Section titled “Inherited from”readonly sends: number;Defined in: relay-sdks/ts/src/document-service.ts:31
Documents the transport accepted.
Inherited from
Section titled “Inherited from”Methods
Section titled “Methods”serve()
Section titled “serve()”serve(options?): Promise<void>;Defined in: relay-sdks/ts/src/document-service.ts:29
Run until the signal aborts or the track ends. Resolves when the track ends without a write having failed. Rejects
with the RelayError that ended the track when a write exposed it, so a retired catalog cannot go unnoticed.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options? |
ServeOptions |
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”update()
Section titled “update()”update(document): void;Defined in: relay-sdks/ts/src/document-service.ts:42
Replace the document, and send it if the relay is subscribed. Returns at once.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
document |
ArrayBufferView |
Returns
Section titled “Returns”void