Skip to content

Commit

Permalink
add module Appearance (facebook#654)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgny committed Mar 26, 2020
1 parent 48ba58c commit c3acd48
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/apis/Appearance.bs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */
21 changes: 21 additions & 0 deletions src/apis/Appearance.md
Original file line number Diff line number Diff line change
@@ -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";
```
13 changes: 13 additions & 0 deletions src/apis/Appearance.re
Original file line number Diff line number Diff line change
@@ -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";
13 changes: 13 additions & 0 deletions src/apis/Appearance.rei
Original file line number Diff line number Diff line change
@@ -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";

0 comments on commit c3acd48

Please sign in to comment.