@thednp/shorty 2.0.0-alpha16 → 2.0.0-alpha18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +0 -0
- package/.lgtm.yml +0 -0
- package/.prettierrc.json +0 -0
- package/LICENSE +0 -0
- package/README.md +4 -4
- package/cypress/e2e/att.cy.ts +0 -0
- package/cypress/e2e/boolean.cy.ts +0 -0
- package/cypress/e2e/class.cy.ts +0 -0
- package/cypress/e2e/event.cy.ts +0 -0
- package/cypress/e2e/get.cy.ts +0 -0
- package/cypress/e2e/is.cy.ts +0 -0
- package/cypress/e2e/misc.cy.ts +0 -0
- package/cypress/e2e/selectors.cy.ts +0 -0
- package/cypress/fixtures/custom-elem.js +0 -0
- package/cypress/plugins/esbuild-istanbul.ts +0 -0
- package/cypress/plugins/tsCompile.ts +0 -0
- package/cypress/support/commands.ts +0 -0
- package/cypress/support/e2e.ts +0 -0
- package/cypress/support/index.js +0 -0
- package/cypress/test.html +0 -0
- package/cypress.config.ts +0 -0
- package/dist/shorty.cjs +1 -1
- package/dist/shorty.cjs.map +1 -1
- package/dist/shorty.d.ts +200 -4
- package/dist/shorty.js +1 -1
- package/dist/shorty.js.map +1 -1
- package/dist/shorty.mjs +191 -179
- package/dist/shorty.mjs.map +1 -1
- package/dts.config.ts +0 -0
- package/package.json +71 -66
- package/src/attr/getAttribute.ts +0 -0
- package/src/attr/getAttributeNS.ts +0 -0
- package/src/attr/hasAttribute.ts +0 -0
- package/src/attr/hasAttributeNS.ts +0 -0
- package/src/attr/removeAttribute.ts +0 -0
- package/src/attr/removeAttributeNS.ts +0 -0
- package/src/attr/setAttribute.ts +0 -0
- package/src/attr/setAttributeNS.ts +0 -0
- package/src/blocks/documentBody.ts +0 -0
- package/src/blocks/documentElement.ts +0 -0
- package/src/blocks/documentHead.ts +0 -0
- package/src/boolean/isApple.ts +0 -0
- package/src/boolean/isFirefox.ts +0 -0
- package/src/boolean/isMobile.ts +0 -0
- package/src/boolean/support3DTransform.ts +0 -0
- package/src/boolean/supportAnimation.ts +0 -0
- package/src/boolean/supportPassive.ts +0 -0
- package/src/boolean/supportTouch.ts +0 -0
- package/src/boolean/supportTransform.ts +0 -0
- package/src/boolean/supportTransition.ts +0 -0
- package/src/class/addClass.ts +0 -0
- package/src/class/hasClass.ts +0 -0
- package/src/class/removeClass.ts +0 -0
- package/src/event/off.ts +6 -4
- package/src/event/on.ts +6 -4
- package/src/event/one.ts +26 -8
- package/src/get/getBoundingClientRect.ts +0 -0
- package/src/get/getDocument.ts +0 -0
- package/src/get/getDocumentBody.ts +0 -0
- package/src/get/getDocumentElement.ts +0 -0
- package/src/get/getDocumentHead.ts +0 -0
- package/src/get/getElementAnimationDelay.ts +0 -0
- package/src/get/getElementAnimationDuration.ts +0 -0
- package/src/get/getElementStyle.ts +0 -0
- package/src/get/getElementTransitionDelay.ts +0 -0
- package/src/get/getElementTransitionDuration.ts +0 -0
- package/src/get/getNodeScroll.ts +0 -0
- package/src/get/getParentNode.ts +0 -0
- package/src/get/getRectRelativeToOffsetParent.ts +0 -0
- package/src/get/getUID.ts +0 -0
- package/src/get/getWindow.ts +0 -0
- package/src/index.ts +4 -0
- package/src/interface/boundingClientRect.d.ts +0 -0
- package/src/interface/css4Declaration.d.ts +0 -0
- package/src/interface/customElement.d.ts +0 -0
- package/src/interface/event.d.ts +337 -0
- package/src/interface/navigatorUA.d.ts +0 -0
- package/src/interface/offsetRect.d.ts +0 -0
- package/src/interface/originalEvent.d.ts +0 -0
- package/src/is/isArray.ts +0 -0
- package/src/is/isCanvas.ts +0 -0
- package/src/is/isCustomElement.ts +0 -0
- package/src/is/isDocument.ts +0 -0
- package/src/is/isElement.ts +0 -0
- package/src/is/isElementInScrollRange.ts +0 -0
- package/src/is/isElementInViewport.ts +0 -0
- package/src/is/isElementsArray.ts +0 -0
- package/src/is/isFunction.ts +0 -0
- package/src/is/isHTMLCollection.ts +0 -0
- package/src/is/isHTMLElement.ts +0 -0
- package/src/is/isHTMLImageElement.ts +0 -0
- package/src/is/isJSON.ts +0 -0
- package/src/is/isMap.ts +0 -0
- package/src/is/isMedia.ts +0 -0
- package/src/is/isNode.ts +0 -0
- package/src/is/isNodeList.ts +0 -0
- package/src/is/isNumber.ts +0 -0
- package/src/is/isObject.ts +0 -0
- package/src/is/isRTL.ts +0 -0
- package/src/is/isSVGElement.ts +0 -0
- package/src/is/isScaledElement.ts +0 -0
- package/src/is/isShadowRoot.ts +0 -0
- package/src/is/isString.ts +0 -0
- package/src/is/isTableElement.ts +0 -0
- package/src/is/isWeakMap.ts +0 -0
- package/src/is/isWindow.ts +0 -0
- package/src/misc/ArrayFrom.ts +0 -0
- package/src/misc/Float32ArrayFrom.ts +0 -0
- package/src/misc/Float64ArrayFrom.ts +0 -0
- package/src/misc/ObjectAssign.ts +0 -0
- package/src/misc/ObjectEntries.ts +0 -0
- package/src/misc/ObjectFromEntries.ts +11 -0
- package/src/misc/ObjectHasOwn.ts +0 -0
- package/src/misc/ObjectKeys.ts +0 -0
- package/src/misc/ObjectValues.ts +0 -0
- package/src/misc/createCustomEvent.ts +0 -0
- package/src/misc/createElement.ts +0 -0
- package/src/misc/createElementNS.ts +0 -0
- package/src/misc/data.ts +0 -0
- package/src/misc/dispatchEvent.ts +0 -0
- package/src/misc/distinct.ts +0 -0
- package/src/misc/emulateAnimationEnd.ts +0 -0
- package/src/misc/emulateTransitionEnd.ts +0 -0
- package/src/misc/focus.ts +0 -0
- package/src/misc/getInstance.ts +0 -0
- package/src/misc/noop.ts +0 -0
- package/src/misc/normalizeOptions.ts +0 -0
- package/src/misc/normalizeValue.ts +0 -0
- package/src/misc/passiveHandler.ts +0 -0
- package/src/misc/reflow.ts +0 -0
- package/src/misc/setElementStyle.ts +0 -0
- package/src/misc/timer.ts +0 -0
- package/src/misc/toLowerCase.ts +0 -0
- package/src/misc/toUpperCase.ts +0 -0
- package/src/selectors/closest.ts +0 -0
- package/src/selectors/getCustomElements.ts +0 -0
- package/src/selectors/getElementById.ts +0 -0
- package/src/selectors/getElementsByClassName.ts +0 -0
- package/src/selectors/getElementsByTagName.ts +0 -0
- package/src/selectors/matches.ts +0 -0
- package/src/selectors/querySelector.ts +0 -0
- package/src/selectors/querySelectorAll.ts +0 -0
- package/src/strings/DOMContentLoadedEvent.ts +0 -0
- package/src/strings/DOMMouseScrollEvent.ts +0 -0
- package/src/strings/abortEvent.ts +0 -0
- package/src/strings/addEventListener.ts +0 -0
- package/src/strings/animationDelay.ts +0 -0
- package/src/strings/animationDuration.ts +0 -0
- package/src/strings/animationEndEvent.ts +0 -0
- package/src/strings/animationName.ts +0 -0
- package/src/strings/ariaChecked.ts +0 -0
- package/src/strings/ariaDescribedBy.ts +0 -0
- package/src/strings/ariaDescription.ts +0 -0
- package/src/strings/ariaExpanded.ts +0 -0
- package/src/strings/ariaHasPopup.ts +0 -0
- package/src/strings/ariaHidden.ts +0 -0
- package/src/strings/ariaLabel.ts +0 -0
- package/src/strings/ariaLabelledBy.ts +0 -0
- package/src/strings/ariaModal.ts +0 -0
- package/src/strings/ariaPressed.ts +0 -0
- package/src/strings/ariaSelected.ts +0 -0
- package/src/strings/ariaValueMax.ts +0 -0
- package/src/strings/ariaValueMin.ts +0 -0
- package/src/strings/ariaValueNow.ts +0 -0
- package/src/strings/ariaValueText.ts +0 -0
- package/src/strings/beforeunloadEvent.ts +0 -0
- package/src/strings/bezierEasings.ts +0 -0
- package/src/strings/blurEvent.ts +0 -0
- package/src/strings/changeEvent.ts +0 -0
- package/src/strings/contextmenuEvent.ts +0 -0
- package/src/strings/dragEvent.ts +0 -0
- package/src/strings/dragendEvent.ts +0 -0
- package/src/strings/dragenterEvent.ts +0 -0
- package/src/strings/dragleaveEvent.ts +0 -0
- package/src/strings/dragoverEvent.ts +0 -0
- package/src/strings/dragstartEvent.ts +0 -0
- package/src/strings/errorEvent.ts +0 -0
- package/src/strings/focusEvent.ts +0 -0
- package/src/strings/focusEvents.ts +0 -0
- package/src/strings/focusinEvent.ts +0 -0
- package/src/strings/focusoutEvent.ts +0 -0
- package/src/strings/gesturechangeEvent.ts +0 -0
- package/src/strings/gestureendEvent.ts +0 -0
- package/src/strings/gesturestartEvent.ts +0 -0
- package/src/strings/keyAlt.ts +0 -0
- package/src/strings/keyArrowDown.ts +0 -0
- package/src/strings/keyArrowLeft.ts +0 -0
- package/src/strings/keyArrowRight.ts +0 -0
- package/src/strings/keyArrowUp.ts +0 -0
- package/src/strings/keyBackspace.ts +0 -0
- package/src/strings/keyCapsLock.ts +0 -0
- package/src/strings/keyControl.ts +0 -0
- package/src/strings/keyDelete.ts +0 -0
- package/src/strings/keyEnter.ts +0 -0
- package/src/strings/keyEscape.ts +0 -0
- package/src/strings/keyInsert.ts +0 -0
- package/src/strings/keyMeta.ts +0 -0
- package/src/strings/keyNumpadEnter.ts +7 -0
- package/src/strings/keyPause.ts +0 -0
- package/src/strings/keyScrollLock.ts +0 -0
- package/src/strings/keyShift.ts +0 -0
- package/src/strings/keySpace.ts +0 -0
- package/src/strings/keyTab.ts +0 -0
- package/src/strings/keyboardEventKeys.ts +0 -0
- package/src/strings/keydownEvent.ts +0 -0
- package/src/strings/keypressEvent.ts +0 -0
- package/src/strings/keyupEvent.ts +0 -0
- package/src/strings/loadEvent.ts +0 -0
- package/src/strings/loadstartEvent.ts +0 -0
- package/src/strings/mouseClickEvents.ts +0 -0
- package/src/strings/mouseHoverEvents.ts +0 -0
- package/src/strings/mouseSwipeEvents.ts +0 -0
- package/src/strings/mouseclickEvent.ts +0 -0
- package/src/strings/mousedblclickEvent.ts +0 -0
- package/src/strings/mousedownEvent.ts +0 -0
- package/src/strings/mouseenterEvent.ts +0 -0
- package/src/strings/mousehoverEvent.ts +0 -0
- package/src/strings/mouseinEvent.ts +0 -0
- package/src/strings/mouseleaveEvent.ts +0 -0
- package/src/strings/mousemoveEvent.ts +0 -0
- package/src/strings/mouseoutEvent.ts +0 -0
- package/src/strings/mouseoverEvent.ts +0 -0
- package/src/strings/mouseupEvent.ts +0 -0
- package/src/strings/mousewheelEvent.ts +0 -0
- package/src/strings/moveEvent.ts +0 -0
- package/src/strings/nativeEvents.ts +0 -0
- package/src/strings/offsetHeight.ts +0 -0
- package/src/strings/offsetWidth.ts +0 -0
- package/src/strings/orientationchangeEvent.ts +0 -0
- package/src/strings/pointercancelEvent.ts +0 -0
- package/src/strings/pointerdownEvent.ts +0 -0
- package/src/strings/pointerleaveEvent.ts +0 -0
- package/src/strings/pointermoveEvent.ts +0 -0
- package/src/strings/pointerupEvent.ts +0 -0
- package/src/strings/readystatechangeEvent.ts +0 -0
- package/src/strings/removeEventListener.ts +0 -0
- package/src/strings/resetEvent.ts +0 -0
- package/src/strings/resizeEvent.ts +0 -0
- package/src/strings/scrollEvent.ts +0 -0
- package/src/strings/scrollHeight.ts +0 -0
- package/src/strings/scrollWidth.ts +0 -0
- package/src/strings/selectEvent.ts +0 -0
- package/src/strings/selectendEvent.ts +0 -0
- package/src/strings/selectstartEvent.ts +0 -0
- package/src/strings/submitEvent.ts +0 -0
- package/src/strings/tabindex.ts +0 -0
- package/src/strings/touchEvents.ts +0 -0
- package/src/strings/touchcancelEvent.ts +0 -0
- package/src/strings/touchendEvent.ts +0 -0
- package/src/strings/touchmoveEvent.ts +0 -0
- package/src/strings/touchstartEvent.ts +0 -0
- package/src/strings/transitionDelay.ts +0 -0
- package/src/strings/transitionDuration.ts +0 -0
- package/src/strings/transitionEndEvent.ts +0 -0
- package/src/strings/transitionProperty.ts +0 -0
- package/src/strings/unloadEvent.ts +0 -0
- package/src/strings/userAgent.ts +0 -0
- package/src/strings/userAgentData.ts +0 -0
- package/tsconfig.json +1 -1
- package/vite.config.ts +0 -0
|
@@ -0,0 +1,337 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions addapted from React 18.2
|
|
3
|
+
* Project: https://react.dev/
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
type NativeAnimationEvent = AnimationEvent;
|
|
7
|
+
type NativeClipboardEvent = ClipboardEvent;
|
|
8
|
+
type NativeCompositionEvent = CompositionEvent;
|
|
9
|
+
type NativeDragEvent = DragEvent;
|
|
10
|
+
type NativeFocusEvent = FocusEvent;
|
|
11
|
+
type NativeKeyboardEvent = KeyboardEvent;
|
|
12
|
+
type NativeMouseEvent = MouseEvent;
|
|
13
|
+
type NativeTouchEvent = TouchEvent;
|
|
14
|
+
type NativePointerEvent = PointerEvent;
|
|
15
|
+
type NativeTransitionEvent = TransitionEvent;
|
|
16
|
+
type NativeUIEvent = UIEvent;
|
|
17
|
+
type NativeWheelEvent = WheelEvent;
|
|
18
|
+
|
|
19
|
+
interface AbstractView {
|
|
20
|
+
styleMedia: StyleMedia;
|
|
21
|
+
document: Document;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//
|
|
25
|
+
// Event System
|
|
26
|
+
// ----------------------------------------------------------------------
|
|
27
|
+
// E = EventObject, C = e.currentTarget, T = e.target
|
|
28
|
+
interface BaseEvent<E = unknown, C = unknown, T = unknown> {
|
|
29
|
+
nativeEvent: Event & E;
|
|
30
|
+
currentTarget: C & EventTarget;
|
|
31
|
+
target: T & EventTarget;
|
|
32
|
+
bubbles: boolean;
|
|
33
|
+
cancelable: boolean;
|
|
34
|
+
defaultPrevented: boolean;
|
|
35
|
+
eventPhase: number;
|
|
36
|
+
isTrusted: boolean;
|
|
37
|
+
preventDefault(): void;
|
|
38
|
+
isDefaultPrevented(): boolean;
|
|
39
|
+
stopPropagation(): void;
|
|
40
|
+
isPropagationStopped(): boolean;
|
|
41
|
+
persist(): void;
|
|
42
|
+
timeStamp: number;
|
|
43
|
+
type: string & NativeEventTypes;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* currentTarget - a reference to the element on which the event listener is registered.
|
|
48
|
+
*
|
|
49
|
+
* target - a reference to the element from which the event was originally dispatched.
|
|
50
|
+
* This might be a child element to the element on which the event listener is registered.
|
|
51
|
+
* If you thought this should be `EventTarget & T`, see https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11508#issuecomment-256045682
|
|
52
|
+
*/
|
|
53
|
+
type NativeEvent<T = PossibleEventTarget, E = Event> = BaseEvent<E, EventTarget & T, EventTarget>;
|
|
54
|
+
|
|
55
|
+
interface ClipboardEvent<T = Element> extends NativeEvent<T, NativeClipboardEvent> {
|
|
56
|
+
clipboardData?: DataTransfer;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
interface CompositionEvent<T = Element> extends NativeEvent<T, NativeCompositionEvent> {
|
|
60
|
+
data: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
interface DragEvent<T = Element> extends MouseEvent<T, NativeDragEvent> {
|
|
64
|
+
dataTransfer: DataTransfer;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
interface PointerEvent<T = Element> extends MouseEvent<T, NativePointerEvent> {
|
|
68
|
+
pointerId: number;
|
|
69
|
+
pressure: number;
|
|
70
|
+
tangentialPressure: number;
|
|
71
|
+
tiltX: number;
|
|
72
|
+
tiltY: number;
|
|
73
|
+
twist: number;
|
|
74
|
+
width: number;
|
|
75
|
+
height: number;
|
|
76
|
+
pointerType: 'mouse' | 'pen' | 'touch';
|
|
77
|
+
isPrimary: boolean;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
interface FocusEvent<T = Element, R = Element> extends NativeEvent<T, NativeFocusEvent> {
|
|
81
|
+
relatedTarget: (EventTarget & R) | null;
|
|
82
|
+
target: EventTarget & T;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type FormControl = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
|
|
86
|
+
type FormEvent<T = FormControl> = NativeEvent<T>;
|
|
87
|
+
|
|
88
|
+
interface ChangeEvent<T = FormControl> extends FormEvent<T> {
|
|
89
|
+
target: EventTarget & T;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type ModifierKey =
|
|
93
|
+
| 'Alt'
|
|
94
|
+
| 'AltGraph'
|
|
95
|
+
| 'CapsLock'
|
|
96
|
+
| 'Control'
|
|
97
|
+
| 'Fn'
|
|
98
|
+
| 'FnLock'
|
|
99
|
+
| 'Hyper'
|
|
100
|
+
| 'Meta'
|
|
101
|
+
| 'NumLock'
|
|
102
|
+
| 'ScrollLock'
|
|
103
|
+
| 'Shift'
|
|
104
|
+
| 'Super'
|
|
105
|
+
| 'Symbol'
|
|
106
|
+
| 'SymbolLock';
|
|
107
|
+
|
|
108
|
+
interface KeyboardEvent<T = Element> extends UIEvent<T, NativeKeyboardEvent> {
|
|
109
|
+
altKey: boolean;
|
|
110
|
+
/** @deprecated */
|
|
111
|
+
charCode: number;
|
|
112
|
+
ctrlKey: boolean;
|
|
113
|
+
code: string;
|
|
114
|
+
/**
|
|
115
|
+
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
|
116
|
+
*/
|
|
117
|
+
getModifierState(key: ModifierKey): boolean;
|
|
118
|
+
/**
|
|
119
|
+
* See the [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#named-key-attribute-values). for possible values
|
|
120
|
+
*/
|
|
121
|
+
key: string;
|
|
122
|
+
/** @deprecated */
|
|
123
|
+
keyCode: number;
|
|
124
|
+
locale: string;
|
|
125
|
+
location: number;
|
|
126
|
+
metaKey: boolean;
|
|
127
|
+
repeat: boolean;
|
|
128
|
+
shiftKey: boolean;
|
|
129
|
+
/** @deprecated */
|
|
130
|
+
which: number;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
interface MouseEvent<T = Element, E = NativeMouseEvent> extends UIEvent<T, E> {
|
|
134
|
+
altKey: boolean;
|
|
135
|
+
button: number;
|
|
136
|
+
buttons: number;
|
|
137
|
+
clientX: number;
|
|
138
|
+
clientY: number;
|
|
139
|
+
ctrlKey: boolean;
|
|
140
|
+
/**
|
|
141
|
+
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
|
142
|
+
*/
|
|
143
|
+
getModifierState(key: ModifierKey): boolean;
|
|
144
|
+
metaKey: boolean;
|
|
145
|
+
movementX: number;
|
|
146
|
+
movementY: number;
|
|
147
|
+
pageX: number;
|
|
148
|
+
pageY: number;
|
|
149
|
+
relatedTarget: EventTarget | null;
|
|
150
|
+
screenX: number;
|
|
151
|
+
screenY: number;
|
|
152
|
+
shiftKey: boolean;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
|
|
156
|
+
altKey: boolean;
|
|
157
|
+
changedTouches: TouchList;
|
|
158
|
+
ctrlKey: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* See [DOM Level 3 Events spec](https://www.w3.org/TR/uievents-key/#keys-modifier). for a list of valid (case-sensitive) arguments to this method.
|
|
161
|
+
*/
|
|
162
|
+
getModifierState(key: ModifierKey): boolean;
|
|
163
|
+
metaKey: boolean;
|
|
164
|
+
shiftKey: boolean;
|
|
165
|
+
targetTouches: TouchList;
|
|
166
|
+
touches: TouchList;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
interface UIEvent<T = Element, E = NativeUIEvent> extends NativeEvent<T, E> {
|
|
170
|
+
detail: number;
|
|
171
|
+
view: AbstractView;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
interface WheelEvent<T = Element> extends MouseEvent<T, NativeWheelEvent> {
|
|
175
|
+
deltaMode: number;
|
|
176
|
+
deltaX: number;
|
|
177
|
+
deltaY: number;
|
|
178
|
+
deltaZ: number;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
interface AnimationEvent<T = Element> extends NativeEvent<T, NativeAnimationEvent> {
|
|
182
|
+
animationName: string;
|
|
183
|
+
elapsedTime: number;
|
|
184
|
+
pseudoElement: string;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
interface TransitionEvent<T = Element> extends NativeEvent<T, NativeTransitionEvent> {
|
|
188
|
+
elapsedTime: number;
|
|
189
|
+
propertyName: string;
|
|
190
|
+
pseudoElement: string;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
//
|
|
194
|
+
// Event Handler Types
|
|
195
|
+
// ----------------------------------------------------------------------
|
|
196
|
+
type EventHandler<E extends NativeEvent<unknown, unknown>> = // (this: unknown & EventTarget, event: E): void;
|
|
197
|
+
(event: E) => void;
|
|
198
|
+
type NativeEventHandler<T = Element> = EventHandler<NativeEvent<T>>;
|
|
199
|
+
type ClipboardEventHandler<T = Element> = EventHandler<ClipboardEvent<T>>;
|
|
200
|
+
type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
|
|
201
|
+
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
|
|
202
|
+
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
|
|
203
|
+
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
|
|
204
|
+
type ChangeEventHandler<T = Element> = EventHandler<ChangeEvent<T>>;
|
|
205
|
+
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
|
206
|
+
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
|
207
|
+
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
|
|
208
|
+
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
|
|
209
|
+
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
210
|
+
type WheelEventHandler<T = Element> = EventHandler<WheelEvent<T>>;
|
|
211
|
+
type AnimationEventHandler<T = Element> = EventHandler<AnimationEvent<T>>;
|
|
212
|
+
type TransitionEventHandler<T = Element> = EventHandler<TransitionEvent<T>>;
|
|
213
|
+
|
|
214
|
+
type SupportedEventObject<T> =
|
|
215
|
+
| NativeEvent<T>
|
|
216
|
+
| ClipboardEvent<T>
|
|
217
|
+
| CompositionEvent<T>
|
|
218
|
+
| DragEvent<T>
|
|
219
|
+
| FocusEvent<T>
|
|
220
|
+
| FormEvent<T>
|
|
221
|
+
| ChangeEvent<T>
|
|
222
|
+
| KeyboardEvent<T>
|
|
223
|
+
| MouseEvent<T>
|
|
224
|
+
| TouchEvent<T>
|
|
225
|
+
| PointerEvent<T>
|
|
226
|
+
| UIEvent<T>
|
|
227
|
+
| WheelEvent<T>
|
|
228
|
+
| AnimationEvent<T>
|
|
229
|
+
| TransitionEvent<T>;
|
|
230
|
+
|
|
231
|
+
type SupportedEventHandler<T> =
|
|
232
|
+
| NativeEventHandler<T>
|
|
233
|
+
| ClipboardEventHandler<T>
|
|
234
|
+
| CompositionEventHandler<T>
|
|
235
|
+
| DragEventHandler<T>
|
|
236
|
+
| FocusEventHandler<T>
|
|
237
|
+
| FormEventHandler<T>
|
|
238
|
+
| ChangeEventHandler<T>
|
|
239
|
+
| KeyboardEventHandler<T>
|
|
240
|
+
| MouseEventHandler<T>
|
|
241
|
+
| TouchEventHandler<T>
|
|
242
|
+
| PointerEventHandler<T>
|
|
243
|
+
| UIEventHandler<T>
|
|
244
|
+
| WheelEventHandler<T>
|
|
245
|
+
| AnimationEventHandler<T>
|
|
246
|
+
| TransitionEventHandler<T>;
|
|
247
|
+
|
|
248
|
+
type NativeEventTypes =
|
|
249
|
+
| 'DOMContentLoaded'
|
|
250
|
+
| 'DOMMouseScroll'
|
|
251
|
+
| 'abort'
|
|
252
|
+
| 'beforeunload'
|
|
253
|
+
| 'blur'
|
|
254
|
+
| 'change'
|
|
255
|
+
| 'click'
|
|
256
|
+
| 'contextmenu'
|
|
257
|
+
| 'dblclick'
|
|
258
|
+
| 'error'
|
|
259
|
+
| 'focus'
|
|
260
|
+
| 'focusin'
|
|
261
|
+
| 'focusout'
|
|
262
|
+
| 'gesturechange'
|
|
263
|
+
| 'gestureend'
|
|
264
|
+
| 'gesturestart'
|
|
265
|
+
| 'hover'
|
|
266
|
+
| 'keydown'
|
|
267
|
+
| 'keypress'
|
|
268
|
+
| 'keyup'
|
|
269
|
+
| 'load'
|
|
270
|
+
| 'mousedown'
|
|
271
|
+
| 'mouseenter'
|
|
272
|
+
| 'mousein'
|
|
273
|
+
| 'mouseleave'
|
|
274
|
+
| 'mousemove'
|
|
275
|
+
| 'mouseout'
|
|
276
|
+
| 'mouseover'
|
|
277
|
+
| 'mouseup'
|
|
278
|
+
| 'mousewheel'
|
|
279
|
+
| 'move'
|
|
280
|
+
| 'orientationchange'
|
|
281
|
+
| 'pointercancel'
|
|
282
|
+
| 'pointerdown'
|
|
283
|
+
| 'pointerleave'
|
|
284
|
+
| 'pointermove'
|
|
285
|
+
| 'pointerup'
|
|
286
|
+
| 'readystatechange'
|
|
287
|
+
| 'reset'
|
|
288
|
+
| 'resize'
|
|
289
|
+
| 'scroll'
|
|
290
|
+
| 'select'
|
|
291
|
+
| 'selectend'
|
|
292
|
+
| 'selectstart'
|
|
293
|
+
| 'submit'
|
|
294
|
+
| 'touchcancel'
|
|
295
|
+
| 'touchend'
|
|
296
|
+
| 'touchmove'
|
|
297
|
+
| 'touchstart'
|
|
298
|
+
| 'unload';
|
|
299
|
+
type PossibleEventTarget = EventTarget & (Element | Document | Window);
|
|
300
|
+
|
|
301
|
+
export {
|
|
302
|
+
SupportedEventObject,
|
|
303
|
+
SupportedEventHandler,
|
|
304
|
+
EventHandler,
|
|
305
|
+
NativeEventTypes,
|
|
306
|
+
NativeEvent,
|
|
307
|
+
ClipboardEvent,
|
|
308
|
+
CompositionEvent,
|
|
309
|
+
DragEvent,
|
|
310
|
+
FocusEvent,
|
|
311
|
+
FormEvent,
|
|
312
|
+
ChangeEvent,
|
|
313
|
+
KeyboardEvent,
|
|
314
|
+
MouseEvent,
|
|
315
|
+
TouchEvent,
|
|
316
|
+
PointerEvent,
|
|
317
|
+
UIEvent,
|
|
318
|
+
WheelEvent,
|
|
319
|
+
AnimationEvent,
|
|
320
|
+
TransitionEvent,
|
|
321
|
+
NativeEventHandler,
|
|
322
|
+
ClipboardEventHandler,
|
|
323
|
+
CompositionEventHandler,
|
|
324
|
+
DragEventHandler,
|
|
325
|
+
FocusEventHandler,
|
|
326
|
+
FormEventHandler,
|
|
327
|
+
ChangeEventHandler,
|
|
328
|
+
KeyboardEventHandler,
|
|
329
|
+
MouseEventHandler,
|
|
330
|
+
TouchEventHandler,
|
|
331
|
+
PointerEventHandler,
|
|
332
|
+
UIEventHandler,
|
|
333
|
+
WheelEventHandler,
|
|
334
|
+
AnimationEventHandler,
|
|
335
|
+
TransitionEventHandler,
|
|
336
|
+
PossibleEventTarget,
|
|
337
|
+
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/is/isArray.ts
CHANGED
|
File without changes
|
package/src/is/isCanvas.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/is/isDocument.ts
CHANGED
|
File without changes
|
package/src/is/isElement.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/is/isFunction.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/is/isHTMLElement.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/is/isJSON.ts
CHANGED
|
File without changes
|
package/src/is/isMap.ts
CHANGED
|
File without changes
|
package/src/is/isMedia.ts
CHANGED
|
File without changes
|
package/src/is/isNode.ts
CHANGED
|
File without changes
|
package/src/is/isNodeList.ts
CHANGED
|
File without changes
|
package/src/is/isNumber.ts
CHANGED
|
File without changes
|
package/src/is/isObject.ts
CHANGED
|
File without changes
|
package/src/is/isRTL.ts
CHANGED
|
File without changes
|
package/src/is/isSVGElement.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/is/isShadowRoot.ts
CHANGED
|
File without changes
|
package/src/is/isString.ts
CHANGED
|
File without changes
|
package/src/is/isTableElement.ts
CHANGED
|
File without changes
|
package/src/is/isWeakMap.ts
CHANGED
|
File without changes
|
package/src/is/isWindow.ts
CHANGED
|
File without changes
|
package/src/misc/ArrayFrom.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/misc/ObjectAssign.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortcut for `Object.fromEntries()` static method.
|
|
3
|
+
*
|
|
4
|
+
* @param entries a target entries object
|
|
5
|
+
* @returns a new Object created from the specified entries in array format [key, value][]
|
|
6
|
+
* @see https://github.com/devinrhode2/ObjectTyped/blob/master/src/index.ts
|
|
7
|
+
*/
|
|
8
|
+
const ObjectFromEntries = <K extends string, V>(entries: [K, V][]) =>
|
|
9
|
+
Object.fromEntries(entries) as Record<K, V>;
|
|
10
|
+
|
|
11
|
+
export default ObjectFromEntries;
|
package/src/misc/ObjectHasOwn.ts
CHANGED
|
File without changes
|
package/src/misc/ObjectKeys.ts
CHANGED
|
File without changes
|
package/src/misc/ObjectValues.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/misc/data.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/misc/distinct.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/misc/focus.ts
CHANGED
|
File without changes
|
package/src/misc/getInstance.ts
CHANGED
|
File without changes
|
package/src/misc/noop.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/misc/reflow.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/misc/timer.ts
CHANGED
|
File without changes
|
package/src/misc/toLowerCase.ts
CHANGED
|
File without changes
|
package/src/misc/toUpperCase.ts
CHANGED
|
File without changes
|
package/src/selectors/closest.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/selectors/matches.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/strings/ariaLabel.ts
CHANGED
|
File without changes
|
|
File without changes
|
package/src/strings/ariaModal.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/strings/blurEvent.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/strings/dragEvent.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/strings/keyAlt.ts
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/src/strings/keyDelete.ts
CHANGED
|
File without changes
|
package/src/strings/keyEnter.ts
CHANGED
|
File without changes
|
package/src/strings/keyEscape.ts
CHANGED
|
File without changes
|
package/src/strings/keyInsert.ts
CHANGED
|
File without changes
|