From 0a38b7139ac8f3683d250d57e474de42591582dd Mon Sep 17 00:00:00 2001 From: gunnargylfa Date: Sun, 24 Sep 2017 17:03:41 +0000 Subject: [PATCH] adding additional bindings for RN PixelRatio --- src/pixelRatioRe.re | 8 +++++++- src/pixelRatioRe.rei | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/pixelRatioRe.re b/src/pixelRatioRe.re index 421bf2c15d3a22..4e1a6b4bad7b52 100644 --- a/src/pixelRatioRe.re +++ b/src/pixelRatioRe.re @@ -1 +1,7 @@ -external get : unit => int = "get" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"]; +external get : unit => float = "get" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"]; + +external getFontScale : unit => float = "getFontScale" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"]; + +external getPixelSizeForLayoutSize : int => int = "getPixelSizeForLayoutSize" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"]; + +external roundToNearestPixel : float => float = "roundToNearestPixel" [@@bs.scope "PixelRatio"] [@@bs.module "react-native"]; \ No newline at end of file diff --git a/src/pixelRatioRe.rei b/src/pixelRatioRe.rei index 8a6c6f2fdf4349..f91484a4c1795e 100644 --- a/src/pixelRatioRe.rei +++ b/src/pixelRatioRe.rei @@ -1 +1,7 @@ -let get: unit => int; +let get: unit => float; + +let getFontScale: unit => float; + +let getPixelSizeForLayoutSize: int => int; + +let roundToNearestPixel: float => float; \ No newline at end of file