-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,5 +2,6 @@ | |
* Delegates event to a selector. | ||
*/ | ||
declare type CombinedElements = EventTarget | EventTarget[] | NodeListOf<Element> | String; | ||
declare const _default: (elements: CombinedElements, selector: string, type: string, callback: () => any, useCapture: boolean | AddEventListenerOptions) => any; | ||
export = _default; | ||
declare function delegate(selector: string, type: string, callback?: Function, useCapture?: boolean | AddEventListenerOptions): object; | ||
declare function delegate(elements: CombinedElements, selector: string, type: string, callback?: Function, useCapture?: boolean | AddEventListenerOptions): object; | ||
export = delegate; | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sindresorhus
Collaborator
|
export =
is the legacy TS syntax. You should be using this:You might be able to export the functions directly. I'm not sure if TS supports overloaded exports.
Also note that it should be
string
, notString
.And I would recommend typing
Function
to be more specific.And the return value should be more explicitly typed (The
.destroy()
) method.