Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(voiceaction): it fixes voiceAction function params type definition #19

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/features/voiceAction/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ import { debounce } from "../../utils/debounce";
* @param {Object} commandParams - Configuration parameters for VoiceCommand.
* @param {boolean} [commandParams.continuous=true] - Specifies if the listening should be continuous.
* @param {string} [commandParams.lang='pt-BR'] - Specifies the language for recognize the command.
* @param {Function} [commandParams.onError] - Callback function to be called when command recognition throw an error.
* @param {Map<string, Function>} [commandParams.commandsMapping] - Map of the respective commands and callback functions.
* @param {Array<Function>} [commandParams.middlewares] - Array of middleware functions to apply to the recognized command before invoke respective callback function.
* @param {function} [commandParams.onError] - Callback function to be called when command recognition throw an error.
* @param {Map<string, function>} [commandParams.commandsMapping] - Map of the respective commands and callback functions.
* @param {Array<function>} [commandParams.middlewares] - Array of middleware functions to apply to the recognized command before invoke respective callback function.
* @param {number} [commandParams.DEBOUNCE_DELAY=50] - The delay (in milliseconds) to debounce voice commands.
* @param {boolean} [commandParams.keepListening=true] - Whether to keep listening for voice commands after each execution.
* @throws {VoiceCommandNotFound} - Throws an error in case respective voice command it's not founded.
* @throws {InvalidVoiceCommandCallbackType} Throws an error if the command callback type is invalid.
* @throws {Error} - Throws an error if the browser does not support the Speech Recognition API.
* @returns {{ listenVoiceCommand: Function, stopListening: Function }}
* @returns {{
* listenVoiceCommand: (onStart: function, onEnd: function) => void, stopListening: function }}
*/
export function VoiceCommand(commandParams) {

Expand Down Expand Up @@ -81,9 +82,8 @@ export function VoiceCommand(commandParams) {
*
* @throws {Error} - Throws an error if the browser does not support the Speech Recognition API.
* @throws {InvalidVoiceCommandCallbackType} Throws an error if the command callback type is invalid.
* @param {Object} options - Configuration options for voice recognition.
* @param {Function} [options.onEnd=() => {}] - A callback function to be executed when listening ends.
* @param {Function} [options.onStart=() => {}] - A callback function to be executed when listening starts.
* @param {Function} [onStart=() => {}] - A callback function to be executed when listening starts.
* @param {Function} [onEnd=() => {}] - A callback function to be executed when listening ends.
* @returns {void}
*/
function listenVoiceCommand(
Expand Down