Skip to content

Commit

Permalink
FCE-1008/ensure tsdoc consistency (#241)
Browse files Browse the repository at this point in the history
## Description

Improves tsdoc quality.


## Types of changes

- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to
      not work as expected)
  • Loading branch information
czerwiukk authored Jan 7, 2025
1 parent bd335e7 commit 1d552c1
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export type UseInitializeDevicesResult = {
};

/**
* Hook allows you to initialize access to the devices before joining the room.
* @category Devices
*/
export const useInitializeDevices = (): UseInitializeDevicesResult => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { useCallback, useEffect, useRef, useState } from "react";

import type { ScreenShareState } from "../../types/internal";
import type { PeerStatus, TracksMiddleware } from "../../types/public";
import { getRemoteOrLocalTrack } from "../../utils/track";
import type { UseScreenshareResult } from "../useScreenShare";

interface ScreenShareManagerProps {
Expand Down Expand Up @@ -136,17 +135,12 @@ export const useScreenShareManager = ({
};
}, [stopStreaming, fishjamClient, stream]);

const videoBroadcast = state.stream ? getRemoteOrLocalTrack(fishjamClient, state.trackIds.videoId) : null;
const audioBroadcast = state.trackIds?.audioId ? getRemoteOrLocalTrack(fishjamClient, state.trackIds.audioId) : null;

return {
startStreaming,
stopStreaming,
stream,
videoTrack: mediaVideoTrack,
audioTrack: mediaAudioTrack,
videoBroadcast,
audioBroadcast,
setTracksMiddleware,
currentTracksMiddleware: state?.tracksMiddleware ?? null,
};
Expand Down
2 changes: 1 addition & 1 deletion packages/react-client/src/hooks/useConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export interface UseConnectionResult {
}

/**
* Hook allows to to join or leave a room and check the current connection status.
* Hook allows to join or leave a room and check the current connection status.
* @category Connection
* @returns {UseConnectionResult}
*/
Expand Down
1 change: 1 addition & 0 deletions packages/react-client/src/hooks/usePeers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ export type UsePeersResult<PeerMetadata, ServerMetadata> = {
};

/**
* Hook allows to access id, tracks and metadata of the local and remote peers.
*
* @category Connection
* @group Hooks
Expand Down
33 changes: 28 additions & 5 deletions packages/react-client/src/hooks/useScreenShare.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Track, TracksMiddleware } from "../types/public";
import type { TracksMiddleware } from "../types/public";
import { useFishjamContext } from "./internal/useFishjamContext";

/**
Expand All @@ -7,22 +7,45 @@ import { useFishjamContext } from "./internal/useFishjamContext";
* @group Types
*/
export type UseScreenshareResult = {
/**
* Invokes the screen sharing prompt in the user's browser and starts streaming upon approval.
*/
startStreaming: (props?: {
audioConstraints?: boolean | MediaTrackConstraints;
videoConstraints?: boolean | MediaTrackConstraints;
}) => Promise<void>;
/**
* Stops the stream and cancels browser screen sharing.
*/
stopStreaming: () => Promise<void>;
/**
* The MediaStream object containing both tracks.
*/
stream: MediaStream | null;
/**
* The separate video MediaStreamTrack.
*/
videoTrack: MediaStreamTrack | null;
/**
* The separate audio MediaStreamTrack.
*/
audioTrack: MediaStreamTrack | null;
videoBroadcast: Track | null;
audioBroadcast: Track | null;
setTracksMiddleware: (middleware: TracksMiddleware | null) => Promise<void>;
/**
* The middleware currently assigned to process the tracks.
* A screenshare may include both audio and video tracks, and this middleware is capable of processing
* each track type.
*/
currentTracksMiddleware: TracksMiddleware | null;
/**
* Sets the middleware responsible for processing the tracks.
* @param middleware The middleware to set, which can be a TracksMiddleware instance or null to remove the middleware.
* @returns A Promise that resolves once the middleware is successfully set.
*/
setTracksMiddleware: (middleware: TracksMiddleware | null) => Promise<void>;
};

/**
*
* Hook to enable screen sharing within a room and manage the existing stream.
* @category Devices
* @group Hooks
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/react-client/src/hooks/useUpdatePeerMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { useCallback } from "react";
import { useFishjamContext } from "./internal/useFishjamContext";

/**
* Hook provides a method to update the metadata of the local peer
* Hook provides a method to update the metadata of the local peer.
* @category Connection
* @group Hooks
* @returns
Expand Down
1 change: 0 additions & 1 deletion packages/react-client/src/hooks/useVAD.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useFishjamClientState } from "./internal/useFishjamClientState";
import { useFishjamContext } from "./internal/useFishjamContext";

/**
*
* @param peerIds List of ids of peers to subscribe to for voice activity detection notifications.
* @category Connection
* @group Hooks
Expand Down

0 comments on commit 1d552c1

Please sign in to comment.