@livekit/components-js-docs 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ ---
2
+ { "title": "ChatMessage.id property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # ChatMessage.id property
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ id: string;
13
+ ```
@@ -21,5 +21,6 @@ export interface ChatMessage
21
21
 
22
22
  | Property | Type | Description |
23
23
  | -------------------------------------------- | ------ | ----------- |
24
+ | [id](./core/chatmessage.id.md) | string | |
24
25
  | [message](./core/chatmessage.message.md) | string | |
25
26
  | [timestamp](./core/chatmessage.timestamp.md) | number | |
@@ -16,6 +16,7 @@ export type ChatOptions = {
16
16
  messageEncoder?: (message: ChatMessage) => Uint8Array;
17
17
  messageDecoder?: (message: Uint8Array) => ReceivedChatMessage;
18
18
  channelTopic?: string;
19
+ updateChannelTopic?: string;
19
20
  };
20
21
  ```
21
22
 
@@ -14,5 +14,6 @@
14
14
  ```typescript
15
15
  DataTopic: {
16
16
  readonly CHAT: "lk-chat-topic";
17
+ readonly CHAT_UPDATE: "lk-chat-update-topic";
17
18
  }
18
19
  ```
@@ -0,0 +1,13 @@
1
+ ---
2
+ { "title": "ReceivedChatMessage.editTimestamp property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # ReceivedChatMessage.editTimestamp property
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ editTimestamp?: number;
13
+ ```
@@ -21,6 +21,7 @@ export interface ReceivedChatMessage extends ChatMessage
21
21
 
22
22
  ## Properties
23
23
 
24
- | Property | Type | Description |
25
- | ------------------------------------------- | ----------- | ------------ |
26
- | [from?](./core/receivedchatmessage.from.md) | Participant | _(Optional)_ |
24
+ | Property | Type | Description |
25
+ | ------------------------------------------------------------- | ----------- | ------------ |
26
+ | [editTimestamp?](./core/receivedchatmessage.edittimestamp.md) | number | _(Optional)_ |
27
+ | [from?](./core/receivedchatmessage.from.md) | Participant | _(Optional)_ |
@@ -18,6 +18,7 @@ export declare function setupChat(
18
18
  ): {
19
19
  messageObservable: import("rxjs").Observable<ReceivedChatMessage[]>;
20
20
  isSendingObservable: BehaviorSubject<boolean>;
21
- send: (message: string) => Promise<void>;
21
+ send: (message: string) => Promise<ChatMessage>;
22
+ update: (message: string, messageId: string) => Promise<ChatMessage>;
22
23
  };
23
24
  ```
@@ -14,7 +14,7 @@
14
14
  ```typescript
15
15
  export declare function setupDataMessageHandler<T extends string>(
16
16
  room: Room,
17
- topic?: T,
17
+ topic?: T | [T, ...T[]],
18
18
  onMessage?: (msg: ReceivedDataMessage<T>) => void
19
19
  ): {
20
20
  messageObservable: Observable<{
@@ -0,0 +1,13 @@
1
+ ---
2
+ { "title": "ChatMessage.id property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # ChatMessage.id property
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ id: string;
13
+ ```
@@ -21,5 +21,6 @@ export interface ChatMessage
21
21
 
22
22
  | Property | Type | Description |
23
23
  | --------------------------------------------- | ------ | ----------- |
24
+ | [id](./react/chatmessage.id.md) | string | |
24
25
  | [message](./react/chatmessage.message.md) | string | |
25
26
  | [timestamp](./react/chatmessage.timestamp.md) | number | |
@@ -9,7 +9,7 @@
9
9
 
10
10
  # useChat
11
11
 
12
- The `useChat` hook provides chat functionality for a LiveKit room. It returns a simple `send` function to send chat messages and an array of `chatMessages` to hold received messages.
12
+ The `useChat` hook provides chat functionality for a LiveKit room. It returns a simple `send` function to send chat messages and an array of `chatMessages` to hold received messages. It also returns a `update` function that allows you to implement message-edit functionality.
13
13
 
14
14
  ## Import
15
15
 
@@ -19,7 +19,7 @@ import { useChat } from "@livekit/components-react";
19
19
 
20
20
  ## Remarks
21
21
 
22
- It is possible to pass configurations for custom message encoding and decoding.
22
+ It is possible to pass configurations for custom message encoding and decoding and non-default topics on which to send the messages.
23
23
 
24
24
  {% partial file="p_usage.md" variables={exampleCount: 0} /%}
25
25
 
@@ -32,7 +32,8 @@ It is possible to pass configurations for custom message encoding and decoding.
32
32
 
33
33
  ```typescript
34
34
  {
35
- send: ((message: string) => Promise<void>) | undefined;
35
+ send: ((message: string) => Promise<import("@livekit/components-core").ChatMessage>) | undefined;
36
+ update: ((message: string, messageId: string) => Promise<import("@livekit/components-core").ChatMessage>) | undefined;
36
37
  chatMessages: ReceivedChatMessage[];
37
38
  isSending: boolean;
38
39
  }
@@ -57,7 +57,7 @@
57
57
  | Hook | Description |
58
58
  | ------------------------------------------------------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
59
59
  | [useAudioPlayback(room)](./react/hook/useaudioplayback.md) | In many browsers to start audio playback, the user must perform a user-initiated event such as clicking a button. The <code>useAudioPlayback</code> hook returns an object with a boolean <code>canPlayAudio</code> flag that indicates whether audio playback is allowed in the current context, as well as a <code>startAudio</code> function that can be called in a button <code>onClick</code> callback to start audio playback in the current context. |
60
- | [useChat(options)](./react/hook/usechat.md) | The <code>useChat</code> hook provides chat functionality for a LiveKit room. It returns a simple <code>send</code> function to send chat messages and an array of <code>chatMessages</code> to hold received messages. |
60
+ | [useChat(options)](./react/hook/usechat.md) | The <code>useChat</code> hook provides chat functionality for a LiveKit room. It returns a simple <code>send</code> function to send chat messages and an array of <code>chatMessages</code> to hold received messages. It also returns a <code>update</code> function that allows you to implement message-edit functionality. |
61
61
  | [useChatToggle({ props })](./react/hook/usechattoggle.md) | The <code>useChatToggle</code> hook provides state and functions for toggling the chat window. |
62
62
  | [useClearPinButton(props)](./react/hook/useclearpinbutton.md) | The <code>useClearPinButton</code> hook provides props for the [ClearPinButton()](./react/component/clearpinbutton.md) or your custom implementation of it component. It adds the <code>onClick</code> handler to signal the <code>LayoutContext</code> that the tile in focus should be cleared. |
63
63
  | [useConnectionQualityIndicator(options)](./react/hook/useconnectionqualityindicator.md) | The <code>useConnectionQualityIndicator</code> hook provides props for the <code>ConnectionQualityIndicator</code> or your custom implementation of it component. |
@@ -0,0 +1,13 @@
1
+ ---
2
+ { "title": "ReceivedChatMessage.editTimestamp property" }
3
+ ---
4
+
5
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
6
+
7
+ # ReceivedChatMessage.editTimestamp property
8
+
9
+ **Signature:**
10
+
11
+ ```typescript
12
+ editTimestamp?: number;
13
+ ```
@@ -21,6 +21,7 @@ export interface ReceivedChatMessage extends ChatMessage
21
21
 
22
22
  ## Properties
23
23
 
24
- | Property | Type | Description |
25
- | -------------------------------------------- | ----------- | ------------ |
26
- | [from?](./react/receivedchatmessage.from.md) | Participant | _(Optional)_ |
24
+ | Property | Type | Description |
25
+ | -------------------------------------------------------------- | ----------- | ------------ |
26
+ | [editTimestamp?](./react/receivedchatmessage.edittimestamp.md) | number | _(Optional)_ |
27
+ | [from?](./react/receivedchatmessage.from.md) | Participant | _(Optional)_ |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@livekit/components-js-docs",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Automatically generated documentation pages for LiveKit Components JS. Intended to be consumed by the documentation page.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -8,7 +8,7 @@
8
8
  "directory": "/docs/beta-docs"
9
9
  },
10
10
  "dependencies": {
11
- "@livekit/components-react": "1.5.2"
11
+ "@livekit/components-react": "1.5.3"
12
12
  },
13
13
  "author": "",
14
14
  "license": "Apache-2.0",