瀏覽代碼

Improve exposed methods typings

Mathieu Acthernoene 5 年之前
父節點
當前提交
c6373c3323
共有 1 個文件被更改,包括 6 次插入6 次删除
  1. 6
    6
      index.js

+ 6
- 6
index.js 查看文件

@@ -212,9 +212,9 @@ export function check(permission: Permission): Promise<PermissionStatus> {
212 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 218
   permissions.forEach(assertValidPermission);
219 219
   return internalCheckMultiple(permissions);
220 220
 }
@@ -227,9 +227,9 @@ export function request(
227 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 233
   permissions.forEach(assertValidPermission);
234 234
   return internalRequestMultiple(permissions);
235 235
 }