scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
52 lines (49 loc) • 1.61 kB
TypeScript
import { AbsDatePicker } from 'scriptable-abstract';
interface DatePickerState {
minimumDate: Date | null;
maximumDate: Date | null;
countdownDuration: number;
minuteInterval: number;
initialDate: Date;
}
/**
* Mock implementation of Scriptable's DatePicker.
* Provides a user interface for selecting dates and times.
* @implements DatePicker
*/
declare class MockDatePicker extends AbsDatePicker<DatePickerState> {
constructor();
private validateDateRange;
private validateMinMaxDates;
get minimumDate(): Date | null;
set minimumDate(value: Date | null);
get maximumDate(): Date | null;
set maximumDate(value: Date | null);
get countdownDuration(): number;
set countdownDuration(value: number);
get minuteInterval(): number;
set minuteInterval(value: number);
get initialDate(): Date;
set initialDate(value: Date);
/**
* Presents the date picker to the user.
* @returns A promise that resolves with the selected date.
*/
pickDate(): Promise<Date>;
/**
* Presents the time picker to the user.
* @returns A promise that resolves with the selected date.
*/
pickTime(): Promise<Date>;
/**
* Presents the countdown duration picker to the user.
* @returns A promise that resolves with the selected duration in seconds.
*/
pickCountdownDuration(): Promise<number>;
/**
* Presents the date picker displaying date and time.
* @returns A promise that resolves with the selected date.
*/
pickDateAndTime(): Promise<Date>;
}
export { MockDatePicker };