scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
50 lines (47 loc) • 1.12 kB
text/typescript
import { AbsSpeech } from 'scriptable-abstract';
interface SpeechState {
lastSpokenText: string | null;
lastLanguage: string | null;
lastRate: number | null;
lastPitch: number | null;
}
/**
* Mock implementation of Scriptable's Speech global variable
* Provides functionality for text-to-speech conversion
*
* @implements Speech
*/
declare class MockSpeech extends AbsSpeech<SpeechState> {
static get instance(): MockSpeech;
constructor();
/**
* @inheritdoc
*/
speak(text: string, language?: string, rate?: number, pitch?: number): Promise<void>;
/**
* @additional
* Get the last spoken text
*/
getLastSpokenText(): string | null;
/**
* @additional
* Get the last used language
*/
getLastLanguage(): string | null;
/**
* @additional
* Get the last used rate
*/
getLastRate(): number | null;
/**
* @additional
* Get the last used pitch
*/
getLastPitch(): number | null;
/**
* @additional
* Clear speech history
*/
clear(): void;
}
export { MockSpeech };