UNPKG

scriptable-testlab

Version:

A lightweight, efficient tool designed to manage and update scripts for Scriptable.

38 lines (35 loc) 1.25 kB
import { AbsAlert } from 'scriptable-abstract'; import { MockTextField } from './text-field.js'; import './color.js'; interface AlertMockState { title: string; message: string; actions: string[]; textFields: MockTextField[]; destructiveActionIndex: number; cancelActionIndex: number; presentedResult: number; } declare class MockAlert extends AbsAlert<AlertMockState> { constructor(); get title(): string; set title(value: string); get message(): string; set message(value: string); get actions(): readonly string[]; get textFields(): readonly MockTextField[]; get destructiveAction(): string | undefined; get cancelAction(): string | undefined; addAction(title: string): void; addDestructiveAction(title: string): void; addCancelAction(title: string): void; addTextField(placeholder?: string, text?: string): TextField; addSecureTextField(placeholder?: string, text?: string): TextField; textFieldValue(index: number): string; setPresentedResult(result: number): void; presentAlert(): Promise<number>; presentSheet(): Promise<number>; present(): Promise<number>; setState(newState: Partial<AlertMockState>): this; } export { MockAlert };