@livekit/components-js-docs 0.1.73 → 0.1.76

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.
Files changed (27) hide show
  1. package/generated-docs/core/createdataobserver.md +1 -1
  2. package/generated-docs/core/createemailregexp.md +1 -1
  3. package/generated-docs/core/index.md +146 -146
  4. package/generated-docs/core/participantbyidentifierobserver.md +1 -1
  5. package/generated-docs/core/setupdatamessagehandler.md +1 -1
  6. package/generated-docs/react/component/chattoggle.md +1 -1
  7. package/generated-docs/react/component/controlbar.md +1 -1
  8. package/generated-docs/react/component/prejoin.md +2 -2
  9. package/generated-docs/react/hook/usechattoggle.md +1 -1
  10. package/generated-docs/react/hook/usefocustoggle.md +2 -2
  11. package/generated-docs/react/hook/usemediadevices.md +1 -1
  12. package/generated-docs/react/hook/usemediadeviceselect.md +5 -5
  13. package/generated-docs/react/hook/useparticipanttile.md +4 -4
  14. package/generated-docs/react/hook/userpc.md +56 -0
  15. package/generated-docs/react/hook/usestartaudio.md +2 -2
  16. package/generated-docs/react/hook/usestartvideo.md +2 -2
  17. package/generated-docs/react/hook/usetracktoggle.md +1 -1
  18. package/generated-docs/react/index.md +138 -129
  19. package/generated-docs/react/meta-data.json +1 -1
  20. package/generated-docs/react/prejoinprops.md +13 -13
  21. package/generated-docs/react/prejoinprops.onvalidate.md +1 -1
  22. package/generated-docs/react/rpccallparams.md +26 -0
  23. package/generated-docs/react/rpchandler.md +25 -0
  24. package/generated-docs/react/rpcperformfn.md +30 -0
  25. package/generated-docs/react/userpcoptions.md +27 -0
  26. package/generated-docs/react/userpcreturn.md +26 -0
  27. package/package.json +2 -2
@@ -14,7 +14,7 @@
14
14
  ```typescript
15
15
  export declare function participantByIdentifierObserver(
16
16
  room: Room,
17
- { kind, identity }: ParticipantIdentifier,
17
+ input: ParticipantIdentifier,
18
18
  options?: ConnectedParticipantObserverOptions
19
19
  ): Observable<RemoteParticipant | undefined>;
20
20
  ```
@@ -18,7 +18,7 @@ export declare function setupDataMessageHandler<T extends string>(
18
18
  onMessage?: (msg: ReceivedDataMessage<T>) => void
19
19
  ): {
20
20
  messageObservable: Observable<{
21
- payload: Uint8Array<ArrayBufferLike>;
21
+ payload: Uint8Array<ArrayBuffer>;
22
22
  topic: T;
23
23
  from: import("livekit-client").RemoteParticipant | undefined;
24
24
  }>;
@@ -25,6 +25,6 @@ For the component to have any effect it has to live inside a `LayoutContext` con
25
25
 
26
26
  ```tsx
27
27
  <LiveKitRoom>
28
- <ToggleChat />
28
+ <ChatToggle />
29
29
  </LiveKitRoom>
30
30
  ```
@@ -19,7 +19,7 @@ import { ControlBar } from "@livekit/components-react";
19
19
 
20
20
  ## Remarks
21
21
 
22
- This component is build with other LiveKit components like `TrackToggle`<!-- -->, `DeviceSelectorButton`<!-- -->, `DisconnectButton` and `StartAudio`<!-- -->.
22
+ This component is built with other LiveKit components like `TrackToggle`<!-- -->, `DeviceSelectorButton`<!-- -->, `DisconnectButton` and `StartAudio`<!-- -->.
23
23
 
24
24
  ## Usage
25
25
 
@@ -9,7 +9,7 @@
9
9
 
10
10
  # PreJoin
11
11
 
12
- The `PreJoin` prefab component is normally presented to the user before he enters a room. This component allows the user to check and select the preferred media device (camera und microphone). On submit the user decisions are returned, which can then be passed on to the `LiveKitRoom` so that the user enters the room with the correct media devices.
12
+ The `PreJoin` prefab component is normally presented to the user before he enters a room. This component allows the user to check and select the preferred media device (camera and microphone). On submit the user decisions are returned, which can then be passed on to the `LiveKitRoom` so that the user enters the room with the correct media devices.
13
13
 
14
14
  ## Import
15
15
 
@@ -65,7 +65,7 @@ _(Optional)_ This function is called with the `LocalUserChoices` if validation i
65
65
  {% /parameter %}
66
66
 
67
67
  {% parameter name="onValidate" type="(values: LocalUserChoices) => boolean" optional=true %}
68
- _(Optional)_ Provide your custom validation function. Only if validation is successful the user choices are past to the onSubmit callback.
68
+ _(Optional)_ Provide your custom validation function. Only if validation is successful the user choices are passed to the onSubmit callback.
69
69
 
70
70
  {% /parameter %}
71
71
 
@@ -23,7 +23,7 @@ Depends on the `LayoutContext` to work properly.
23
23
 
24
24
  ## Properties
25
25
 
26
- {% parameter name="{ props }.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
26
+ {% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
27
27
  {% /parameter %}
28
28
 
29
29
  ## Returns
@@ -26,10 +26,10 @@ return <button {...mergedProps}>{inFocus ? "Unfocus" : "Focus"}</button>;
26
26
 
27
27
  ## Properties
28
28
 
29
- {% parameter name="{ trackRef, props }.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
29
+ {% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
30
30
  {% /parameter %}
31
31
 
32
- {% parameter name="{ trackRef, props }.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
32
+ {% parameter name="input.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
33
33
  {% /parameter %}
34
34
 
35
35
  ## Returns
@@ -26,7 +26,7 @@ const audioDevices = useMediaDevices({ kind: "audioinput" });
26
26
 
27
27
  ## Properties
28
28
 
29
- {% parameter name="{ kind, onError, }" type="{
29
+ {% parameter name="input" type="{
30
30
  kind: MediaDeviceKind;
31
31
  onError?: (e: Error) => void;
32
32
  }" optional=false %}
@@ -27,23 +27,23 @@ const { devices, activeDeviceId, setActiveMediaDevice } = useMediaDeviceSelect({
27
27
 
28
28
  ## Properties
29
29
 
30
- {% parameter name="{ kind, room, track, requestPermissions, onError, }.kind" type="MediaDeviceKind" optional=false %}
30
+ {% parameter name="input.kind" type="MediaDeviceKind" optional=false %}
31
31
  {% /parameter %}
32
32
 
33
- {% parameter name="{ kind, room, track, requestPermissions, onError, }.onError" type="(e: Error) => void" optional=true %}
33
+ {% parameter name="input.onError" type="(e: Error) => void" optional=true %}
34
34
  this callback gets called if an error is thrown when failing to select a device and also if a user denied permissions, eventhough the `requestPermissions` option is set to `true`<!-- -->. Most commonly this will emit a MediaDeviceError
35
35
 
36
36
  {% /parameter %}
37
37
 
38
- {% parameter name="{ kind, room, track, requestPermissions, onError, }.requestPermissions" type="boolean" optional=true %}
38
+ {% parameter name="input.requestPermissions" type="boolean" optional=true %}
39
39
  this will call getUserMedia if the permissions are not yet given to enumerate the devices with device labels. in some browsers multiple calls to getUserMedia result in multiple permission prompts. It's generally advised only flip this to true, once a (preview) track has been acquired successfully with the appropriate permissions.
40
40
 
41
41
  {% /parameter %}
42
42
 
43
- {% parameter name="{ kind, room, track, requestPermissions, onError, }.room" type="Room" optional=true %}
43
+ {% parameter name="input.room" type="Room" optional=true %}
44
44
  {% /parameter %}
45
45
 
46
- {% parameter name="{ kind, room, track, requestPermissions, onError, }.track" type="LocalAudioTrack | LocalVideoTrack" optional=true %}
46
+ {% parameter name="input.track" type="LocalAudioTrack | LocalVideoTrack" optional=true %}
47
47
  {% /parameter %}
48
48
 
49
49
  ## Returns
@@ -23,16 +23,16 @@ The returned props include many data attributes that are useful for CSS styling
23
23
 
24
24
  ## Properties
25
25
 
26
- {% parameter name="{ trackRef, onParticipantClick, disableSpeakingIndicator, htmlProps, }.htmlProps" type="React.HTMLAttributes<T>" optional=false %}
26
+ {% parameter name="input.htmlProps" type="React.HTMLAttributes<T>" optional=false %}
27
27
  {% /parameter %}
28
28
 
29
- {% parameter name="{ trackRef, onParticipantClick, disableSpeakingIndicator, htmlProps, }.disableSpeakingIndicator" type="boolean" optional=true %}
29
+ {% parameter name="input.disableSpeakingIndicator" type="boolean" optional=true %}
30
30
  {% /parameter %}
31
31
 
32
- {% parameter name="{ trackRef, onParticipantClick, disableSpeakingIndicator, htmlProps, }.onParticipantClick" type="(event: ParticipantClickEvent) => void" optional=true %}
32
+ {% parameter name="input.onParticipantClick" type="(event: ParticipantClickEvent) => void" optional=true %}
33
33
  {% /parameter %}
34
34
 
35
- {% parameter name="{ trackRef, onParticipantClick, disableSpeakingIndicator, htmlProps, }.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
35
+ {% parameter name="input.trackRef" type="TrackReferenceOrPlaceholder" optional=true %}
36
36
  The track reference to display.
37
37
 
38
38
  {% /parameter %}
@@ -0,0 +1,56 @@
1
+ ---
2
+ {
3
+ "title": "useRpc",
4
+ "linkToSource": "https://github.com/livekit/components-js/blob/main/packages/react/src/hooks/useRpc.ts"
5
+ }
6
+ ---
7
+
8
+ <!-- Do not edit this file. It is automatically generated by API Documenter. -->
9
+
10
+ # useRpc
11
+
12
+ {% callout type="note" variation="normal" %}
13
+
14
+ This feature is under active development and may change based on developer feedback and real-world usage.
15
+
16
+ {% /callout %}
17
+
18
+ Hook for declarative RPC method registration and outbound RPC calls.
19
+
20
+ Registers a handler for an incoming RPC method and returns a `performRpc` function for outbound calls. The handler is registered on mount and unregistered on unmount. Handler identity does not matter (captured by ref), so inline functions work without `useCallback`<!-- -->.
21
+
22
+ ## Import
23
+
24
+ ```typescript
25
+ import { useRpc } from "@livekit/components-react";
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ```tsx
31
+ const { performRpc } = useRpc(
32
+ session,
33
+ "getUserLocation",
34
+ async (payload: { highAccuracy: boolean }) => {
35
+ const pos = await getPosition(payload.highAccuracy);
36
+ return { lat: pos.coords.latitude, lng: pos.coords.longitude };
37
+ }
38
+ );
39
+ ```
40
+
41
+ ## Properties
42
+
43
+ {% parameter name="handler" type="RpcHandler<SerializerInput<S>, SerializerOutput<S>>" optional=false %}
44
+ {% /parameter %}
45
+
46
+ {% parameter name="methodName" type="string" optional=false %}
47
+ {% /parameter %}
48
+
49
+ {% parameter name="session" type="UseSessionReturn" optional=false %}
50
+ {% /parameter %}
51
+
52
+ ## Returns
53
+
54
+ ```typescript
55
+ UseRpcReturn;
56
+ ```
@@ -25,10 +25,10 @@ import { useStartAudio } from "@livekit/components-react";
25
25
 
26
26
  ## Properties
27
27
 
28
- {% parameter name="{ room, props }.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
28
+ {% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
29
29
  {% /parameter %}
30
30
 
31
- {% parameter name="{ room, props }.room" type="Room" optional=true %}
31
+ {% parameter name="input.room" type="Room" optional=true %}
32
32
  {% /parameter %}
33
33
 
34
34
  ## Returns
@@ -25,10 +25,10 @@ import { useStartVideo } from "@livekit/components-react";
25
25
 
26
26
  ## Properties
27
27
 
28
- {% parameter name="{ room, props }.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
28
+ {% parameter name="input.props" type="React.ButtonHTMLAttributes<HTMLButtonElement>" optional=false %}
29
29
  {% /parameter %}
30
30
 
31
- {% parameter name="{ room, props }.room" type="Room" optional=true %}
31
+ {% parameter name="input.room" type="Room" optional=true %}
32
32
  {% /parameter %}
33
33
 
34
34
  ## Returns
@@ -26,7 +26,7 @@ return <button {...buttonProps}>{enabled ? "disable" : "enable"}</button>;
26
26
 
27
27
  ## Properties
28
28
 
29
- {% parameter name="{ source, onChange, initialState, captureOptions, publishOptions, onDeviceError, room, ...rest }.room" type="Room" optional=true %}
29
+ {% parameter name="input.room" type="Room" optional=true %}
30
30
  {% /parameter %}
31
31
 
32
32
  ## Returns