浏览代码

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 4 年前
父节点
当前提交
a48c9819c5
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 1 次插入6 次删除
  1. 1
    6
      src/WebViewTypes.ts

+ 1
- 6
src/WebViewTypes.ts 查看文件

301
   readonly urlPrefixesForDefaultIntent?: string[];
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
 export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
306
 export declare type ContentMode = 'recommended' | 'mobile' | 'desktop';
312
 
307