Skip to content

Commit

Permalink
refactor(esl-utils): TOUCH_EVENTS from device-detector module ret…
Browse files Browse the repository at this point in the history
…ired, DeviceDetector is deprecated

BREAKING CHANGE: both `DeviceDetector.TOUCH_EVENTS` and `TOUCH_EVENTS` are retired from `device-detector` module.
Please also note that the DeviceDetector class is also deprecated.
  • Loading branch information
ala-n committed Jan 16, 2024
1 parent deef57d commit e9ed603
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/modules/esl-utils/environment/device-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,10 @@ export const isTouchDevice = ((): boolean => {
// Note: always true for IE
export const hasHover = !matchMedia('(hover: none)').matches;

type TouchEventsDefinition = {
START: string;
MOVE: string;
END: string;
};
/** @deprecated TODO: needs to be reworked or moved away from device detector */
export const TOUCH_EVENTS = ((): TouchEventsDefinition => {
const isTouch = isTouchDevice;
return {
START: isTouch ? 'touchstart' : 'pointerdown',
MOVE: isTouch ? 'touchmove' : 'pointermove',
END: isTouch ? 'touchend' : 'pointerup'
};
})();

/**
* Device detection utility
* @readonly
* @deprecated use separate checks from the same module instead
*/
@ExportNs('DeviceDetector')
export abstract class DeviceDetector {
Expand Down Expand Up @@ -116,9 +102,6 @@ export abstract class DeviceDetector {
// Hover check
// Note: always true for IE
public static hasHover = hasHover;

/** @deprecated TODO: needs to be reworked or moved away from device detector */
static TOUCH_EVENTS = TOUCH_EVENTS;
}

declare global {
Expand Down

0 comments on commit e9ed603

Please # to comment.