import * as _angular_core from '@angular/core'; import { Signal, Provider } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; interface NgpInteractionOptions { hover?: boolean; press?: boolean; focus?: boolean; focusWithin?: boolean; focusVisible?: boolean; disabled?: Signal; } /** * Setup the interactions without relying on HostDirectives. * @internal */ declare function ngpInteractions({ focus, hover, press, focusWithin, focusVisible, disabled, }: NgpInteractionOptions): void; interface NgpInteractionsConfig { /** Whether all interactions are disabled */ disabled?: boolean; /** Whether hover interactions are enabled */ hover?: boolean; /** Whether focus interactions are enabled */ focus?: boolean; /** Whether focus-visible interactions are enabled */ focusVisible?: boolean; /** Whether press interactions are enabled */ press?: boolean; } /** * Provide the default Interactions configuration * @param config The Interactions configuration * @returns The provider */ declare function provideInteractionsConfig(config: Partial): Provider[]; /** * Apply the `ngpFocusVisible` directive to an element that should be visually focused. This is similar to `ngpFocus` * but it will only apply the focus visible styles when the element is focused via keyboard navigation. */ declare class NgpFocusVisible { /** * Whether focus events are listened to. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Emit when the element is visually focused. */ readonly focusChange: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpFocusVisibleProps { disabled?: Signal; onFocusChange?: (value: boolean) => void; } interface NgpFocusVisibleState { isFocused: Signal; } /** * @internal */ declare function ngpFocusVisible({ onFocusChange, disabled, }: NgpFocusVisibleProps): NgpFocusVisibleState; /** * This was inspired by the React Aria useFocus hook. * https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/interactions/src/useFocus.ts#L20 */ declare class NgpFocus { /** * Whether listening for focus events is disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Emit when the focus state changes. */ readonly focus: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpFocusProps { disabled?: Signal; focusWithin?: boolean; onFocus?: () => void; onBlur?: () => void; } interface NgpFocusState { isFocused: Signal; } /** * @internal */ declare function ngpFocus({ onFocus, onBlur, focusWithin, disabled, }: NgpFocusProps): NgpFocusState; /** * Apply the `ngpHover` directive to an element that you want to listen for hover events. T * his is particulaly useful for supporting hover events on touch devices, where hover events are not handled consistently. * On iOS relying on the `:hover` pseudo-class can result in the hover state being stuck until the user taps elsewhere on the screen. */ declare class NgpHover { /** * Whether hoving should be disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Emit an event when hovering starts. */ readonly hoverStart: _angular_core.OutputEmitterRef; /** * Emit an event when hovering ends. */ readonly hoverEnd: _angular_core.OutputEmitterRef; /** * Emit an event when the hover state changes. */ readonly hoverChange: _angular_core.OutputEmitterRef; /** * Setup the hover state. */ constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpHoverProps { disabled?: Signal; onHoverStart?: () => void; onHoverEnd?: () => void; } interface NgpHoverState { hovered: Signal; } /** * Programatically add the hover functionality to an element. * This is useful in cases where we can't necessarily use a HostDirective, * because there is a chance the directive has already been used. * @internal */ declare function ngpHover({ onHoverStart, onHoverEnd, disabled, }: NgpHoverProps): NgpHoverState; /** * The `NgpMove` directive is used to enable the pointer and keyboard move interactions on an element. */ declare class NgpMove { /** * Access the disposable helper. */ private readonly disposables; /** * Whether movement is disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Emit when the move event begins. */ readonly start: _angular_core.OutputEmitterRef; /** * Emit when the element is moved. */ readonly move: _angular_core.OutputEmitterRef; /** * Emit when the move event ends. */ readonly end: _angular_core.OutputEmitterRef; /** * Whether the element is currently being moved. */ protected isMoving: _angular_core.WritableSignal; /** * Store the last x position of the element. */ private x; /** * Store the last y position of the element. */ private y; /** * Store the id of the last pointer. */ private pointerId; /** * Store the disposable event listeners. */ private disposableListeners; /** * Handle a move start. */ private onMoveStart; /** * Handle a move event. */ private onMove; /** * Handle a move end. */ private onMoveEnd; /** * Handle the pointer down event. */ protected onPointerDown(event: PointerEvent): void; /** * Handle the pointer up event. */ protected onPointerUp(event: PointerEvent): void; /** * Handle the pointer move event. */ protected onPointerMove(event: PointerEvent): void; private triggerKeyboardMove; protected onArrowUp(event: Event): void; protected onArrowDown(event: Event): void; protected onArrowLeft(event: Event): void; protected onArrowRight(event: Event): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpMoveBaseEvent { /** * Whether the event was triggered by a mouse or keyboard event. */ pointerType: PointerType; /** * Whether the shift key was pressed during the event. */ shiftKey: boolean; /** * Whether the control key was pressed during the event. */ ctrlKey: boolean; /** * Whether the meta key was pressed during the event. */ metaKey: boolean; /** * Whether the alt key was pressed during the event. */ altKey: boolean; } interface NgpMoveEvent extends NgpMoveBaseEvent { /** * The amount of pixels moved in the x-axis. */ deltaX: number; /** * The amount of pixels moved in the y-axis. */ deltaY: number; } type PointerType = 'mouse' | 'pen' | 'touch' | 'keyboard' | 'virtual'; /** * The `ngpPress` directive listens for press events on an element. This is particularly useful for supporting press events on touch devices, where press events are not handled consistently. */ declare class NgpPress { /** * Whether listening for press events is disabled. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Emit when the press begins. */ readonly pressStart: _angular_core.OutputEmitterRef; /** * Emit when the press ends. */ readonly pressEnd: _angular_core.OutputEmitterRef; /** * Emit when the press changes. */ readonly pressChange: _angular_core.OutputEmitterRef; constructor(); static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵdir: _angular_core.ɵɵDirectiveDeclaration; } interface NgpPressState { pressed: Signal; } interface NgpPressProps { disabled?: Signal; onPressStart?: () => void; onPressEnd?: () => void; } /** * @internal */ declare function ngpPress({ onPressStart, onPressEnd, disabled, }: NgpPressProps): NgpPressState; export { NgpFocus, NgpFocusVisible, NgpHover, NgpMove, NgpPress, ngpFocus, ngpFocusVisible, ngpHover, ngpInteractions, ngpPress, provideInteractionsConfig, ngpInteractions as setupInteractions }; export type { NgpInteractionsConfig, NgpMoveEvent };