applicationCommands module
APIs for application commands.
Type Aliases
| ApplicationCommandsEvents |
Application command events. |
| Command |
A command that can be triggered by an end user by dictating one of the CommandVariants. Commands belong to a CommandSet. |
| CommandPlaceholder |
A command placeholder with a list of possible spoken forms and values. Example
|
| CommandPlaceholderDetail |
Details for a CommandPlaceholder within a CommandRecognizedDetail. |
| CommandPlaceholderValue |
A specific value that can be used in a CommandPlaceholder and that values associated spokenForm. Example
|
| CommandRecognizedDetail |
Event detail for a |
| CommandSet |
A grouping for related Commands that can be enabled or disabled together. |
| CommandType |
Application command type. |
| CommandVariant |
A spokenForm and associated displayString for a Command. Must contain only alphabetic characters and spaces, with the exception of placeholders. Commands can have multiple command variants to allow for different ways of saying the same command. |
Functions
| add |
Add or update application command placeholders. |
| add |
Add or update application commands. |
| add |
Add or update application command sets. |
| complete |
Completes a command that was queued with queueCommand and resumes recognition. |
| queue |
Programmatically queues an application command.
This allows content to be inserted into the document during dictation, such as a link or information from a template.
When a command is queued, the current utterance is broken.
Once the preceding audio is recognized, the |
Variables
| Command |
Application command types. |
| events | The listener only EventTarget for application command events. |
Function Details
addOrUpdateCommandPlaceholders(CommandPlaceholder[])
Add or update application command placeholders.
function addOrUpdateCommandPlaceholders(placeholders: CommandPlaceholder[]): Promise<void>
Parameters
- placeholders
The placeholders to add or update. If a placeholder already exists, its placeholderValues will be replaced.
Returns
Promise<void>
A promise that resolves when all placeholders have been processed.
addOrUpdateCommands(Command[])
Add or update application commands.
function addOrUpdateCommands(commands: Command[]): Promise<void>
Parameters
- commands
-
Command[]
The commands to add or update. If a command already exists, its variants will be replaced.
Returns
Promise<void>
A promise that resolves when all commands have been processed.
addOrUpdateCommandSets(CommandSet[])
Add or update application command sets.
function addOrUpdateCommandSets(commandSets: CommandSet[]): Promise<void>
Parameters
- commandSets
The command sets to add or update.
Returns
Promise<void>
A promise that resolves when all command sets have been processed.
completeCommand(string)
Note
This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Completes a command that was queued with queueCommand and resumes recognition.
function completeCommand(id: string): Promise<void>
Parameters
- id
-
string
The id of the command to complete.
Returns
Promise<void>
A promise that resolves when the command is completed.
queueCommand(string)
Note
This API is in Beta and provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Programmatically queues an application command.
This allows content to be inserted into the document during dictation, such as a link or information from a template.
When a command is queued, the current utterance is broken.
Once the preceding audio is recognized, the commandRecognized event will be raised with the provided id.
Content can then be inserted into the document.
After content is inserted, call completeCommand to resume recognition.
function queueCommand(id: string): Promise<void>
Parameters
- id
-
string
The id of the command to queue. This can be correlated in the commandRecognized event.
Returns
Promise<void>
A promise that resolves when the command is queued.
Remarks
This feature is currently only supported for custom external controls; standard controls and custom web controls are not supported.
Variable Details
CommandTypes
Application command types.
CommandTypes: Readonly<{ ApplicationAutoText: "ApplicationAutoText", ApplicationCommand: "ApplicationCommand", AutoText: "AutoText", ChoiceListCommand: "ChoiceListCommand", HostedViewCommand: "HostedViewCommand", NamedFieldsNavigation: "NamedFieldsNavigation", Navigation: "Navigation", NonVocalCommand: "NonVocalCommand", PlateMode: "PlateMode", SiteCommand: "SiteCommand", SpellCommand: "SpellCommand", System: "System", Unknown: "Unknown", VATriggerWord: "VATriggerWord" }>
Type
Readonly<{ ApplicationAutoText: "ApplicationAutoText", ApplicationCommand: "ApplicationCommand", AutoText: "AutoText", ChoiceListCommand: "ChoiceListCommand", HostedViewCommand: "HostedViewCommand", NamedFieldsNavigation: "NamedFieldsNavigation", Navigation: "Navigation", NonVocalCommand: "NonVocalCommand", PlateMode: "PlateMode", SiteCommand: "SiteCommand", SpellCommand: "SpellCommand", System: "System", Unknown: "Unknown", VATriggerWord: "VATriggerWord" }>
events
The listener only EventTarget for application command events.
events: DragonEventTarget<ApplicationCommandsEvents>