Browse Source

fix(types): add basicAuthCredential prop

iwashita 4 years ago
parent
commit
4b0be3f0cd
2 changed files with 30 additions and 0 deletions
  1. 12
    0
      docs/Reference.md
  2. 18
    0
      src/WebViewTypes.ts

+ 12
- 0
docs/Reference.md View File

71
 - [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
71
 - [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
72
 - [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
72
 - [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
73
 - [`onFileDownload`](Reference.md#onFileDownload)
73
 - [`onFileDownload`](Reference.md#onFileDownload)
74
+- [`basicAuthCredential`](Reference.md#basicAuthCredential)
74
 
75
 
75
 ## Methods Index
76
 ## Methods Index
76
 
77
 
1265
 | ------- | -------- | -------- |
1266
 | ------- | -------- | -------- |
1266
 | function | No       | iOS      |
1267
 | function | No       | iOS      |
1267
 
1268
 
1269
+### `basicAuthCredential`[⬆](#props-index)<!-- Link generated with jump2header -->
1270
+
1271
+An object that specifies the credentials of a user to be used for basic authentication.
1272
+
1273
+- `username` (string) - A username used for basic authentication.
1274
+- `password` (string) - A password used for basic authentication.
1275
+
1276
+| Type   | Required |
1277
+| ------ | -------- |
1278
+| object | No       |
1279
+
1268
 ## Methods
1280
 ## Methods
1269
 
1281
 
1270
 ### `extraNativeComponentConfig()`[⬆](#methods-index)<!-- Link generated with jump2header -->
1282
 ### `extraNativeComponentConfig()`[⬆](#methods-index)<!-- Link generated with jump2header -->

+ 18
- 0
src/WebViewTypes.ts View File

249
   event: ShouldStartLoadRequest,
249
   event: ShouldStartLoadRequest,
250
 ) => boolean;
250
 ) => boolean;
251
 
251
 
252
+export interface BasicAuthCredential {
253
+  /**
254
+   * A username used for basic authentication.
255
+   */
256
+  username: string;
257
+
258
+  /**
259
+   * A password used for basic authentication.
260
+   */
261
+  password: string;
262
+}
263
+
252
 export interface CommonNativeWebViewProps extends ViewProps {
264
 export interface CommonNativeWebViewProps extends ViewProps {
253
   cacheEnabled?: boolean;
265
   cacheEnabled?: boolean;
254
   incognito?: boolean;
266
   incognito?: boolean;
277
    * Append to the existing user-agent. Overridden if `userAgent` is set.
289
    * Append to the existing user-agent. Overridden if `userAgent` is set.
278
    */
290
    */
279
   applicationNameForUserAgent?: string;
291
   applicationNameForUserAgent?: string;
292
+  basicAuthCredential?: BasicAuthCredential;
280
 }
293
 }
281
 
294
 
282
 export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
295
 export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
1031
    * Append to the existing user-agent. Overridden if `userAgent` is set.
1044
    * Append to the existing user-agent. Overridden if `userAgent` is set.
1032
    */
1045
    */
1033
   applicationNameForUserAgent?: string;
1046
   applicationNameForUserAgent?: string;
1047
+
1048
+  /**
1049
+   * An object that specifies the credentials of a user to be used for basic authentication.
1050
+   */
1051
+  basicAuthCredential?: BasicAuthCredential;
1034
 }
1052
 }