diff --git a/src/apis/Appearance.bs.js b/src/apis/Appearance.bs.js new file mode 100644 index 00000000000000..ae1b9f17e65d38 --- /dev/null +++ b/src/apis/Appearance.bs.js @@ -0,0 +1 @@ +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/src/apis/Appearance.md b/src/apis/Appearance.md new file mode 100644 index 00000000000000..f4bc919e9b5840 --- /dev/null +++ b/src/apis/Appearance.md @@ -0,0 +1,21 @@ +--- +id: apis/AppState +title: AppState +wip: true +--- + +```reason +type t; + +[@bs.inline "dark"] +let dark: t; + +[@bs.inline "light"] +let light: t; + +[@bs.scope "Appearance"] [@bs.module "react-native"] +external getColorScheme: unit => option(t) = "getColorScheme"; + +[@bs.module "react-native"] +external useColorScheme: unit => option(t) = "useColorScheme"; +``` diff --git a/src/apis/Appearance.re b/src/apis/Appearance.re new file mode 100644 index 00000000000000..ee391f2b879bdd --- /dev/null +++ b/src/apis/Appearance.re @@ -0,0 +1,13 @@ +type t = string; + +[@bs.inline] +let dark = "dark"; + +[@bs.inline] +let light = "light"; + +[@bs.scope "Appearance"] [@bs.module "react-native"] +external getColorScheme: unit => option(t) = "getColorScheme"; + +[@bs.module "react-native"] +external useColorScheme: unit => option(t) = "useColorScheme"; diff --git a/src/apis/Appearance.rei b/src/apis/Appearance.rei new file mode 100644 index 00000000000000..daa81476037079 --- /dev/null +++ b/src/apis/Appearance.rei @@ -0,0 +1,13 @@ +type t; + +[@bs.inline "dark"] +let dark: t; + +[@bs.inline "light"] +let light: t; + +[@bs.scope "Appearance"] [@bs.module "react-native"] +external getColorScheme: unit => option(t) = "getColorScheme"; + +[@bs.module "react-native"] +external useColorScheme: unit => option(t) = "useColorScheme";