Browse Source

Improve exposed methods typings

Mathieu Acthernoene 5 years ago
parent
commit
c6373c3323
1 changed files with 6 additions and 6 deletions
  1. 6
    6
      index.js

+ 6
- 6
index.js View File

212
   return internalCheck(permission);
212
   return internalCheck(permission);
213
 }
213
 }
214
 
214
 
215
-export function checkMultiple(
216
-  permissions: Permission[],
217
-): Promise<{ [permission: Permission]: PermissionStatus }> {
215
+export function checkMultiple<P: Permission>(
216
+  permissions: P[],
217
+): Promise<{ [permission: P]: PermissionStatus }> {
218
   permissions.forEach(assertValidPermission);
218
   permissions.forEach(assertValidPermission);
219
   return internalCheckMultiple(permissions);
219
   return internalCheckMultiple(permissions);
220
 }
220
 }
227
   return internalRequest(permission, config);
227
   return internalRequest(permission, config);
228
 }
228
 }
229
 
229
 
230
-export function requestMultiple(
231
-  permissions: Permission[],
232
-): Promise<{ [permission: Permission]: PermissionStatus }> {
230
+export function requestMultiple<P: Permission>(
231
+  permissions: P[],
232
+): Promise<{ [permission: P]: PermissionStatus }> {
233
   permissions.forEach(assertValidPermission);
233
   permissions.forEach(assertValidPermission);
234
   return internalRequestMultiple(permissions);
234
   return internalRequestMultiple(permissions);
235
 }
235
 }