1 | import {EventsFnOptions} from './DOMSource';
|
2 | import {makeDOMDriver as make, VNode, DOMDriverOptions} from './index';
|
3 | import {Stream} from 'most';
|
4 | import {Stream as xsStream} from 'xstream';
|
5 | import {Driver} from '@cycle/run';
|
6 |
|
7 | export interface DOMSource {
|
8 | select(selector: string): DOMSource;
|
9 | elements(): Stream<Array<Element>>;
|
10 | element(): Stream<Element>;
|
11 | events<K extends keyof HTMLElementEventMap>(
|
12 | eventType: K,
|
13 | options?: EventsFnOptions,
|
14 | bubbles?: boolean
|
15 | ): Stream<HTMLElementEventMap[K]>;
|
16 | events(eventType: string, options?: EventsFnOptions): Stream<Event>;
|
17 | }
|
18 |
|
19 | export const makeDOMDriver: (
|
20 | sel: string | Element | DocumentFragment,
|
21 | opts?: DOMDriverOptions
|
22 | ) => Driver<xsStream<VNode>, DOMSource> = make as any;
|