UNPKG

1.43 kBTypeScriptView Raw
1import { BaseGestureConfig, ContinousBaseGesture } from './gesture';
2import { ForceTouchGestureConfig } from '../ForceTouchGestureHandler';
3import type { ForceTouchGestureHandlerEventPayload } from '../GestureHandlerEventPayload';
4import { GestureUpdateEvent } from '../gestureHandlerCommon';
5export type ForceTouchGestureChangeEventPayload = {
6 forceChange: number;
7};
8export declare class ForceTouchGesture extends ContinousBaseGesture<ForceTouchGestureHandlerEventPayload, ForceTouchGestureChangeEventPayload> {
9 config: BaseGestureConfig & ForceTouchGestureConfig;
10 constructor();
11 /**
12 * A minimal pressure that is required before gesture can activate.
13 * Should be a value from range [0.0, 1.0]. Default is 0.2.
14 * @param force
15 */
16 minForce(force: number): this;
17 /**
18 * A maximal pressure that could be applied for gesture.
19 * If the pressure is greater, gesture fails. Should be a value from range [0.0, 1.0].
20 * @param force
21 */
22 maxForce(force: number): this;
23 /**
24 * Value defining if haptic feedback has to be performed on activation.
25 * @param value
26 */
27 feedbackOnActivation(value: boolean): this;
28 onChange(callback: (event: GestureUpdateEvent<GestureUpdateEvent<ForceTouchGestureHandlerEventPayload & ForceTouchGestureChangeEventPayload>>) => void): this;
29}
30export type ForceTouchGestureType = InstanceType<typeof ForceTouchGesture>;