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

const placeholder: CommandPlaceholder = {
  id: "patientId",
  label: "name of the patient",
  placeholderValues: [
    { value: "PTN.48389488", spokenForm: "mister Pink" },
    { value: "PTN.48323466", spokenForm: "mister Orange" },
  ]
};
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

const placeholderValue: CommandPlaceholderValue = {
  value: "PTN.48389488",
  spokenForm: "mister Pink"
};
CommandRecognizedDetail

Event detail for a commandRecognized event. Raised when a Command is recognized.

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

addOrUpdateCommandPlaceholders(CommandPlaceholder[])

Add or update application command placeholders.

addOrUpdateCommands(Command[])

Add or update application commands.

addOrUpdateCommandSets(CommandSet[])

Add or update application command sets.

completeCommand(string)

Completes a command that was queued with queueCommand and resumes recognition.

queueCommand(string)

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.

Variables

CommandTypes

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

CommandPlaceholder[]

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

CommandSet[]

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>

Type