Skip to content

Commit

Permalink
Fix - Typescript: this is now an HTMLElement in event handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanJard committed Oct 25, 2023
1 parent 04ea6b7 commit 60a142e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions types/types.d.ts
Expand Up @@ -813,7 +813,7 @@ export interface Api<T> {
* @param callback Specific callback function to remove if you want to unbind a single event listener.
* @returns DataTables Api instance
*/
off(event: string, callback?: ((e: Event, ...args: any[]) => void)): Api<T>;
off(event: string, callback?: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Remove event handlers from selected elements
Expand All @@ -823,7 +823,7 @@ export interface Api<T> {
* @param callback Specific callback function to remove if you want to unbind a single event listener.
* @returns DataTables Api instance
*/
off(event: string, selector: string, callback?: ((e: Event, ...args: any[]) => void)): Api<T>;
off(event: string, selector: string, callback?: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Table events listener.
Expand All @@ -832,7 +832,7 @@ export interface Api<T> {
* @param callback Specific callback function to remove if you want to unbind a single event listener.
* @returns DataTables Api instance
*/
on(event: string, callback: ((e: Event, ...args: any[]) => void)): Api<T>;
on(event: string, callback: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Listen for events from selected elements
Expand All @@ -842,7 +842,7 @@ export interface Api<T> {
* @param callback Event handler.
* @returns DataTables Api instance
*/
on(event: string, selector: string, callback: ((e: Event, ...args: any[]) => void)): Api<T>;
on(event: string, selector: string, callback: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Listen for a table event once and then remove the listener.
Expand All @@ -852,7 +852,7 @@ export interface Api<T> {
* Listen for events from tables and fire a callback when they occur
* @returns DataTables Api instance
*/
one(event: string, callback: ((e: Event, ...args: any[]) => void)): Api<T>;
one(event: string, callback: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Listen for events from a selected element and trigger only once then remove the listener.
Expand All @@ -862,7 +862,7 @@ export interface Api<T> {
* @param callback Event handler.
* @returns DataTables Api instance
*/
one(event: string, selector: string, callback: ((e: Event, ...args: any[]) => void)): Api<T>;
one(event: string, selector: string, callback: ((this: HTMLElement, e: Event, ...args: any[]) => void)): Api<T>;

/**
* Page Methods / object
Expand Down

0 comments on commit 60a142e

Please sign in to comment.