Browse Source

Improve request type doc

Mathieu Acthernoene 5 years ago
parent
commit
f3d950098d
1 changed files with 26 additions and 22 deletions
  1. 26
    22
      README.md

+ 26
- 22
README.md View File

174
 
174
 
175
 ### Methods
175
 ### Methods
176
 
176
 
177
-*types used in usage examples*
177
+_types used in usage examples_
178
 
178
 
179
-```ts  
180
-type Permission =
181
-  | keyof ANDROID_PERMISSIONS
182
-  | keyof IOS_PERMISSIONS
179
+```ts
180
+type Permission = keyof ANDROID_PERMISSIONS | keyof IOS_PERMISSIONS;
183
 
181
 
184
 type PermissionStatus =
182
 type PermissionStatus =
185
   | "granted"
183
   | "granted"
186
   | "denied"
184
   | "denied"
187
   | "never_ask_again"
185
   | "never_ask_again"
188
   | "unavailable";
186
   | "unavailable";
189
-
190
-type NotificationOption =
191
-  | "badge"
192
-  | "sound"
193
-  | "alert"
194
-  | "carPlay"
195
-  | "criticalAlert"
196
-  | "provisional";
197
-
198
-type Rationale = {
199
-  title: string;
200
-  message: string;
201
-  buttonPositive: string;
202
-  buttonNegative?: string;
203
-  buttonNeutral?: string;
204
-};
205
 ```
187
 ```
206
 
188
 
207
 #### check()
189
 #### check()
272
 #### Method type
254
 #### Method type
273
 
255
 
274
 ```ts
256
 ```ts
275
-function request(permission: string, config: RequestConfig = {}): Promise<PermissionStatus>;
257
+type NotificationOption =
258
+  | "badge"
259
+  | "sound"
260
+  | "alert"
261
+  | "carPlay"
262
+  | "criticalAlert"
263
+  | "provisional";
264
+
265
+type Rationale = {
266
+  title: string;
267
+  message: string;
268
+  buttonPositive: string;
269
+  buttonNegative?: string;
270
+  buttonNeutral?: string;
271
+};
272
+
273
+function request(
274
+  permission: string,
275
+  config: {
276
+    notificationOptions?: NotificationOption[];
277
+    rationale?: Rationale;
278
+  } = {},
279
+): Promise<PermissionStatus>;
276
 ```
280
 ```
277
 
281
 
278
 #### Usage example
282
 #### Usage example