abort-controller-x
Advanced tools
Comparing version 0.4.1 to 0.4.2
@@ -21,3 +21,3 @@ export declare type EventTargetLike<T> = EventTargetLike.HasEventTargetAddRemove<T> | EventTargetLike.NodeStyleEventEmitter | EventTargetLike.NodeCompatibleEventEmitter | EventTargetLike.JQueryStyleEventEmitter<any, T>; | ||
*/ | ||
export declare function waitForEvent<T>(signal: AbortSignal, target: EventTargetLike<T>, eventName: string, options?: EventTargetLike.EventListenerOptions): Promise<T>; | ||
export declare function waitForEvent<T>(signal: AbortSignal, target: EventTargetLike<T>, eventName: string | symbol, options?: EventTargetLike.EventListenerOptions): Promise<T>; | ||
export declare namespace EventTargetLike { | ||
@@ -34,8 +34,8 @@ interface NodeStyleEventEmitter { | ||
interface JQueryStyleEventEmitter<TContext, T> { | ||
on: (eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
off: (eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
on: (eventName: string | symbol, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
off: (eventName: string | symbol, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
} | ||
interface HasEventTargetAddRemove<E> { | ||
addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void; | ||
removeEventListener(type: string, listener: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void; | ||
addEventListener(type: string | symbol, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void; | ||
removeEventListener(type: string | symbol, listener: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void; | ||
} | ||
@@ -42,0 +42,0 @@ interface EventListenerOptions { |
@@ -21,3 +21,3 @@ export declare type EventTargetLike<T> = EventTargetLike.HasEventTargetAddRemove<T> | EventTargetLike.NodeStyleEventEmitter | EventTargetLike.NodeCompatibleEventEmitter | EventTargetLike.JQueryStyleEventEmitter<any, T>; | ||
*/ | ||
export declare function waitForEvent<T>(signal: AbortSignal, target: EventTargetLike<T>, eventName: string, options?: EventTargetLike.EventListenerOptions): Promise<T>; | ||
export declare function waitForEvent<T>(signal: AbortSignal, target: EventTargetLike<T>, eventName: string | symbol, options?: EventTargetLike.EventListenerOptions): Promise<T>; | ||
export declare namespace EventTargetLike { | ||
@@ -34,8 +34,8 @@ interface NodeStyleEventEmitter { | ||
interface JQueryStyleEventEmitter<TContext, T> { | ||
on: (eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
off: (eventName: string, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
on: (eventName: string | symbol, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
off: (eventName: string | symbol, handler: (this: TContext, t: T, ...args: any[]) => any) => void; | ||
} | ||
interface HasEventTargetAddRemove<E> { | ||
addEventListener(type: string, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void; | ||
removeEventListener(type: string, listener: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void; | ||
addEventListener(type: string | symbol, listener: ((evt: E) => void) | null, options?: boolean | AddEventListenerOptions): void; | ||
removeEventListener(type: string | symbol, listener: ((evt: E) => void) | null, options?: EventListenerOptions | boolean): void; | ||
} | ||
@@ -42,0 +42,0 @@ interface EventListenerOptions { |
{ | ||
"name": "abort-controller-x", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Abortable async function helpers", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1,2 +0,2 @@ | ||
import {execute} from './execute'; | ||
import { execute } from './execute'; | ||
@@ -31,3 +31,3 @@ export type EventTargetLike<T> = | ||
target: EventTargetLike<T>, | ||
eventName: string, | ||
eventName: string | symbol, | ||
options?: EventTargetLike.EventListenerOptions, | ||
@@ -91,7 +91,7 @@ ): Promise<T> { | ||
on: ( | ||
eventName: string, | ||
eventName: string | symbol, | ||
handler: (this: TContext, t: T, ...args: any[]) => any, | ||
) => void; | ||
off: ( | ||
eventName: string, | ||
eventName: string | symbol, | ||
handler: (this: TContext, t: T, ...args: any[]) => any, | ||
@@ -103,3 +103,3 @@ ) => void; | ||
addEventListener( | ||
type: string, | ||
type: string | symbol, | ||
listener: ((evt: E) => void) | null, | ||
@@ -109,3 +109,3 @@ options?: boolean | AddEventListenerOptions, | ||
removeEventListener( | ||
type: string, | ||
type: string | symbol, | ||
listener: ((evt: E) => void) | null, | ||
@@ -130,3 +130,3 @@ options?: EventListenerOptions | boolean, | ||
target: EventTargetLike<T>, | ||
eventName: string, | ||
eventName: string | symbol, | ||
handler: (...args: any[]) => void, | ||
@@ -133,0 +133,0 @@ options?: EventTargetLike.EventListenerOptions, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
175943