- Name
transcript- Kind
- property
- Type
string- Requirement
- optional
DocsAPI referenceUI machinesvoice-input
voice-input machine
The public state machine contract for @grassroot/ui-machines/voice-input. The machine owns behaviour; the matching headless layer owns composition.
@grassroot/ui-machines/voice-input
Package
Service example
voice-input.tsts
import { createService } from "@grassroot/statechart";import { voiceInputMachine } from "@grassroot/ui-machines/voice-input"; const service = createService(voiceInputMachine, { input: {} });service.start();service.send({ type: "…" });service.stop();9 of 9
Exports
VoiceInput
typeVoiceInputts
type VoiceInput = { readonly transcript?: string;};Name
Kind
Type
Requirement
transcriptproperty
stringoptional
VoiceInputContext
typeVoiceInputContextts
type VoiceInputContext = { readonly transcript?: string; readonly error?: unknown;};Name
Kind
Type
Requirement
errorproperty
unknownoptional
transcriptproperty
stringoptional
- Name
error- Kind
- property
- Type
unknown- Requirement
- optional
- Name
transcript- Kind
- property
- Type
string- Requirement
- optional
VoiceInputDiagnosticCodests
export declare const VoiceInputDiagnosticCodes: readonly DiagnosticCatalogueEntry[];VoiceInputEvent
typeVoiceInputEventts
type VoiceInputEvent = { readonly type: "REQUEST_PERMISSION";} | { readonly type: "PERMISSION_GRANTED";} | { readonly type: "PERMISSION_DENIED"; readonly error?: unknown;} | { readonly type: "RECORDING_STOPPED";} | { readonly type: "TRANSCRIPT"; readonly transcript: string;} | { readonly type: "TRANSCRIPT_DONE"; readonly transcript?: string;} | { readonly type: "FAILED"; readonly error?: unknown;} | { readonly type: "ABORT"; readonly error?: unknown;} | { readonly type: "RESET";};voiceInputMachine
valuevoiceInputMachinets
export declare const voiceInputMachine: Machine<VoiceInput, VoiceInputValue, VoiceInputContext, VoiceInputEvent, never>;voiceInputReplaySequence
valuevoiceInputReplaySequencets
export declare const voiceInputReplaySequence: readonly VoiceInputEvent[];voiceInputSelectors
valuevoiceInputSelectorsts
export declare const voiceInputSelectors: { isActive(snapshot: VoiceInputSnapshot): boolean; isTerminal(snapshot: VoiceInputSnapshot): boolean; canStart(snapshot: VoiceInputSnapshot): boolean; transcript(snapshot: VoiceInputSnapshot): string; error(snapshot: VoiceInputSnapshot): unknown;};Name
Kind
Type
Requirement
canStartmethod
(snapshot: VoiceInputSnapshot) => booleanrequired
errormethod
(snapshot: VoiceInputSnapshot) => unknownrequired
isActivemethod
(snapshot: VoiceInputSnapshot) => booleanrequired
isTerminalmethod
(snapshot: VoiceInputSnapshot) => booleanrequired
transcriptmethod
(snapshot: VoiceInputSnapshot) => stringrequired
- Name
canStart- Kind
- method
- Type
(snapshot: VoiceInputSnapshot) => boolean- Requirement
- required
- Name
error- Kind
- method
- Type
(snapshot: VoiceInputSnapshot) => unknown- Requirement
- required
- Name
isActive- Kind
- method
- Type
(snapshot: VoiceInputSnapshot) => boolean- Requirement
- required
- Name
isTerminal- Kind
- method
- Type
(snapshot: VoiceInputSnapshot) => boolean- Requirement
- required
- Name
transcript- Kind
- method
- Type
(snapshot: VoiceInputSnapshot) => string- Requirement
- required
VoiceInputSnapshot
typeVoiceInputSnapshotts
type VoiceInputSnapshot = Snapshot<VoiceInputValue, VoiceInputContext>;VoiceInputValue
typeVoiceInputValuets
type VoiceInputValue = "idle" | "permission" | "recording" | "transcribing" | "done" | "denied" | "failed";