TuilUser
class exported by @mwillbanks/tuil-testing-ink.
class
Public class exported by @mwillbanks/tuil-testing-ink.
export class TuilUser {
constructor(
readonly write: (input: string) => void,
readonly ready: Promise<void>,
) {}
async press(keys: string): Promise<void> {
await this.ready;
this.write(keySequences[keys] ?? keys);
await Bun.sleep(50);
}
async type(value: string): Promise<void> {
await this.ready;
for (const character of value) {
this.write(character);
await Bun.sleep(0);
}
await Bun.sleep(50);
}
}Members
| Member | Type | Required | Description | Related types |
|---|---|---|---|---|
__constructor | any | Yes | The __constructor member uses the any contract. | — |
press | (keys: string) => Promise<void> | Yes | The press member uses the (keys: string) => Promise<void> contract. | — |
type | (value: string) => Promise<void> | Yes | The type member uses the (value: string) => Promise<void> contract. | — |
Parameters
This declaration has no public members.
Returns
This declaration does not return a value.
Throws
No thrown errors are documented for this declaration.
Related types
No package-local related types.
Source
View the secondary source reference