import * as React from 'react'; import { ConnectionState, Room } from 'livekit-client'; import { setupTextStream, type TextStreamData } from '@livekit/components-core'; import { useEnsureRoom } from '../context'; import { useConnectionState } from './useConnectionStatus'; import { useObservableState } from './internal'; /** @beta */ export type UseTextStreamOptions = { room?: Room; }; /** * @beta * @param topic - the topic to listen to * @returns an array of TextStreamData that holds the text, participantInfo, and streamInfo * @example * ```tsx * const { textStreams } = useTextStream('my-topic'); * return