tuil
ReferencePackages@mwillbanks/tuil-testing-inkAPI

TuilUser

class exported by @mwillbanks/tuil-testing-ink.

View rawEdit

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

MemberTypeRequiredDescriptionRelated types
__constructoranyYesThe __constructor member uses the any contract.
press(keys: string) => Promise<void>YesThe press member uses the (keys: string) => Promise<void> contract.
type(value: string) => Promise<void>YesThe 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.

No package-local related types.

Source

View the secondary source reference

Package

@mwillbanks/tuil-testing-ink

On this page