Interface LiveReact<Snapshot>
Properties
live
Methods
LiveProvider
Parameters
Returns Element
unsafe__useLiveInstance
- unsafe__useLiveInstance(): Live<Snapshot>
Returns Live<Snapshot>
unsafe__useRTCInstance
useConnect
- useConnect(): (options?: { force?: boolean; url?: string; getTicket?: any }) => Promise<boolean | Error>
Returns (options?: { force?: boolean; url?: string; getTicket?: any }) => Promise<boolean | Error>
- (options?: { force?: boolean; url?: string; getTicket?: any }): Promise<boolean | Error>
Parameters
Optional options: { force?: boolean; url?: string; getTicket?: any }
Optional force?: boolean
Optional url?: string
getTicket?:function
- getTicket(): Promise<string>
Returns Promise<string>
Returns Promise<boolean | Error>
useCurrentWebSocketUrl
- useCurrentWebSocketUrl(): undefined | string
Returns undefined | string
useKeyframe
- useKeyframe<K>(frameName: K): [frame: Snapshot[K], setFrame: (frame: Snapshot[K]) => boolean | Error]
Type parameters
K: string | number | symbol
Parameters
Returns [frame: Snapshot[K], setFrame: (frame: Snapshot[K]) => boolean | Error]
useKeyframeUpdateCallback
- useKeyframeUpdateCallback<K>(name: K, callback: (...args: Parameters<KeyframeTypes<Snapshot>[K]>) => ReturnType<KeyframeTypes<Snapshot>[K]>, deps?: DependencyList): () => void
Type parameters
K: string | number | symbol
Parameters
name: K
callback: (...args: Parameters<KeyframeTypes<Snapshot>[K]>) => ReturnType<KeyframeTypes<Snapshot>[K]>
Optional deps: DependencyList
Returns () => void
useLiveAction
useLiveEventCallback
- useLiveEventCallback<K>(name: K, callback: (...args: Parameters<LiveEventType<Snapshot>[K]>) => ReturnType<LiveEventType<Snapshot>[K]>, deps?: DependencyList): () => void
Type parameters
Parameters
name: K
callback: (...args: Parameters<LiveEventType<Snapshot>[K]>) => ReturnType<LiveEventType<Snapshot>[K]>
Optional deps: DependencyList
Returns () => void
useRTCAction
useRTCEventCallback
- useRTCEventCallback<K>(name: K, callback: (...args: Parameters<RTCEventType[K]>) => ReturnType<RTCEventType[K]>, deps?: DependencyList): () => void
Type parameters
Parameters
Returns () => void
useReadyState
useSelfInfo
- useSelfInfo(): [Partial<UserInfo>, (userInfo: Partial<UserInfo>) => Promise<boolean | Error>]
Returns [Partial<UserInfo>, (userInfo: Partial<UserInfo>) => Promise<boolean | Error>]
useSnapshot
- useSnapshot(): undefined | Partial<Snapshot>
Returns undefined | Partial<Snapshot>
useUserList
Returns undefined | UserInfo[]
useWebSocketEventCallback
Type parameters
Parameters
name: K
Optional deps: DependencyList
Returns () => void
新建文件
LiveReact.ts
创建一个 LiveReact 实例对象: