UNPKG

1.05 kBTypeScriptView Raw
1import { EventStream } from "./observable";
2/**
3 * JQuery/Zepto integration support
4 */
5export declare const $: {
6 /**
7 Creates an EventStream from events on a
8 jQuery or Zepto.js object. You can pass optional arguments to add a
9 jQuery live selector and/or a function that processes the jQuery
10 event and its parameters, if given, like this:
11
12 ```js
13 $("#my-div").asEventStream("click", ".more-specific-selector")
14 $("#my-div").asEventStream("click", ".more-specific-selector", function(event, args) { return args[0] })
15 $("#my-div").asEventStream("click", function(event, args) { return args[0] })
16 ```
17
18 Note: you need to install the `asEventStream` method on JQuery by calling
19 [init()](#_.aseventstream) as in `Bacon.$.init($)`.
20 */
21 asEventStream(eventName: string, selector: string | undefined, eventTransformer: any): EventStream<any>;
22 /**
23 * Installs the [asEventStream](#_.aseventstream) to the given jQuery/Zepto object (the `$` object).
24 */
25 init(jQuery: any): void;
26};