-
-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathMLRNModule.ts
60 lines (47 loc) · 1.36 KB
/
MLRNModule.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
import { NativeModules } from "react-native";
import { CameraMode } from "./types/CameraMode";
interface IMLRNModule {
CameraModes: {
Flight: CameraMode.Flight;
Ease: CameraMode.Ease;
Linear: CameraMode.Linear;
None: CameraMode.None;
};
OfflinePackDownloadState: {
Inactive: string | number;
Active: string | number;
Complete: string | number;
Unknown?: string | number;
};
StyleSource: {
DefaultSourceID: string;
};
StyleURL: {
Default: string;
};
/**
* @deprecated This will be removed in the next major version.
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
*/
setAccessToken(accessToken: string | null): Promise<string | null>;
/**
* @deprecated This will be removed in the next major version.
* @see https://github.com/maplibre/maplibre-react-native/issues/25#issuecomment-1382382044
*/
getAccessToken(): Promise<string>;
addCustomHeader(headerName: string, headerValue: string): void;
removeCustomHeader(headerName: string): void;
setConnected(connected: boolean): void;
}
const MLRNModule: IMLRNModule = Object.create(NativeModules.MLRNModule);
export const {
CameraModes,
OfflinePackDownloadState,
StyleSource,
StyleURL,
setAccessToken,
getAccessToken,
addCustomHeader,
removeCustomHeader,
setConnected,
} = MLRNModule;