Pārlūkot izejas kodu

fix(ts): Convert ContentInsetAdjustmentBehavior from an enum back to a string union type (#1536)

ContentInsetAdjustmentBehavior was originally added as a string union type. The change to support MacOS replaced it with an enum, which was a bit of a breaking change, especially as the enum was not exported from the main library. Exporting the enum would probably also help, but since this was the only enum and the rest of react-native-webview uses string unions instead, it seems best to revert it to a string union.

Co-authored-by: Jamon Holmgren <jamonholmgren@gmail.com>
Caleb Clarke 3 gadus atpakaļ
vecāks
revīzija
a48c9819c5
No account linked to committer's email address
1 mainītis faili ar 1 papildinājumiem un 6 dzēšanām
  1. 1
    6
      src/WebViewTypes.ts

+ 1
- 6
src/WebViewTypes.ts Parādīt failu

@@ -301,12 +301,7 @@ export interface AndroidNativeWebViewProps extends CommonNativeWebViewProps {
301 301
   readonly urlPrefixesForDefaultIntent?: string[];
302 302
 }
303 303
 
304
-export enum ContentInsetAdjustmentBehavior {
305
-  automatic = 'automatic',
306
-  scrollableAxes = 'scrollableAxes',
307
-  never = 'never',
308
-  always = 'always'
309
-};
304
+export declare type ContentInsetAdjustmentBehavior = 'automatic' | 'scrollableAxes' | 'never' | 'always';
310 305
 
311 306
 export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
312 307