Skip to content

Commit 5546f93

Browse files
author
Travis CI User
committed
Deploy website
Deploy website version based on HEAD
0 parents  commit 5546f93

14 files changed

+2134
-0
lines changed

css/main.css

+1,906
Large diffs are not rendered by default.

docs/API.html

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<html lang="en"><head><meta charset="utf-8"/><meta http-equiv="X-UA-Compatible" content="IE=edge"/><title>API · React Native Sensors</title><meta name="viewport" content="width=device-width"/><meta name="generator" content="Docusaurus"/><meta property="og:title" content="API · React Native Sensors"/><meta property="og:type" content="website"/><meta property="og:url" content="https://react-native-sensors.github.io/index.html"/><meta property="og:description" content="We have two different APIs to provide the same functionality, one is **Default**, which is more verbose, the other one is **Decorator** which is a bit more elegant, but might be harder to read."/><link rel="shortcut icon" href="/"/><link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css"/><script type="text/javascript" src="https://buttons.github.io/buttons.js"></script><link rel="stylesheet" href="/css/main.css"/></head><body class="sideNavVisible doc"><div class="fixedHeaderContainer"><div class="headerWrapper wrapper"><header><a href="/"><h2 class="headerTitle">React Native Sensors</h2></a><div class="navigationWrapper navigationSlider"><nav class="slidingNav"><ul class="nav-site nav-site-internal"><li class="siteNavGroupActive"><a href="/docs/GettingStarted.html" target="_self">Docs</a></li><li class=""><a href="https://github.com/react-native-sensors/react-native-sensors" target="_self">GitHub</a></li></ul></nav></div></header></div></div><div class="navPusher"><div class="docMainWrapper wrapper"><div class="container docsNavContainer" id="docsNav"><nav class="toc"><div class="toggleNav"><section class="navWrapper wrapper"><div class="navBreadcrumb wrapper"><div class="navToggle" id="navToggler"><i></i></div><h2><i></i><span>API</span></h2></div><div class="navGroups"><div class="navGroup navGroupActive"><h3>Getting Started</h3><ul><li class="navListItem"><a class="navItem" href="/docs/Installation.html">Installation</a></li><li class="navListItem"><a class="navItem" href="/docs/GettingStarted.html">Getting Started</a></li></ul></div><div class="navGroup navGroupActive"><h3>Usage</h3><ul><li class="navListItem"><a class="navItem" href="/docs/Usage.Default.html">Default Syntax</a></li><li class="navListItem"><a class="navItem" href="/docs/Usage.Decorator.html">Decorator Syntax</a></li></ul></div><div class="navGroup navGroupActive"><h3>API</h3><ul><li class="navListItem navListItemActive"><a class="navItem navItemActive" href="/docs/API.html">API</a></li><li class="navListItem"><a class="navItem" href="/docs/Changelog.html">Changelog</a></li></ul></div></div></section></div><script>
2+
var toggler = document.getElementById('navToggler');
3+
var nav = document.getElementById('docsNav');
4+
toggler.onclick = function() {
5+
nav.classList.toggle('docsSliderActive');
6+
};
7+
</script></nav></div><div class="container mainContainer"><div class="wrapper"><div class="post"><header class="postHeader"><h1>API</h1></header><article><div><span><p>We have two different APIs to provide the same functionality, one is <strong>Default</strong>, which is more verbose, the other one is <strong>Decorator</strong> which is a bit more elegant, but might be harder to read.</p>
8+
<p>Supported sensors:</p>
9+
<ul>
10+
<li>Accelerometer</li>
11+
<li>Gyroscope</li>
12+
<li>Magnetometer</li>
13+
</ul>
14+
<p>The API of each of them is the same, therefore you will just see Accelerometer in the docs:</p>
15+
<h2><a class="anchor" aria-hidden="true" id="default"></a><a href="#default" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Default</h2>
16+
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> { Accelerometer } <span class="hljs-keyword">from</span> <span class="hljs-string">"react-native-sensors"</span>;
17+
</code></pre>
18+
<h3><a class="anchor" aria-hidden="true" id="async-constructoroptions-object-promise-sensorobservable"></a><a href="#async-constructoroptions-object-promise-sensorobservable" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>async constructor(options: Object) =&gt; Promise<SensorObservable></h3>
19+
<h4><a class="anchor" aria-hidden="true" id="optionsupdateinterval"></a><a href="#optionsupdateinterval" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>options.updateInterval</h4>
20+
<p><code>number</code> indicating how often updates should be polled, defaults to 100ms.</p>
21+
<h3><a class="anchor" aria-hidden="true" id="sensorobservable"></a><a href="#sensorobservable" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>SensorObservable</h3>
22+
<p>This is an <a href="http://reactivex.io/rxjs/class/es6/Observable.js~Observable.html">RxJS Observable</a>, extended by these functions:</p>
23+
<h4><a class="anchor" aria-hidden="true" id="stop"></a><a href="#stop" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>stop</h4>
24+
<p>Destroys the event creator and closes the observable.</p>
25+
<h2><a class="anchor" aria-hidden="true" id="decorator"></a><a href="#decorator" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>Decorator</h2>
26+
<pre><code class="hljs css js"><span class="hljs-keyword">import</span> { decorator } <span class="hljs-keyword">from</span> <span class="hljs-string">"react-native-sensors"</span>;
27+
</code></pre>
28+
<h3><a class="anchor" aria-hidden="true" id="decorator-sensorname-string-options-object-boolean-functionreactcomponent"></a><a href="#decorator-sensorname-string-options-object-boolean-functionreactcomponent" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>decorator({ [sensorName: string]: (options: Object | Boolean) }) =&gt; Function(ReactComponent)</h3>
29+
<pre><code class="hljs css js"><span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> sensors({
30+
<span class="hljs-attr">Accelerometer</span>: {
31+
<span class="hljs-attr">updateInterval</span>: <span class="hljs-number">300</span>
32+
},
33+
<span class="hljs-attr">Gyroscope</span>: <span class="hljs-literal">true</span>
34+
})(MyComponent);
35+
</code></pre>
36+
<h4><a class="anchor" aria-hidden="true" id="optionsupdateinterval"></a><a href="#optionsupdateinterval" aria-hidden="true" class="hash-link" ><svg aria-hidden="true" height="16" version="1.1" viewBox="0 0 16 16" width="16"><path fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path></svg></a>options.updateInterval</h4>
37+
<p><code>number</code> indicating how often updates should be polled, defaults to 100ms.</p>
38+
</span></div></article></div><div class="docs-prevnext"><a class="docs-prev button" href="Usage.Decorator.html">← The Decorator Syntax of React Native Sensors</a><a class="docs-next button" href="Changelog.html">Changelog →</a></div></div></div></div><footer class="nav-footer" id="footer"><section class="sitemap"><a href="/" class="nav-home"></a><div><h5>Docs</h5><a href="/docs/en/doc1.html">Getting Started (or other categories)</a><a href="/docs/en/doc2.html">Guides (or other categories)</a><a href="/docs/en/doc3.html">API Reference (or other categories)</a></div><div><h5>Community</h5><a href="/en/users.html">User Showcase</a><a href="http://stackoverflow.com/questions/tagged/" target="_blank">Stack Overflow</a><a href="https://discordapp.com/">Project Chat</a><a href="https://twitter.com/" target="_blank">Twitter</a></div><div><h5>More</h5><a href="/blog">Blog</a><a href="https://github.com/">GitHub</a><a class="github-button" href="https://github.com/react-native-sensors/react-native-sensors" data-icon="octicon-star" data-count-href="/facebook/docusaurus/stargazers" data-show-count="true" data-count-aria-label="# stargazers on GitHub" aria-label="Star this project on GitHub">Star</a></div></section><a href="https://code.facebook.com/projects/" target="_blank" class="fbOpenSource"><img src="/img/oss_logo.png" alt="Facebook Open Source" width="170" height="45"/></a><section class="copyright">Copyright © 2018 Facebook Inc.</section></footer></div></body></html>

0 commit comments

Comments
 (0)