| 5 | import {fromEvent} from './fromEvent'; |
| 6 | |
| 7 | export class DocumentDOMSource implements DOMSource { |
| 8 | constructor(private _name: string) { |
| 9 | } |
| 10 | |
| 11 | public select(selector: string): DOMSource { |
| 12 | // This functionality is still undefined/undecided. |
| 13 | return this; |
| 14 | } |
| 15 | |
| 16 | public elements(): MemoryStream<Document> { |
| 17 | const out: DevToolEnabledSource & MemoryStream<Document> = |
| 18 | adapt(xs.of(document)); |
| 19 | out._isCycleSource = this._name; |
| 20 | return out; |
| 21 | } |
| 22 | |
| 23 | public events(eventType: string, options: EventsFnOptions = {}): Stream<Event> { |
| 24 | let stream: Stream<Event>; |
| 25 | if (options && typeof options.useCapture === 'boolean') { |
| 26 | stream = fromEvent(document, eventType, options.useCapture); |
| 27 | } else { |
| 28 | stream = fromEvent(document, eventType); |
| 29 | } |
| 30 | const out: DevToolEnabledSource & Stream<Event> = adapt(stream); |
| 31 | out._isCycleSource = this._name; |
| 32 | return out; |
| 33 | } |
| 34 | } |
nothing calls this directly
no outgoing calls
no test coverage detected