Squashed overloads for 'on' in 'clipboard'.

Technically, Clipboard should extend the emitter class from 'tiny-emitter'.
This commit is contained in:
Daniel Rosenwasser
2016-12-24 13:31:54 -05:00
parent 31972f078c
commit 2d78b6c3b1
+3 -4
View File
@@ -8,12 +8,11 @@ declare class Clipboard {
/**
* Subscribes to events that indicate the result of a copy/cut operation.
* @param type {string} Event type ('success' or 'error').
* @param type {"success" | "error"} Event type ('success' or 'error').
* @param handler Callback function.
*/
on(type: "success", handler: (e: Clipboard.Event) => void): this;
on(type: "error", handler: (e: Clipboard.Event) => void): this;
on(type: string, handler: (e: Clipboard.Event) => void): this;
on(type: "success" | "error", handler: (e: Clipboard.Event) => void): this;
on(type: string, handler: (...args: any[]) => void): this;
/**
* Clears all event bindings.