import React from 'react'; import {CallbacksInterface} from './PropsContext'; import {IRtcEngine} from 'react-native-agora'; import type {DualStreamMode, UidInterface} from './PropsContext'; export interface UidStateInterface { min: Array; max: Array; } export interface ActionInterface { type: T; value: Parameters; } export type DispatchType = < T extends keyof CallbacksInterface, V extends Parameters, >(action: { type: T; value: V; }) => void; export type ActionType = ActionInterface; export interface RtcContextInterface { RtcEngine: IRtcEngine; dispatch: DispatchType; rtcUidRef: React.MutableRefObject; rtcChannelJoined: boolean; setDualStreamMode: React.Dispatch>; } const RtcContext = React.createContext( {} as RtcContextInterface, ); export const RtcProvider = RtcContext.Provider; export const RtcConsumer = RtcContext.Consumer; export default RtcContext;