| 5 | } from './interfaces.js' |
| 6 | |
| 7 | export class OptionsReader implements TouchBackendOptions { |
| 8 | public constructor( |
| 9 | private args: Partial<TouchBackendOptions>, |
| 10 | private context: TouchBackendContext, |
| 11 | ) {} |
| 12 | |
| 13 | public get delay(): number { |
| 14 | return this.args.delay ?? 0 |
| 15 | } |
| 16 | |
| 17 | public get scrollAngleRanges(): AngleRange[] | undefined { |
| 18 | return this.args.scrollAngleRanges |
| 19 | } |
| 20 | |
| 21 | public get getDropTargetElementsAtPoint(): |
| 22 | | ((x: number, y: number, elements: HTMLElement[]) => HTMLElement[]) |
| 23 | | undefined { |
| 24 | return this.args.getDropTargetElementsAtPoint |
| 25 | } |
| 26 | |
| 27 | public get ignoreContextMenu(): boolean { |
| 28 | return this.args.ignoreContextMenu ?? false |
| 29 | } |
| 30 | |
| 31 | public get enableHoverOutsideTarget(): boolean { |
| 32 | return this.args.enableHoverOutsideTarget ?? false |
| 33 | } |
| 34 | |
| 35 | public get enableKeyboardEvents(): boolean { |
| 36 | return this.args.enableKeyboardEvents ?? false |
| 37 | } |
| 38 | |
| 39 | public get enableMouseEvents(): boolean { |
| 40 | return this.args.enableMouseEvents ?? false |
| 41 | } |
| 42 | |
| 43 | public get enableTouchEvents(): boolean { |
| 44 | return this.args.enableTouchEvents ?? true |
| 45 | } |
| 46 | |
| 47 | public get touchSlop(): number { |
| 48 | return this.args.touchSlop || 0 |
| 49 | } |
| 50 | |
| 51 | public get delayTouchStart(): number { |
| 52 | return this.args?.delayTouchStart ?? this.args?.delay ?? 0 |
| 53 | } |
| 54 | |
| 55 | public get delayMouseStart(): number { |
| 56 | return this.args?.delayMouseStart ?? this.args?.delay ?? 0 |
| 57 | } |
| 58 | |
| 59 | public get window(): Window | undefined { |
| 60 | if (this.context && this.context.window) { |
| 61 | return this.context.window |
| 62 | } else if (typeof window !== 'undefined') { |
| 63 | return window |
| 64 | } |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…