|
|
import { Handle } from "../interfaces";
|
|
|
|
|
|
/**
|
|
|
* TODO: Type this better
|
|
|
*/
|
|
|
export function _keypress(object: any, listener: EventListener): Handle;
|
|
|
|
|
|
/**
|
|
|
* `dojo.connect` is a deprecated event handling and delegation method in
|
|
|
* Dojo. It allows one function to "listen in" on the execution of
|
|
|
* any other, triggering the second whenever the first is called. Many
|
|
|
* listeners may be attached to a function, and source functions may
|
|
|
* be either regular function calls or DOM events.
|
|
|
*/
|
|
|
export function connect(obj: any, event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
|
|
|
export function connect(event: string, context: any, method: EventListener | string, dontFix?: boolean): Handle;
|
|
|
|
|
|
/**
|
|
|
* Remove a link created by dojo.connect.
|
|
|
*/
|
|
|
export function disconnect(handle: Handle): void;
|
|
|
|
|
|
/**
|
|
|
* Attach a listener to a named topic. The listener function is invoked whenever the
|
|
|
* named topic is published (see: dojo.publish).
|
|
|
* Returns a handle which is needed to unsubscribe this listener.
|
|
|
*/
|
|
|
export function subscribe(topic: string, context: any, method: EventListener): Handle;
|
|
|
|
|
|
/**
|
|
|
* Invoke all listener method subscribed to topic.
|
|
|
*/
|
|
|
export function publish(topic: string, args: any[]): boolean;
|
|
|
|
|
|
/**
|
|
|
* Ensure that every time obj.event() is called, a message is published
|
|
|
* on the topic. Returns a handle which can be passed to
|
|
|
* dojo.disconnect() to disable subsequent automatic publication on
|
|
|
* the topic.
|
|
|
*/
|
|
|
export function connectPublisher(topic: string, obj: any, method: string): Handle;
|
|
|
export function connectPublisher(topic: string, method: EventListener): Handle;
|
|
|
|
|
|
/**
|
|
|
* Checks an event for the copy key (meta on Mac, and ctrl anywhere else)
|
|
|
*/
|
|
|
export function isCopyKey(e: Event): boolean;
|
|
|
|