UNPKG

cabbie-sync

Version:
113 lines (78 loc) 3.47 kB
'use strict'; Object.defineProperty(exports, "__esModule", { value: true }); var _getPrototypeOf = require('babel-runtime/core-js/object/get-prototype-of'); var _getPrototypeOf2 = _interopRequireDefault(_getPrototypeOf); var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck'); var _classCallCheck3 = _interopRequireDefault(_classCallCheck2); var _createClass2 = require('babel-runtime/helpers/createClass'); var _createClass3 = _interopRequireDefault(_createClass2); var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn'); var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2); var _inherits2 = require('babel-runtime/helpers/inherits'); var _inherits3 = _interopRequireDefault(_inherits2); var _addDebugging = require('./add-debugging'); var _addDebugging2 = _interopRequireDefault(_addDebugging); var _baseClass = require('./base-class'); var _baseClass2 = _interopRequireDefault(_baseClass); var _flowRuntime = require('flow-runtime'); var _flowRuntime2 = _interopRequireDefault(_flowRuntime); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } var Alert = function (_BaseClass) { (0, _inherits3.default)(Alert, _BaseClass); function Alert() { (0, _classCallCheck3.default)(this, Alert); return (0, _possibleConstructorReturn3.default)(this, (Alert.__proto__ || (0, _getPrototypeOf2.default)(Alert)).apply(this, arguments)); } (0, _createClass3.default)(Alert, [{ key: 'getText', /* * Gets the text of the currently displayed JavaScript alert(), confirm(), or prompt() dialog */ value: function getText() /*: string*/ { var _returnType = _flowRuntime2.default.return(_flowRuntime2.default.string()); return _returnType.assert(this.requestJSON('GET', '/alert_text')); } /* * Sends keystrokes to a JavaScript prompt() dialog */ }, { key: 'setText', value: function setText(text /*: string*/) /*: void*/ { var _textType = _flowRuntime2.default.string(); var _returnType2 = _flowRuntime2.default.return(_flowRuntime2.default.void()); _flowRuntime2.default.param('text', _textType).assert(text); this.requestJSON('POST', '/alert_text', { text: text }); } /* * Accepts the currently displayed alert dialog. Usually, this is equivalent to * clicking on the 'OK' button in the dialog. */ }, { key: 'accept', value: function accept() /*: void*/ { var _returnType3 = _flowRuntime2.default.return(_flowRuntime2.default.void()); this.requestJSON('POST', '/accept_alert'); } /* * Dismisses the currently displayed alert dialog. For confirm() and prompt() dialogs, * this is equivalent to clicking the 'Cancel' button. For alert() dialogs, this is * equivalent to clicking the 'OK' button. * * Note: Never use this with an alert. Use accept() instead. */ }, { key: 'dismiss', value: function dismiss() /*: void*/ { var _returnType4 = _flowRuntime2.default.return(_flowRuntime2.default.void()); this.requestJSON('POST', '/dismiss_alert'); } }]); return Alert; }(_baseClass2.default); /** * * This file is generated automatically, run npm run build to re-generate. **/ (0, _addDebugging2.default)(Alert); exports.default = Alert;