瀏覽代碼

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
No account linked to committer's email address
共有 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