UNPKG

1.35 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var xstream_1 = require("xstream");
4var adapt_1 = require("@cycle/run/lib/adapt");
5var fromEvent_1 = require("./fromEvent");
6var DocumentDOMSource = /** @class */ (function () {
7 function DocumentDOMSource(_name) {
8 this._name = _name;
9 }
10 DocumentDOMSource.prototype.select = function (selector) {
11 // This functionality is still undefined/undecided.
12 return this;
13 };
14 DocumentDOMSource.prototype.elements = function () {
15 var out = adapt_1.adapt(xstream_1.default.of([document]));
16 out._isCycleSource = this._name;
17 return out;
18 };
19 DocumentDOMSource.prototype.element = function () {
20 var out = adapt_1.adapt(xstream_1.default.of(document));
21 out._isCycleSource = this._name;
22 return out;
23 };
24 DocumentDOMSource.prototype.events = function (eventType, options, bubbles) {
25 if (options === void 0) { options = {}; }
26 var stream;
27 stream = fromEvent_1.fromEvent(document, eventType, options.useCapture, options.preventDefault);
28 var out = adapt_1.adapt(stream);
29 out._isCycleSource = this._name;
30 return out;
31 };
32 return DocumentDOMSource;
33}());
34exports.DocumentDOMSource = DocumentDOMSource;
35//# sourceMappingURL=DocumentDOMSource.js.map
\No newline at end of file