@thednp/event-listener
Advanced tools
Comparing version 2.0.4 to 2.0.5
@@ -1,22 +0,18 @@ | ||
/** | ||
* Type definitions addapted from React 18.2 | ||
* Project: https://react.dev/ | ||
*/ | ||
export type NativeAnimationEvent = AnimationEvent; | ||
export type NativeClipboardEvent = ClipboardEvent; | ||
export type NativeCompositionEvent = CompositionEvent; | ||
export type NativeDragEvent = DragEvent; | ||
export type NativeFocusEvent = FocusEvent; | ||
export type NativeKeyboardEvent = KeyboardEvent; | ||
export type NativeMouseEvent = MouseEvent; | ||
export type NativeTouchEvent = TouchEvent; | ||
export type NativePointerEvent = PointerEvent; | ||
export type NativeTransitionEvent = TransitionEvent; | ||
export type NativeUIEvent = UIEvent; | ||
export type NativeWheelEvent = WheelEvent; | ||
export interface AbstractView { | ||
type NativeAnimationEvent = AnimationEvent$1; | ||
type NativeClipboardEvent = ClipboardEvent$1; | ||
type NativeCompositionEvent = CompositionEvent$1; | ||
type NativeDragEvent = DragEvent$1; | ||
type NativeFocusEvent = FocusEvent$1; | ||
type NativeKeyboardEvent = KeyboardEvent$1; | ||
type NativeMouseEvent = MouseEvent$1; | ||
type NativeTouchEvent = TouchEvent$1; | ||
type NativePointerEvent = PointerEvent$1; | ||
type NativeTransitionEvent = TransitionEvent$1; | ||
type NativeUIEvent = UIEvent$1; | ||
type NativeWheelEvent = WheelEvent$1; | ||
interface AbstractView { | ||
styleMedia: StyleMedia; | ||
document: Document; | ||
} | ||
export interface BaseEvent<E = Event, C = unknown, T = unknown> { | ||
interface BaseEvent<E = Event, C = unknown, T = unknown> { | ||
nativeEvent: E; | ||
@@ -46,12 +42,12 @@ currentTarget: C | null; | ||
export type NativeEvent<T = Element, E = Event> = BaseEvent<E, T, T>; | ||
export interface ClipboardEvent<T = Element> extends NativeEvent<T, NativeClipboardEvent> { | ||
interface ClipboardEvent$1<T = Element> extends NativeEvent<T, NativeClipboardEvent> { | ||
clipboardData: DataTransfer; | ||
} | ||
export interface CompositionEvent<T = Element> extends NativeEvent<T, NativeCompositionEvent> { | ||
interface CompositionEvent$1<T = Element> extends NativeEvent<T, NativeCompositionEvent> { | ||
data: string; | ||
} | ||
export interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> { | ||
interface DragEvent$1<T = Element> extends MouseEvent$1<T, NativeDragEvent> { | ||
dataTransfer: DataTransfer; | ||
} | ||
export interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> { | ||
interface PointerEvent$1<T = Element> extends MouseEvent$1<T, NativePointerEvent> { | ||
pointerId: number; | ||
@@ -68,7 +64,7 @@ pressure: number; | ||
} | ||
export interface FocusEvent<T = Element, R = Element> extends NativeEvent<T, NativeFocusEvent> { | ||
interface FocusEvent$1<T = Element, R = Element> extends NativeEvent<T, NativeFocusEvent> { | ||
relatedTarget: (EventTarget & R) | null; | ||
target: EventTarget & T; | ||
} | ||
export type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; | ||
type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement; | ||
export type FormEvent<T = FormControl> = NativeEvent<T>; | ||
@@ -78,4 +74,4 @@ export interface ChangeEvent<T = FormControl> extends FormEvent<T> { | ||
} | ||
export type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock"; | ||
export interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> { | ||
type ModifierKey = "Alt" | "AltGraph" | "CapsLock" | "Control" | "Fn" | "FnLock" | "Hyper" | "Meta" | "NumLock" | "ScrollLock" | "Shift" | "Super" | "Symbol" | "SymbolLock"; | ||
interface KeyboardEvent$1<T = Element> extends UIEvent$1<T, NativeKeyboardEvent> { | ||
altKey: boolean; | ||
@@ -104,3 +100,3 @@ /** @deprecated */ | ||
} | ||
export interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> { | ||
interface MouseEvent$1<T = Element, E = NativeMouseEvent> extends UIEvent$1<T, E> { | ||
altKey: boolean; | ||
@@ -126,3 +122,3 @@ button: number; | ||
} | ||
export interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> { | ||
interface TouchEvent$1<T = Element> extends UIEvent$1<T, NativeTouchEvent> { | ||
altKey: boolean; | ||
@@ -140,7 +136,7 @@ changedTouches: TouchList; | ||
} | ||
export interface UIEvent<T = Element, E = NativeUIEvent> extends NativeEvent<T, E> { | ||
interface UIEvent$1<T = Element, E = NativeUIEvent> extends NativeEvent<T, E> { | ||
detail: number; | ||
view: AbstractView; | ||
} | ||
export interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> { | ||
interface WheelEvent$1<T = Element> extends MouseEvent$1<T, NativeWheelEvent> { | ||
deltaMode: number; | ||
@@ -151,3 +147,3 @@ deltaX: number; | ||
} | ||
export interface AnimationEvent<T = Element> extends NativeEvent<T, NativeAnimationEvent> { | ||
interface AnimationEvent$1<T = Element> extends NativeEvent<T, NativeAnimationEvent> { | ||
animationName: string; | ||
@@ -157,3 +153,3 @@ elapsedTime: number; | ||
} | ||
export interface TransitionEvent<T = Element> extends NativeEvent<T, NativeTransitionEvent> { | ||
interface TransitionEvent$1<T = Element> extends NativeEvent<T, NativeTransitionEvent> { | ||
elapsedTime: number; | ||
@@ -163,18 +159,18 @@ propertyName: string; | ||
} | ||
export type EventHandler<T = Element, E = Event | NativeEvent<T>> = (event: E) => void; | ||
type EventHandler<T = Element, E = Event | NativeEvent<T>> = (event: E) => void; | ||
export type NativeEventHandler<T = Element> = EventHandler<T, NativeEvent<T>>; | ||
export type ClipboardEventHandler<T = Element> = EventHandler<T, ClipboardEvent<T>>; | ||
export type CompositionEventHandler<T = Element> = EventHandler<T, CompositionEvent<T>>; | ||
export type DragEventHandler<T = Element> = EventHandler<T, DragEvent<T>>; | ||
export type FocusEventHandler<T = Element> = EventHandler<T, FocusEvent<T>>; | ||
export type ClipboardEventHandler<T = Element> = EventHandler<T, ClipboardEvent$1<T>>; | ||
export type CompositionEventHandler<T = Element> = EventHandler<T, CompositionEvent$1<T>>; | ||
export type DragEventHandler<T = Element> = EventHandler<T, DragEvent$1<T>>; | ||
export type FocusEventHandler<T = Element> = EventHandler<T, FocusEvent$1<T>>; | ||
export type FormEventHandler<T = Element> = EventHandler<T, FormEvent<T>>; | ||
export type ChangeEventHandler<T = Element> = EventHandler<T, ChangeEvent<T>>; | ||
export type KeyboardEventHandler<T = Element> = EventHandler<T, KeyboardEvent<T>>; | ||
export type MouseEventHandler<T = Element> = EventHandler<T, MouseEvent<T>>; | ||
export type TouchEventHandler<T = Element> = EventHandler<T, TouchEvent<T>>; | ||
export type PointerEventHandler<T = Element> = EventHandler<T, PointerEvent<T>>; | ||
export type UIEventHandler<T = Element> = EventHandler<T, UIEvent<T>>; | ||
export type WheelEventHandler<T = Element> = EventHandler<T, WheelEvent<T>>; | ||
export type AnimationEventHandler<T = Element> = EventHandler<T, AnimationEvent<T>>; | ||
export type TransitionEventHandler<T = Element> = EventHandler<T, TransitionEvent<T>>; | ||
export type KeyboardEventHandler<T = Element> = EventHandler<T, KeyboardEvent$1<T>>; | ||
export type MouseEventHandler<T = Element> = EventHandler<T, MouseEvent$1<T>>; | ||
export type TouchEventHandler<T = Element> = EventHandler<T, TouchEvent$1<T>>; | ||
export type PointerEventHandler<T = Element> = EventHandler<T, PointerEvent$1<T>>; | ||
export type UIEventHandler<T = Element> = EventHandler<T, UIEvent$1<T>>; | ||
export type WheelEventHandler<T = Element> = EventHandler<T, WheelEvent$1<T>>; | ||
export type AnimationEventHandler<T = Element> = EventHandler<T, AnimationEvent$1<T>>; | ||
export type TransitionEventHandler<T = Element> = EventHandler<T, TransitionEvent$1<T>>; | ||
export type PossibleEventTarget = EventTarget & (Element | Document | Window); | ||
@@ -205,4 +201,19 @@ export type EventRegistryEntry<T = EventTarget, H = NativeEventHandler<T>> = Map<H, AddEventListenerOptions | undefined | boolean>; | ||
export { | ||
AnimationEvent$1 as AnimationEvent, | ||
ClipboardEvent$1 as ClipboardEvent, | ||
CompositionEvent$1 as CompositionEvent, | ||
DragEvent$1 as DragEvent, | ||
FocusEvent$1 as FocusEvent, | ||
KeyboardEvent$1 as KeyboardEvent, | ||
MouseEvent$1 as MouseEvent, | ||
PointerEvent$1 as PointerEvent, | ||
TouchEvent$1 as TouchEvent, | ||
TransitionEvent$1 as TransitionEvent, | ||
UIEvent$1 as UIEvent, | ||
WheelEvent$1 as WheelEvent, | ||
}; | ||
export as namespace Listener; | ||
export {}; |
{ | ||
"name": "@thednp/event-listener", | ||
"author": "thednp", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "Modern event listener for efficient web applications based on subscribe-publish pattern.", | ||
@@ -40,14 +40,14 @@ "license": "MIT", | ||
"devDependencies": { | ||
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.0", | ||
"@cypress/code-coverage": "^3.12.0", | ||
"@types/istanbul-lib-instrument": "^1.7.4", | ||
"@bahmutov/cypress-esbuild-preprocessor": "^2.2.1", | ||
"@cypress/code-coverage": "^3.12.43", | ||
"@types/istanbul-lib-instrument": "^1.7.7", | ||
"@typescript-eslint/eslint-plugin": "^5.62.0", | ||
"@typescript-eslint/parser": "^5.62.0", | ||
"cypress": "^12.17.4", | ||
"dts-bundle-generator": "^8.0.1", | ||
"eslint": "^8.48.0", | ||
"eslint-plugin-jsdoc": "^46.5.1", | ||
"dts-bundle-generator": "^9.5.1", | ||
"eslint": "^8.57.0", | ||
"eslint-plugin-jsdoc": "^46.10.1", | ||
"eslint-plugin-prefer-arrow": "^1.2.3", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"istanbul-lib-coverage": "^3.2.0", | ||
"istanbul-lib-coverage": "^3.2.2", | ||
"istanbul-lib-instrument": "^5.2.1", | ||
@@ -57,7 +57,6 @@ "ncp": "^2.0.0", | ||
"prettier": "^2.8.8", | ||
"rimraf": "^5.0.1", | ||
"typescript": "^5.2.2", | ||
"vite": "^4.4.9" | ||
"rimraf": "^5.0.9", | ||
"typescript": "^5.5.3", | ||
"vite": "^5.3.4" | ||
}, | ||
"packageManager": "pnpm@8.6.12", | ||
"engines": { | ||
@@ -69,2 +68,3 @@ "node": ">=16", | ||
"pre-test": "pnpm clean-coverage", | ||
"badges": "npx -p dependency-version-badge update-badge eslint typescript vite prettier cypress", | ||
"test": "pnpm pre-test && cypress run", | ||
@@ -78,3 +78,3 @@ "clean-coverage": "rimraf coverage .nyc_output", | ||
"fix:ts": "eslint -c .eslintrc.cjs --ext .ts src --fix", | ||
"dts": "dts-bundle-generator --config ./dts.config.ts", | ||
"dts": "dts-bundle-generator --config ./dts.config.cjs", | ||
"build": "pnpm check:ts && pnpm lint:ts && vite build && pnpm dts", | ||
@@ -81,0 +81,0 @@ "docs": "ncp dist/event-listener.js docs/event-listener.js && ncp dist/event-listener.js.map docs/event-listener.js.map" |
@@ -9,5 +9,5 @@ ## EventListener | ||
[![cypress version](https://img.shields.io/badge/cypress-12.17.4-brightgreen)](https://cypress.io/) | ||
[![typescript version](https://img.shields.io/badge/typescript-5.2.2-brightgreen)](https://www.typescriptlang.org/) | ||
[![eslint version](https://img.shields.io/badge/eslint-8.48.0-brightgreen)](https://github.com/eslint) | ||
[![vite version](https://img.shields.io/badge/vite-4.4.9-brightgreen)](https://github.com/vitejs) | ||
[![typescript version](https://img.shields.io/badge/typescript-5.5.3-brightgreen)](https://www.typescriptlang.org/) | ||
[![eslint version](https://img.shields.io/badge/eslint-8.57.0-brightgreen)](https://github.com/eslint) | ||
[![vite version](https://img.shields.io/badge/vite-5.3.4-brightgreen)](https://github.com/vitejs) | ||
[![prettier version](https://img.shields.io/badge/prettier-2.8.8-brightgreen)](https://prettier.io/) | ||
@@ -14,0 +14,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"lib": ["DOM", "ESNext", "DOM.Iterable"], | ||
"types": ["vite", "vite/client"], | ||
// "types": ["vite", "vite/client"], | ||
"rootDir": "./src", | ||
@@ -25,6 +25,6 @@ "baseUrl": "./", | ||
"allowSyntheticDefaultImports": true, | ||
"noEmit": true, | ||
"noEmit": true | ||
}, | ||
"include": ["src/*"], | ||
"exclude": ["node_modules", "experiments", "coverage", "dist"], | ||
"exclude": ["node_modules", "experiments", "coverage", "dist"] | ||
} |
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
86442
40
1346