scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
81 lines (78 loc) • 2.47 kB
text/typescript
import { AbsCalendarEvent } from 'scriptable-abstract';
/**
* State interface for CalendarEvent mock
*/
interface CalendarEventState {
identifier: string;
title: string;
location: string;
notes: string;
startDate: Date;
endDate: Date;
isAllDay: boolean;
attendees: Array<{
isCurrentUser: boolean;
name: string;
status: string;
type: string;
role: string;
}>;
availability: 'busy' | 'free' | 'tentative' | 'unavailable';
timeZone: string;
calendar: any;
}
/**
* Mock implementation of Scriptable's CalendarEvent.
* Represents a calendar event that can be created, modified and removed.
*/
declare class MockCalendarEvent extends AbsCalendarEvent<CalendarEventState> {
private static _instance;
static get instance(): MockCalendarEvent;
constructor();
/**
* _Creates a new calendar event._
* @param calendar - Calendar to create the event in.
* @see https://docs.scriptable.app/calendarevent/#new-calendarevent
*/
static create(calendar: any): MockCalendarEvent;
/**
* _Saves the calendar event._
* @see https://docs.scriptable.app/calendarevent/#-save
*/
save(): Promise<void>;
/**
* _Removes the calendar event._
* @see https://docs.scriptable.app/calendarevent/#-remove
*/
remove(): Promise<void>;
/**
* _Presents a view for editing the calendar event._
* @see https://docs.scriptable.app/calendarevent/#-presentedit
*/
presentEdit(): Promise<MockCalendarEvent>;
/**
* _Presents a view for creating a new calendar event._
* @see https://docs.scriptable.app/calendarevent/#presentcreate
*/
static presentCreate(): Promise<MockCalendarEvent>;
get identifier(): string;
get title(): string;
set title(value: string);
get location(): string;
set location(value: string);
get notes(): string;
set notes(value: string);
get startDate(): Date;
set startDate(value: Date);
get endDate(): Date;
set endDate(value: Date);
get isAllDay(): boolean;
set isAllDay(value: boolean);
get attendees(): CalendarEventState['attendees'];
get availability(): CalendarEventState['availability'];
set availability(value: CalendarEventState['availability']);
get timeZone(): string;
set timeZone(value: string);
get calendar(): any;
}
export { type CalendarEventState, MockCalendarEvent };