gesturx 1.7.0 → 1.7.1

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/dist/index.d.ts CHANGED
@@ -12,11 +12,7 @@ declare type PanConfig = {
12
12
  numInputs?: number;
13
13
  };
14
14
 
15
- export declare interface PanEvent extends RecognizerEvent {
16
- type: "panStart" | "panMove" | "panEnd";
17
- }
18
-
19
- declare interface PanEvent_2 extends RecognizerEvent {
15
+ declare interface PanEvent extends RecognizerEvent {
20
16
  type: "panStart" | "panMove" | "panEnd";
21
17
  }
22
18
 
@@ -28,8 +24,8 @@ export declare class PanRecognizer extends Recognizer<PanRecognizerOptions, PanE
28
24
  update(config: RecognizerConfig<PanRecognizerOptions>): void;
29
25
  }
30
26
 
31
- declare interface PanRecognizerInterface extends Recognizer<PanRecognizerOptions, PanEvent_2> {
32
- events$: Observable<PanEvent_2>;
27
+ declare interface PanRecognizerInterface extends Recognizer<PanRecognizerOptions, PanEvent> {
28
+ events$: Observable<PanEvent>;
33
29
  update(options: RecognizerConfig<PanRecognizerOptions>): void;
34
30
  }
35
31
 
@@ -77,15 +73,13 @@ declare interface PinchRecognizerOptions {
77
73
  export declare class Recognizable<T extends Recognizer<any, any>[]> implements RecognizableInterface<T> {
78
74
  protected options: {
79
75
  recognizers: T;
80
- afterEventReceived?: (event: PointerEvent) => PointerEvent;
81
- };
76
+ } & RecognizerConfig<unknown>;
82
77
  events$: Observable<ObservedValueOf<T[number]["events$"]>>;
83
78
  recognizers: T;
84
79
  state$: Observable<RecognizableState>;
85
80
  constructor(options: {
86
81
  recognizers: T;
87
- afterEventReceived?: (event: PointerEvent) => PointerEvent;
88
- });
82
+ } & RecognizerConfig<unknown>);
89
83
  update(options: RecognizerConfig<unknown>): void;
90
84
  }
91
85
 
@@ -108,10 +102,11 @@ declare interface RecognizableInterface<T extends Recognizer<any, any>[]> {
108
102
  */
109
103
  readonly state$: Observable<RecognizableState>;
110
104
  /**
111
- * Initialize the instance with a given html element.
105
+ * Update the recognizable with given options.
112
106
  *
113
- * You can only initialize one element per instance but you can
114
- * change the element and call the method again if needed.
107
+ * The options are in fact passed down to all of the recognizers.
108
+ * Use it to initialize the container when you want to start
109
+ * listenin to gesture events.
115
110
  */
116
111
  update(options: RecognizerConfig<unknown>): void;
117
112
  }
@@ -132,7 +127,10 @@ export declare abstract class Recognizer<Options extends Record<any, any>, Event
132
127
  protected configSubject: BehaviorSubject<RecognizerConfig<Options> & {
133
128
  panConfig?: PanConfig | undefined;
134
129
  }>;
135
- protected panEvent$: Observable<PanEvent>;
130
+ protected pan$: Observable<RecognizerPanEvent>;
131
+ protected panStart$: Observable<RecognizerEvent>;
132
+ protected panMove$: Observable<RecognizerEvent>;
133
+ protected panEnd$: Observable<RecognizerEvent>;
136
134
  protected pointerEvent$: Observable<PointerEvent>;
137
135
  protected pointerDown$: Observable<PointerEvent>;
138
136
  protected pointerUp$: Observable<PointerEvent>;
@@ -204,6 +202,10 @@ declare interface RecognizerEvent {
204
202
  pointersAverageDistance: number;
205
203
  }
206
204
 
205
+ export declare interface RecognizerPanEvent extends RecognizerEvent {
206
+ type: "start" | "move" | "end";
207
+ }
208
+
207
209
  declare interface RotateEvent extends RecognizerEvent {
208
210
  type: "rotateMove" | "rotateStart" | "rotateEnd";
209
211
  /**