forked from react-native-maps/react-native-maps
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsharedTypes.ts
101 lines (80 loc) · 1.58 KB
/
sharedTypes.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import {NativeSyntheticEvent} from 'react-native';
export type Provider = 'google' | undefined;
export type LatLng = {
latitude: number;
longitude: number;
};
export type Point = {
x: number;
y: number;
};
export type Region = LatLng & {
latitudeDelta: number;
longitudeDelta: number;
};
export type Frame = Point & {height: number; width: number};
export type CalloutPressEvent = NativeSyntheticEvent<{
action: 'callout-press';
/**
* @platform iOS
*/
frame?: Frame;
/**
* @platform iOS
*/
id?: string;
/**
* @platform iOS
*/
point?: Point;
/**
* @platform Android
*/
coordinate?: LatLng;
/**
* @platform Android
*/
position?: Point;
}>;
export type LineCapType = 'butt' | 'round' | 'square';
export type LineJoinType = 'miter' | 'round' | 'bevel';
export type ClickEvent<T = {}> = NativeSyntheticEvent<
{coordinate: LatLng; position: Point} & T
>;
export type MarkerDeselectEvent = Omit<
ClickEvent<{
action: 'marker-deselect';
id: string;
}>,
'position'
>;
export type MarkerSelectEvent = Omit<
ClickEvent<{id: string; action: 'marker-select'}>,
'position'
>;
export type MarkerDragEvent = ClickEvent<{
/**
* @platform iOS
*/
id?: string;
}>;
export type MarkerDragStartEndEvent = NativeSyntheticEvent<{
coordinate: LatLng;
/**
* @platform iOS
*/
id?: string;
/**
* @platform Android
*/
position?: Point;
}>;
export type MarkerPressEvent = NativeSyntheticEvent<{
id: string;
action: 'marker-press';
coordinate: LatLng;
/**
* @platform Android
*/
position?: Point;
}>;