scriptable-testlab
Version:
A lightweight, efficient tool designed to manage and update scripts for Scriptable.
50 lines • 1.29 kB
JavaScript
var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
import { AbsMessage } from "scriptable-abstract";
const DEFAULT_STATE = {
recipients: [],
body: ""
};
const _MockMessage = class _MockMessage extends AbsMessage {
static get instance() {
if (!this._instance) {
this._instance = new _MockMessage();
}
return this._instance;
}
constructor() {
super(DEFAULT_STATE);
}
get recipients() {
return [...this.state.recipients];
}
set recipients(value) {
this.setState({ recipients: [...value] });
}
get body() {
return this.state.body;
}
set body(value) {
this.setState({ body: value });
}
/**
* Send the message.
* @returns A promise that resolves when the message is sent
*/
async send() {
return Promise.resolve();
}
/**
* Clear the message details
*/
clear() {
this.setState(DEFAULT_STATE);
}
};
__publicField(_MockMessage, "_instance", null);
let MockMessage = _MockMessage;
export {
MockMessage
};
//# sourceMappingURL=message.js.map