From 4a408c0fb502b902fe7f6874bd5cd5c103ddfda1 Mon Sep 17 00:00:00 2001 From: lukasIO Date: Fri, 8 Sep 2023 13:44:57 +0200 Subject: [PATCH] update api docs --- packages/core/etc/components-core.api.md | 4 +- packages/react/etc/components-react.api.md | 57 ++++++++++++++++------ 2 files changed, 44 insertions(+), 17 deletions(-) diff --git a/packages/core/etc/components-core.api.md b/packages/core/etc/components-core.api.md index b8f567cd7..5d0ea28b7 100644 --- a/packages/core/etc/components-core.api.md +++ b/packages/core/etc/components-core.api.md @@ -230,7 +230,7 @@ export type MediaToggleType = { }; // @public (undocumented) -export function mutedObserver(participant: Participant, source: Track.Source): Observable; +export function mutedObserver(trackRef: TrackReferenceOrPlaceholder): Observable; // @public (undocumented) export function observeParticipantEvents(participant: T, ...events: ParticipantEvent[]): Observable; @@ -462,7 +462,7 @@ export function setupStartAudio(): { }; // @public (undocumented) -export function setupTrackMutedIndicator(participant: Participant, source: Track.Source): { +export function setupTrackMutedIndicator(trackRef: TrackReferenceOrPlaceholder): { className: string; mediaMutedObserver: Observable; }; diff --git a/packages/react/etc/components-react.api.md b/packages/react/etc/components-react.api.md index aa8e8e3b7..319b46ec5 100644 --- a/packages/react/etc/components-react.api.md +++ b/packages/react/etc/components-react.api.md @@ -40,9 +40,10 @@ import { SetMediaDeviceOptions } from '@livekit/components-core'; import type { SourcesArray } from '@livekit/components-core'; import type { ToggleSource } from '@livekit/components-core'; import { Track } from 'livekit-client'; +import type { TrackIdentifier } from '@livekit/components-core'; import { TrackPublication } from 'livekit-client'; import type { TrackReference } from '@livekit/components-core'; -import type { TrackReferenceOrPlaceholder } from '@livekit/components-core'; +import { TrackReferenceOrPlaceholder } from '@livekit/components-core'; import type { TrackSourceWithOptions } from '@livekit/components-core'; import type { VideoCaptureOptions } from 'livekit-client'; import type { VideoSource } from '@livekit/components-core'; @@ -81,12 +82,14 @@ export interface AudioTrackProps } // @public (undocumented) -export function AudioVisualizer({ participant, ...props }: AudioVisualizerProps): React_2.JSX.Element; +export function AudioVisualizer({ participant, trackRef, ...props }: AudioVisualizerProps): React_2.JSX.Element; // @public (undocumented) export interface AudioVisualizerProps extends React_2.HTMLAttributes { - // (undocumented) + // @deprecated (undocumented) participant?: Participant; + // (undocumented) + trackRef?: TrackReferenceOrPlaceholder; } // @public @@ -459,16 +462,18 @@ export interface TrackLoopProps { } // @public -export function TrackMutedIndicator({ source, participant, show, ...props }: TrackMutedIndicatorProps): React_2.JSX.Element | null; +export function TrackMutedIndicator({ source, participant, trackRef, show, ...props }: TrackMutedIndicatorProps): React_2.JSX.Element | null; // @public (undocumented) export interface TrackMutedIndicatorProps extends React_2.HTMLAttributes { - // (undocumented) + // @deprecated (undocumented) participant?: Participant; // (undocumented) show?: 'always' | 'muted' | 'unmuted'; - // (undocumented) + // @deprecated (undocumented) source: Track.Source; + // (undocumented) + trackRef?: TrackReferenceOrPlaceholder; } // @public @@ -574,7 +579,7 @@ export function useEnsureParticipant(participant?: Participant): Participant; export function useEnsureRoom(room?: Room): Room; // @public -export function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): void; +export function useEnsureTrackRef(trackRef?: TrackReferenceOrPlaceholder): TrackReferenceOrPlaceholder; // @public @deprecated export function useEnsureTrackReference(track?: TrackReferenceOrPlaceholder): TrackReferenceOrPlaceholder; @@ -611,7 +616,10 @@ trackCount: number): { }; // @public (undocumented) -export function useIsMuted(source: Track.Source, options?: UseIsMutedOptions): boolean; +export function useIsMuted(trackRef: TrackReferenceOrPlaceholder): boolean; + +// @public @deprecated (undocumented) +export function useIsMuted(source: Track.Source, options: UseIsMutedOptions): boolean; // @public (undocumented) export interface UseIsMutedOptions { @@ -690,7 +698,7 @@ export interface UseMediaDeviceSelectProps { track?: LocalAudioTrack | LocalVideoTrack; } -// @public (undocumented) +// @public @deprecated (undocumented) export function useMediaTrack(source: VideoSource | AudioSource, participant?: Participant, options?: UseMediaTrackOptions): { publication: TrackPublication | undefined; isMuted: boolean | undefined; @@ -699,7 +707,7 @@ export function useMediaTrack(source: VideoSource | AudioSource, participant?: P elementProps: React_2.HTMLAttributes; }; -// @public (undocumented) +// @public @deprecated (undocumented) export function useMediaTrackByName(name: string, participant?: Participant, options?: UseMediaTrackOptions): { publication: TrackPublication | undefined; isMuted: boolean | undefined; @@ -885,21 +893,40 @@ export interface UseTokenOptions { userInfo?: UserInfo; } +// @public (undocumented) +export function useTrack(trackRef: TrackIdentifier, options?: UseTrackOptions): { + publication: TrackPublication | undefined; + isMuted: boolean | undefined; + isSubscribed: boolean | undefined; + track: Track | undefined; + elementProps: React_2.HTMLAttributes; +}; + // @public @deprecated export function useTrackContext(): TrackReferenceOrPlaceholder; +// Warning: (ae-forgotten-export) The symbol "TrackMutedIndicatorReturnType" needs to be exported by the entry point index.d.ts +// // @public (undocumented) -export function useTrackMutedIndicator(source: Track.Source, options?: UseTrackMutedIndicatorOptions): { - isMuted: boolean; - className: string; -}; +export function useTrackMutedIndicator(trackRef?: TrackReferenceOrPlaceholder): TrackMutedIndicatorReturnType; + +// @public @deprecated (undocumented) +export function useTrackMutedIndicator(source: Track.Source, options: UseTrackMutedIndicatorOptions): TrackMutedIndicatorReturnType; // @public (undocumented) export interface UseTrackMutedIndicatorOptions { - // (undocumented) + // @deprecated (undocumented) participant?: Participant; } +// @public (undocumented) +export interface UseTrackOptions { + // (undocumented) + element?: React_2.RefObject; + // (undocumented) + props?: React_2.HTMLAttributes; +} + // @public export function useTrackRefContext(): TrackReferenceOrPlaceholder;