update website

This commit is contained in:
Christopher Chedeau
2015-03-15 18:44:26 -07:00
parent 44f3f386c3
commit 1da61d41cb
28 changed files with 52 additions and 939 deletions
File diff suppressed because one or more lines are too long
+1 -80
View File
File diff suppressed because one or more lines are too long
+1 -94
View File
@@ -4,100 +4,7 @@ root components should register themselves with
for the app and then actually run the app when it's ready by invoking
<code>AppRegistry.runApplication</code>.</p><p><code>AppRegistry</code> should be <code>require</code>d early in the <code>require</code> sequence to make
sure the JS execution environment is setup before other modules are
<code>require</code>d.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerconfig"></a><span class="propType">static </span>registerConfig(<span class="propType">config</span>) <a class="hash-link" href="#registerconfig">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registercomponent"></a><span class="propType">static </span>registerComponent(<span class="propType">appKey, getComponentFunc</span>) <a class="hash-link" href="#registercomponent">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerrunnable"></a><span class="propType">static </span>registerRunnable(<span class="propType">appKey, func</span>) <a class="hash-link" href="#registerrunnable">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="runapplication"></a><span class="propType">static </span>runApplication(<span class="propType">appKey, appParameters</span>) <a class="hash-link" href="#runapplication">#</a></h4></div></div><pre>{
&quot;methods&quot;: [
{
&quot;line&quot;: 31,
&quot;source&quot;: &quot;registerConfig: function(config) {\n for (var i = 0; i &lt; config.length; ++i) {\n if (config[i].run) {\n AppRegistry.registerRunnable(config[i].appKey, config[i].run);\n } else {\n AppRegistry.registerComponent(config[i].appKey, config[i].component);\n }\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;config&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;registerConfig&quot;
},
{
&quot;line&quot;: 41,
&quot;source&quot;: &quot;registerComponent: function(appKey, getComponentFunc) {\n runnables[appKey] = {\n run: (appParameters) =&gt;\n renderApplication(getComponentFunc(), appParameters.initialProps, appParameters.rootTag)\n };\n return appKey;\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;appKey&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;getComponentFunc&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;registerComponent&quot;
},
{
&quot;line&quot;: 49,
&quot;source&quot;: &quot;registerRunnable: function(appKey, func) {\n runnables[appKey] = {run: func};\n return appKey;\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;appKey&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;func&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;registerRunnable&quot;
},
{
&quot;line&quot;: 54,
&quot;source&quot;: &quot;runApplication: function(appKey, appParameters) {\n console.log(\n &#x27;Running application \&quot;&#x27; + appKey + &#x27;\&quot; with appParams: &#x27; +\n JSON.stringify(appParameters) + &#x27;. &#x27; +\n &#x27;__DEV__ === &#x27; + __DEV__ +\n &#x27;, development-level warning are &#x27; + (__DEV__ ? &#x27;ON&#x27; : &#x27;OFF&#x27;) +\n &#x27;, performance optimizations are &#x27; + (__DEV__ ? &#x27;OFF&#x27; : &#x27;ON&#x27;)\n );\n invariant(\n runnables[appKey] &amp;&amp; runnables[appKey].run,\n &#x27;Application &#x27; + appKey + &#x27; has not been registered.&#x27;\n );\n runnables[appKey].run(appParameters);\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;appKey&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;appParameters&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;runApplication&quot;
}
],
&quot;properties&quot;: [],
&quot;superClass&quot;: null,
&quot;type&quot;: &quot;api&quot;,
&quot;line&quot;: 30,
&quot;name&quot;: &quot;AppRegistry&quot;,
&quot;docblock&quot;: &quot;/**\n * `AppRegistry` is the JS entry point to running all React Native apps. App\n * root components should register themselves with\n * `AppRegistry.registerComponent`, then the native system can load the bundle\n * for the app and then actually run the app when it&#x27;s ready by invoking\n * `AppRegistry.runApplication`.\n *\n * `AppRegistry` should be `require`d early in the `require` sequence to make\n * sure the JS execution environment is setup before other modules are\n * `require`d.\n */\n&quot;,
&quot;requires&quot;: [
{
&quot;name&quot;: &quot;invariant&quot;
},
{
&quot;name&quot;: &quot;renderApplication&quot;
}
]
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="appstate.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
<code>require</code>d.</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerconfig"></a><span class="propType">static </span>registerConfig(<span class="propType">config</span>) <a class="hash-link" href="#registerconfig">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registercomponent"></a><span class="propType">static </span>registerComponent(<span class="propType">appKey, getComponentFunc</span>) <a class="hash-link" href="#registercomponent">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="registerrunnable"></a><span class="propType">static </span>registerRunnable(<span class="propType">appKey, func</span>) <a class="hash-link" href="#registerrunnable">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="runapplication"></a><span class="propType">static </span>runApplication(<span class="propType">appKey, appParameters</span>) <a class="hash-link" href="#runapplication">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="appstate.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+1 -56
View File
File diff suppressed because one or more lines are too long
+1 -59
View File
File diff suppressed because one or more lines are too long
+5 -228
View File
@@ -2,237 +2,14 @@
system. It should be used instead of LocalStorage.</p><p>It is recommended that you use an abstraction on top of AsyncStorage instead
of AsyncStorage directly for anything more than light usage since it
operates globally.</p><p>This JS code is a simple facad over the native iOS implementation to provide
a clear JS API, real Error objects, and simple non-multi functions.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="getitem"></a><span class="propType">static </span>getItem(<span class="propType">key: string, callback: (error: ?Error, result: ?string) =&gt; void</span>) <a class="hash-link" href="#getitem">#</a></h4><div><p>Fetches <code>key</code> and passes the result to <code>callback</code>, along with an <code>Error</code> if
a clear JS API, real Error objects, and simple non-multi functions.</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="getitem"></a><span class="propType">static </span>getItem(<span class="propType">key: string, callback: (error: ?Error, result: ?string) =&gt; void</span>) <a class="hash-link" href="#getitem">#</a></h4><div><p>Fetches <code>key</code> and passes the result to <code>callback</code>, along with an <code>Error</code> if
there is any.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="setitem"></a><span class="propType">static </span>setItem(<span class="propType">key: string, value: string, callback: ?(error: ?Error) =&gt; void</span>) <a class="hash-link" href="#setitem">#</a></h4><div><p>Sets <code>value</code> for <code>key</code> and calls <code>callback</code> on completion, along with an
<code>Error</code> if there is any.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="removeitem"></a><span class="propType">static </span>removeItem(<span class="propType">key: string, callback: ?(error: ?Error) =&gt; void</span>) <a class="hash-link" href="#removeitem">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="mergeitem"></a><span class="propType">static </span>mergeItem(<span class="propType">key: string, value: string, callback: ?(error: ?Error) =&gt; void</span>) <a class="hash-link" href="#mergeitem">#</a></h4><div><p>Merges existing value with input value, assuming they are stringified json.</p><p>Not supported by all native implementations.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clear"></a><span class="propType">static </span>clear(<span class="propType">callback: ?(error: ?Error) =&gt; void</span>) <a class="hash-link" href="#clear">#</a></h4><div><p>Erases <em>all</em> AsyncStorage for all clients, libraries, etc. You probably
don&#x27;t want to call this - use removeItem or multiRemove to clear only your
own keys instead.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="getallkeys"></a><span class="propType">static </span>getAllKeys(<span class="propType">callback: (error: ?Error) =&gt; void</span>) <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the system, for all callers, libraries, etc.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiget"></a><span class="propType">static </span>multiGet(<span class="propType">keys: :({&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;string&quot;,&quot;length&quot;:1}],&quot;length&quot;:4}, callback: (errors: ?Array&lt;Error&gt;, result: ?Array&lt;Array&lt;string&gt;&gt;) =&gt; void</span>) <a class="hash-link" href="#multiget">#</a></h4><div><p>multiGet invokes callback with an array of key-value pair arrays that
matches the input format of multiSet.</p><p>multiGet([&#x27;k1&#x27;, &#x27;k2&#x27;], cb) -&gt; cb([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]])</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiset"></a><span class="propType">static </span>multiSet(<span class="propType">keyValuePairs: :({&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;string&quot;,&quot;length&quot;:1}],&quot;length&quot;:4}],&quot;length&quot;:7}, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multiset">#</a></h4><div><p>multiSet and multiMerge take arrays of key-value array pairs that match
the output of multiGet, e.g.</p><p>multiSet([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]], cb);</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiremove"></a><span class="propType">static </span>multiRemove(<span class="propType">keys: :({&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;string&quot;,&quot;length&quot;:1}],&quot;length&quot;:4}, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multiremove">#</a></h4><div><p>Delete all the keys in the <code>keys</code> array.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multimerge"></a><span class="propType">static </span>multiMerge(<span class="propType">keyValuePairs: :({&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;generic&quot;,&quot;value&quot;:[{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;Array&quot;,&quot;length&quot;:1},{&quot;type&quot;:&quot;simple&quot;,&quot;value&quot;:&quot;string&quot;,&quot;length&quot;:1}],&quot;length&quot;:4}],&quot;length&quot;:7}, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multimerge">#</a></h4><div><p>Merges existing values with input values, assuming they are stringified
json.</p><p>Not supported by all native implementations.</p></div></div></div><pre>{
&quot;methods&quot;: [
{
&quot;line&quot;: 32,
&quot;source&quot;: &quot;getItem: function(\n key: string,\n callback: (error: ?Error, result: ?string) =&gt; void\n ): void {\n RKAsyncStorage.multiGet([key], function(errors, result) {\n // Unpack result to get value from [[key,value]]\n var value = (result &amp;&amp; result[0] &amp;&amp; result[0][1]) ? result[0][1] : null;\n callback((errors &amp;&amp; convertError(errors[0])) || null, value);\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Fetches `key` and passes the result to `callback`, along with an `Error` if\n * there is any.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;key&quot;
},
{
&quot;typehint&quot;: &quot;(error: ?Error, result: ?string) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;getItem&quot;
},
{
&quot;line&quot;: 47,
&quot;source&quot;: &quot;setItem: function(\n key: string,\n value: string,\n callback: ?(error: ?Error) =&gt; void\n ): void {\n RKAsyncStorage.multiSet([[key,value]], function(errors) {\n callback &amp;&amp; callback((errors &amp;&amp; convertError(errors[0])) || null);\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Sets `value` for `key` and calls `callback` on completion, along with an\n * `Error` if there is any.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;key&quot;
},
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;value&quot;
},
{
&quot;typehint&quot;: &quot;?(error: ?Error) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;setItem&quot;
},
{
&quot;line&quot;: 57,
&quot;source&quot;: &quot;removeItem: function(\n key: string,\n callback: ?(error: ?Error) =&gt; void\n ): void {\n RKAsyncStorage.multiRemove([key], function(errors) {\n callback &amp;&amp; callback((errors &amp;&amp; convertError(errors[0])) || null);\n });\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;key&quot;
},
{
&quot;typehint&quot;: &quot;?(error: ?Error) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;removeItem&quot;
},
{
&quot;line&quot;: 71,
&quot;source&quot;: &quot;mergeItem: function(\n key: string,\n value: string,\n callback: ?(error: ?Error) =&gt; void\n ): void {\n RKAsyncStorage.multiMerge([[key,value]], function(errors) {\n callback &amp;&amp; callback((errors &amp;&amp; convertError(errors[0])) || null);\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Merges existing value with input value, assuming they are stringified json.\n *\n * Not supported by all native implementations.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;key&quot;
},
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}&quot;,
&quot;name&quot;: &quot;value&quot;
},
{
&quot;typehint&quot;: &quot;?(error: ?Error) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;mergeItem&quot;
},
{
&quot;line&quot;: 86,
&quot;source&quot;: &quot;clear: function(callback: ?(error: ?Error) =&gt; void) {\n RKAsyncStorage.clear(function(error) {\n callback &amp;&amp; callback(convertError(error));\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Erases *all* AsyncStorage for all clients, libraries, etc. You probably\n * don&#x27;t want to call this - use removeItem or multiRemove to clear only your\n * own keys instead.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;?(error: ?Error) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;clear&quot;
},
{
&quot;line&quot;: 95,
&quot;source&quot;: &quot;getAllKeys: function(callback: (error: ?Error) =&gt; void) {\n RKAsyncStorage.getAllKeys(function(error, keys) {\n callback(convertError(error), keys);\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Gets *all* keys known to the system, for all callers, libraries, etc.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;(error: ?Error) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;getAllKeys&quot;
},
{
&quot;line&quot;: 117,
&quot;source&quot;: &quot;multiGet: function(\n keys: Array&lt;string&gt;,\n callback: (errors: ?Array&lt;Error&gt;, result: ?Array&lt;Array&lt;string&gt;&gt;) =&gt; void\n ): void {\n RKAsyncStorage.multiGet(keys, function(errors, result) {\n callback(\n (errors &amp;&amp; errors.map((error) =&gt; convertError(error))) || null,\n result\n );\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * multiGet invokes callback with an array of key-value pair arrays that\n * matches the input format of multiSet.\n *\n * multiGet([&#x27;k1&#x27;, &#x27;k2&#x27;], cb) -&gt; cb([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]])\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}],\&quot;length\&quot;:4}&quot;,
&quot;name&quot;: &quot;keys&quot;
},
{
&quot;typehint&quot;: &quot;(errors: ?Array&lt;Error&gt;, result: ?Array&lt;Array&lt;string&gt;&gt;) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;multiGet&quot;
},
{
&quot;line&quot;: 135,
&quot;source&quot;: &quot;multiSet: function(\n keyValuePairs: Array&lt;Array&lt;string&gt;&gt;,\n callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void\n ): void {\n RKAsyncStorage.multiSet(keyValuePairs, function(errors) {\n callback &amp;&amp; callback(\n (errors &amp;&amp; errors.map((error) =&gt; convertError(error))) || null\n );\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * multiSet and multiMerge take arrays of key-value array pairs that match\n * the output of multiGet, e.g.\n *\n * multiSet([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]], cb);\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}],\&quot;length\&quot;:4}],\&quot;length\&quot;:7}&quot;,
&quot;name&quot;: &quot;keyValuePairs&quot;
},
{
&quot;typehint&quot;: &quot;?(errors: ?Array&lt;Error&gt;) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;multiSet&quot;
},
{
&quot;line&quot;: 149,
&quot;source&quot;: &quot;multiRemove: function(\n keys: Array&lt;string&gt;,\n callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void\n ): void {\n RKAsyncStorage.multiRemove(keys, function(errors) {\n callback &amp;&amp; callback(\n (errors &amp;&amp; errors.map((error) =&gt; convertError(error))) || null\n );\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Delete all the keys in the `keys` array.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}],\&quot;length\&quot;:4}&quot;,
&quot;name&quot;: &quot;keys&quot;
},
{
&quot;typehint&quot;: &quot;?(errors: ?Array&lt;Error&gt;) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;multiRemove&quot;
},
{
&quot;line&quot;: 166,
&quot;source&quot;: &quot;multiMerge: function(\n keyValuePairs: Array&lt;Array&lt;string&gt;&gt;,\n callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void\n ): void {\n RKAsyncStorage.multiMerge(keyValuePairs, function(errors) {\n callback &amp;&amp; callback(\n (errors &amp;&amp; errors.map((error) =&gt; convertError(error))) || null\n );\n });\n }&quot;,
&quot;docblock&quot;: &quot;/**\n * Merges existing values with input values, assuming they are stringified\n * json.\n *\n * Not supported by all native implementations.\n */\n&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: &quot;{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;generic\&quot;,\&quot;value\&quot;:[{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;Array\&quot;,\&quot;length\&quot;:1},{\&quot;type\&quot;:\&quot;simple\&quot;,\&quot;value\&quot;:\&quot;string\&quot;,\&quot;length\&quot;:1}],\&quot;length\&quot;:4}],\&quot;length\&quot;:7}&quot;,
&quot;name&quot;: &quot;keyValuePairs&quot;
},
{
&quot;typehint&quot;: &quot;?(errors: ?Array&lt;Error&gt;) =&gt; void&quot;,
&quot;name&quot;: &quot;callback&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: &quot;void&quot;,
&quot;name&quot;: &quot;multiMerge&quot;
}
],
&quot;properties&quot;: [],
&quot;superClass&quot;: null,
&quot;type&quot;: &quot;api&quot;,
&quot;line&quot;: 27,
&quot;name&quot;: &quot;AsyncStorage&quot;,
&quot;docblock&quot;: &quot;/**\n * AsyncStorage is a simple, asynchronous, persistent, global, key-value storage\n * system. It should be used instead of LocalStorage.\n *\n * It is recommended that you use an abstraction on top of AsyncStorage instead\n * of AsyncStorage directly for anything more than light usage since it\n * operates globally.\n *\n * This JS code is a simple facad over the native iOS implementation to provide\n * a clear JS API, real Error objects, and simple non-multi functions.\n */\n&quot;,
&quot;requires&quot;: [
{
&quot;name&quot;: &quot;NativeModulesDeprecated&quot;
}
]
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="cameraroll.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
own keys instead.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="getallkeys"></a><span class="propType">static </span>getAllKeys(<span class="propType">callback: (error: ?Error) =&gt; void</span>) <a class="hash-link" href="#getallkeys">#</a></h4><div><p>Gets <em>all</em> keys known to the system, for all callers, libraries, etc.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiget"></a><span class="propType">static </span>multiGet(<span class="propType">keys: Array&lt;string&gt;, callback: (errors: ?Array&lt;Error&gt;, result: ?Array&lt;Array&lt;string&gt;&gt;) =&gt; void</span>) <a class="hash-link" href="#multiget">#</a></h4><div><p>multiGet invokes callback with an array of key-value pair arrays that
matches the input format of multiSet.</p><p>multiGet([&#x27;k1&#x27;, &#x27;k2&#x27;], cb) -&gt; cb([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]])</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiset"></a><span class="propType">static </span>multiSet(<span class="propType">keyValuePairs: Array&lt;Array&lt;string&gt;&gt;, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multiset">#</a></h4><div><p>multiSet and multiMerge take arrays of key-value array pairs that match
the output of multiGet, e.g.</p><p>multiSet([[&#x27;k1&#x27;, &#x27;val1&#x27;], [&#x27;k2&#x27;, &#x27;val2&#x27;]], cb);</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multiremove"></a><span class="propType">static </span>multiRemove(<span class="propType">keys: Array&lt;string&gt;, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multiremove">#</a></h4><div><p>Delete all the keys in the <code>keys</code> array.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="multimerge"></a><span class="propType">static </span>multiMerge(<span class="propType">keyValuePairs: Array&lt;Array&lt;string&gt;&gt;, callback: ?(errors: ?Array&lt;Error&gt;) =&gt; void</span>) <a class="hash-link" href="#multimerge">#</a></h4><div><p>Merges existing values with input values, assuming they are stringified
json.</p><p>Not supported by all native implementations.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="cameraroll.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+2 -76
View File
File diff suppressed because one or more lines are too long
+20 -11
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -3,7 +3,7 @@ based on a set truncLength.</p><p>In the following example, the text will trunca
to show only the first 17 characters plus &#x27;...&#x27; with a See More button to
expand the text to its full length.</p><div class="prism language-javascript">render<span class="token punctuation">:</span> <span class="token keyword">function</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">return</span> &lt;ExpandingText truncLength<span class="token operator">=</span><span class="token punctuation">{</span><span class="token number">20</span><span class="token punctuation">}</span> text<span class="token operator">=</span><span class="token punctuation">{</span>EXAMPLE_TEXT<span class="token punctuation">}</span> <span class="token operator">/</span><span class="token operator">&gt;</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemorestyle"></a>seeMoreStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#seemorestyle">#</a></h4><div><p>The styles that will be applied to the See More button. Default
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemorestyle"></a>seeMoreStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#seemorestyle">#</a></h4><div><p>The styles that will be applied to the See More button. Default
is bold.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="seemoretext"></a>seeMoreText <span class="propType">string</span> <a class="hash-link" href="#seemoretext">#</a></h4><div><p>The caption that will be appended at the end, by default it is
<code>&#x27;See More&#x27;</code>.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="text"></a>text <span class="propType">string</span> <a class="hash-link" href="#text">#</a></h4><div><p>Text to be displayed. It will be truncated if the character length
is greater than the <code>truncLength</code> property.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="textstyle"></a>textStyle <span class="propType">Text.propTypes.style</span> <a class="hash-link" href="#textstyle">#</a></h4><div><p>The styles that will be applied to the text (both truncated and
+1 -1
View File
@@ -13,7 +13,7 @@ images from local disk, such as the camera roll.</p><p>Example usage:</p><div cl
<span class="token operator">/</span><span class="token operator">&gt;</span>
&lt;<span class="token operator">/</span>View<span class="token operator">&gt;</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitylabel"></a>accessibilityLabel <span class="propType">string</span> <a class="hash-link" href="#accessibilitylabel">#</a></h4><div><p>accessibilityLabel - Custom string to display for accessibility.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>accessible - Whether this element should be revealed as an accessible
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessibilitylabel"></a>accessibilityLabel <span class="propType">string</span> <a class="hash-link" href="#accessibilitylabel">#</a></h4><div><p>accessibilityLabel - Custom string to display for accessibility.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>accessible - Whether this element should be revealed as an accessible
element.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="capinsets"></a>capInsets <span class="propType">EdgeInsetsPropType</span> <a class="hash-link" href="#capinsets">#</a></h4><div><p>capInsets - When the image is resized, the corners of the size specified
by capInsets will stay a fixed size, but the center content and borders
of the image will be stretched. This is useful for creating resizable
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@ data source tells the ListView if it needs to re-render a row because the
source data has changed - see ListViewDataSource for more details.</p></li><li><p>Rate-limited row rendering - By default, only one row is rendered per
event-loop (customizable with the <code>pageSize</code> prop). This breaks up the
work into smaller chunks to reduce the chance of dropping frames while
rendering rows.</p></li></ul></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="scrollview"></a><a href="scrollview.html#proptypes">ScrollView props...</a> <a class="hash-link" href="#scrollview">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="datasource"></a>dataSource <span class="propType">ListViewDataSource</span> <a class="hash-link" href="#datasource">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="initiallistsize"></a>initialListSize <span class="propType">number</span> <a class="hash-link" href="#initiallistsize">#</a></h4><div><p>How many rows to render on initial component mount. Use this to make
rendering rows.</p></li></ul></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="scrollview"></a><a href="scrollview.html#proptypes">ScrollView props...</a> <a class="hash-link" href="#scrollview">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="datasource"></a>dataSource <span class="propType">ListViewDataSource</span> <a class="hash-link" href="#datasource">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="initiallistsize"></a>initialListSize <span class="propType">number</span> <a class="hash-link" href="#initiallistsize">#</a></h4><div><p>How many rows to render on initial component mount. Use this to make
it so that the first screen worth of data apears at one time instead of
over the course of multiple frames.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onchangevisiblerows"></a>onChangeVisibleRows <span class="propType">func</span> <a class="hash-link" href="#onchangevisiblerows">#</a></h4><div><p>(visibleRows, changedRows) =&gt; void</p><p>Called when the set of visible rows changes. <code>visibleRows</code> maps
{ sectionID: { rowID: true }} for all the visible rows, and
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -33,7 +33,7 @@ transitions back to it</li><li><code>resetTo(route)</code> - Replaces the top it
initialRoute<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">.</span><span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">&gt;</span>
<span class="token punctuation">)</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="initialroute"></a>initialRoute <span class="propType">{component: func, title: string, passProps: object, backButtonTitle: string, rightButtonTitle: string, onRightButtonPress: func, wrapperStyle: View.propTypes.style}</span> <a class="hash-link" href="#initialroute">#</a></h4><div><p>NavigatorIOS uses &quot;route&quot; objects to identify child views, their props,
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="initialroute"></a>initialRoute <span class="propType">{component: func, title: string, passProps: object, backButtonTitle: string, rightButtonTitle: string, onRightButtonPress: func, wrapperStyle: View.propTypes.style}</span> <a class="hash-link" href="#initialroute">#</a></h4><div><p>NavigatorIOS uses &quot;route&quot; objects to identify child views, their props,
and navigation bar configuration. &quot;push&quot; and all the other navigation
operations expect routes to be like this:</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="itemwrapperstyle"></a>itemWrapperStyle <span class="propType">View.propTypes.style</span> <a class="hash-link" href="#itemwrapperstyle">#</a></h4><div><p>The default wrapper style for components in the navigator.
A common use case is to set the backgroundColor for every page</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="tintcolor"></a>tintColor <span class="propType">string</span> <a class="hash-link" href="#tintcolor">#</a></h4><div><p>The color used for buttons in the navigation bar</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="pickerios.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -35
View File
@@ -10,41 +10,7 @@ by the pixel ratio.</p><p>var image = getImage({
width: 200 <em> PixelRatio.get(),
height: 100 </em> PixelRatio.get()
});</p>&lt;Image source={image} style={{width: 200, height: 100}} /&gt;
</div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="get"></a><span class="propType">static </span>get(<span class="propType"></span>) <a class="hash-link" href="#get">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="startdetecting"></a><span class="propType">static </span>startDetecting(<span class="propType"></span>) <a class="hash-link" href="#startdetecting">#</a></h4></div></div><pre>{
&quot;methods&quot;: [
{
&quot;line&quot;: 45,
&quot;source&quot;: &quot;static get() {\n return Dimensions.get(&#x27;window&#x27;).scale;\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;get&quot;
},
{
&quot;line&quot;: 49,
&quot;source&quot;: &quot;static startDetecting() {\n // no-op for iOS, but this is useful for other platforms\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;startDetecting&quot;
}
],
&quot;type&quot;: &quot;api&quot;,
&quot;line&quot;: 44,
&quot;name&quot;: &quot;PixelRatio&quot;,
&quot;docblock&quot;: &quot;/**\n * PixelRatio class gives access to the device pixel density.\n *\n * Some examples:\n * - PixelRatio.get() === 2\n * - iPhone 4, 4S\n * - iPhone 5, 5c, 5s\n * - iPhone 6\n *\n * - PixelRatio.get() === 3\n * - iPhone 6 plus\n *\n * There are a few use cases for using PixelRatio:\n *\n * == Displaying a line that&#x27;s as thin as the device permits\n *\n * A width of 1 is actually pretty thick on an iPhone 4+, we can do one that&#x27;s\n * thinner using a width of 1 / PixelRatio.get(). It&#x27;s a technique that works\n * on all the devices independent of their pixel density.\n *\n * style={{ borderWidth: 1 / PixelRatio.get() }}\n *\n * == Fetching a correctly sized image\n *\n * You should get a higher resolution image if you are on a high pixel density\n * device. A good rule of thumb is to multiply the size of the image you display\n * by the pixel ratio.\n *\n * var image = getImage({\n * width: 200 * PixelRatio.get(),\n * height: 100 * PixelRatio.get()\n * });\n * &lt;Image source={image} style={{width: 200, height: 100}} /&gt;\n */\n&quot;,
&quot;requires&quot;: [
{
&quot;name&quot;: &quot;Dimensions&quot;
}
]
}</pre></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="statusbarios.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
</div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="get"></a><span class="propType">static </span>get(<span class="propType"></span>) <a class="hash-link" href="#get">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="startdetecting"></a><span class="propType">static </span>startDetecting(<span class="propType"></span>) <a class="hash-link" href="#startdetecting">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="statusbarios.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -76
View File
File diff suppressed because one or more lines are too long
+1 -104
View File
@@ -23,110 +23,7 @@ in the render function.</p><p>Performance:
- Making a stylesheet from a style object makes it possible to refer to it
by ID instead of creating a new style object every time.
- It also allows to send the style only once through the bridge. All
subsequent uses are going to refer an id (not implemented yet).</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div><pre>{
&quot;methods&quot;: [
{
&quot;line&quot;: 55,
&quot;source&quot;: &quot;static create(obj) {\n var result = {};\n for (var key in obj) {\n StyleSheet.validateStyle(key, obj);\n result[key] = StyleSheetRegistry.registerStyle(obj[key]);\n }\n return result;\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;obj&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;create&quot;
},
{
&quot;line&quot;: 64,
&quot;source&quot;: &quot;static validateStyleProp(prop, style, caller) {\n if (!__DEV__) {\n return;\n }\n if (allStylePropTypes[prop] === undefined) {\n var message1 = &#x27;\&quot;&#x27; + prop + &#x27;\&quot; is not a valid style property.&#x27;;\n var message2 = &#x27;\\nValid style props: &#x27; +\n JSON.stringify(Object.keys(allStylePropTypes), null, &#x27; &#x27;);\n styleError(message1, style, caller, message2);\n }\n var error = allStylePropTypes[prop](\n style,\n prop,\n caller,\n ReactPropTypeLocations.prop\n );\n if (error) {\n styleError(error.message, style, caller);\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;prop&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;style&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;caller&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;validateStyleProp&quot;
},
{
&quot;line&quot;: 85,
&quot;source&quot;: &quot;static validateStyle(name, styles) {\n if (!__DEV__) {\n return;\n }\n for (var prop in styles[name]) {\n StyleSheet.validateStyleProp(prop, styles[name], &#x27;StyleSheet &#x27; + name);\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;name&quot;
},
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;styles&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;validateStyle&quot;
},
{
&quot;line&quot;: 94,
&quot;source&quot;: &quot;static addValidStylePropTypes(stylePropTypes) {\n for (var key in stylePropTypes) {\n invariant(\n allStylePropTypes[key] === undefined ||\n allStylePropTypes[key] === stylePropTypes[key],\n &#x27;Attemped to redefine existing style prop type \&quot;&#x27; + key + &#x27;\&quot;.&#x27;\n );\n allStylePropTypes[key] = stylePropTypes[key];\n }\n }&quot;,
&quot;modifiers&quot;: [
&quot;static&quot;
],
&quot;params&quot;: [
{
&quot;typehint&quot;: null,
&quot;name&quot;: &quot;stylePropTypes&quot;
}
],
&quot;tparams&quot;: null,
&quot;returntypehint&quot;: null,
&quot;name&quot;: &quot;addValidStylePropTypes&quot;
}
],
&quot;type&quot;: &quot;api&quot;,
&quot;line&quot;: 54,
&quot;name&quot;: &quot;StyleSheet&quot;,
&quot;docblock&quot;: &quot;/**\n * A StyleSheet is an abstraction similar to CSS StyleSheets\n *\n * Create a new StyleSheet:\n *\n * var styles = StyleSheet.create({\n * container: {\n * borderRadius: 4,\n * borderWidth: 0.5,\n * borderColor: &#x27;#d6d7da&#x27;,\n * },\n * title: {\n * fontSize: 19,\n * fontWeight: &#x27;bold&#x27;,\n * },\n * activeTitle: {\n * color: &#x27;red&#x27;,\n * },\n * })\n *\n * Use a StyleSheet:\n *\n * &lt;View style={styles.container}&gt;\n * &lt;Text style={[styles.title, this.props.isActive &amp;&amp; styles.activeTitle]} /&gt;\n * &lt;/View&gt;\n *\n * Code quality:\n * - By moving styles away from the render function, you&#x27;re making the code\n * code easier to understand.\n * - Naming the styles is a good way to add meaning to the low level components\n * in the render function.\n *\n * Performance:\n * - Making a stylesheet from a style object makes it possible to refer to it\n * by ID instead of creating a new style object every time.\n * - It also allows to send the style only once through the bridge. All\n * subsequent uses are going to refer an id (not implemented yet).\n */\n&quot;,
&quot;requires&quot;: [
{
&quot;name&quot;: &quot;ImageStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;ReactPropTypeLocations&quot;
},
{
&quot;name&quot;: &quot;StyleSheetRegistry&quot;
},
{
&quot;name&quot;: &quot;TextStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;ViewStylePropTypes&quot;
},
{
&quot;name&quot;: &quot;invariant&quot;
}
]
}</pre></div><noscript></noscript><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
subsequent uses are going to refer an id (not implemented yet).</p></div><h3><a class="anchor" name="methods"></a>Methods <a class="hash-link" href="#methods">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="create"></a><span class="propType">static </span>create(<span class="propType">obj</span>) <a class="hash-link" href="#create">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyleprop"></a><span class="propType">static </span>validateStyleProp(<span class="propType">prop, style, caller</span>) <a class="hash-link" href="#validatestyleprop">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="validatestyle"></a><span class="propType">static </span>validateStyle(<span class="propType">name, styles</span>) <a class="hash-link" href="#validatestyle">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="addvalidstyleproptypes"></a><span class="propType">static </span>addValidStylePropTypes(<span class="propType">stylePropTypes</span>) <a class="hash-link" href="#addvalidstyleproptypes">#</a></h4></div></div></div><noscript></noscript><div class="docs-prevnext"></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+1 -1
View File
@@ -2,7 +2,7 @@
a controlled component, so you must hook in to the <code>onValueChange</code> callback
and update the <code>value</code> prop in order for the component to update, otherwise
the user&#x27;s change will be reverted immediately to reflect <code>props.value</code> as the
source of truth.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="disabled"></a>disabled <span class="propType">bool</span> <a class="hash-link" href="#disabled">#</a></h4><div><p>If true the user won&#x27;t be able to toggle the switch.
source of truth.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="disabled"></a>disabled <span class="propType">bool</span> <a class="hash-link" href="#disabled">#</a></h4><div><p>If true the user won&#x27;t be able to toggle the switch.
Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="ontintcolor"></a>onTintColor <span class="propType">string</span> <a class="hash-link" href="#ontintcolor">#</a></h4><div><p>Background color when the switch is turned on.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onvaluechange"></a>onValueChange <span class="propType">func</span> <a class="hash-link" href="#onvaluechange">#</a></h4><div><p>Callback that is called when the user toggles the switch.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="thumbtintcolor"></a>thumbTintColor <span class="propType">string</span> <a class="hash-link" href="#thumbtintcolor">#</a></h4><div><p>Background color for the switch round button.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="tintcolor"></a>tintColor <span class="propType">string</span> <a class="hash-link" href="#tintcolor">#</a></h4><div><p>Background color when the switch is turned off.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="value"></a>value <span class="propType">bool</span> <a class="hash-link" href="#value">#</a></h4><div><p>The value of the switch, if true the switch will be turned on.
Default value is false.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="tabbarios.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -23,7 +23,7 @@ each other on account of the literal newlines:</p><div class="prism language-jav
fontSize<span class="token punctuation">:</span> <span class="token number">20</span><span class="token punctuation">,</span>
fontWeight<span class="token punctuation">:</span> <span class="token string">&#x27;bold&#x27;</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="numberoflines"></a>numberOfLines <span class="propType">number</span> <a class="hash-link" href="#numberoflines">#</a></h4><div><p>Used to truncate the text with an elipsis after computing the text
<span class="token punctuation">}</span><span class="token punctuation">;</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="numberoflines"></a>numberOfLines <span class="propType">number</span> <a class="hash-link" href="#numberoflines">#</a></h4><div><p>Used to truncate the text with an elipsis after computing the text
layout, including line wrapping, such that the total number of lines does
not exceed this number.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpress"></a>onPress <span class="propType">func</span> <a class="hash-link" href="#onpress">#</a></h4><div><p>This function is called on press. Text intrinsically supports press
handling with a default highlight state (which can be disabled with
+1 -1
View File
@@ -17,7 +17,7 @@ Setting <code>value</code> once is like setting the default value, but you can c
continuously based on <code>onChangeText</code> events as well. If you really want to
force the component to always revert to the value you are setting, you can
set <code>controlled={true}</code>.</p><p>The <code>multiline</code> prop is not supported in all releases, and some props are
multiline only.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocapitalize"></a>autoCapitalize <span class="propType">enum(&#x27;none&#x27;, &#x27;sentences&#x27;, &#x27;words&#x27;, &#x27;characters&#x27;)</span> <a class="hash-link" href="#autocapitalize">#</a></h4><div><p>Can tell TextInput to automatically capitalize certain characters.</p><ul><li>characters: all characters,</li><li>words: first letter of each word</li><li>sentences: first letter of each sentence (default)</li><li>none: don&#x27;t auto capitalize anything</li></ul></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocorrect"></a>autoCorrect <span class="propType">bool</span> <a class="hash-link" href="#autocorrect">#</a></h4><div><p>If false, disables auto-correct. Default value is true.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autofocus"></a>autoFocus <span class="propType">bool</span> <a class="hash-link" href="#autofocus">#</a></h4><div><p>If true, focuses the input on componentDidMount. Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="bufferdelay"></a>bufferDelay <span class="propType">number</span> <a class="hash-link" href="#bufferdelay">#</a></h4><div><p>This helps avoid drops characters due to race conditions between JS and
multiline only.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocapitalize"></a>autoCapitalize <span class="propType">enum(&#x27;none&#x27;, &#x27;sentences&#x27;, &#x27;words&#x27;, &#x27;characters&#x27;)</span> <a class="hash-link" href="#autocapitalize">#</a></h4><div><p>Can tell TextInput to automatically capitalize certain characters.</p><ul><li>characters: all characters,</li><li>words: first letter of each word</li><li>sentences: first letter of each sentence (default)</li><li>none: don&#x27;t auto capitalize anything</li></ul></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autocorrect"></a>autoCorrect <span class="propType">bool</span> <a class="hash-link" href="#autocorrect">#</a></h4><div><p>If false, disables auto-correct. Default value is true.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="autofocus"></a>autoFocus <span class="propType">bool</span> <a class="hash-link" href="#autofocus">#</a></h4><div><p>If true, focuses the input on componentDidMount. Default value is false.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="bufferdelay"></a>bufferDelay <span class="propType">number</span> <a class="hash-link" href="#bufferdelay">#</a></h4><div><p>This helps avoid drops characters due to race conditions between JS and
the native text input. The default should be fine, but if you&#x27;re
potentially doing very slow operations on every keystroke then you may
want to try increasing this.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="clearbuttonmode"></a>clearButtonMode <span class="propType">enum(&#x27;never&#x27;, &#x27;while-editing&#x27;, &#x27;unless-editing&#x27;, &#x27;always&#x27;)</span> <a class="hash-link" href="#clearbuttonmode">#</a></h4><div><p>When the clear button should appear on the right side of the text view</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="controlled"></a>controlled <span class="propType">bool</span> <a class="hash-link" href="#controlled">#</a></h4><div><p>If you really want this to behave as a controlled component, you can set
+1 -1
View File
@@ -12,7 +12,7 @@ backgroundColor of the wrapped view isn&#x27;t explicitly set to an opaque color
<span class="token operator">/</span><span class="token operator">&gt;</span>
&lt;<span class="token operator">/</span>View<span class="token operator">&gt;</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
active.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onpress"></a>onPress <span class="propType">func</span> <a class="hash-link" href="#onpress">#</a></h4><div><p>Called when the touch is released, but not if cancelled (e.g. by
a scroll that steals the responder lock).</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="style"></a>style <span class="propType">View.propTypes.style</span> <a class="hash-link" href="#style">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="underlaycolor"></a>underlayColor <span class="propType">string</span> <a class="hash-link" href="#underlaycolor">#</a></h4><div><p>The color of the underlay that will show through when the touch is
active.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="touchableopacity.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
+1 -1
View File
@@ -10,7 +10,7 @@ easy to add to an app without weird side-effects.</p><p>Example:</p><div class="
<span class="token operator">/</span><span class="token operator">&gt;</span>
&lt;<span class="token operator">/</span>View<span class="token operator">&gt;</span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
<span class="token punctuation">}</span><span class="token punctuation">,</span></div></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="activeopacity"></a>activeOpacity <span class="propType">number</span> <a class="hash-link" href="#activeopacity">#</a></h4><div><p>Determines what the opacity of the wrapped view should be when touch is
active.</p></div></div></div></div><noscript></noscript><div class="docs-prevnext"><a class="docs-next" href="touchablewithoutfeedback.html#content">Next →</a></div></div></section><footer class="wrap"><div class="right">© 2015 Facebook Inc.</div></footer></div><div id="fb-root"></div><script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -15,7 +15,7 @@ a default parent (flexDirection: &#x27;column&#x27;), the children will fill the
but not the height.</p><p>Many library components can be treated like plain <code>Views</code> in many cases, for
example passing them children, setting style, etc.</p><p><code>View</code>s are designed to be used with <code>StyleSheet</code>s for clarity and
performance, although inline styles are also supported. It is common for
<code>StyleSheet</code>s to be combined dynamically. See <code>StyleSheet.js</code> for more info.</p></div><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>When true, indicates that the view is an accessibility element</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onmoveshouldsetresponder"></a>onMoveShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onmoveshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondergrant"></a>onResponderGrant <span class="propType">func</span> <a class="hash-link" href="#onrespondergrant">#</a></h4><div><p>For most touch interactions, you&#x27;ll simply want to wrap your component in
<code>StyleSheet</code>s to be combined dynamically. See <code>StyleSheet.js</code> for more info.</p></div><h3><a class="anchor" name="props"></a>Props <a class="hash-link" href="#props">#</a></h3><div class="props"><div class="prop"><h4 class="propTitle"><a class="anchor" name="accessible"></a>accessible <span class="propType">bool</span> <a class="hash-link" href="#accessible">#</a></h4><div><p>When true, indicates that the view is an accessibility element</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onmoveshouldsetresponder"></a>onMoveShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onmoveshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondergrant"></a>onResponderGrant <span class="propType">func</span> <a class="hash-link" href="#onrespondergrant">#</a></h4><div><p>For most touch interactions, you&#x27;ll simply want to wrap your component in
<code>TouchableHighlight.js</code>. Check out <code>Touchable.js</code> and
<code>ScrollResponder.js</code> for more discussion.</p></div></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onrespondermove"></a>onResponderMove <span class="propType">func</span> <a class="hash-link" href="#onrespondermove">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderreject"></a>onResponderReject <span class="propType">func</span> <a class="hash-link" href="#onresponderreject">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderrelease"></a>onResponderRelease <span class="propType">func</span> <a class="hash-link" href="#onresponderrelease">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderterminate"></a>onResponderTerminate <span class="propType">func</span> <a class="hash-link" href="#onresponderterminate">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onresponderterminationrequest"></a>onResponderTerminationRequest <span class="propType">func</span> <a class="hash-link" href="#onresponderterminationrequest">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onstartshouldsetresponder"></a>onStartShouldSetResponder <span class="propType">func</span> <a class="hash-link" href="#onstartshouldsetresponder">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="onstartshouldsetrespondercapture"></a>onStartShouldSetResponderCapture <span class="propType">func</span> <a class="hash-link" href="#onstartshouldsetrespondercapture">#</a></h4></div><div class="prop"><h4 class="propTitle"><a class="anchor" name="pointerevents"></a>pointerEvents <span class="propType">enum(&#x27;box-none&#x27;, &#x27;none&#x27;, &#x27;box-only&#x27;, &#x27;auto&#x27;)</span> <a class="hash-link" href="#pointerevents">#</a></h4><div><p>In the absence of <code>auto</code> property, <code>none</code> is much like <code>CSS</code>&#x27;s <code>none</code>
value. <code>box-none</code> is as if you had applied the <code>CSS</code> class:</p><p> .cantTouchThis * {