fix: update tap event data (#8415)

* Update tap event data object

Adds a:

- TabGestureEventData interface, which can be used for both tap and doubleTap events.

- The event object returned by both tap and doubleTap events now have getX(), getY(), and getPointersCount() methods. These facilitate the same function as those of the touch event object.

* ui(gesture): getX,getY in DIP

Updates the getX() and getY() methods of Tap, doubleTap and touch events to return DIP instead of DP.

* ui(gesture): tap event data includes location

Tap and doubleTap event data now include getX and getY methods for event location. These are in DIP format.

getPointerCount is also available.

* Fix tslint errors

* fix minor formatting issues for api-extrector
This commit is contained in:
Sam Donald
2020-03-19 21:51:23 +11:00
committed by GitHub
parent 4a67a3b73f
commit 8dbb623944
6 changed files with 397 additions and 378 deletions

View File

@@ -870,17 +870,17 @@ export class Frame extends View {
// @public
export interface GestureEventData extends EventData {
android: any
ios: any /* UIGestureRecognizer */;
type: GestureTypes;
view: View;
}
android: any
ios: any /* UIGestureRecognizer */;
type: GestureTypes;
view: View;
}
// @public
export interface GestureEventDataWithState extends GestureEventData {
// (undocumented)
state: number;
}
}
// @public
export class GesturesObserver {
@@ -897,7 +897,7 @@ export class GesturesObserver {
observe(type: GestureTypes);
type: GestureTypes;
}
}
// @public
export enum GestureStateTypes {
@@ -905,7 +905,7 @@ export enum GestureStateTypes {
cancelled,
changed,
ended
}
}
// @public
export enum GestureTypes {
@@ -917,7 +917,7 @@ export enum GestureTypes {
swipe,
tap,
touch
}
}
// @public
export class GridLayout extends LayoutBase {
@@ -1011,49 +1011,49 @@ export const Http: {
// @public
export interface HttpContent {
raw: any;
raw: any;
toArrayBuffer: () => ArrayBuffer;
toArrayBuffer: () => ArrayBuffer;
toFile: (destinationFilePath?: string) => File;
toFile: (destinationFilePath?: string) => File;
toImage: () => Promise<ImageSource>;
toImage: () => Promise<ImageSource>;
toJSON: (encoding?: HttpResponseEncoding) => any;
toJSON: (encoding?: HttpResponseEncoding) => any;
toString: (encoding?: HttpResponseEncoding) => string;
toString: (encoding?: HttpResponseEncoding) => string;
}
// @public
export interface HttpRequestOptions {
content?: string | FormData | ArrayBuffer;
content?: string | FormData | ArrayBuffer;
dontFollowRedirects?: boolean;
dontFollowRedirects?: boolean;
headers?: any;
headers?: any;
method: string;
method: string;
timeout?: number;
timeout?: number;
url: string;
url: string;
}
// @public
export interface HttpResponse {
content?: HttpContent;
content?: HttpContent;
headers: Headers;
headers: Headers;
statusCode: number;
statusCode: number;
}
// @public (undocumented)
export enum HttpResponseEncoding {
// (undocumented)
GBK,
// (undocumented)
UTF8
// (undocumented)
GBK,
// (undocumented)
UTF8
}
// @public
@@ -1646,7 +1646,7 @@ export interface PanGestureEventData extends GestureEventDataWithState {
deltaX: number;
// (undocumented)
deltaY: number;
}
}
// @public
export interface ParserEvent {
@@ -1702,7 +1702,7 @@ export interface PinchGestureEventData extends GestureEventDataWithState {
// (undocumented)
scale: number;
}
}
// @public
export class Placeholder extends View {
@@ -1767,7 +1767,7 @@ export class Repeater extends CustomLayoutView {
export interface RotationGestureEventData extends GestureEventDataWithState {
// (undocumented)
rotation: number;
}
}
// @public
export module Screen {
@@ -2172,13 +2172,13 @@ export enum SwipeDirection {
left,
right,
up
}
}
// @public
export interface SwipeGestureEventData extends GestureEventData {
// (undocumented)
direction: SwipeDirection;
}
}
// @public
export class Switch extends View {
@@ -2417,6 +2417,15 @@ export class TabViewItem extends ViewBase {
public view: View;
}
// @public
export interface TapGestureEventData extends GestureEventData {
getPointerCount(): number;
getX(): number;
getY(): number;
}
// @public
export interface Template {
(): View;
@@ -2536,20 +2545,12 @@ export interface TimerInfo {
}
// @public
export interface TouchGestureEventData extends GestureEventData {
export interface TouchGestureEventData extends TapGestureEventData {
action: "up" | "move" | "down" | "cancel";
// Warning: (ae-forgotten-export) The symbol "Pointer" needs to be exported by the entry point index.d.ts
getActivePointers(): Array<Pointer>;
getAllPointers(): Array<Pointer>;
getPointerCount(): number;
getX(): number;
getY(): number;
}
}
// @public (undocumented)
export const Trace: {