Skip to content

Commit 5218ce9

Browse files
committed
refactor: implement request AndroidPermission in typescript
1 parent 44a508c commit 5218ce9

File tree

11 files changed

+84
-1285
lines changed

11 files changed

+84
-1285
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,11 @@ module.exports = {
8585
files: ['**/*.{ts,tsx}'],
8686

8787
parserOptions: {
88-
project: './tsconfig.json',
88+
project: [
89+
'./tsconfig.json',
90+
'./example/tsconfig.json',
91+
'./plugin/src/__tests__/tsconfig.eslint.json',
92+
],
8993
},
9094
plugins: ['@typescript-eslint'],
9195
extends: [

.github/workflows/on-push.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@ jobs:
3333
- name: Lint
3434
run: yarn lint
3535

36+
- name: Type check
37+
run: yarn type:check
38+
3639
- name: Test
3740
run: yarn unittest
3841

example/tsconfig.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"baseUrl": ".",
5+
"paths": {
6+
"@rnmapbox/maps": ["../"],
7+
"react": ["./node_modules/@types/react"],
8+
}
9+
},
10+
"include": ["index.js", "src/**/*", "../index.ts", "../javascript/**/*"]
11+
}

index.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import {
2222
FeatureCollection,
2323
} from '@turf/helpers';
2424

25+
import type { requestAndroidLocationPermissions as _requestAndroidLocationPermissions } from './javascript/requestAndroidLocationPermissions';
26+
2527
// prettier-ignore
2628
type ExpressionName =
2729
// Types
@@ -108,7 +110,8 @@ declare namespace MapboxGL {
108110
function getAccessToken(): Promise<string>;
109111
function setTelemetryEnabled(telemetryEnabled: boolean): void;
110112
function setConnected(connected: boolean): void;
111-
function requestAndroidLocationPermissions(): Promise<boolean>;
113+
114+
const requestAndroidLocationPermissions = _requestAndroidLocationPermissions;
112115

113116
const offlineManager: OfflineManager;
114117
const snapshotManager: SnapshotManager;

0 commit comments

Comments
 (0)