expo-permissions-store 0.1.0
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/README.md +213 -0
- package/dist/api.d.ts +537 -0
- package/dist/api.d.ts.map +1 -0
- package/dist/createApi.d.ts +1600 -0
- package/dist/createApi.d.ts.map +1 -0
- package/dist/foreground.d.ts +7 -0
- package/dist/foreground.d.ts.map +1 -0
- package/dist/index.cjs +322 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +286 -0
- package/dist/permissions/handlers.d.ts +4 -0
- package/dist/permissions/handlers.d.ts.map +1 -0
- package/dist/store.d.ts +20 -0
- package/dist/store.d.ts.map +1 -0
- package/dist/types.d.ts +32 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +103 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export type PermissionType = "camera" | "microphone" | "mediaLibrary" | "locationForeground" | "locationBackground" | "notifications" | "contacts" | "calendar" | "tracking";
|
|
2
|
+
export type PermissionStatus = "undetermined" | "granted" | "denied" | "limited";
|
|
3
|
+
export interface PermissionState {
|
|
4
|
+
status: PermissionStatus;
|
|
5
|
+
canAskAgain: boolean;
|
|
6
|
+
expires: "never" | number;
|
|
7
|
+
}
|
|
8
|
+
export interface PermissionsConfig {
|
|
9
|
+
/**
|
|
10
|
+
* Which permissions to include in the API
|
|
11
|
+
* @default all permissions
|
|
12
|
+
*/
|
|
13
|
+
permissions?: PermissionType[];
|
|
14
|
+
/**
|
|
15
|
+
* Re-check permissions when app returns to foreground
|
|
16
|
+
* @default true
|
|
17
|
+
*/
|
|
18
|
+
recheckOnForeground?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Automatically check all configured permissions on store creation
|
|
21
|
+
* @default false
|
|
22
|
+
*/
|
|
23
|
+
autoCheckOnMount?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* RTK Query cache time in seconds
|
|
26
|
+
* @default Infinity
|
|
27
|
+
*/
|
|
28
|
+
cacheTime?: number;
|
|
29
|
+
}
|
|
30
|
+
export declare const ALL_PERMISSIONS: PermissionType[];
|
|
31
|
+
export declare const DEFAULT_CONFIG: Required<PermissionsConfig>;
|
|
32
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GACtB,QAAQ,GACR,YAAY,GACZ,cAAc,GACd,oBAAoB,GACpB,oBAAoB,GACpB,eAAe,GACf,UAAU,GACV,UAAU,GACV,UAAU,CAAC;AAEf,MAAM,MAAM,gBAAgB,GACxB,cAAc,GACd,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAE/B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAE9B;;;OAGG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,eAAe,EAAE,cAAc,EAU3C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,iBAAiB,CAKtD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "expo-permissions-store",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Redux Toolkit (RTK Query) store for managing Expo permissions",
|
|
5
|
+
"main": "dist/index.cjs",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"keywords": [
|
|
20
|
+
"expo",
|
|
21
|
+
"permissions",
|
|
22
|
+
"redux",
|
|
23
|
+
"rtk-query",
|
|
24
|
+
"react-native"
|
|
25
|
+
],
|
|
26
|
+
"author": "",
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/tupe12334/expo-permissions-store.git"
|
|
31
|
+
},
|
|
32
|
+
"peerDependencies": {
|
|
33
|
+
"@reduxjs/toolkit": ">=1.9.0",
|
|
34
|
+
"react": ">=18.0.0",
|
|
35
|
+
"react-redux": ">=8.0.0"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"expo-camera": {
|
|
39
|
+
"optional": true
|
|
40
|
+
},
|
|
41
|
+
"expo-media-library": {
|
|
42
|
+
"optional": true
|
|
43
|
+
},
|
|
44
|
+
"expo-location": {
|
|
45
|
+
"optional": true
|
|
46
|
+
},
|
|
47
|
+
"expo-notifications": {
|
|
48
|
+
"optional": true
|
|
49
|
+
},
|
|
50
|
+
"expo-contacts": {
|
|
51
|
+
"optional": true
|
|
52
|
+
},
|
|
53
|
+
"expo-calendar": {
|
|
54
|
+
"optional": true
|
|
55
|
+
},
|
|
56
|
+
"expo-tracking-transparency": {
|
|
57
|
+
"optional": true
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@commitlint/cli": "^19.0.0",
|
|
62
|
+
"@release-it/conventional-changelog": "^10.0.0",
|
|
63
|
+
"@commitlint/config-conventional": "^19.0.0",
|
|
64
|
+
"@eslint/js": "^9.0.0",
|
|
65
|
+
"@reduxjs/toolkit": "^2.0.0",
|
|
66
|
+
"@types/react": "^18.2.0",
|
|
67
|
+
"cspell": "^8.0.0",
|
|
68
|
+
"eslint": "^9.0.0",
|
|
69
|
+
"eslint-config-prettier": "^9.0.0",
|
|
70
|
+
"expo-calendar": "^14.1.4",
|
|
71
|
+
"expo-camera": "^16.1.11",
|
|
72
|
+
"expo-contacts": "^14.2.6",
|
|
73
|
+
"expo-location": "^18.1.6",
|
|
74
|
+
"expo-media-library": "^17.1.7",
|
|
75
|
+
"expo-notifications": "^0.29.14",
|
|
76
|
+
"expo-tracking-transparency": "^5.2.4",
|
|
77
|
+
"husky": "^9.0.0",
|
|
78
|
+
"jest": "^29.7.0",
|
|
79
|
+
"knip": "^5.0.0",
|
|
80
|
+
"lint-staged": "^15.0.0",
|
|
81
|
+
"prettier": "^3.0.0",
|
|
82
|
+
"react": "^18.2.0",
|
|
83
|
+
"react-native": "^0.76.0",
|
|
84
|
+
"react-redux": "^9.0.0",
|
|
85
|
+
"release-it": "^19.0.0",
|
|
86
|
+
"tsup": "^8.0.0",
|
|
87
|
+
"typescript": "^5.3.0",
|
|
88
|
+
"typescript-eslint": "^8.0.0"
|
|
89
|
+
},
|
|
90
|
+
"scripts": {
|
|
91
|
+
"build": "tsup && tsc --project tsconfig.build.json",
|
|
92
|
+
"dev": "tsup --watch",
|
|
93
|
+
"lint": "eslint src",
|
|
94
|
+
"lint:fix": "eslint src --fix",
|
|
95
|
+
"format": "prettier --write .",
|
|
96
|
+
"format:check": "prettier --check .",
|
|
97
|
+
"typecheck": "tsc --noEmit",
|
|
98
|
+
"spell": "cspell \"**/*\"",
|
|
99
|
+
"knip": "knip",
|
|
100
|
+
"test": "jest --passWithNoTests",
|
|
101
|
+
"release": "release-it"
|
|
102
|
+
}
|
|
103
|
+
}
|