@100mslive/react-sdk 0.0.5-alpha.0 → 0.0.5-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { HMSStore, HMSActions, HMSNotification, HMSNotifications, HMSStatsStore, HMSStats, HMSStoreWrapper } from '@100mslive/hms-video-store';
|
|
2
|
+
import { HMSStore, HMSActions, HMSNotification, HMSNotifications, HMSStatsStore, IStoreReadOnly, HMSStats, HMSStoreWrapper } from '@100mslive/hms-video-store';
|
|
3
|
+
import { EqualityChecker, StateSelector } from 'zustand';
|
|
4
|
+
export interface IHMSReactStore<S extends HMSStore | HMSStatsStore> extends IStoreReadOnly<S> {
|
|
5
|
+
<U>(selector: StateSelector<S, U>, equalityFn?: EqualityChecker<U>): U;
|
|
6
|
+
}
|
|
3
7
|
export interface HMSRoomProviderProps {
|
|
4
8
|
actions?: HMSActions;
|
|
5
9
|
store?: HMSStoreWrapper;
|
|
6
10
|
notifications?: HMSNotifications;
|
|
7
|
-
|
|
11
|
+
stats?: HMSStats;
|
|
8
12
|
isHMSStatsOn?: boolean;
|
|
9
13
|
}
|
|
10
14
|
export declare const HMSRoomProvider: React.FC<HMSRoomProviderProps>;
|
|
@@ -12,8 +16,8 @@ export declare const HMSRoomProvider: React.FC<HMSRoomProviderProps>;
|
|
|
12
16
|
* `useHMSStore` is a read only hook which can be passed a selector to read data.
|
|
13
17
|
* The hook can only be used in a component if HMSRoomProvider is present in its ancestors.
|
|
14
18
|
*/
|
|
15
|
-
export declare const useHMSStore: <StateSlice>(selector:
|
|
16
|
-
export declare const useHMSStatsStore: <StateSlice>(selector:
|
|
19
|
+
export declare const useHMSStore: <StateSlice>(selector: StateSelector<HMSStore, StateSlice>, equalityFn?: EqualityChecker<StateSlice>) => StateSlice;
|
|
20
|
+
export declare const useHMSStatsStore: <StateSlice>(selector: StateSelector<HMSStatsStore, StateSlice>, equalityFn?: EqualityChecker<StateSlice>) => StateSlice | undefined;
|
|
17
21
|
/**
|
|
18
22
|
* `useHMSVanillaStore` is a read only hook which returns the vanilla HMSStore.
|
|
19
23
|
* Usage:
|
|
@@ -32,3 +36,4 @@ export declare const useHMSActions: () => HMSActions;
|
|
|
32
36
|
* `useHMSNotifications` is a read only hook which gives the latest notification(HMSNotification) received.
|
|
33
37
|
*/
|
|
34
38
|
export declare const useHMSNotifications: () => HMSNotification | null;
|
|
39
|
+
export declare const useIsHMSStatsOn: () => boolean;
|
package/dist/hooks/useVideo.d.ts
CHANGED
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { HMSTrackID } from '@100mslive/hms-video-store';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* @param trackId {HMSTrackID}
|
|
5
|
+
* the returned ref can be used to set on a video element meant to display the video for the passed in track id. The hook will take care of attaching and detaching video, and will automatically detach when the video goes out of view to save on bandwidth.
|
|
6
|
+
*/
|
|
7
|
+
export declare const useVideo: (trackId: HMSTrackID) => (node: any) => void;
|
|
@@ -4,14 +4,18 @@ interface UseVideoListProps {
|
|
|
4
4
|
/**
|
|
5
5
|
* Max tiles in a page. Overrides maxRowCount and maxColCount
|
|
6
6
|
*/
|
|
7
|
-
maxTileCount
|
|
8
|
-
maxRowCount
|
|
9
|
-
maxColCount
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
maxTileCount?: number;
|
|
8
|
+
maxRowCount?: number;
|
|
9
|
+
maxColCount?: number;
|
|
10
|
+
/**
|
|
11
|
+
* Given a screensharing peer the function should return true if their screenshare should be included for the video tile, and false otherwise. This can be useful if there are multiple screenshares in the room where you may want to show one in the center view and others in video list along side other tiles.
|
|
12
|
+
*/
|
|
12
13
|
showScreenFn?: (peer: HMSPeer) => boolean;
|
|
13
14
|
peers: HMSPeer[];
|
|
14
15
|
overflow?: 'scroll-x' | 'scroll-y' | 'hidden';
|
|
16
|
+
/**
|
|
17
|
+
* Aspect ratio of VideoTiles
|
|
18
|
+
*/
|
|
15
19
|
aspectRatio?: {
|
|
16
20
|
width: number;
|
|
17
21
|
height: number;
|
|
@@ -22,10 +26,11 @@ interface UseVideoListProps {
|
|
|
22
26
|
*/
|
|
23
27
|
filterNonPublishingPeers?: boolean;
|
|
24
28
|
}
|
|
25
|
-
export declare const useVideoList: ({ maxTileCount, maxColCount, maxRowCount,
|
|
26
|
-
|
|
29
|
+
export declare const useVideoList: ({ maxTileCount, maxColCount, maxRowCount, showScreenFn, peers, overflow, aspectRatio, filterNonPublishingPeers, }: UseVideoListProps) => {
|
|
30
|
+
pagesWithTiles: (TrackWithPeer & {
|
|
27
31
|
width: number;
|
|
28
32
|
height: number;
|
|
29
33
|
})[][];
|
|
34
|
+
ref: React.MutableRefObject<any>;
|
|
30
35
|
};
|
|
31
36
|
export {};
|