Ver código fonte

fix(types): add basicAuthCredential prop

iwashita 4 anos atrás
pai
commit
4b0be3f0cd
2 arquivos alterados com 30 adições e 0 exclusões
  1. 12
    0
      docs/Reference.md
  2. 18
    0
      src/WebViewTypes.ts

+ 12
- 0
docs/Reference.md Ver arquivo

@@ -71,6 +71,7 @@ This document lays out the current public properties and methods for the React N
71 71
 - [`pullToRefreshEnabled`](Reference.md#pullToRefreshEnabled)
72 72
 - [`ignoreSilentHardwareSwitch`](Reference.md#ignoreSilentHardwareSwitch)
73 73
 - [`onFileDownload`](Reference.md#onFileDownload)
74
+- [`basicAuthCredential`](Reference.md#basicAuthCredential)
74 75
 
75 76
 ## Methods Index
76 77
 
@@ -1265,6 +1266,17 @@ Example:
1265 1266
 | ------- | -------- | -------- |
1266 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 1280
 ## Methods
1269 1281
 
1270 1282
 ### `extraNativeComponentConfig()`[⬆](#methods-index)<!-- Link generated with jump2header -->

+ 18
- 0
src/WebViewTypes.ts Ver arquivo

@@ -249,6 +249,18 @@ export type OnShouldStartLoadWithRequest = (
249 249
   event: ShouldStartLoadRequest,
250 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 264
 export interface CommonNativeWebViewProps extends ViewProps {
253 265
   cacheEnabled?: boolean;
254 266
   incognito?: boolean;
@@ -277,6 +289,7 @@ export interface CommonNativeWebViewProps extends ViewProps {
277 289
    * Append to the existing user-agent. Overridden if `userAgent` is set.
278 290
    */
279 291
   applicationNameForUserAgent?: string;
292
+  basicAuthCredential?: BasicAuthCredential;
280 293
 }
281 294
 
282 295
 export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
@@ -1031,4 +1044,9 @@ export interface WebViewSharedProps extends ViewProps {
1031 1044
    * Append to the existing user-agent. Overridden if `userAgent` is set.
1032 1045
    */
1033 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
 }