@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) • 1.84 kB
TypeScript
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/esm/").PrimitiveAtom<any> & {
init: any;
};
/**
* Stores all property paths for a given participant.
*/
export declare const participantPropertyPathsState: import("jotai/esm/vanilla/utils/atomFamily").AtomFamily<string, import("jotai/esm/").PrimitiveAtom<any[]> & {
init: any[];
}>;
/**
* Stores resolved values for each participant and property path.
*/
export declare const participantPropertyState: import("jotai/esm/vanilla/utils/atomFamily").AtomFamily<string, import("jotai/esm/").PrimitiveAtom<any> & {
init: any;
}>;
declare 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 {};