Skip to content

Commit

Permalink
fix: typedoc parameters issue (#127)
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxianzhe authored Aug 7, 2023
1 parent afcb9a1 commit 32dcedc
Show file tree
Hide file tree
Showing 21 changed files with 81 additions and 90 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ build/
**/storybook-static/*
.snapshots/
*.min.js
**/typedoc/*
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
**/node_modules/*
**/storybook-static/*
pnpm-lock.yaml
**/typedoc/*
2 changes: 1 addition & 1 deletion packages/agora-rtc-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"update-readme": "pnpm esbuild-dev ../../scripts/docs/update-readme.ts",
"gene-comment": "esbuild-dev ../../scripts/docs/api.ts && esbuild-dev ../../scripts/docs/component.ts && esbuild-dev ../../scripts/docs/data-types.ts",
"gene-docs": "pnpm run gene-md && pnpm run gene-stories && pnpm run gene-comment && pnpm run update-readme",
"typedoc": "typedoc src --out ../../typedoc --name 'Video SDK for React' --includeVersion"
"typedoc": "typedoc src"
},
"peerDependencies": {
"agora-rtc-sdk-ng": ">=4.18.2",
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useConnectionState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { joinDisposers, timeout } from "../misc/utils";
/**
* Returns the detailed connection state of the SDK.
*
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return ConnectionState The connection state between the SDK and Agora's edge server. See ConnectionState for details.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useConnectionState } from "agora-rtc-react";
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useCurrentUID.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { timeout } from "../misc/utils";
/**
* Returns the current user ID.
*
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return UID | undefined The user ID of the current user. If the current user has not joined any channel, undefined is returned.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useCurrentUID } from "agora-rtc-react";
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useIsConnected.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ import { joinDisposers, timeout } from "../misc/utils";
/**
* Returns whether the SDK is connected to Agora's server.
*
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return boolean <li>true: The SDK is connected to the server.</li><li>false: The SDK is not connected to the server.</li>
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useIsConnected } from "agora-rtc-react";
Expand Down
11 changes: 4 additions & 7 deletions packages/agora-rtc-react/src/hooks/useJoin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,11 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets a user automatically join a channel when the component is ready and automatically leaves the channel when the component is unmounted.
* You can customize the conditions required to join a channel using fetchArgs. For example, generating a token and other asynchronous operations can be performed before joining the channel.
*
* @param `fetchArgs` {JoinOptions | (() => Promise<JoinOptions>)} The parameters or asynchronous function required to join the channel. See [`JoinOptions`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/interfaces/JoinOptions.html) for details.
* @param `ready` {boolean} Whether the user is ready to join the channel. The default value is `true`.
* @param `client` {IAgoraRTCClient} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return data UID
* @return isLoading boolean
* @return isConnected boolean
* @return error AgoraRTCReactError | null
* @param fetchArgs - The parameters or asynchronous function required to join the channel. See [`JoinOptions`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/interfaces/JoinOptions.html) for details.
* @param ready - Whether the user is ready to join the channel. The default value is `true`.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useJoin } from "agora-rtc-react";
Expand Down
9 changes: 4 additions & 5 deletions packages/agora-rtc-react/src/hooks/useLocalCameraTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,11 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets you create a local camera video track.
* This hook can only create the video track once before the component is destroyed.
* After the component is unmounted, the video track created by this hook stops publishing.
*
* @param `ready` {boolean} Whether it is ready to create the track. The default value is `true`.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return localCameraTrack ICameraVideoTrack | null
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param ready - Whether it is ready to create the track. The default value is `true`.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useLocalCameraTrack } from "agora-rtc-react";
Expand Down
11 changes: 5 additions & 6 deletions packages/agora-rtc-react/src/hooks/useLocalMicrophoneTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets you create a local microphone audio track.
* This hook can only create the audio track once before the component is destroyed.
* After the component is unmounted, the audio track created by this hook stops publishing.
*
* @param `ready` {boolean} Whether it is ready to create the track. The default value is `true`.
* @param `audioTrackConfig` {MicrophoneAudioTrackInitConfig} Configurations for initializing the microphone audio track. The default is `{ ANS: true, AEC: true }`. See [`MicrophoneAudioTrackInitConfig`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/microphoneaudiotrackinitconfig.html) for details.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return localMicrophoneTrack IMicrophoneAudioTrack | null
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param ready - Whether it is ready to create the track. The default value is `true`.
* @param audioTrackConfig - Configurations for initializing the microphone audio track. The default is `{ ANS: true, AEC: true }`. See [`MicrophoneAudioTrackInitConfig`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/microphoneaudiotrackinitconfig.html) for details.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useLocalMicrophoneTrack } from "agora-rtc-react";
Expand Down
13 changes: 6 additions & 7 deletions packages/agora-rtc-react/src/hooks/useLocalScreenTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets you create a local video track for screen-sharing.
* This hook can only create the video track once before the component is destroyed.
* After the component is unmounted, the video track created by this hook stops publishing.
*
* @param `ready` {boolean} Whether it is ready to create the track. The default value is `true`.
* @param `screenVideoTrackInitConfig` {screenVideoTrackInitConfig} Screen-sharing video configuration, including encoding and capturing configurations.
* @param `withAudio` {string} Whether to share the audio of the screen-sharing input source during screen sharing. Supported values are `"enable"`, `"disable"`, and `"auto"`. See the parameters of [`createScreenVideoTrack`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x//createScreenVideoTrack.html) for details.
* @param `client` {IAgoraRTCClient} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return screenTrack [ILocalVideoTrack, ILocalAudioTrack] | ILocalVideoTrack | null
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param ready - Whether it is ready to create the track. The default value is `true`.
* @param screenVideoTrackInitConfig - Screen-sharing video configuration, including encoding and capturing configurations.
* @param withAudio - Whether to share the audio of the screen-sharing input source during screen sharing. Supported values are `"enable"`, `"disable"`, and `"auto"`. See the parameters of [`createScreenVideoTrack`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x//createScreenVideoTrack.html) for details.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { AgoraRTCScreenShareProvider, LocalVideoTrack, useLocalScreenTrack } from "agora-rtc-react";
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useNetworkQuality.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const initQuality = (): NetworkQuality => ({
/**
* Returns the network quality of the local user.
*
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return NetworkQuality The network quality of the local user. See NetworkQuality for details.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useNetworkQuality } from "agora-rtc-react";
Expand Down
8 changes: 3 additions & 5 deletions packages/agora-rtc-react/src/hooks/usePublish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@ import { useIsConnected } from "./useIsConnected";
/**
* This hook lets you publish the local tracks when the component is ready and unpublish them when the component is unmounted.
*
* @param `tracks` {(ILocalTrack | null)[]} The list of local tracks.
* @param `readyToPublish` {boolean} Whether the local tracks are ready to publish. The default value is `true`.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param tracks - The list of local tracks.
* @param readyToPublish - Whether the local tracks are ready to publish. The default value is `true`.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useLocalMicrophoneTrack, useLocalCameraTrack, usePublish } from "agora-rtc-react";
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useRTCClient.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ function useOptionalRTCClient(client?: IAgoraRTCClient | null): IAgoraRTCClient
/**
* Returns the IAgoraRTCClient object.
*
* @param `client` {IAgoraRTCClient | null} If provided, the passed `IAgoraRTCClient` object is returned. If not provided, the `IAgoraRTCClient` object obtained from the [parent component's context](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/functions/AgoraRTCProvider.html) is returned.
* @return IAgoraRTCClient The IAgoraRTCClient client.
* @param client - If provided, the passed `IAgoraRTCClient` object is returned. If not provided, the `IAgoraRTCClient` object obtained from the [parent component's context](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/functions/AgoraRTCProvider.html) is returned.
* @example
* ```jsx
* import { useRTCClient } from "agora-rtc-react";
Expand Down
9 changes: 4 additions & 5 deletions packages/agora-rtc-react/src/hooks/useRemoteAudioTracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets you automatically subscribe to and retrieve remote users' audio tracks.
* When the component is unmounted, this hook stops subscribing to the audio tracks of the specified users.
* This hook updates the subscribed audio tracks when the users parameter changes.
*
* @param `users` {IAgoraRTCRemoteUser[] | undefined} The list of remote users.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return audioTracks IRemoteAudioTrack[]
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param users - The list of remote users.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useRemoteUsers, useRemoteVideoTracks } from "agora-rtc-react";
Expand Down
9 changes: 3 additions & 6 deletions packages/agora-rtc-react/src/hooks/useRemoteUserTrack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ import { useIsConnected } from "./useIsConnected";
/**
* This hook lets you retrieve the audio or video track of a remote user.
*
* @param `user` {IAgoraRTCRemoteUser | undefined} The remote user.
* @param `mediaType` {"video" | "audio"} The media type. Pass `"video"` or `"audio"`.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return track IRemoteVideoTrack | IRemoteAudioTrack | undefined
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param user - The remote user.
* @param mediaType - The media type. Pass `"video"` or `"audio"`.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useRemoteUsers, useRemoteUserTrack } from "agora-rtc-react";
Expand Down
7 changes: 5 additions & 2 deletions packages/agora-rtc-react/src/hooks/useRemoteUsers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ import { joinDisposers } from "../misc/utils";

/**
* This hook lets you retrieve the list of remote users.
* The return value of this hook is updated in the following cases:
* When a remote user joins or leaves the channel.
* When the role of a remote user changes (for example, from broadcaster to audience).
* When a remote user publishes or unpublishes the audio or video track.
*
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return IAgoraRTCRemoteUser[] The list of remote users.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useRemoteUsers } from "agora-rtc-react";
Expand Down
9 changes: 4 additions & 5 deletions packages/agora-rtc-react/src/hooks/useRemoteVideoTracks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@ import { useIsConnected } from "./useIsConnected";

/**
* This hook lets you automatically subscribe to and retrieve remote users' video tracks.
* When the component is unmounted, this hook stops subscribing to the video tracks of the specified users.
* This hook updates the subscribed video tracks when the users parameter changes.
*
* @param `users` {IAgoraRTCRemoteUser[] | undefined} The list of remote users.
* @param `client` {IAgoraRTCClient | null} Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @return videoTracks IRemoteVideoTrack[]
* @return isLoading boolean
* @return error AgoraRTCReactError | null
* @param users - The list of remote users.
* @param client - Created using the Web SDK's [`IAgoraRTC.createClient`](https://api-ref.agora.io/en/video-sdk/web/4.x/interfaces/iagorartc.html#createclient) method.
* @example
* ```jsx
* import { useRemoteUsers, useRemoteVideoTracks } from "agora-rtc-react";
Expand Down
3 changes: 1 addition & 2 deletions packages/agora-rtc-react/src/hooks/useVolumeLevel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import { interval } from "../misc/utils";
/**
* Returns the volume level of an audio track at a frequency of once per second.
*
* @param `audioTrack` {IRemoteAudioTrack | ILocalAudioTrack | undefined} The local or remote audio track. The local audio track can be created by calling [`useLocalMicrophoneTrack`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/functions/useLocalMicrophoneTrack.html). If undefined, the volume level is 0.
* @return number The volume level. The value range is [0,1]. 1 is the highest volume level. Usually a user with a volume level above 0.6 is a speaking user.
* @param audioTrack - The local or remote audio track. The local audio track can be created by calling [`useLocalMicrophoneTrack`](https://api-ref.agora.io/en/video-sdk/reactjs/2.x/functions/useLocalMicrophoneTrack.html). If undefined, the volume level is 0.
* @example
* ```jsx
* import { useVolumeLevel, useLocalMicrophoneTrack } from "agora-rtc-react";
Expand Down
7 changes: 7 additions & 0 deletions packages/agora-rtc-react/typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"out": "../../typedoc",
"name": "Video SDK for React",
"includeVersion": true,
"hideGenerator": true,
"githubPages": false
}
Loading

0 comments on commit 32dcedc

Please sign in to comment.