UNPKG

@daily-co/daily-react

Version:

Daily React makes it easier to integrate [@daily-co/daily-js](https://www.npmjs.com/package/@daily-co/daily-js) in React applications.

31 lines (30 loc) 2.96 kB
import { ExtendedDailyParticipant } from '../DailyParticipants'; import type { NumericKeys } from '../types/NumericKeys'; import type { Paths } from '../types/paths'; import type { PathValue } from '../types/pathValue'; export declare const getPropertyParam: (id: string, property: Paths<ExtendedDailyParticipant>) => string; export declare const getParticipantPropertyAtom: (id: string, property: Paths<ExtendedDailyParticipant>) => import("jotai").PrimitiveAtom<any> & { init: any; }; /** * Stores all property paths for a given participant. */ export declare const participantPropertyPathsState: import("jotai/vanilla/utils/atomFamily").AtomFamily<string, import("jotai").PrimitiveAtom<("permissions" | "audio" | "video" | "tracks" | "audioTrack" | "videoTrack" | "screenVideoTrack" | "screenAudioTrack" | "screen" | "user_id" | "user_name" | "userData" | "session_id" | "joined_at" | "networkQualityState" | "networkThreshold" | "will_eject_at" | "local" | "owner" | "record" | "participantType" | "cam_info" | "screen_info" | "last_active" | "permissions.hasPresence" | "permissions.canSend" | "permissions.canReceive" | "permissions.canAdmin" | "permissions.canReceive.base" | "permissions.canReceive.byUserId" | "permissions.canReceive.byParticipantId" | `tracks.${string}`)[]> & { init: ("permissions" | "audio" | "video" | "tracks" | "audioTrack" | "videoTrack" | "screenVideoTrack" | "screenAudioTrack" | "screen" | "user_id" | "user_name" | "userData" | "session_id" | "joined_at" | "networkQualityState" | "networkThreshold" | "will_eject_at" | "local" | "owner" | "record" | "participantType" | "cam_info" | "screen_info" | "last_active" | "permissions.hasPresence" | "permissions.canSend" | "permissions.canReceive" | "permissions.canAdmin" | "permissions.canReceive.base" | "permissions.canReceive.byUserId" | "permissions.canReceive.byParticipantId" | `tracks.${string}`)[]; }>; /** * Stores resolved values for each participant and property path. */ export declare const participantPropertyState: import("jotai/vanilla/utils/atomFamily").AtomFamily<string, import("jotai").PrimitiveAtom<any> & { init: any; }>; type UseParticipantPropertyReturnType<T extends ExtendedDailyParticipant, P extends Paths<T> | Paths<T>[]> = P extends Paths<T>[] ? { [K in keyof P]: K extends NumericKeys ? PathValue<T, P[K]> : unknown; } : P extends Paths<T> ? PathValue<T, P> : never; /** * Returns a participant's property that you subscribe to. * @param participantId The participant's session_id. * @param propertyPaths the array of participant property that you want to subscribe to. */ export declare const useParticipantProperty: <T extends ExtendedDailyParticipant = ExtendedDailyParticipant, P extends Paths<T, keyof T> | [Paths<T, keyof T>, ...Paths<T, keyof T>[]] = Paths<T, keyof T> | [Paths<T, keyof T>, ...Paths<T, keyof T>[]]>(participantId: string, propertyPaths: P) => UseParticipantPropertyReturnType<T, P>; export {};