Move to Docusaurus.

This commit is contained in:
Hector Ramos
2017-08-31 10:38:26 -07:00
parent cb9b266b8e
commit 692d3f72fb
476 changed files with 48088 additions and 5200 deletions
+3
View File
@@ -57,3 +57,6 @@ node_modules
/coverage
/third-party
/website/src
/website/build
+14
View File
@@ -0,0 +1,14 @@
{
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/Libraries/react-native/react-native-implementation.js"
}
]
}
+1
View File
@@ -0,0 +1 @@
/build/
+30
View File
@@ -0,0 +1,30 @@
# React Native Docs Generator
The React Native website is generated from a collection of markdown documents. This directory holds a collection of scripts necessary to generate these markdown docs prior to the site being built.
## import-existing-docs.js
For development use only. This script will pull down the current docs from master, and apply any transformations necessary to host the docs under the new website build script.
### Usage
Run the following command locally:
```
GIT_USER=your_git_user GITHUB_USERNAME=facebook GITHUB_REPONAME=react-native node server/import-existing-docs.js
```
This will perform a sparse checkout of the `docs/` folder from `master`, generating a clean set of markdown docs in the local `docs/` folder. It will also write to disk an updated `sidebars.json` file based on these docs.
## build.js
Runs the usual autodocs generation scripts used by the `react-page-middleware` variant of the React Native website, but provides markdown instead of HTML. Run this script prior to building the website.
### Usage
Run the following commands locally (the generate script needs to run first):
```
node server/generate.js
node server/build.js
```
@@ -12,14 +12,14 @@
var React = require('React');
var AlgoliaDocSearch = React.createClass({
render: function() {
class AlgoliaDocSearch extends React.Component {
render() {
return (
<div className="algolia-search-wrapper">
<input id="algolia-doc-search" tabIndex="0" type="text" placeholder="Search docs..." />
</div>
);
}
});
}
module.exports = AlgoliaDocSearch;
@@ -17,8 +17,8 @@ var BlogPostHeader = require('BlogPostHeader');
var BlogPostFooter = require('BlogPostFooter');
var ExcerptLink = require('ExcerptLink');
var BlogPost = React.createClass({
render: function() {
class BlogPost extends React.Component {
render() {
var post = this.props.post;
return (
@@ -31,6 +31,6 @@ var BlogPost = React.createClass({
</article>
);
}
});
}
module.exports = BlogPost;
@@ -13,8 +13,8 @@
var React = require('React');
var BlogPostDate = React.createClass({
render: function() {
class BlogPostDate extends React.Component {
render() {
var post = this.props.post;
var match = post.publishedAt.match(/([0-9]+)-([0-9]+)-([0-9]+)/);
@@ -32,6 +32,6 @@ var BlogPostDate = React.createClass({
<time className="date" datetime={post.publishedAt}>{postedOnDate}</time>
);
}
});
}
module.exports = BlogPostDate;
@@ -16,8 +16,8 @@ var BlogPostHeader = require('BlogPostHeader');
var Marked = require('Marked');
var ExcerptLink = require('ExcerptLink');
var BlogPostExcerpt = React.createClass({
render: function() {
class BlogPostExcerpt extends React.Component {
render() {
var post = this.props.post;
return (
<article className="entry-excerpt">
@@ -33,6 +33,6 @@ var BlogPostExcerpt = React.createClass({
</article>
);
}
});
}
module.exports = BlogPostExcerpt;
@@ -14,8 +14,8 @@
var React = require('React');
var BlogPostDate = require('BlogPostDate');
var BlogPostFooter = React.createClass({
render: function() {
class BlogPostFooter extends React.Component {
render() {
var post = this.props.post;
var authorImage = this.props.post.authorImage ? this.props.post.authorImage : '/react-native/img/author.png';
@@ -58,6 +58,6 @@ var BlogPostFooter = React.createClass({
</div>
);
}
});
}
module.exports = BlogPostFooter;
@@ -14,8 +14,8 @@
var React = require('React');
var BlogPostDate = require('BlogPostDate');
var BlogPostHeader = React.createClass({
render: function() {
class BlogPostHeader extends React.Component {
render() {
var post = this.props.post;
var hero;
@@ -54,6 +54,6 @@ var BlogPostHeader = React.createClass({
</header>
);
}
});
}
module.exports = BlogPostHeader;
@@ -13,8 +13,15 @@
var Metadata = require('Metadata');
var React = require('React');
var DocsSidebar = React.createClass({
getCategories: function() {
class DocsSidebar extends React.Component {
constructor(props, context) {
super(props, context);
this.getCategories = this.getCategories.bind(this);
this.getLink = this.getLink.bind(this);
}
getCategories() {
var metadatas = Metadata.files.filter(function(metadata) {
return metadata.layout === 'docs' || metadata.layout === 'autodocs';
});
@@ -67,13 +74,13 @@ var DocsSidebar = React.createClass({
categories.push(currentCategory);
return categories;
},
}
getLink: function(metadata) {
getLink(metadata) {
return metadata.permalink;
},
}
render: function() {
render() {
return <div className="nav-docs">
<div className="nav-docs-viewport">
{this.getCategories().map((category) =>
@@ -97,6 +104,6 @@ var DocsSidebar = React.createClass({
</div>
</div>;
}
});
}
module.exports = DocsSidebar;
@@ -12,8 +12,8 @@
var React = require('React');
var EjectBanner = React.createClass({
render: function() {
class EjectBanner extends React.Component {
render() {
return (
<div className="banner-crna-ejected">
<h3>Project with Native Code Required</h3>
@@ -25,6 +25,6 @@ var EjectBanner = React.createClass({
</div>
);
}
});
}
module.exports = EjectBanner;
@@ -13,8 +13,8 @@
var React = require('React');
var ExcerptLink = React.createClass({
render: function() {
class ExcerptLink extends React.Component {
render() {
var cta = "Read more";
if (this.props.category === "videos") {
@@ -29,6 +29,6 @@ var ExcerptLink = React.createClass({
</footer>
);
}
});
}
module.exports = ExcerptLink;
+13 -10
View File
@@ -5,22 +5,25 @@
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Footer
*/
'use strict';
var React = require('React');
var fourOhFour = React.createClass({
render: function() {
function getGitHubPath(path) {
return 'https://github.com/facebook/react-native/blob/master/' + path;
}
class Footer extends React.Component {
render() {
return (
<html>
<head>
<meta httpEquiv="refresh" content="0; /react-native/docs/getting-started.html" />
</head>
<body />
</html>
<p className="edit-page-block">
<a target="_blank" href={getGitHubPath(this.props.path)}>Improve this page</a> by sending a pull request!
</p>
);
}
});
}
module.exports = fourOhFour;
module.exports = Footer;
+3 -3
View File
@@ -13,10 +13,10 @@
var Header = require('Header');
var React = require('React');
var H2 = React.createClass({
render: function() {
class H2 extends React.Component {
render() {
return <Header {...this.props} level={2}>{this.props.children}</Header>;
}
});
}
module.exports = H2;
@@ -16,12 +16,8 @@ var PropTypes = require('prop-types');
var slugify = require('slugify');
var Header = React.createClass({
contextTypes: {
permalink: PropTypes.string
},
render: function() {
class Header extends React.Component {
render() {
var slug = slugify(this.props.toSlug || this.props.children);
var H = 'h' + this.props.level;
var base = this.context.permalink || '';
@@ -33,6 +29,10 @@ var Header = React.createClass({
</H>
);
}
});
}
Header.contextTypes = {
permalink: PropTypes.string
};
module.exports = Header;
@@ -13,18 +13,19 @@
var AlgoliaDocSearch = require('AlgoliaDocSearch');
var React = require('React');
var HeaderLinks = React.createClass({
linksInternal: [
{section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'},
{section: 'support', href: '/react-native/support.html', text: 'Help'},
{section: 'blog', href: '/react-native/blog/', text: 'Blog'},
],
linksExternal: [
{section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
{section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
],
var linksInternal = [
{section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'},
{section: 'support', href: '/react-native/support.html', text: 'Help'},
{section: 'blog', href: '/react-native/blog/', text: 'Blog'},
];
makeLinks: function(links) {
var linksExternal = [
{section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
{section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
];
class HeaderLinks extends React.Component {
makeLinks(links) {
return links.map(function(link) {
return (
<li key={link.section}>
@@ -37,23 +38,23 @@ var HeaderLinks = React.createClass({
</li>
);
}, this);
},
}
render: function() {
render() {
return (
<div className="nav-site-wrapper">
<ul className="nav-site nav-site-internal">
{this.makeLinks(this.linksInternal)}
{this.makeLinks(linksInternal)}
</ul>
<AlgoliaDocSearch />
<ul className="nav-site nav-site-external">
{this.makeLinks(this.linksExternal)}
{this.makeLinks(linksExternal)}
</ul>
</div>
);
}
});
}
module.exports = HeaderLinks;
@@ -19,13 +19,8 @@ function getGitHubPath(path) {
return 'https://github.com/facebook/react-native/blob/master/' + path;
}
var HeaderWithGithub = React.createClass({
contextTypes: {
version: PropTypes.string
},
render: function() {
class HeaderWithGithub extends React.Component {
render() {
return (
<table width="100%">
<tbody>
@@ -47,6 +42,10 @@ var HeaderWithGithub = React.createClass({
</table>
);
}
});
}
HeaderWithGithub.contextTypes = {
version: PropTypes.string
};
module.exports = HeaderWithGithub;
+3 -3
View File
@@ -12,8 +12,8 @@
var React = require('React');
var Hero = React.createClass({
render: function() {
class Hero extends React.Component {
render() {
return (
<div className="hero">
<div className="wrap">
@@ -26,6 +26,6 @@ var Hero = React.createClass({
</div>
);
}
});
}
module.exports = Hero;
@@ -1193,15 +1193,15 @@ marked.inlineLexer = InlineLexer.output;
marked.parse = marked;
var Marked = React.createClass({
render: function() {
class Marked extends React.Component {
render() {
return this.props.children
? React.DOM.div(
null,
marked(this.props.children, this.props)
)
: null;
},
});
}
}
module.exports = Marked;
+9 -12
View File
@@ -526,16 +526,8 @@ _.languages.java = _.languages.extend('clike', {
},
});
var Prism = React.createClass({
statics: {
_: _,
},
getDefaultProps: function() {
return {
language: 'javascript',
};
},
render: function() {
class Prism extends React.Component {
render() {
var grammar = _.languages[this.props.language];
if (!grammar) {
grammar = _.languages.javascript;
@@ -549,7 +541,12 @@ var Prism = React.createClass({
)}
</div>
);
},
});
}
}
Prism._ = _;
Prism.defaultProps = {
language: 'javascript',
};
module.exports = Prism;
@@ -13,14 +13,14 @@
var React = require('React');
const ShowcaseAppIcon = React.createClass({
render: function() {
class ShowcaseAppIcon extends React.Component {
render() {
return (
<a href={this.props.linkUri}>
<img src={this.props.iconUri} alt={this.props.name} />
</a>
);
}
});
}
module.exports = ShowcaseAppIcon;
+49
View File
@@ -0,0 +1,49 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule Site
*/
'use strict';
var HeaderLinks = require('HeaderLinks');
var Metadata = require('Metadata');
var React = require('React');
class Site extends React.Component {
render() {
const path = Metadata.config.RN_DEPLOYMENT_PATH;
var basePath = '/react-native/' +
(path ? path + '/' : '');
var title = this.props.title
? this.props.title
: 'React Native | A framework for building native apps using React';
return (
<html>
<head>
<title>{title}</title>
<base href={basePath} />
<link
rel="stylesheet"
href="css/react-native.css"
/>
<link rel="stylesheet" href="css/prism.css" />
<meta property="rn:category" content={this.props.category} />
</head>
<body>
{this.props.children}
</body>
</html>
);
}
}
module.exports = Site;
@@ -41,14 +41,16 @@ var ReactNativeToExpoSDKVersionMap = {
* }
* ```
*/
var SnackPlayer = React.createClass({
contextTypes: {
version: PropTypes.number.isRequired,
},
class SnackPlayer extends React.Component {
constructor(props, context) {
super(props, context);
this.parseParams = this.parseParams.bind(this);
}
componentDidMount() {
window.ExpoSnack && window.ExpoSnack.initialize();
},
}
render() {
var code = encodeURIComponent(this.props.children);
@@ -110,9 +112,9 @@ var SnackPlayer = React.createClass({
</div>
</div>
);
},
}
parseParams: function(paramString) {
parseParams(paramString) {
var params = {};
if (paramString) {
@@ -124,7 +126,11 @@ var SnackPlayer = React.createClass({
}
return params;
},
});
}
}
SnackPlayer.contextTypes = {
version: PropTypes.number.isRequired,
};
module.exports = SnackPlayer;
@@ -31,8 +31,14 @@ var WEB_PLAYER_VERSION = '1.2.6';
* AppRegistry.registerComponent('MyApp', () => App);
* ```
*/
var WebPlayer = React.createClass({
parseParams: function(paramString) {
class WebPlayer extends React.Component {
constructor(props, context) {
super(props, context);
this.parseParams = this.parseParams.bind(this);
}
parseParams(paramString) {
var params = {};
if (paramString) {
@@ -44,9 +50,9 @@ var WebPlayer = React.createClass({
}
return params;
},
}
render: function() {
render() {
var hash = `#code=${encodeURIComponent(this.props.children)}`;
if (this.props.params) {
@@ -65,7 +71,7 @@ var WebPlayer = React.createClass({
/>
</div>
);
},
});
}
}
module.exports = WebPlayer;
@@ -12,14 +12,14 @@
var React = require('React');
var center = React.createClass({
render: function() {
class center extends React.Component {
render() {
return (
<div {...this.props} style={{textAlign: 'center'}}>
{this.props.children}
</div>
);
}
});
}
module.exports = center;
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large Load Diff
@@ -11,10 +11,7 @@
'use strict';
var DocsSidebar = require('DocsSidebar');
var Footer = require('Footer');
var Header = require('Header');
var HeaderWithGithub = require('HeaderWithGithub');
var Marked = require('Marked');
var Metadata = require('Metadata');
var Prism = require('Prism');
@@ -204,8 +201,23 @@ function getNamedTypes(typedefs) {
return namedTypes;
}
var ComponentDoc = React.createClass({
renderProp: function(name, prop) {
class ComponentDoc extends React.Component {
constructor(props, context) {
super(props, context);
this.extractPlatformFromProps = this.extractPlatformFromProps.bind(this);
this.renderCompose = this.renderCompose.bind(this);
this.renderStylesheetProp = this.renderStylesheetProp.bind(this);
this.renderStylesheetProps = this.renderStylesheetProps.bind(this);
this.renderMethod = this.renderMethod.bind(this);
this.renderMethods = this.renderMethods.bind(this);
this.renderProp = this.renderProp.bind(this);
this.renderProps = this.renderProps.bind(this);
this.renderTypeDef = this.renderTypeDef.bind(this);
this.renderTypeDefs = this.renderTypeDefs.bind(this);
}
renderProp(name, prop) {
return (
<div className="prop" key={name}>
<Header level={4} className="propTitle" toSlug={name}>
@@ -232,9 +244,9 @@ var ComponentDoc = React.createClass({
{prop.description && <Marked>{prop.description}</Marked>}
</div>
);
},
}
renderCompose: function(name) {
renderCompose(name) {
return (
<div className="prop" key={name}>
<Header level={4} className="propTitle" toSlug={name}>
@@ -242,9 +254,9 @@ var ComponentDoc = React.createClass({
</Header>
</div>
);
},
}
renderStylesheetProp: function(name, prop) {
renderStylesheetProp(name, prop) {
return (
<div className="prop" key={name}>
<h6 className="propTitle">
@@ -261,9 +273,9 @@ var ComponentDoc = React.createClass({
</h6>
</div>
);
},
}
renderStylesheetProps: function(stylesheetName) {
renderStylesheetProps(stylesheetName) {
var style = this.props.content.styles[stylesheetName];
this.extractPlatformFromProps(style.props);
return (
@@ -299,9 +311,9 @@ var ComponentDoc = React.createClass({
}
</div>
);
},
}
renderProps: function(props, composes) {
renderProps(props, composes) {
return (
<div className="props">
{(composes || []).map((name) =>
@@ -313,9 +325,9 @@ var ComponentDoc = React.createClass({
}
</div>
);
},
}
extractPlatformFromProps: function(props) {
extractPlatformFromProps(props) {
for (var key in props) {
var prop = props[key];
var description = prop.description || '';
@@ -326,9 +338,9 @@ var ComponentDoc = React.createClass({
prop.description = description;
prop.platforms = platforms;
}
},
}
renderMethod: function(method, namedTypes) {
renderMethod(method, namedTypes) {
return (
<Method
key={method.name}
@@ -339,11 +351,12 @@ var ComponentDoc = React.createClass({
examples={method.examples}
returns={method.returns}
namedTypes={namedTypes}
entityName={this.props.componentName}
/>
);
},
}
renderMethods: function(methods, namedTypes) {
renderMethods(methods, namedTypes) {
if (!methods || !methods.length) {
return null;
}
@@ -357,9 +370,9 @@ var ComponentDoc = React.createClass({
</div>
</span>
);
},
}
renderTypeDef: function(typedef, namedTypes) {
renderTypeDef(typedef, namedTypes) {
return (
<TypeDef
key={typedef.name}
@@ -372,9 +385,9 @@ var ComponentDoc = React.createClass({
namedTypes={namedTypes}
/>
);
},
}
renderTypeDefs: function(typedefs, namedTypes) {
renderTypeDefs(typedefs, namedTypes) {
if (!typedefs || !typedefs.length) {
return null;
}
@@ -388,9 +401,9 @@ var ComponentDoc = React.createClass({
</div>
</span>
);
},
}
render: function() {
render() {
var content = this.props.content;
this.extractPlatformFromProps(content.props);
const namedTypes = getNamedTypes(content.typedef);
@@ -406,11 +419,23 @@ var ComponentDoc = React.createClass({
</div>
);
}
});
}
var APIDoc = React.createClass({
class APIDoc extends React.Component {
constructor(props, context) {
super(props, context);
renderMethod: function(method, namedTypes) {
this.renderMethod = this.renderMethod.bind(this);
this.renderMethods = this.renderMethods.bind(this);
this.renderProperty = this.renderProperty.bind(this);
this.renderProperties = this.renderProperties.bind(this);
this.renderClasses = this.renderClasses.bind(this);
this.renderTypeDef = this.renderTypeDef.bind(this);
this.renderTypeDefs = this.renderTypeDefs.bind(this);
this.renderMainDescription = this.renderMainDescription.bind(this);
}
renderMethod(method, namedTypes) {
return (
<Method
key={method.name}
@@ -419,13 +444,13 @@ var APIDoc = React.createClass({
params={method.params}
modifiers={method.scope ? [method.scope] : method.modifiers}
examples={method.examples}
apiName={this.props.apiName}
entityName={this.props.apiName}
namedTypes={namedTypes}
/>
);
},
}
renderMethods: function(methods, namedTypes) {
renderMethods(methods, namedTypes) {
if (!methods.length) {
return null;
}
@@ -439,9 +464,9 @@ var APIDoc = React.createClass({
</div>
</span>
);
},
}
renderProperty: function(property) {
renderProperty(property) {
return (
<div className="prop" key={property.name}>
<Header level={4} className="propTitle" toSlug={property.name}>
@@ -457,9 +482,9 @@ var APIDoc = React.createClass({
</Marked>}
</div>
);
},
}
renderProperties: function(properties) {
renderProperties(properties) {
if (!properties || !properties.length) {
return null;
}
@@ -473,9 +498,9 @@ var APIDoc = React.createClass({
</div>
</span>
);
},
}
renderClasses: function(classes, namedTypes) {
renderClasses(classes, namedTypes) {
if (!classes || !classes.length) {
return null;
}
@@ -490,22 +515,22 @@ var APIDoc = React.createClass({
<Header level={2} toSlug={cls.name}>
class {cls.name}
</Header>
<ul>
<div>
{cls.docblock && <Marked>
{removeCommentsFromDocblock(cls.docblock)}
</Marked>}
{this.renderMethods(cls.methods, namedTypes)}
{this.renderProperties(cls.properties)}
</ul>
</div>
</span>
);
})}
</div>
</span>
);
},
}
renderTypeDef: function(typedef, namedTypes) {
renderTypeDef(typedef, namedTypes) {
return (
<TypeDef
key={typedef.name}
@@ -518,9 +543,9 @@ var APIDoc = React.createClass({
namedTypes={namedTypes}
/>
);
},
}
renderTypeDefs: function(typedefs, namedTypes) {
renderTypeDefs(typedefs, namedTypes) {
if (!typedefs || !typedefs.length) {
return null;
}
@@ -534,9 +559,9 @@ var APIDoc = React.createClass({
</div>
</span>
);
},
};
renderMainDescription: function(content) {
renderMainDescription(content) {
if (content.docblock) {
return (
<Marked>
@@ -552,9 +577,9 @@ var APIDoc = React.createClass({
);
}
return null;
},
}
render: function() {
render() {
var content = this.props.content;
if (!content.methods) {
throw new Error(
@@ -572,10 +597,18 @@ var APIDoc = React.createClass({
</div>
);
}
});
}
var Method = React.createClass({
renderTypehintRec: function(typehint) {
class Method extends React.Component {
constructor(props, context) {
super(props, context);
this.renderTypehint = this.renderTypehint.bind(this);
this.renderTypehintRec = this.renderTypehintRec.bind(this);
this.renderMethodExamples = this.renderMethodExamples.bind(this);
this.renderMethodParameters = this.renderMethodParameters.bind(this);
}
renderTypehintRec(typehint) {
if (typehint.type === 'simple') {
return typehint.value;
}
@@ -585,10 +618,9 @@ var Method = React.createClass({
}
return JSON.stringify(typehint);
}
},
renderTypehint: function(typehint) {
renderTypehint(typehint) {
if (typeof typehint === 'object' && typehint.name) {
return renderType(typehint);
}
@@ -599,9 +631,9 @@ var Method = React.createClass({
}
return this.renderTypehintRec(typehint);
},
}
renderMethodExamples: function(examples) {
renderMethodExamples(examples) {
if (!examples || !examples.length) {
return null;
}
@@ -621,9 +653,9 @@ var Method = React.createClass({
</div>
);
});
},
};
renderMethodParameters: function(params) {
renderMethodParameters(params) {
if (!params || !params.length) {
return null;
}
@@ -634,6 +666,7 @@ var Method = React.createClass({
if (!foundDescription) {
return null;
}
return (
<div>
<strong>Parameters:</strong>
@@ -651,7 +684,7 @@ var Method = React.createClass({
<td>
{param.optional ? '[' + param.name + ']' : param.name}
<br/><br/>
{renderTypeWithLinks(param.type, this.props.apiName, this.props.namedTypes)}
{renderTypeWithLinks(param.type, this.props.entityName, this.props.namedTypes)}
</td>
<td className="description"><Marked>{param.description}</Marked></td>
</tr>
@@ -661,9 +694,9 @@ var Method = React.createClass({
</table>
</div>
);
},
}
render: function() {
render() {
return (
<div className="prop">
<Header level={4} className="methodTitle" toSlug={this.props.name}>
@@ -690,11 +723,18 @@ var Method = React.createClass({
{this.renderMethodExamples(this.props.examples)}
</div>
);
},
});
}
}
var TypeDef = React.createClass({
renderProperties: function(properties) {
class TypeDef extends React.Component {
constructor(props, context) {
super(props, context);
this.renderProperties = this.renderProperties.bind(this);
this.renderValues = this.renderValues.bind(this);
}
renderProperties(properties) {
if (!properties || !properties.length) {
return null;
}
@@ -729,9 +769,9 @@ var TypeDef = React.createClass({
</table>
</div>
);
},
}
renderValues: function(values) {
renderValues(values) {
if (!values || !values.length) {
return null;
}
@@ -764,9 +804,9 @@ var TypeDef = React.createClass({
</table>
</div>
);
},
}
render: function() {
render() {
return (
<div className="prop">
<Header level={4} className="propTitle" toSlug={this.props.name}>
@@ -782,23 +822,24 @@ var TypeDef = React.createClass({
{this.renderValues(this.props.values)}
</div>
);
},
});
}
}
var Autodocs = React.createClass({
childContextTypes: {
permalink: PropTypes.string,
version: PropTypes.string
},
class Autodocs extends React.Component {
contsructor(props, context) {
super(props, context);
getChildContext: function() {
this.renderFullDescription = this.renderFullDescription.bind(this);
}
getChildContext() {
return {
permalink: this.props.metadata.permalink,
version: Metadata.config.RN_VERSION || 'next'
};
},
}
renderFullDescription: function(docs) {
renderFullDescription(docs) {
if (!docs.fullDescription) {
return;
}
@@ -808,39 +849,33 @@ var Autodocs = React.createClass({
<Marked>
{docs.fullDescription}
</Marked>
<Footer path={'docs/' + docs.componentName + '.md'} />
</div>
);
},
}
render: function() {
render() {
var metadata = this.props.metadata;
var docs = JSON.parse(this.props.children);
var content = docs.type === 'component' || docs.type === 'style' ?
<ComponentDoc content={docs} /> :
<APIDoc content={docs} apiName={metadata.title} />;
var content = docs.type === 'component' || docs.type === 'style'
? <ComponentDoc content={docs} componentName={metadata.title} />
: <APIDoc content={docs} apiName={metadata.title} />;
return (
<Site
section="docs"
category={metadata.category}
title={metadata.title} >
<section className="content wrap documentationContent">
<DocsSidebar metadata={metadata} />
<div className="inner-content">
<a id="content" />
<Header level={1}>{metadata.title}</Header>
{content}
<Footer path={metadata.path} />
{this.renderFullDescription(docs)}
<div className="docs-prevnext">
{metadata.previous && <a className="docs-prev" href={'docs/' + metadata.previous + '.html#content'}>&larr; Prev</a>}
{metadata.next && <a className="docs-next" href={'docs/' + metadata.next + '.html#content'}>Next &rarr;</a>}
</div>
</div>
</section>
<div className="inner-content" id="componentContent">
{content}
{this.renderFullDescription(docs)}
</div>
</Site>
);
}
});
}
Autodocs.childContextTypes = {
permalink: PropTypes.string,
version: PropTypes.string
};
module.exports = Autodocs;
@@ -15,19 +15,24 @@ var React = require('React');
var Site = require('Site');
var Hero = require('Hero');
var MetadataBlog = require('MetadataBlog');
var BlogPost = require('BlogPost');
var BlogPostExcerpt = require('BlogPostExcerpt');
var BlogPageLayout = React.createClass({
getPageURL: function(page) {
class BlogPageLayout extends React.Component {
constructor(props, context) {
super(props, context);
this.getPageURL = this.getPageURL.bind(this);
}
getPageURL(page) {
var url = '/react-native/blog/';
if (page > 0) {
url += 'page' + (page + 1) + '/';
}
return url + '#content';
},
}
render: function() {
render() {
var perPage = this.props.metadata.perPage;
var page = this.props.metadata.page;
return (
@@ -55,6 +60,6 @@ var BlogPageLayout = React.createClass({
</Site>
);
}
});
}
module.exports = BlogPageLayout;
@@ -19,8 +19,8 @@ var BlogPost = require('BlogPost');
var BlogPostHeader = require('BlogPostHeader');
var Marked = require('Marked');
var BlogPostLayout = React.createClass({
render: function() {
class BlogPostLayout extends React.Component {
render() {
return (
<Site
section="blog"
@@ -39,6 +39,6 @@ var BlogPostLayout = React.createClass({
</Site>
);
}
});
}
module.exports = BlogPostLayout;
+51
View File
@@ -0,0 +1,51 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
* @providesModule DocsLayout
*/
'use strict';
var DocsSidebar = require('DocsSidebar');
var EjectBanner = require('EjectBanner');
var Footer = require('Footer');
var Header = require('Header');
var Marked = require('Marked');
var Metadata = require('Metadata');
var React = require('React');
var PropTypes = require('prop-types');
var Site = require('Site');
class DocsLayout extends React.Component {
getChildContext() {
return {
permalink: this.props.metadata.permalink,
version: Metadata.config.RN_VERSION || 'next'
};
}
render() {
var metadata = this.props.metadata;
var content = this.props.children;
return (
<Site
category={metadata.category}
title={metadata.title} >
<div className="inner-content" id="componentContent">
<Marked>{content}</Marked>
</div>
</Site>
);
}
}
DocsLayout.childContextTypes = {
permalink: PropTypes.string,
version: PropTypes.string
};
module.exports = DocsLayout;
@@ -15,30 +15,28 @@ var React = require('React');
var PropTypes = require('prop-types');
var Site = require('Site');
var support = React.createClass({
childContextTypes: {
permalink: PropTypes.string
},
getChildContext: function() {
class support extends React.Component {
getChildContext() {
return {permalink: this.props.metadata.permalink};
},
}
render: function() {
render() {
var metadata = this.props.metadata;
var content = this.props.children;
return (
<Site
section={metadata.section}
title={metadata.title} >
<section className="content wrap documentationContent nosidebar">
<div className="inner-content">
<Marked>{content}</Marked>
</div>
</section>
<div className="inner-content">
<Marked>{content}</Marked>
</div>
</Site>
);
}
});
}
support.childContextTypes = {
permalink: PropTypes.string
};
module.exports = support;
@@ -12,8 +12,8 @@
var React = require('React');
var RedirectLayout = React.createClass({
render: function() {
class RedirectLayout extends React.Component {
render() {
var destinationUrl = this.props.metadata.destinationUrl;
return (
@@ -32,6 +32,6 @@ var RedirectLayout = React.createClass({
</html>
);
}
});
}
module.exports = RedirectLayout;
+34
View File
@@ -0,0 +1,34 @@
{
"scripts": {
"build": "node server/build.js",
"test": "jest"
},
"dependencies": {
"babel-core": "^6.6.4",
"babel-plugin-transform-flow-strip-types": "^6.21.0",
"bluebird": "^2.9.21",
"connect": "2.8.3",
"deep-assign": "^2.0.0",
"feed": "^0.3.0",
"flow-parser": "^0.32.0",
"fs.extra": "1.3.2",
"glob": "6.0.4",
"jsdoc-api": "^1.1.0",
"jsdom": "^11.1.0",
"jstransform": "11.0.3",
"memory-cache": "^0.1.6",
"mkdirp": "^0.5.1",
"optimist": "0.6.0",
"prop-types": "^15.5.8",
"react": "~0.13.0",
"react-docgen": "3.0.0-beta5",
"react-page-middleware": "0.4.1",
"remove-markdown": "^0.1.0",
"request": "^2.69.0",
"semver-compare": "^1.0.0"
},
"devDependencies": {
"front-matter": "^2.1.2",
"jest": "^15.1.1"
}
}
+150
View File
@@ -0,0 +1,150 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*
*/
'use strict';
const fs = require('fs');
const path = require('path');
const convert = require('../convert.js');
const http = require('http');
const extractDocs = require('../extractDocs');
const docsList = require('../docsList');
const glob = require('glob');
const DOCS_MD_DIR = path.join(__dirname, '/../../src/react-native');
const BUILD_DIR = path.join(__dirname, '/../../build/react-native');
function splitHeader(content) {
var lines = content.split(/\r?\n/);
for (var i = 1; i < lines.length - 1; ++i) {
if (lines[i] === '---') {
break;
}
}
return {
header: i < lines.length - 1 ?
lines.slice(1, i + 1).join('\n') : null,
content: lines.slice(i + 1).join('\n')
};
}
function extractMetadata(content) {
var metadata = {};
var both = splitHeader(content);
var lines = both.header.split('\n');
for (var i = 0; i < lines.length - 1; ++i) {
var keyvalue = lines[i].split(':');
var key = keyvalue[0].trim();
var value = keyvalue.slice(1).join(':').trim();
// Handle the case where you have "Community #10"
try { value = JSON.parse(value); } catch(e) { }
metadata[key] = value;
}
return {metadata: metadata, rawContent: both.content};
}
function rmFile(file) {
try {
fs.unlinkSync(file);
} catch(e) {
/* seriously, unlink throws when the file doesn't exist :( */
}
}
let extractedDocs;
beforeAll(() => {
glob(DOCS_MD_DIR + '/**/*.*', function(er, files) {
files.forEach(rmFile);
extractedDocs = extractDocs();
require('../build');
});
});
describe('extractDocs.js', () => {
it('doc has frontmatter', () => {
const firstDoc = extractedDocs[0];
expect(firstDoc.slice(0, 3) === '---').toBeTruthy();
});
it ('extracted expected number of docs', () => {
const all = docsList.components
.concat(docsList.apis)
.concat(docsList.stylesWithPermalink);
expect(extractedDocs.length == all.length);
})
})
describe('convert.js', () => {
it ('converted a component', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
expect(files.length).toBeGreaterThan(0);
});
it ('converted a component with DocsLayout', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
let foundDocsLayout = false;
files.forEach(function (file) {
const content = fs.readFileSync(file, {encoding: 'utf8'});
if (content.indexOf("var Layout = require(\"DocsLayout\");") !== -1) {
foundDocsLayout = true;
}
});
expect(foundDocsLayout).toBeTruthy();
});
it ('converted a component with AutodocsLayout', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
let foundDocsLayout = false;
files.forEach(function (file) {
const content = fs.readFileSync(file, {encoding: 'utf8'});
if (content.indexOf("var Layout = require(\"AutodocsLayout\");") !== -1) {
foundDocsLayout = true;
}
});
expect(foundDocsLayout).toBeTruthy();
});
})
describe('generate.js', () => {
it ('rendered all webpages', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
files.forEach(function (file) {
const targetFile = file.replace(/^src/, 'build');
const content = fs.readFileSync(targetFile, {encoding: 'utf8'});
expect(content.length).toBeGreaterThan(0);
});
});
})
describe('build.js', () => {
it ('rendered files', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
expect(files.length).toBeGreaterThan(0);
});
it ('rendered all files', () => {
const files = glob.sync(DOCS_MD_DIR + '/**/*.*');
files.forEach(function (file) {
const targetFile = file.replace(/^src/, 'build').replace(/\.html$/, '.md');;
const content = fs.readFileSync(targetFile, {encoding: 'utf8'});
expect(content.length).toBeGreaterThan(0);
});
});
it ('rendered markdown contains frontmatter', () => {
const files = glob.sync(BUILD_DIR + '/**/*.md');
files.forEach(function (file) {
const content = fs.readFileSync(file, {encoding: 'utf8'});
expect(content.slice(0, 3) === '---').toBeTruthy();
});
});
})
+153
View File
@@ -0,0 +1,153 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
"use strict";
var fs = require("fs");
var glob = require("glob");
var Promise = require("bluebird");
var mkdirp = require("mkdirp");
var slugify = require("../core/slugify");
var jsdom = require("jsdom");
const { JSDOM } = jsdom;
var queue = Promise.resolve();
function bodyContentFromDOM(dom) {
const el = dom.window.document.querySelector("#componentContent");
if (el) {
return el.innerHTML;
} else {
return null;
}
}
function componentNameFromDOM(dom) {
const el = dom.window.document.querySelector("title");
if (el) {
return el.innerHTML;
} else {
return "Component";
}
}
function componentCategoryFromDOM(dom) {
const el = dom.window.document.querySelector('meta[property="rn:category"]');
if (el) {
return el.content;
} else {
return "Components";
}
}
/**
* Updates sidebar.json with the autogenerated API docs, without overwriting existing sections/categories.
*
* @param {*} categories
*/
function updateSidebarSync(categories) {
const sidebarFile = "../website/sidebars.json";
let sidebarContent = { SIDEBAR_AUTODOCS_SECTION: {} };
if (fs.existsSync(sidebarFile)) {
sidebarContent = JSON.parse(fs.readFileSync(sidebarFile));
}
let sortedCategories = {};
for (var category in categories) {
const sortedCategory = categories[category].sort();
sortedCategories[category] = sortedCategory;
// TODO: replace with spread once babelized?
}
const newSidebarContent = Object.assign({}, sidebarContent, {
API: sortedCategories
});
fs.writeFileSync(sidebarFile, JSON.stringify(newSidebarContent));
}
// Generate HTML for each non-source code JS file
glob("build/**/*.html", function(er, files) {
let categories = {};
files.forEach(function(file) {
queue = queue
.then(function() {
return JSDOM.fromFile(file);
})
.then(function(dom) {
const body = bodyContentFromDOM(dom);
if (!body) {
console.log("Skipping " + file);
return;
}
const componentName = componentNameFromDOM(dom);
const slug = slugify(componentName);
let category = "Components";
const componentCategory = componentCategoryFromDOM(dom);
if (componentCategory) {
category = componentCategory;
}
const metadata = { id: slug, category: category };
const res = [
"---",
"id: " + slug,
"title: " + componentName,
"sidebar: api",
"category: " + category,
"permalink: docs/" + slug + ".html",
"---",
body
]
.filter(function(line) {
return line;
})
.join("\n");
const targetFile = "../docs/autogen_" + componentName + ".md";
mkdirp.sync(targetFile.replace(new RegExp("/[^/]*$"), ""));
console.log("Writing " + targetFile);
fs.writeFileSync(targetFile, res);
if (categories[category]) {
categories[category].push(slug);
} else {
categories[category] = [slug];
}
})
.catch(function(error) {
console.error("Skipping " + targetFile + ": " + error);
});
});
queue = queue
.then(function() {
console.log("Generated Markdown files from HTML");
updateSidebarSync(categories);
})
.catch(function(e) {
console.error(e);
process.exit(1);
});
});
// TODO: Generate a sidebar. Looks like this:
/*
{
"docs": {
"The Basics": ["doc1"],
"Guides": ["doc2"],
"Components": ["doc3"],
"APIs": ["doc3"]
},
"docs-other": {
"First Category": ["doc4", "doc5"]
}
}
I'm guessing for API/Components we can just do it alphabetically.
For everything else, we can get an initial order from the frontmatter, and bake it into the sidebar.
Then we can make sure that the build script only updates the API and Components keys, leaving Guides/The Basics untouched.
*/
@@ -77,7 +77,7 @@ function buildFile(layout, metadata, rawContent) {
'var React = require("React");',
'var Layout = require("' + layout + '");',
rawContent && 'var content = ' + backtickify(rawContent) + ';',
'var Post = React.createClass({',
'var Page = React.createClass({',
rawContent && ' statics: { content: content },',
' render: function() {',
' return (',
@@ -87,7 +87,7 @@ function buildFile(layout, metadata, rawContent) {
' );',
' }',
'});',
'module.exports = Post;'
'module.exports = Page;'
].filter(e => e).join('\n');
}
@@ -97,17 +97,9 @@ function execute(options) {
}
var DOCS_MD_DIR = '../docs/';
var BLOG_MD_DIR = '../blog/';
var CONFIG_JSON_DIR = '../';
glob.sync('src/react-native/docs/*.*').forEach(rmFile);
glob.sync('src/react-native/blog/*.*').forEach(rmFile);
glob.sync('../blog/img/*.*').forEach(file => {
writeFileAndCreateFolder(
'src/react-native/blog/img/' + path.basename(file),
fs.readFileSync(file)
);
});
var metadatas = {
files: [],
@@ -153,20 +145,6 @@ function execute(options) {
extractedDocs.forEach(function(content) {
handleMarkdown(content, null);
});
var files = glob.sync(DOCS_MD_DIR + '**/*.*');
files.forEach(function(file) {
var extension = path.extname(file);
if (extension === '.md' || extension === '.markdown') {
var content = fs.readFileSync(file, {encoding: 'utf8'});
handleMarkdown(content, path.basename(file));
}
if (extension === '.json') {
var content = fs.readFileSync(file, {encoding: 'utf8'});
metadatas[path.basename(file, '.json')] = JSON.parse(content);
}
});
}
// we need to pass globals for the components to be configurable
@@ -180,13 +158,6 @@ function execute(options) {
metadatas.config[key] = process.env[key];
});
// load showcase apps into metadata
var showcaseApps = JSON.parse(fs.readFileSync(
path.basename(CONFIG_JSON_DIR + 'showcase.json'),
{encoding: 'utf8'}
));
metadatas.showcaseApps = showcaseApps;
fs.writeFileSync(
'core/metadata.js',
'/**\n' +
@@ -195,66 +166,6 @@ function execute(options) {
' */\n' +
'module.exports = ' + JSON.stringify(metadatas, null, 2) + ';'
);
files = glob.sync(BLOG_MD_DIR + '**/*.md');
const metadatasBlog = {
files: [],
};
files.sort().reverse().forEach(file => {
// Transform
// 2015-08-13-blog-post-name-0.5.md
// into
// 2015/08/13/blog-post-name-0-5.html
var filePath = path.basename(file)
.replace('-', '/')
.replace('-', '/')
.replace('-', '/')
// react-middleware is broken with files that contains multiple . like react-0.14.js
.replace(/\./g, '-')
.replace(/\-md$/, '.html');
// Extract 2015-08-13 from 2015/08/13/blog-post-name-0-5.html
var match = filePath.match(/([0-9]+)\/([0-9]+)\/([0-9]+)/);
var year = match[1];
var month = match[2];
var day = match[3];
var publishedAt = year + '-' + month + '-' + day;
var res = extractMetadata(fs.readFileSync(file, {encoding: 'utf8'}));
var rawContent = res.rawContent;
var excerpt = removeMd(rawContent).trim().split('\n')[0];
var metadata = Object.assign({path: filePath, content: rawContent, publishedAt: publishedAt, excerpt: excerpt}, res.metadata);
metadatasBlog.files.push(metadata);
writeFileAndCreateFolder(
'src/react-native/blog/' + filePath.replace(/\.html$/, '.js'),
buildFile('BlogPostLayout', metadata, rawContent)
);
});
var perPage = 15;
for (var page = 0; page < Math.ceil(metadatasBlog.files.length / perPage); ++page) {
writeFileAndCreateFolder(
'src/react-native/blog' + (page > 0 ? '/page' + (page + 1) : '') + '/index.js',
buildFile('BlogPageLayout', { page: page, perPage: perPage })
);
}
fs.writeFileSync(
'core/metadata-blog.js',
'/**\n' +
' * @generated\n' +
' * @providesModule MetadataBlog\n' +
' */\n' +
'module.exports = ' + JSON.stringify(metadatasBlog, null, 2) + ';'
);
fs.writeFileSync(
'server/metadata-blog.json',
JSON.stringify(metadatasBlog, null, 2)
);
}
if (argv.convert) {
@@ -51,7 +51,6 @@ const components = [
const apis = [
'../Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js',
'../Libraries/ActionSheetIOS/ActionSheetIOS.js',
'../Libraries/AdSupport/AdSupportIOS.js',
'../Libraries/Alert/Alert.js',
'../Libraries/Alert/AlertIOS.js',
'../Libraries/Animated/src/AnimatedImplementation.js',
@@ -147,9 +147,12 @@ function componentsToMarkdown(type, json, filepath, idx, styles) {
if (type === 'api') {
type = 'API';
} else {
type = type.charAt(0).toUpperCase() + type.substring(1).toLowerCase();
}
// Put styles (e.g. Flexbox) into the API category
const category = (type === 'style' ? 'APIs' : type + 's');
const category = (type === 'Style' ? 'APIs' : type + 's');
const next = getNextComponent(idx);
const previous = getPreviousComponent(idx);
@@ -19,53 +19,8 @@ var Feed = require('feed');
require('./convert.js')({extractDocs: true});
server.noconvert = true;
// Sadly, our setup fatals when doing multiple concurrent requests
// I don't have the time to dig into why, it's easier to just serialize
// requests.
var queue = Promise.resolve();
// Generate RSS Feeds
queue = queue.then(function() {
return new Promise(function(resolve, reject) {
var targetFile = 'build/react-native/blog/feed.xml';
var basePath = 'https://facebook.github.io/react-native/';
var blogPath = basePath + 'blog/';
var metadataBlog = JSON.parse(fs.readFileSync('server/metadata-blog.json'));
var latestPost = metadataBlog.files[0];
var feed = new Feed({
title: 'React Native Blog',
description: 'The best place to stay up-to-date with the latest React Native news and events.',
id: blogPath,
link: blogPath,
image: basePath + 'img/header_logo.png',
copyright: 'Copyright © ' + new Date().getFullYear() + ' Facebook Inc.',
updated: new Date(latestPost.publishedAt),
});
metadataBlog.files.forEach(function(post) {
var url = blogPath + post.path;
feed.addItem({
title: post.title,
id: url,
link: url,
date: new Date(post.publishedAt),
author: [{
name: post.author,
link: post.authorURL
}],
description: post.excerpt,
});
});
mkdirp.sync(targetFile.replace(new RegExp('/[^/]*$'), ''));
fs.writeFileSync(targetFile, feed.render('atom-1.0'));
console.log('Generated RSS feed')
resolve();
});
});
// Generate HTML for each non-source code JS file
glob('src/**/*.*', function(er, files) {
files.forEach(function(file) {
+213
View File
@@ -0,0 +1,213 @@
#!/usr/bin/env node
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
*/
"use strict";
const fm = require("front-matter");
const fs = require("fs");
const glob = require("glob");
const mkdirp = require("mkdirp");
const shell = require("shelljs");
const GIT_USER = process.env.GIT_USER;
const GITHUB_USERNAME = process.env.GITHUB_USERNAME;
const GITHUB_REPONAME = process.env.GITHUB_REPONAME;
const remoteBranch = `https://${GIT_USER}@github.com/${GITHUB_USERNAME}/${GITHUB_REPONAME}.git`;
const targetDir = `${GITHUB_REPONAME}-docs`;
const DOCS_DIR = `../docs`;
if (!GIT_USER) {
shell.echo("GIT_USER undefined.");
shell.exit(1);
}
if (!GITHUB_USERNAME) {
shell.echo("GITHUB_USERNAME undefined.");
shell.exit(1);
}
if (!GITHUB_REPONAME) {
shell.echo("GITHUB_REPONAME undefined.");
shell.exit(1);
}
if (!shell.which("git")) {
shell.echo("Sorry, this script requires git");
shell.exit(1);
}
function prepareFilesystem() {
shell.cd(process.cwd());
shell.exec(`rm -rf build/`);
shell.mkdir(`build`);
shell.cd(`build`);
shell.exec(`rm -rf ${targetDir}`);
shell.mkdir(targetDir);
}
function checkOutDocs() {
shell.cd(targetDir);
shell.exec(`git init`).code !== 0;
if (shell.exec(`git remote add origin ${remoteBranch}`).code !== 0) {
shell.echo("Error: git remote failed");
shell.exit(1);
}
shell.exec(`git config core.sparsecheckout true`).code !== 0;
shell.exec(`echo "docs/*" >> .git/info/sparse-checkout`).code !== 0;
if (shell.exec(`git fetch --depth 1 origin master`).code !== 0) {
shell.echo("Error: git fetch failed");
shell.exit(1);
}
if (shell.exec(`git pull --depth 1 origin master`).code !== 0) {
shell.echo("Error: git pull failed");
shell.exit(1);
}
shell.echo("Checked out react-native-docs");
shell.cd(`../..`);
}
function generateDocsMetadata(files) {
let sidebarsMetadata = new Object();
files.forEach(function(file) {
const data = fs.readFileSync(file, "utf8");
const content = fm(data);
const metadata = content.attributes;
const rawContent = content.body;
if (metadata.layout !== "docs") {
console.log(`Skipping ${file} due to non-docs layout ${metadata.layout}`);
return;
}
if (metadata.category) {
if (!Object.keys(sidebarsMetadata).includes(metadata.category)) {
sidebarsMetadata = Object.assign({}, sidebarsMetadata, {
[metadata.category]: {}
});
}
const sidebarMetadata = {
previous: metadata.previous,
next: metadata.next,
id: metadata.id,
title: metadata.title,
content: rawContent,
filename: file
};
const updatedCategory = Object.assign(
{},
sidebarsMetadata[metadata.category],
{ [sidebarMetadata.id]: sidebarMetadata }
);
sidebarsMetadata = Object.assign({}, sidebarsMetadata, {
[metadata.category]: updatedCategory
});
} else {
console.log(`Skipping ${file} due to lack of category`);
return;
}
if (!metadata.permalink) {
console.log(`Skipping ${file} due to lack of permalink`);
return;
}
if (metadata.permalink.match(/^https?:/)) {
// skips non-local docs?
console.log(`Skipping ${file} as its permalink is external`);
return;
}
});
fs.writeFileSync(
`build/sidebars-metadata.json`,
JSON.stringify(sidebarsMetadata)
);
return sidebarsMetadata;
}
function generateSidebarsFromMetadata(sidebarsMetadata) {
let sidebars = new Object();
Object.keys(sidebarsMetadata).forEach(function(category) {
if (!Object.keys(sidebars).includes(category)) {
sidebars = Object.assign({}, sidebars, { [category]: [] });
}
let categoryHead;
let allFilesInCategory = Object.keys(sidebarsMetadata[category]);
Object.entries(sidebarsMetadata[category]).forEach(function([id, file]) {
if (allFilesInCategory.includes(file.previous)) {
// skip, we're looking for head
console.log(`skipping ${file.id}`);
return;
}
categoryHead = file;
});
let updatedCategory = [categoryHead.id];
let currentFile = categoryHead;
while (allFilesInCategory.includes(currentFile.next)) {
updatedCategory = updatedCategory.concat([currentFile.next]);
currentFile = sidebarsMetadata[category][currentFile.next];
}
sidebars = Object.assign({}, sidebars, { [category]: updatedCategory });
});
return sidebars;
}
function generateMarkdownFromMetadata(sidebarMetadata) {
Object.keys(sidebarMetadata).forEach(function(category) {
Object.keys(sidebarMetadata[category]).forEach(function(docId) {
const doc = sidebarMetadata[category][docId];
const targetFile = `../docs/${doc.id}.md`;
const res = [
"---",
"id: " + doc.id,
"title: " + doc.title,
"---",
doc.content
]
.filter(function(line) {
return line;
})
.join("\n");
fs.writeFileSync(targetFile, res);
console.log(`Wrote ${targetFile}`);
});
});
}
function processDocs() {
// Generate sidebars.json
glob(`build/${targetDir}/docs/*.md`, function(er, files) {
const sidebarsMetadata = generateDocsMetadata(files);
const sidebars = generateSidebarsFromMetadata(sidebarsMetadata);
fs.writeFileSync(
`../website/sidebars.json`,
JSON.stringify({
docs: sidebars
})
);
console.log("Generated sidebars.json file from docs");
generateMarkdownFromMetadata(sidebarsMetadata);
console.log("Generated markdown files from docs");
});
}
prepareFilesystem();
checkOutDocs();
processDocs();
+10
View File
@@ -0,0 +1,10 @@
var jsdom = require('jsdom');
const { JSDOM } = jsdom;
const dom = new JSDOM(`<!DOCTYPE html><html><head><title>WebView</title><base href="/react-native/"><meta property="rn:category" content="APIs" /><link rel="stylesheet" href="css/react-native.css"><link rel="stylesheet" href="css/prism.css"></head><body><div class="inner-content" id="componentContent">expected content</div></body></html>`);
const el = dom.window.document.querySelector("#componentContent");
console.log(el.innerHTML);
console.log(dom.window.document.querySelector("title").innerHTML);
console.log(dom.window.document.querySelector('meta[property="rn:category"]').content);
@@ -61,6 +61,6 @@ const app = connect()
const portToUse = port || 8079;
const server = http.createServer(app);
server.listen(portToUse, function(){
console.log('Open http://localhost:' + portToUse + '/react-native/index.html');
console.log('Open http://localhost:' + portToUse + '/react-native/docs/animated.html');
});
module.exports = server;
+129
View File
@@ -0,0 +1,129 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 87,
"source": "fetch: function(): Promise \{\\n return new Promise((resolve, reject) => \{\\n AccessibilityManager.getCurrentVoiceOverState(\\n resolve,\\n reject\\n );\\n });\\n }",
"docblock": "/**\\n * Query whether a screen reader is currently enabled. Returns a promise which\\n * resolves to a boolean. The result is \`true\` when a screen reader is enabled\\n * and \`false\` otherwise.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1}",
"name": "fetch"
},
\{
"line": 108,
"source": "addEventListener: function (\\n eventName: ChangeEventName,\\n handler: Function\\n ): Object \{\\n var listener;\\n\\n if (eventName === 'change') \{\\n listener = RCTDeviceEventEmitter.addListener(\\n VOICE_OVER_EVENT,\\n handler\\n );\\n } else if (eventName === 'announcementFinished') \{\\n listener = RCTDeviceEventEmitter.addListener(\\n ANNOUNCEMENT_DID_FINISH_EVENT,\\n handler\\n );\\n }\\n\\n _subscriptions.set(handler, listener);\\n return \{\\n remove: AccessibilityInfo.removeEventListener.bind(null, eventName, handler),\\n };\\n }",
"docblock": "/**\\n * Add an event handler. Supported events:\\n *\\n * - \`change\`: Fires when the state of the screen reader changes. The argument\\n * to the event handler is a boolean. The boolean is \`true\` when a screen\\n * reader is enabled and \`false\` otherwise.\\n * - \`announcementFinished\`: iOS-only event. Fires when the screen reader has\\n * finished making an announcement. The argument to the event handler is a dictionary\\n * with these keys:\\n * - \`announcement\`: The string announced by the screen reader.\\n * - \`success\`: A boolean indicating whether the announcement was successfully made.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ChangeEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "Object",
"name": "addEventListener"
},
\{
"line": 135,
"source": "setAccessibilityFocus: function(\\n reactTag: number\\n ): void \{\\n AccessibilityManager.setAccessibilityFocus(reactTag);\\n }",
"docblock": "/**\\n * iOS-Only. Set accessibility focus to a react component.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "reactTag"
}
],
"tparams": null,
"returntypehint": "void",
"name": "setAccessibilityFocus"
},
\{
"line": 144,
"source": "announceForAccessibility: function(\\n announcement: string\\n ): void \{\\n AccessibilityManager.announceForAccessibility(announcement);\\n }",
"docblock": "/**\\n * iOS-Only. Post a string to be announced by the screen reader.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "announcement"
}
],
"tparams": null,
"returntypehint": "void",
"name": "announceForAccessibility"
},
\{
"line": 153,
"source": "removeEventListener: function(\\n eventName: ChangeEventName,\\n handler: Function\\n ): void \{\\n var listener = _subscriptions.get(handler);\\n if (!listener) \{\\n return;\\n }\\n listener.remove();\\n _subscriptions.delete(handler);\\n }",
"docblock": "/**\\n * Remove an event handler.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ChangeEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "void",
"name": "removeEventListener"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 80,
"name": "AccessibilityInfo",
"docblock": "/**\\n * Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The\\n * \`AccessibilityInfo\` API is designed for this purpose. You can use it to query the current state of the\\n * screen reader as well as to register to be notified when the state of the screen reader changes.\\n *\\n * Here's a small example illustrating how to use \`AccessibilityInfo\`:\\n *\\n * \`\`\`javascript\\n * class ScreenReaderStatusExample extends React.Component \{\\n * state = \{\\n * screenReaderEnabled: false,\\n * }\\n *\\n * componentDidMount() \{\\n * AccessibilityInfo.addEventListener(\\n * 'change',\\n * this._handleScreenReaderToggled\\n * );\\n * AccessibilityInfo.fetch().done((isEnabled) => \{\\n * this.setState(\{\\n * screenReaderEnabled: isEnabled\\n * });\\n * });\\n * }\\n *\\n * componentWillUnmount() \{\\n * AccessibilityInfo.removeEventListener(\\n * 'change',\\n * this._handleScreenReaderToggled\\n * );\\n * }\\n *\\n * _handleScreenReaderToggled = (isEnabled) => \{\\n * this.setState(\{\\n * screenReaderEnabled: isEnabled,\\n * });\\n * }\\n *\\n * render() \{\\n * return (\\n * <View>\\n * <Text>\\n * The screen reader is \{this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.\\n * </Text>\\n * </View>\\n * );\\n * }\\n * }\\n * \`\`\`\\n */\\n",
"requires": [
\{
"name": "NativeModules"
},
\{
"name": "Promise"
},
\{
"name": "RCTDeviceEventEmitter"
}
],
"filepath": "Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js",
"componentName": "AccessibilityInfo",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"accessibilityinfo","title":"AccessibilityInfo","layout":"autodocs","category":"APIs","permalink":"docs/accessibilityinfo.html","platform":"cross","next":"actionsheetios","previous":"webview","sidebar":true,"path":"Libraries/Components/AccessibilityInfo/AccessibilityInfo.ios.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+87
View File
@@ -0,0 +1,87 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 30,
"source": "showActionSheetWithOptions(options: Object, callback: Function) \{\\n invariant(\\n typeof options === 'object' && options !== null,\\n 'Options must be a valid object'\\n );\\n invariant(\\n typeof callback === 'function',\\n 'Must provide a valid callback'\\n );\\n RCTActionSheetManager.showActionSheetWithOptions(\\n \{...options, tintColor: processColor(options.tintColor)},\\n callback\\n );\\n }",
"docblock": "/**\\n * Display an iOS action sheet. The \`options\` object must contain one or more\\n * of:\\n *\\n * - \`options\` (array of strings) - a list of button titles (required)\\n * - \`cancelButtonIndex\` (int) - index of cancel button in \`options\`\\n * - \`destructiveButtonIndex\` (int) - index of destructive button in \`options\`\\n * - \`title\` (string) - a title to show above the action sheet\\n * - \`message\` (string) - a message to show below the title\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "Object",
"name": "options"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "showActionSheetWithOptions"
},
\{
"line": 59,
"source": "showShareActionSheetWithOptions(\\n options: Object,\\n failureCallback: Function,\\n successCallback: Function\\n ) \{\\n invariant(\\n typeof options === 'object' && options !== null,\\n 'Options must be a valid object'\\n );\\n invariant(\\n typeof failureCallback === 'function',\\n 'Must provide a valid failureCallback'\\n );\\n invariant(\\n typeof successCallback === 'function',\\n 'Must provide a valid successCallback'\\n );\\n RCTActionSheetManager.showShareActionSheetWithOptions(\\n \{...options, tintColor: processColor(options.tintColor)},\\n failureCallback,\\n successCallback\\n );\\n }",
"docblock": "/**\\n * Display the iOS share sheet. The \`options\` object should contain\\n * one or both of \`message\` and \`url\` and can additionally have\\n * a \`subject\` or \`excludedActivityTypes\`:\\n *\\n * - \`url\` (string) - a URL to share\\n * - \`message\` (string) - a message to share\\n * - \`subject\` (string) - a subject for the message\\n * - \`excludedActivityTypes\` (array) - the activities to exclude from the ActionSheet\\n *\\n * NOTE: if \`url\` points to a local file, or is a base64-encoded\\n * uri, the file it points to will be loaded and shared directly.\\n * In this way, you can share images, videos, PDF files, etc.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "Object",
"name": "options"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "failureCallback"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "successCallback"
}
],
"tparams": null,
"returntypehint": null,
"name": "showShareActionSheetWithOptions"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 19,
"name": "ActionSheetIOS",
"docblock": "/**\\n */\\n",
"requires": [
\{
"name": "NativeModules"
},
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "processColor"
}
],
"filepath": "Libraries/ActionSheetIOS/ActionSheetIOS.js",
"componentName": "ActionSheetIOS",
"componentPlatform": "ios"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"actionsheetios","title":"ActionSheetIOS","layout":"autodocs","category":"APIs","permalink":"docs/actionsheetios.html","platform":"ios","next":"alert","previous":"accessibilityinfo","sidebar":true,"path":"Libraries/ActionSheetIOS/ActionSheetIOS.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+723
View File
@@ -0,0 +1,723 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "Displays a circular loading indicator.",
"displayName": "ActivityIndicator",
"methods": [],
"props": \{
"animating": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Whether to show the indicator (true, the default) or hide it (false).",
"defaultValue": \{
"value": "true",
"computed": false
}
},
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "The foreground color of the spinner (default is gray).",
"defaultValue": \{
"value": "Platform.OS === 'ios' ? GRAY : undefined",
"computed": false
}
},
"size": \{
"type": \{
"name": "union",
"value": [
\{
"name": "enum",
"value": [
\{
"value": "'small'",
"computed": false
},
\{
"value": "'large'",
"computed": false
}
]
},
\{
"name": "number"
}
]
},
"required": false,
"description": "Size of the indicator (default is 'small').\\nPassing a number to the size prop is only supported on Android.",
"defaultValue": \{
"value": "'small'",
"computed": false
}
},
"hidesWhenStopped": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Whether the indicator should hide when not animating (true by default).\\n\\n@platform ios",
"defaultValue": \{
"value": "true",
"computed": false
}
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/ActivityIndicator/ActivityIndicator.js",
"componentName": "ActivityIndicator",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"activityindicator","title":"ActivityIndicator","layout":"autodocs","category":"Components","permalink":"docs/activityindicator.html","platform":"cross","next":"button","previous":null,"sidebar":true,"path":"Libraries/Components/ActivityIndicator/ActivityIndicator.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+70
View File
@@ -0,0 +1,70 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "Alert",
"docblock": "/**\\n * Launches an alert dialog with the specified title and message.\\n *\\n * Optionally provide a list of buttons. Tapping any button will fire the\\n * respective onPress callback and dismiss the alert. By default, the only\\n * button will be an 'OK' button.\\n *\\n * This is an API that works both on iOS and Android and can show static\\n * alerts. To show an alert that prompts the user to enter some information,\\n * see \`AlertIOS\`; entering text in an alert is common on iOS only.\\n *\\n * ## iOS\\n *\\n * On iOS you can specify any number of buttons. Each button can optionally\\n * specify a style, which is one of 'default', 'cancel' or 'destructive'.\\n *\\n * ## Android\\n *\\n * On Android at most three buttons can be specified. Android has a concept\\n * of a neutral, negative and a positive button:\\n *\\n * - If you specify one button, it will be the 'positive' one (such as 'OK')\\n * - Two buttons mean 'negative', 'positive' (such as 'Cancel', 'OK')\\n * - Three buttons mean 'neutral', 'negative', 'positive' (such as 'Later', 'Cancel', 'OK')\\n *\\n * By default alerts on Android can be dismissed by tapping outside of the alert\\n * box. This event can be handled by providing an optional \`options\` parameter,\\n * with an \`onDismiss\` callback property \`\{ onDismiss: () => \{} }\`.\\n *\\n * Alternatively, the dismissing behavior can be disabled altogether by providing\\n * an optional \`options\` parameter with the \`cancelable\` property set to \`false\`\\n * i.e. \`\{ cancelable: false }\`\\n *\\n * Example usage:\\n * \`\`\`\\n * // Works on both iOS and Android\\n * Alert.alert(\\n * 'Alert Title',\\n * 'My Alert Msg',\\n * [\\n * \{text: 'Ask me later', onPress: () => console.log('Ask me later pressed')},\\n * \{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},\\n * \{text: 'OK', onPress: () => console.log('OK Pressed')},\\n * ],\\n * \{ cancelable: false }\\n * )\\n * \`\`\`\\n */\\n",
"methods": [
\{
"line": 81,
"source": "static alert(\\n title: ?string,\\n message?: ?string,\\n buttons?: Buttons,\\n options?: Options,\\n type?: AlertType,\\n ): void \{\\n if (Platform.OS === 'ios') \{\\n if (typeof type !== 'undefined') \{\\n console.warn('Alert.alert() with a 5th \\"type\\" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.');\\n AlertIOS.alert(title, message, buttons, type);\\n return;\\n }\\n AlertIOS.alert(title, message, buttons);\\n } else if (Platform.OS === 'android') \{\\n AlertAndroid.alert(title, message, buttons, options);\\n }\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":2,\\"nullable\\":true}",
"name": "title"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":2,\\"nullable\\":true}",
"name": "message?"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Buttons\\",\\"length\\":1}",
"name": "buttons?"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Options\\",\\"length\\":1}",
"name": "options?"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"AlertType\\",\\"length\\":1}",
"name": "type?"
}
],
"tparams": null,
"returntypehint": "void",
"name": "alert"
}
],
"type": "api",
"line": 79,
"requires": [
\{
"name": "AlertIOS"
},
\{
"name": "NativeModules"
},
\{
"name": "Platform"
}
],
"filepath": "Libraries/Alert/Alert.js",
"componentName": "Alert",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"alert","title":"Alert","layout":"autodocs","category":"APIs","permalink":"docs/alert.html","platform":"cross","next":"alertios","previous":"actionsheetios","sidebar":true,"path":"Libraries/Alert/Alert.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+389
View File
@@ -0,0 +1,389 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"typedef": [
\{
"name": "AlertType",
"description": "An Alert button type",
"type": \{
"names": [
"$Enum"
]
},
"values": [
\{
"type": \{
"names": [
"string"
]
},
"description": "Default alert with no inputs",
"name": "default"
},
\{
"type": \{
"names": [
"string"
]
},
"description": "Plain text input alert",
"name": "plain-text"
},
\{
"type": \{
"names": [
"string"
]
},
"description": "Secure text input alert",
"name": "secure-text"
},
\{
"type": \{
"names": [
"string"
]
},
"description": "Login and password alert",
"name": "login-password"
}
]
},
\{
"name": "AlertButtonStyle",
"description": "An Alert button style",
"type": \{
"names": [
"$Enum"
]
},
"values": [
\{
"type": \{
"names": [
"string"
]
},
"description": "Default button style",
"name": "default"
},
\{
"type": \{
"names": [
"string"
]
},
"description": "Cancel button style",
"name": "cancel"
},
\{
"type": \{
"names": [
"string"
]
},
"description": "Destructive button style",
"name": "destructive"
}
]
},
\{
"name": "ButtonsArray",
"description": "Array or buttons",
"type": \{
"names": [
"Array"
]
},
"values": [
\{
"type": \{
"names": [
"string"
]
},
"description": "Button label",
"name": "text"
},
\{
"type": \{
"names": [
"Function"
]
},
"description": "Callback function when button pressed",
"name": "onPress"
},
\{
"type": \{
"names": [
"$Enum"
]
},
"description": "Button style",
"name": "style"
}
],
"meta": \{
"range": [
500,
724
],
"filename": "xlbud4cpt8cpr2l1wuq0d.js",
"lineno": 27,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{}
},
"properties": [
\{
"type": \{
"names": [
"string"
]
},
"optional": true,
"description": "Button label",
"name": "text"
},
\{
"type": \{
"names": [
"function"
]
},
"optional": true,
"description": "Callback function when button pressed",
"name": "onPress"
},
\{
"type": \{
"names": [
"AlertButtonStyle"
]
},
"optional": true,
"description": "Button style",
"name": "style"
}
],
"longname": "ButtonsArray",
"scope": "global",
"order": 0
}
],
"class": [
\{
"meta": \{
"range": [
1301,
6425
],
"filename": "xlbud4cpt8cpr2l1wuq0d.js",
"lineno": 64,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000011",
"name": "AlertIOS",
"type": "ClassDeclaration",
"paramnames": []
}
},
"description": "\`AlertIOS\` provides functionality to create an iOS alert dialog with a\\nmessage or create a prompt for user input.\\n\\nCreating an iOS alert:\\n\\n\`\`\`\\nAlertIOS.alert(\\n 'Sync Complete',\\n 'All your data are belong to us.'\\n);\\n\`\`\`\\n\\nCreating an iOS prompt:\\n\\n\`\`\`\\nAlertIOS.prompt(\\n 'Enter a value',\\n null,\\n text => console.log(\\"You entered \\"+text)\\n);\\n\`\`\`\\n\\nWe recommend using the [\`Alert.alert\`](docs/alert.html) method for\\ncross-platform support if you don't need to create iOS-only prompts.",
"name": "AlertIOS",
"longname": "AlertIOS",
"scope": "global",
"order": 1
}
],
"methods": [
\{
"meta": \{
"range": [
1320,
2364
],
"filename": "xlbud4cpt8cpr2l1wuq0d.js",
"lineno": 65,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{}
},
"description": "Create and display a popup alert.",
"scope": "static",
"name": "alert",
"params": [
\{
"description": "The dialog's title.",
"name": "title",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "An optional message that appears below\\n the dialog's title.",
"name": "message",
"type": \{
"names": [
"string"
]
},
"optional": true
},
\{
"description": "This optional argument should\\n be either a single-argument function or an array of buttons. If passed\\n a function, it will be called when the user taps 'OK'.\\n\\n If passed an array of button configurations, each button should include\\n a \`text\` key, as well as optional \`onPress\` and \`style\` keys. \`style\`\\n should be one of 'default', 'cancel' or 'destructive'.",
"name": "callbackOrButtons",
"type": \{
"names": [
"?(() => void)",
"ButtonsArray"
]
},
"optional": true
},
\{
"description": "Deprecated, do not use.",
"name": "type",
"type": \{
"names": [
"AlertType"
]
},
"optional": true
}
],
"examples": [
"<caption>Example with custom buttons</caption>\\n\\nAlertIOS.alert(\\n 'Update available',\\n 'Keep your app up to date to enjoy the latest features',\\n [\\n \{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},\\n \{text: 'Install', onPress: () => console.log('Install Pressed')},\\n ],\\n);"
],
"longname": "alert",
"order": 2,
"line": 135,
"source": "static alert(\\n title: ?string,\\n message?: ?string,\\n callbackOrButtons?: ?(() => void) | ButtonsArray,\\n type?: AlertType,\\n ): void \{\\n if (typeof type !== 'undefined') \{\\n console.warn('AlertIOS.alert() with a 4th \\"type\\" parameter is deprecated and will be removed. Use AlertIOS.prompt() instead.');\\n this.prompt(title, message, callbackOrButtons, type);\\n return;\\n }\\n this.prompt(title, message, callbackOrButtons, 'default');\\n }",
"docblock": "/**\\n * Create and display a popup alert.\\n * @static\\n * @method alert\\n * @param title The dialog's title.\\n * @param message An optional message that appears below\\n * the dialog's title.\\n * @param callbackOrButtons This optional argument should\\n * be either a single-argument function or an array of buttons. If passed\\n * a function, it will be called when the user taps 'OK'.\\n *\\n * If passed an array of button configurations, each button should include\\n * a \`text\` key, as well as optional \`onPress\` and \`style\` keys. \`style\`\\n * should be one of 'default', 'cancel' or 'destructive'.\\n * @param type Deprecated, do not use.\\n *\\n * @example <caption>Example with custom buttons</caption>\\n *\\n * AlertIOS.alert(\\n * 'Update available',\\n * 'Keep your app up to date to enjoy the latest features',\\n * [\\n * \{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},\\n * \{text: 'Install', onPress: () => console.log('Install Pressed')},\\n * ],\\n * );\\n */\\n",
"modifiers": [
"static"
],
"returns": \{
"type": \{
"names": [
"void"
]
}
}
},
\{
"meta": \{
"range": [
2746,
4559
],
"filename": "xlbud4cpt8cpr2l1wuq0d.js",
"lineno": 101,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{}
},
"description": "Create and display a prompt to enter some text.",
"scope": "static",
"name": "prompt",
"params": [
\{
"description": "The dialog's title.",
"name": "title",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "An optional message that appears above the text\\n input.",
"name": "message",
"type": \{
"names": [
"string"
]
},
"optional": true
},
\{
"description": "This optional argument should\\n be either a single-argument function or an array of buttons. If passed\\n a function, it will be called with the prompt's value when the user\\n taps 'OK'.\\n\\n If passed an array of button configurations, each button should include\\n a \`text\` key, as well as optional \`onPress\` and \`style\` keys (see\\n example). \`style\` should be one of 'default', 'cancel' or 'destructive'.",
"name": "callbackOrButtons",
"type": \{
"names": [
"?((text: string) => void)",
"ButtonsArray"
]
},
"optional": true
},
\{
"description": "This configures the text input. One of 'plain-text',\\n 'secure-text' or 'login-password'.",
"name": "type",
"type": \{
"names": [
"AlertType"
]
},
"optional": true
},
\{
"description": "The default text in text input.",
"name": "defaultValue",
"type": \{
"names": [
"string"
]
},
"optional": true
},
\{
"description": "The keyboard type of first text field(if exists).\\n One of 'default', 'email-address', 'numeric', 'phone-pad',\\n 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad',\\n 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'.",
"name": "keyboardType",
"type": \{
"names": [
"string"
]
},
"optional": true
}
],
"examples": [
"<caption>Example with custom buttons</caption>\\n\\nAlertIOS.prompt(\\n 'Enter password',\\n 'Enter your password to claim your $1.5B in lottery winnings',\\n [\\n \{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},\\n \{text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},\\n ],\\n 'secure-text'\\n);",
"<caption>Example with the default button and a custom callback</caption>\\n\\nAlertIOS.prompt(\\n 'Update username',\\n null,\\n text => console.log(\\"Your username is \\"+text),\\n null,\\n 'default'\\n);"
],
"longname": "prompt",
"order": 3,
"line": 194,
"source": "static prompt(\\n title: ?string,\\n message?: ?string,\\n callbackOrButtons?: ?((text: string) => void) | ButtonsArray,\\n type?: ?AlertType = 'plain-text',\\n defaultValue?: string,\\n keyboardType?: string\\n ): void \{\\n if (typeof type === 'function') \{\\n console.warn(\\n 'You passed a callback function as the \\"type\\" argument to AlertIOS.prompt(). React Native is ' +\\n 'assuming you want to use the deprecated AlertIOS.prompt(title, defaultValue, buttons, callback) ' +\\n 'signature. The current signature is AlertIOS.prompt(title, message, callbackOrButtons, type, defaultValue, ' +\\n 'keyboardType) and the old syntax will be removed in a future version.');\\n\\n var callback = type;\\n var defaultValue = message;\\n RCTAlertManager.alertWithArgs(\{\\n title: title || undefined,\\n type: 'plain-text',\\n defaultValue,\\n }, (id, value) => \{\\n callback(value);\\n });\\n return;\\n }\\n\\n var callbacks = [];\\n var buttons = [];\\n var cancelButtonKey;\\n var destructiveButtonKey;\\n if (typeof callbackOrButtons === 'function') \{\\n callbacks = [callbackOrButtons];\\n }\\n else if (callbackOrButtons instanceof Array) \{\\n callbackOrButtons.forEach((btn, index) => \{\\n callbacks[index] = btn.onPress;\\n if (btn.style === 'cancel') \{\\n cancelButtonKey = String(index);\\n } else if (btn.style === 'destructive') \{\\n destructiveButtonKey = String(index);\\n }\\n if (btn.text || index < (callbackOrButtons || []).length - 1) \{\\n var btnDef = \{};\\n btnDef[index] = btn.text || '';\\n buttons.push(btnDef);\\n }\\n });\\n }\\n\\n RCTAlertManager.alertWithArgs(\{\\n title: title || undefined,\\n message: message || undefined,\\n buttons,\\n type: type || undefined,\\n defaultValue,\\n cancelButtonKey,\\n destructiveButtonKey,\\n keyboardType,\\n }, (id, value) => \{\\n var cb = callbacks[id];\\n cb && cb(value);\\n });\\n }",
"docblock": "/**\\n * Create and display a prompt to enter some text.\\n * @static\\n * @method prompt\\n * @param title The dialog's title.\\n * @param message An optional message that appears above the text\\n * input.\\n * @param callbackOrButtons This optional argument should\\n * be either a single-argument function or an array of buttons. If passed\\n * a function, it will be called with the prompt's value when the user\\n * taps 'OK'.\\n *\\n * If passed an array of button configurations, each button should include\\n * a \`text\` key, as well as optional \`onPress\` and \`style\` keys (see\\n * example). \`style\` should be one of 'default', 'cancel' or 'destructive'.\\n * @param type This configures the text input. One of 'plain-text',\\n * 'secure-text' or 'login-password'.\\n * @param defaultValue The default text in text input.\\n * @param keyboardType The keyboard type of first text field(if exists).\\n * One of 'default', 'email-address', 'numeric', 'phone-pad',\\n * 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad',\\n * 'name-phone-pad', 'decimal-pad', 'twitter' or 'web-search'.\\n *\\n * @example <caption>Example with custom buttons</caption>\\n *\\n * AlertIOS.prompt(\\n * 'Enter password',\\n * 'Enter your password to claim your $1.5B in lottery winnings',\\n * [\\n * \{text: 'Cancel', onPress: () => console.log('Cancel Pressed'), style: 'cancel'},\\n * \{text: 'OK', onPress: password => console.log('OK Pressed, password: ' + password)},\\n * ],\\n * 'secure-text'\\n * );\\n *\\n * @example <caption>Example with the default button and a custom callback</caption>\\n *\\n * AlertIOS.prompt(\\n * 'Update username',\\n * null,\\n * text => console.log(\\"Your username is \\"+text),\\n * null,\\n * 'default'\\n * );\\n */\\n",
"modifiers": [
"static"
],
"returns": \{
"type": \{
"names": [
"void"
]
}
}
}
],
"type": "api",
"filepath": "Libraries/Alert/AlertIOS.js",
"componentName": "AlertIOS",
"componentPlatform": "ios"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"alertios","title":"AlertIOS","layout":"autodocs","category":"APIs","permalink":"docs/alertios.html","platform":"ios","next":"animated","previous":"alert","sidebar":true,"path":"Libraries/Alert/AlertIOS.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
File diff suppressed because one or more lines are too long
+310
View File
@@ -0,0 +1,310 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 84,
"source": "setWrapperComponentProvider(provider: WrapperComponentProvider) \{\\n wrapperComponentProvider = provider;\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"WrapperComponentProvider\\",\\"length\\":1}",
"name": "provider"
}
],
"tparams": null,
"returntypehint": null,
"name": "setWrapperComponentProvider"
},
\{
"line": 88,
"source": "registerConfig(config: Array<AppConfig>): void \{\\n config.forEach((appConfig) => \{\\n if (appConfig.run) \{\\n AppRegistry.registerRunnable(appConfig.appKey, appConfig.run);\\n } else \{\\n invariant(\\n appConfig.component != null,\\n 'AppRegistry.registerConfig(...): Every config is expected to set ' +\\n 'either \`run\` or \`component\`, but \`%s\` has neither.',\\n appConfig.appKey\\n );\\n AppRegistry.registerComponent(\\n appConfig.appKey,\\n appConfig.component,\\n appConfig.section,\\n );\\n }\\n });\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"AppConfig\\",\\"length\\":1}],\\"length\\":4}",
"name": "config"
}
],
"tparams": null,
"returntypehint": "void",
"name": "registerConfig"
},
\{
"line": 108,
"source": "registerComponent(\\n appKey: string,\\n componentProvider: ComponentProvider,\\n section?: boolean,\\n ): string \{\\n runnables[appKey] = \{\\n componentProvider,\\n run: (appParameters) =>\\n renderApplication(\\n componentProviderInstrumentationHook(componentProvider),\\n appParameters.initialProps,\\n appParameters.rootTag,\\n wrapperComponentProvider && wrapperComponentProvider(appParameters),\\n )\\n };\\n if (section) \{\\n sections[appKey] = runnables[appKey];\\n }\\n return appKey;\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "appKey"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ComponentProvider\\",\\"length\\":1}",
"name": "componentProvider"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}",
"name": "section?"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "registerComponent"
},
\{
"line": 129,
"source": "registerRunnable(appKey: string, run: Function): string \{\\n runnables[appKey] = \{run};\\n return appKey;\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "appKey"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "run"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "registerRunnable"
},
\{
"line": 134,
"source": "registerSection(appKey: string, component: ComponentProvider): void \{\\n AppRegistry.registerComponent(appKey, component, true);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "appKey"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ComponentProvider\\",\\"length\\":1}",
"name": "component"
}
],
"tparams": null,
"returntypehint": "void",
"name": "registerSection"
},
\{
"line": 138,
"source": "getAppKeys(): Array<string> \{\\n return Object.keys(runnables);\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":4}",
"name": "getAppKeys"
},
\{
"line": 142,
"source": "getSectionKeys(): Array<string> \{\\n return Object.keys(sections);\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":4}",
"name": "getSectionKeys"
},
\{
"line": 146,
"source": "getSections(): Runnables \{\\n return \{\\n ...sections\\n };\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Runnables\\",\\"length\\":1}",
"name": "getSections"
},
\{
"line": 152,
"source": "getRunnable(appKey: string): ?Runnable \{\\n return runnables[appKey];\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "appKey"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Runnable\\",\\"length\\":2,\\"nullable\\":true}",
"name": "getRunnable"
},
\{
"line": 156,
"source": "getRegistry(): Registry \{\\n return \{\\n sections: AppRegistry.getSectionKeys(),\\n runnables: \{...runnables},\\n };\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Registry\\",\\"length\\":1}",
"name": "getRegistry"
},
\{
"line": 163,
"source": "setComponentProviderInstrumentationHook(hook: ComponentProviderInstrumentationHook) \{\\n componentProviderInstrumentationHook = hook;\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ComponentProviderInstrumentationHook\\",\\"length\\":1}",
"name": "hook"
}
],
"tparams": null,
"returntypehint": null,
"name": "setComponentProviderInstrumentationHook"
},
\{
"line": 167,
"source": "runApplication(appKey: string, appParameters: any): void \{\\n const msg =\\n 'Running application \\"' + appKey + '\\" with appParams: ' +\\n JSON.stringify(appParameters) + '. ' +\\n '__DEV__ === ' + String(__DEV__) +\\n ', development-level warning are ' + (__DEV__ ? 'ON' : 'OFF') +\\n ', performance optimizations are ' + (__DEV__ ? 'OFF' : 'ON');\\n infoLog(msg);\\n BugReporting.addSource('AppRegistry.runApplication' + runCount++, () => msg);\\n invariant(\\n runnables[appKey] && runnables[appKey].run,\\n 'Application ' + appKey + ' has not been registered.\\\\n\\\\n' +\\n 'Hint: This error often happens when you\\\\'re running the packager ' +\\n '(local dev server) from a wrong folder. For example you have ' +\\n 'multiple apps and the packager is still running for the app you ' +\\n 'were working on before.\\\\nIf this is the case, simply kill the old ' +\\n 'packager instance (e.g. close the packager terminal window) ' +\\n 'and start the packager in the correct app folder (e.g. cd into app ' +\\n 'folder and run \\\\'npm start\\\\').\\\\n\\\\n' +\\n 'This error can also happen due to a require\() error during ' +\\n 'initialization or failure to call AppRegistry.registerComponent.\\\\n\\\\n'\\n );\\n\\n SceneTracker.setActiveScene(\{name: appKey});\\n runnables[appKey].run(appParameters);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "appKey"
},
\{
"typehint": "any",
"name": "appParameters"
}
],
"tparams": null,
"returntypehint": "void",
"name": "runApplication"
},
\{
"line": 194,
"source": "unmountApplicationComponentAtRootTag(rootTag: number): void \{\\n ReactNative.unmountComponentAtNodeAndRemoveContainer(rootTag);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "rootTag"
}
],
"tparams": null,
"returntypehint": "void",
"name": "unmountApplicationComponentAtRootTag"
},
\{
"line": 205,
"source": "registerHeadlessTask(taskKey: string, task: TaskProvider): void \{\\n if (tasks.has(taskKey)) \{\\n console.warn(\`registerHeadlessTask called multiple times for same key '$\{taskKey}'\`);\\n }\\n tasks.set(taskKey, task);\\n }",
"docblock": "/**\\n * Register a headless task. A headless task is a bit of code that runs without a UI.\\n * @param taskKey the key associated with this task\\n * @param task a promise returning function that takes some data passed from the native side as\\n * the only argument; when the promise is resolved or rejected the native side is\\n * notified of this event and it may decide to destroy the JS context.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "taskKey"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"TaskProvider\\",\\"length\\":1}",
"name": "task"
}
],
"tparams": null,
"returntypehint": "void",
"name": "registerHeadlessTask"
},
\{
"line": 219,
"source": "startHeadlessTask(taskId: number, taskKey: string, data: any): void \{\\n const taskProvider = tasks.get(taskKey);\\n if (!taskProvider) \{\\n throw new Error(\`No task registered for key $\{taskKey}\`);\\n }\\n taskProvider()(data)\\n .then(() => NativeModules.HeadlessJsTaskSupport.notifyTaskFinished(taskId))\\n .catch(reason => \{\\n console.error(reason);\\n NativeModules.HeadlessJsTaskSupport.notifyTaskFinished(taskId);\\n });\\n }",
"docblock": "/**\\n * Only called from native code. Starts a headless task.\\n *\\n * @param taskId the native id for this task instance to keep track of its execution\\n * @param taskKey the key for the task to start\\n * @param data the data to pass to the task\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "taskId"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "taskKey"
},
\{
"typehint": "any",
"name": "data"
}
],
"tparams": null,
"returntypehint": "void",
"name": "startHeadlessTask"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 83,
"name": "AppRegistry",
"docblock": "/**\\n * <div class=\\"banner-crna-ejected\\">\\n * <h3>Project with Native Code Required</h3>\\n * <p>\\n * This API only works in projects made with <code>react-native init</code>\\n * or in those made with Create React Native App which have since ejected. For\\n * more information about ejecting, please see\\n * the <a href=\\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\\" target=\\"_blank\\">guide</a> on\\n * the Create React Native App repository.\\n * </p>\\n * </div>\\n *\\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's ready by invoking\\n * \`AppRegistry.runApplication\`.\\n *\\n * To \\"stop\\" an application when a view should be destroyed, call\\n * \`AppRegistry.unmountApplicationComponentAtRootTag\` with the tag that was\\n * passed into \`runApplication\`. These should always be used as a pair.\\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",
"requires": [
\{
"name": "BatchedBridge"
},
\{
"name": "BugReporting"
},
\{
"name": "NativeModules"
},
\{
"name": "ReactNative"
},
\{
"name": "SceneTracker"
},
\{
"name": "infoLog"
},
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "renderApplication"
}
],
"filepath": "Libraries/ReactNative/AppRegistry.js",
"componentName": "AppRegistry",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"appregistry","title":"AppRegistry","layout":"autodocs","category":"APIs","permalink":"docs/appregistry.html","platform":"cross","next":"appstate","previous":"animated","sidebar":true,"path":"Libraries/ReactNative/AppRegistry.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+101
View File
@@ -0,0 +1,101 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "AppState",
"docblock": "/**\\n * \`AppState\` can tell you if the app is in the foreground or background,\\n * and notify you when the state changes.\\n *\\n * AppState is frequently used to determine the intent and proper behavior when\\n * handling push notifications.\\n *\\n * ### App States\\n *\\n * - \`active\` - The app is running in the foreground\\n * - \`background\` - The app is running in the background. The user is either\\n * in another app or on the home screen\\n * - \`inactive\` - This is a state that occurs when transitioning between\\n * foreground & background, and during periods of inactivity such as\\n * entering the Multitasking view or in the event of an incoming call\\n *\\n * For more information, see\\n * [Apple's documentation](https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html)\\n *\\n * ### Basic Usage\\n *\\n * To see the current state, you can check \`AppState.currentState\`, which\\n * will be kept up-to-date. However, \`currentState\` will be null at launch\\n * while \`AppState\` retrieves it over the bridge.\\n *\\n * \`\`\`\\n * import React, \{Component} from 'react'\\n * import \{AppState, Text} from 'react-native'\\n *\\n * class AppStateExample extends Component \{\\n *\\n * state = \{\\n * appState: AppState.currentState\\n * }\\n *\\n * componentDidMount() \{\\n * AppState.addEventListener('change', this._handleAppStateChange);\\n * }\\n *\\n * componentWillUnmount() \{\\n * AppState.removeEventListener('change', this._handleAppStateChange);\\n * }\\n *\\n * _handleAppStateChange = (nextAppState) => \{\\n * if (this.state.appState.match(/inactive|background/) && nextAppState === 'active') \{\\n * console.log('App has come to the foreground!')\\n * }\\n * this.setState(\{appState: nextAppState});\\n * }\\n *\\n * render() \{\\n * return (\\n * <Text>Current state is: \{this.state.appState}</Text>\\n * );\\n * }\\n *\\n * }\\n * \`\`\`\\n *\\n * This example will only ever appear to say \\"Current state is: active\\" because\\n * the app is only visible to the user when in the \`active\` state, and the null\\n * state will happen only momentarily.\\n */\\n",
"methods": [
\{
"line": 90,
"source": "= true;\\n\\n constructor() \{\\n super(RCTAppState);\\n\\n this.isAvailable = true;\\n this._eventHandlers = \{\\n change: new Map(),\\n memoryWarning: new Map(),\\n };\\n\\n // TODO: Remove the 'active' fallback after \`initialAppState\` is exported by\\n // the Android implementation.\\n this.currentState = RCTAppState.initialAppState || 'active';\\n\\n // TODO: this is a terrible solution - in order to ensure \`currentState\` prop\\n // is up to date, we have to register an observer that updates it whenever\\n // the state changes, even if nobody cares. We should just deprecate the\\n // \`currentState\` property and get rid of this.\\n this.addListener(\\n 'appStateDidChange',\\n (appStateData) => \{\\n this.currentState = appStateData.app_state;\\n }\\n );\\n\\n // TODO: see above - this request just populates the value of \`currentState\`\\n // when the module is first initialized. Would be better to get rid of the prop\\n // and expose \`getCurrentAppState\` method directly.\\n RCTAppState.getCurrentAppState(\\n (appStateData) => \{\\n this.currentState = appStateData.app_state;\\n },\\n logError\\n );\\n }",
"modifiers": [],
"params": [
\{
"typehint": null,
"name": ";"
},
\{
"typehint": null,
"name": "("
}
],
"tparams": null,
"returntypehint": null,
"name": "="
},
\{
"line": 137,
"source": "addEventListener(\\n type: string,\\n handler: Function\\n ) \{\\n invariant(\\n ['change', 'memoryWarning'].indexOf(type) !== -1,\\n 'Trying to subscribe to unknown event: \\"%s\\"', type\\n );\\n if (type === 'change') \{\\n this._eventHandlers[type].set(handler, this.addListener(\\n 'appStateDidChange',\\n (appStateData) => \{\\n handler(appStateData.app_state);\\n }\\n ));\\n } else if (type === 'memoryWarning') \{\\n this._eventHandlers[type].set(handler, this.addListener(\\n 'memoryWarning',\\n handler\\n ));\\n }\\n }",
"docblock": "/**\\n * Add a handler to AppState changes by listening to the \`change\` event type\\n * and providing the handler\\n *\\n * TODO: now that AppState is a subclass of NativeEventEmitter, we could deprecate\\n * \`addEventListener\` and \`removeEventListener\` and just use \`addListener\` and\\n * \`listener.remove()\` directly. That will be a breaking change though, as both\\n * the method and event names are different (addListener events are currently\\n * required to be globally unique).\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "addEventListener"
},
\{
"line": 163,
"source": "removeEventListener(\\n type: string,\\n handler: Function\\n ) \{\\n invariant(\\n ['change', 'memoryWarning'].indexOf(type) !== -1,\\n 'Trying to remove listener for unknown event: \\"%s\\"', type\\n );\\n if (!this._eventHandlers[type].has(handler)) \{\\n return;\\n }\\n this._eventHandlers[type].get(handler).remove();\\n this._eventHandlers[type].delete(handler);\\n }",
"docblock": "/**\\n * Remove a handler by passing the \`change\` event type and the handler\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeEventListener"
}
],
"superClass": "NativeEventEmitter",
"type": "api",
"line": 86,
"requires": [
\{
"name": "MissingNativeEventEmitterShim"
},
\{
"name": "NativeEventEmitter"
},
\{
"name": "NativeModules"
},
\{
"name": "logError"
},
\{
"name": "fbjs/lib/invariant"
}
],
"filepath": "Libraries/AppState/AppState.js",
"componentName": "AppState",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"appstate","title":"AppState","layout":"autodocs","category":"APIs","permalink":"docs/appstate.html","platform":"cross","next":"asyncstorage","previous":"appregistry","sidebar":true,"path":"Libraries/AppState/AppState.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+682
View File
@@ -0,0 +1,682 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"class": [
\{
"meta": \{
"range": [
1920,
14385
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 62,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000024",
"name": "AsyncStorage",
"type": "ObjectExpression",
"value": "\{\\"_getRequests\\":\\"\\",\\"_getKeys\\":\\"\\",\\"_immediate\\":null,\\"getItem\\":\\"\\",\\"setItem\\":\\"\\",\\"removeItem\\":\\"\\",\\"mergeItem\\":\\"\\",\\"clear\\":\\"\\",\\"getAllKeys\\":\\"\\",\\"flushGetRequests\\":\\"\\",\\"multiGet\\":\\"\\",\\"multiSet\\":\\"\\",\\"multiRemove\\":\\"\\",\\"multiMerge\\":\\"\\"}"
}
},
"description": "\`AsyncStorage\` is a simple, unencrypted, asynchronous, persistent, key-value storage\\nsystem that is global to the app. It should be used instead of LocalStorage.\\n\\nIt is recommended that you use an abstraction on top of \`AsyncStorage\`\\ninstead of \`AsyncStorage\` directly for anything more than light usage since\\nit operates globally.\\n\\nOn iOS, \`AsyncStorage\` is backed by native code that stores small values in a\\nserialized dictionary and larger values in separate files. On Android,\\n\`AsyncStorage\` will use either [RocksDB](http://rocksdb.org/) or SQLite\\nbased on what is available.\\n\\nThe \`AsyncStorage\` JavaScript code is a simple facade that provides a clear\\nJavaScript API, real \`Error\` objects, and simple non-multi functions. Each\\nmethod in the API returns a \`Promise\` object.\\n\\nPersisting data:\\n\`\`\`\\ntry \{\\n await AsyncStorage.setItem('@MySuperStore:key', 'I like to save it.');\\n} catch (error) \{\\n // Error saving data\\n}\\n\`\`\`\\n\\nFetching data:\\n\`\`\`\\ntry \{\\n const value = await AsyncStorage.getItem('@MySuperStore:key');\\n if (value !== null)\{\\n // We have data!!\\n console.log(value);\\n }\\n} catch (error) \{\\n // Error retrieving data\\n}\\n\`\`\`",
"name": "AsyncStorage",
"longname": "AsyncStorage",
"scope": "global",
"order": 0
}
],
"methods": [
\{
"meta": \{
"range": [
2285,
2786
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 75,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000033",
"name": "getItem",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Fetches an item for a \`key\` and invokes a callback upon completion.\\nReturns a \`Promise\` object.",
"params": [
\{
"description": "Key of the item to fetch.",
"name": "key",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "Function that will be called with a result if found or\\n any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error, result: ?string) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"name": "getItem",
"longname": "AsyncStorage.getItem",
"memberof": "AsyncStorage",
"scope": "static",
"order": 1,
"line": 77,
"source": "getItem: function(\\n key: string,\\n callback?: ?(error: ?Error, result: ?string) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiGet([key], function(errors, result) \{\\n // Unpack result to get value from [[key,value]]\\n var value = (result && result[0] && result[0][1]) ? result[0][1] : null;\\n var errs = convertErrors(errors);\\n callback && callback(errs && errs[0], value);\\n if (errs) \{\\n reject(errs[0]);\\n } else \{\\n resolve(value);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Fetches an item for a \`key\` and invokes a callback upon completion.\\n * Returns a \`Promise\` object.\\n * @param key Key of the item to fetch.\\n * @param callback Function that will be called with a result if found or\\n * any error.\\n * @returns A \`Promise\` object.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
3094,
3459
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 99,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000108",
"name": "setItem",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Sets the value for a \`key\` and invokes a callback upon completion.\\nReturns a \`Promise\` object.",
"params": [
\{
"description": "Key of the item to set.",
"name": "key",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "Value to set for the \`key\`.",
"name": "value",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "Function that will be called with any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"name": "setItem",
"longname": "AsyncStorage.setItem",
"memberof": "AsyncStorage",
"scope": "static",
"order": 2,
"line": 104,
"source": "setItem: function(\\n key: string,\\n value: string,\\n callback?: ?(error: ?Error) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiSet([[key,value]], function(errors) \{\\n var errs = convertErrors(errors);\\n callback && callback(errs && errs[0]);\\n if (errs) \{\\n reject(errs[0]);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Sets the value for a \`key\` and invokes a callback upon completion.\\n * Returns a \`Promise\` object.\\n * @param key Key of the item to set.\\n * @param value Value to set for the \`key\`.\\n * @param callback Function that will be called with any error.\\n * @returns A \`Promise\` object.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
3725,
4080
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 120,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000163",
"name": "removeItem",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Removes an item for a \`key\` and invokes a callback upon completion.\\nReturns a \`Promise\` object.",
"params": [
\{
"description": "Key of the item to remove.",
"name": "key",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "Function that will be called with any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"name": "removeItem",
"longname": "AsyncStorage.removeItem",
"memberof": "AsyncStorage",
"scope": "static",
"order": 3,
"line": 129,
"source": "removeItem: function(\\n key: string,\\n callback?: ?(error: ?Error) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiRemove([key], function(errors) \{\\n var errs = convertErrors(errors);\\n callback && callback(errs && errs[0]);\\n if (errs) \{\\n reject(errs[0]);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Removes an item for a \`key\` and invokes a callback upon completion.\\n * Returns a \`Promise\` object.\\n * @param key Key of the item to remove.\\n * @param callback Function that will be called with any error.\\n * @returns A \`Promise\` object.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
5240,
5609
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 169,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000215",
"name": "mergeItem",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Merges an existing \`key\` value with an input value, assuming both values\\nare stringified JSON. Returns a \`Promise\` object.\\n\\n**NOTE:** This is not supported by all native implementations.",
"params": [
\{
"description": "Key of the item to modify.",
"name": "key",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "New value to merge for the \`key\`.",
"name": "value",
"type": \{
"names": [
"string"
]
}
},
\{
"description": "Function that will be called with any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"examples": [
"<caption>Example</caption>\\nlet UID123_object = \{\\n name: 'Chris',\\n age: 30,\\n traits: \{hair: 'brown', eyes: 'brown'},\\n};\\n// You only need to define what will be added or updated\\nlet UID123_delta = \{\\n age: 31,\\n traits: \{eyes: 'blue', shoe_size: 10}\\n};\\n\\nAsyncStorage.setItem('UID123', JSON.stringify(UID123_object), () => \{\\n AsyncStorage.mergeItem('UID123', JSON.stringify(UID123_delta), () => \{\\n AsyncStorage.getItem('UID123', (err, result) => \{\\n console.log(result);\\n });\\n });\\n});\\n\\n// Console log result:\\n// => \{'name':'Chris','age':31,'traits':\\n// \{'shoe_size':10,'hair':'brown','eyes':'blue'}}"
],
"name": "mergeItem",
"longname": "AsyncStorage.mergeItem",
"memberof": "AsyncStorage",
"scope": "static",
"order": 4,
"line": 181,
"source": "mergeItem: function(\\n key: string,\\n value: string,\\n callback?: ?(error: ?Error) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiMerge([[key,value]], function(errors) \{\\n var errs = convertErrors(errors);\\n callback && callback(errs && errs[0]);\\n if (errs) \{\\n reject(errs[0]);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Merges an existing \`key\` value with an input value, assuming both values\\n * are stringified JSON. Returns a \`Promise\` object.\\n *\\n * **NOTE:** This is not supported by all native implementations.\\n *\\n * @param key Key of the item to modify.\\n * @param value New value to merge for the \`key\`.\\n * @param callback Function that will be called with any error.\\n * @returns A \`Promise\` object.\\n *\\n * @example <caption>Example</caption>\\n * let UID123_object = \{\\n * name: 'Chris',\\n * age: 30,\\n * traits: \{hair: 'brown', eyes: 'brown'},\\n * };\\n * // You only need to define what will be added or updated\\n * let UID123_delta = \{\\n * age: 31,\\n * traits: \{eyes: 'blue', shoe_size: 10}\\n * };\\n *\\n * AsyncStorage.setItem('UID123', JSON.stringify(UID123_object), () => \{\\n * AsyncStorage.mergeItem('UID123', JSON.stringify(UID123_delta), () => \{\\n * AsyncStorage.getItem('UID123', (err, result) => \{\\n * console.log(result);\\n * });\\n * });\\n * });\\n *\\n * // Console log result:\\n * // => \{'name':'Chris','age':31,'traits':\\n * // \{'shoe_size':10,'hair':'brown','eyes':'blue'}}\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
5934,
6263
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 190,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000270",
"name": "clear",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Erases *all* \`AsyncStorage\` for all clients, libraries, etc. You probably\\ndon't want to call this; use \`removeItem\` or \`multiRemove\` to clear only\\nyour app's keys. Returns a \`Promise\` object.",
"params": [
\{
"description": "Function that will be called with any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"name": "clear",
"longname": "AsyncStorage.clear",
"memberof": "AsyncStorage",
"scope": "static",
"order": 5,
"line": 206,
"source": "clear: function(callback?: ?(error: ?Error) => void): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.clear(function(error) \{\\n callback && callback(convertError(error));\\n if (error && convertError(error))\{\\n reject(convertError(error));\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Erases *all* \`AsyncStorage\` for all clients, libraries, etc. You probably\\n * don't want to call this; use \`removeItem\` or \`multiRemove\` to clear only\\n * your app's keys. Returns a \`Promise\` object.\\n * @param callback Function that will be called with any error.\\n * @returns A \`Promise\` object.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
6547,
6875
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 211,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000315",
"name": "getAllKeys",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Gets *all* keys known to your app; for all callers, libraries, etc.\\nReturns a \`Promise\` object.",
"params": [
\{
"description": "Function that will be called the keys found and any error.",
"name": "callback",
"type": \{
"names": [
"?(error: ?Error, keys: ?Array<string>) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object.\\n\\nExample: see the \`multiGet\` example."
}
],
"name": "getAllKeys",
"longname": "AsyncStorage.getAllKeys",
"memberof": "AsyncStorage",
"scope": "static",
"order": 6,
"line": 227,
"source": "getAllKeys: function(callback?: ?(error: ?Error, keys: ?Array<string>) => void): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.getAllKeys(function(error, keys) \{\\n callback && callback(convertError(error), keys);\\n if (error) \{\\n reject(convertError(error));\\n } else \{\\n resolve(keys);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Gets *all* keys known to your app; for all callers, libraries, etc.\\n * Returns a \`Promise\` object.\\n * @param callback Function that will be called the keys found and any error.\\n * @returns A \`Promise\` object.\\n *\\n * Example: see the \`multiGet\` example.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
7392,
8575
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 235,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000358",
"name": "flushGetRequests",
"type": "FunctionExpression"
},
"vars": \{
"getRequests": "AsyncStorage.flushGetRequests~getRequests",
"getKeys": "AsyncStorage.flushGetRequests~getKeys",
"this._getRequests": "AsyncStorage.flushGetRequests#_getRequests",
"this._getKeys": "AsyncStorage.flushGetRequests#_getKeys",
"": null
}
},
"description": "Flushes any pending requests using a single batch call to get the data.",
"name": "flushGetRequests",
"longname": "AsyncStorage.flushGetRequests",
"memberof": "AsyncStorage",
"scope": "static",
"order": 7,
"line": 251,
"source": "flushGetRequests: function(): void \{\\n const getRequests = this._getRequests;\\n const getKeys = this._getKeys;\\n\\n this._getRequests = [];\\n this._getKeys = [];\\n\\n RCTAsyncStorage.multiGet(getKeys, function(errors, result) \{\\n // Even though the runtime complexity of this is theoretically worse vs if we used a map,\\n // it's much, much faster in practice for the data sets we deal with (we avoid\\n // allocating result pair arrays). This was heavily benchmarked.\\n //\\n // Is there a way to avoid using the map but fix the bug in this breaking test?\\n // https://github.com/facebook/react-native/commit/8dd8ad76579d7feef34c014d387bf02065692264\\n const map = \{};\\n result && result.forEach(([key, value]) => \{ map[key] = value; return value; });\\n const reqLength = getRequests.length;\\n for (let i = 0; i < reqLength; i++) \{\\n const request = getRequests[i];\\n const requestKeys = request.keys;\\n const requestResult = requestKeys.map(key => [key, map[key]]);\\n request.callback && request.callback(null, requestResult);\\n request.resolve && request.resolve(requestResult);\\n }\\n });\\n }",
"docblock": "/** Flushes any pending requests using a single batch call to get the data. */\\n",
"modifiers": [
"static"
],
"params": \{
"type": \{
"names": [
""
]
}
},
"returns": \{
"type": \{
"names": [
"void"
]
}
}
},
\{
"meta": \{
"range": [
9513,
10248
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 292,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000481",
"name": "multiGet",
"type": "FunctionExpression"
},
"vars": \{
"this._immediate": "AsyncStorage.multiGet#_immediate",
"": null,
"getRequest": "AsyncStorage.multiGet~getRequest",
"promiseResult": "AsyncStorage.multiGet~promiseResult"
}
},
"description": "This allows you to batch the fetching of items given an array of \`key\`\\ninputs. Your callback will be invoked with an array of corresponding\\nkey-value pairs found:\\n\\n\`\`\`\\nmultiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])\\n\`\`\`\\n\\nThe method returns a \`Promise\` object.",
"params": [
\{
"description": "Array of key for the items to get.",
"name": "keys",
"type": \{
"names": [
"Array<string>"
]
}
},
\{
"description": "Function that will be called with a key-value array of\\n the results, plus an array of any key-specific errors found.",
"name": "callback",
"type": \{
"names": [
"?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"examples": [
"<caption>Example</caption>\\n\\nAsyncStorage.getAllKeys((err, keys) => \{\\n AsyncStorage.multiGet(keys, (err, stores) => \{\\n stores.map((result, i, store) => \{\\n // get at each store's key/value so you can work with it\\n let key = store[i][0];\\n let value = store[i][1];\\n });\\n });\\n});"
],
"name": "multiGet",
"longname": "AsyncStorage.multiGet",
"memberof": "AsyncStorage",
"scope": "static",
"order": 8,
"line": 306,
"source": "multiGet: function(\\n keys: Array<string>,\\n callback?: ?(errors: ?Array<Error>, result: ?Array<Array<string>>) => void\\n ): Promise \{\\n if (!this._immediate) \{\\n this._immediate = setImmediate(() => \{\\n this._immediate = null;\\n this.flushGetRequests();\\n });\\n }\\n\\n var getRequest = \{\\n keys: keys,\\n callback: callback,\\n // do we need this?\\n keyIndex: this._getKeys.length,\\n resolve: null,\\n reject: null,\\n };\\n\\n var promiseResult = new Promise((resolve, reject) => \{\\n getRequest.resolve = resolve;\\n getRequest.reject = reject;\\n });\\n\\n this._getRequests.push(getRequest);\\n // avoid fetching duplicates\\n keys.forEach(key => \{\\n if (this._getKeys.indexOf(key) === -1) \{\\n this._getKeys.push(key);\\n }\\n });\\n\\n return promiseResult;\\n }",
"docblock": "/**\\n * This allows you to batch the fetching of items given an array of \`key\`\\n * inputs. Your callback will be invoked with an array of corresponding\\n * key-value pairs found:\\n *\\n * \`\`\`\\n * multiGet(['k1', 'k2'], cb) -> cb([['k1', 'val1'], ['k2', 'val2']])\\n * \`\`\`\\n *\\n * The method returns a \`Promise\` object.\\n *\\n * @param keys Array of key for the items to get.\\n * @param callback Function that will be called with a key-value array of\\n * the results, plus an array of any key-specific errors found.\\n * @returns A \`Promise\` object.\\n *\\n * @example <caption>Example</caption>\\n *\\n * AsyncStorage.getAllKeys((err, keys) => \{\\n * AsyncStorage.multiGet(keys, (err, stores) => \{\\n * stores.map((result, i, store) => \{\\n * // get at each store's key/value so you can work with it\\n * let key = store[i][0];\\n * let value = store[i][1];\\n * });\\n * });\\n * });\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
10805,
11163
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 341,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000589",
"name": "multiSet",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Use this as a batch operation for storing multiple key-value pairs. When\\nthe operation completes you'll get a single callback with any errors:\\n\\n\`\`\`\\nmultiSet([['k1', 'val1'], ['k2', 'val2']], cb);\\n\`\`\`\\n\\nThe method returns a \`Promise\` object.",
"params": [
\{
"description": "Array of key-value array for the items to set.",
"name": "keyValuePairs",
"type": \{
"names": [
"Array<Array<string>>"
]
}
},
\{
"description": "Function that will be called with an array of any\\n key-specific errors found.",
"name": "callback",
"type": \{
"names": [
"?(errors: ?Array<Error>) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object.\\nExample: see the \`multiMerge\` example."
}
],
"name": "multiSet",
"longname": "AsyncStorage.multiSet",
"memberof": "AsyncStorage",
"scope": "static",
"order": 9,
"line": 358,
"source": "multiSet: function(\\n keyValuePairs: Array<Array<string>>,\\n callback?: ?(errors: ?Array<Error>) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiSet(keyValuePairs, function(errors) \{\\n var error = convertErrors(errors);\\n callback && callback(error);\\n if (error) \{\\n reject(error);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Use this as a batch operation for storing multiple key-value pairs. When\\n * the operation completes you'll get a single callback with any errors:\\n *\\n * \`\`\`\\n * multiSet([['k1', 'val1'], ['k2', 'val2']], cb);\\n * \`\`\`\\n *\\n * The method returns a \`Promise\` object.\\n *\\n * @param keyValuePairs Array of key-value array for the items to set.\\n * @param callback Function that will be called with an array of any\\n * key-specific errors found.\\n * @returns A \`Promise\` object.\\n * Example: see the \`multiMerge\` example.\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
11710,
12056
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 371,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000634",
"name": "multiRemove",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Call this to batch the deletion of all keys in the \`keys\` array. Returns\\na \`Promise\` object.",
"params": [
\{
"description": "Array of key for the items to delete.",
"name": "keys",
"type": \{
"names": [
"Array<string>"
]
}
},
\{
"description": "Function that will be called an array of any key-specific\\n errors found.",
"name": "callback",
"type": \{
"names": [
"?(errors: ?Array<Error>) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"examples": [
"<caption>Example</caption>\\nlet keys = ['k1', 'k2'];\\nAsyncStorage.multiRemove(keys, (err) => \{\\n // keys k1 & k2 removed, if they existed\\n // do most stuff after removal (if you want)\\n});"
],
"name": "multiRemove",
"longname": "AsyncStorage.multiRemove",
"memberof": "AsyncStorage",
"scope": "static",
"order": 10,
"line": 391,
"source": "multiRemove: function(\\n keys: Array<string>,\\n callback?: ?(errors: ?Array<Error>) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiRemove(keys, function(errors) \{\\n var error = convertErrors(errors);\\n callback && callback(error);\\n if (error) \{\\n reject(error);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Call this to batch the deletion of all keys in the \`keys\` array. Returns\\n * a \`Promise\` object.\\n *\\n * @param keys Array of key for the items to delete.\\n * @param callback Function that will be called an array of any key-specific\\n * errors found.\\n * @returns A \`Promise\` object.\\n *\\n * @example <caption>Example</caption>\\n * let keys = ['k1', 'k2'];\\n * AsyncStorage.multiRemove(keys, (err) => \{\\n * // keys k1 & k2 removed, if they existed\\n * // do most stuff after removal (if you want)\\n * });\\n */\\n",
"modifiers": [
"static"
]
},
\{
"meta": \{
"range": [
14021,
14383
],
"filename": "4c30ra99ajhb8q4jcdobwp.js",
"lineno": 443,
"path": "/var/folders/82/w8hcc_tj7yq80482srkc1r2x0bj21j/T",
"code": \{
"id": "astnode100000679",
"name": "multiMerge",
"type": "FunctionExpression"
},
"vars": \{
"": null
}
},
"description": "Batch operation to merge in existing and new values for a given set of\\nkeys. This assumes that the values are stringified JSON. Returns a\\n\`Promise\` object.\\n\\n**NOTE**: This is not supported by all native implementations.",
"params": [
\{
"description": "Array of key-value array for the items to merge.",
"name": "keyValuePairs",
"type": \{
"names": [
"Array<Array<string>>"
]
}
},
\{
"description": "Function that will be called with an array of any\\n key-specific errors found.",
"name": "callback",
"type": \{
"names": [
"?(errors: ?Array<Error>) => void"
]
},
"optional": true
}
],
"returns": [
\{
"description": "A \`Promise\` object."
}
],
"examples": [
"<caption>Example</caption>\\n// first user, initial values\\nlet UID234_object = \{\\n name: 'Chris',\\n age: 30,\\n traits: \{hair: 'brown', eyes: 'brown'},\\n};\\n\\n// first user, delta values\\nlet UID234_delta = \{\\n age: 31,\\n traits: \{eyes: 'blue', shoe_size: 10},\\n};\\n\\n// second user, initial values\\nlet UID345_object = \{\\n name: 'Marge',\\n age: 25,\\n traits: \{hair: 'blonde', eyes: 'blue'},\\n};\\n\\n// second user, delta values\\nlet UID345_delta = \{\\n age: 26,\\n traits: \{eyes: 'green', shoe_size: 6},\\n};\\n\\nlet multi_set_pairs = [['UID234', JSON.stringify(UID234_object)], ['UID345', JSON.stringify(UID345_object)]]\\nlet multi_merge_pairs = [['UID234', JSON.stringify(UID234_delta)], ['UID345', JSON.stringify(UID345_delta)]]\\n\\nAsyncStorage.multiSet(multi_set_pairs, (err) => \{\\n AsyncStorage.multiMerge(multi_merge_pairs, (err) => \{\\n AsyncStorage.multiGet(['UID234','UID345'], (err, stores) => \{\\n stores.map( (result, i, store) => \{\\n let key = store[i][0];\\n let val = store[i][1];\\n console.log(key, val);\\n });\\n });\\n });\\n});\\n\\n// Console log results:\\n// => UID234 \{\\"name\\":\\"Chris\\",\\"age\\":31,\\"traits\\":\{\\"shoe_size\\":10,\\"hair\\":\\"brown\\",\\"eyes\\":\\"blue\\"}}\\n// => UID345 \{\\"name\\":\\"Marge\\",\\"age\\":26,\\"traits\\":\{\\"shoe_size\\":6,\\"hair\\":\\"blonde\\",\\"eyes\\":\\"green\\"}}"
],
"name": "multiMerge",
"longname": "AsyncStorage.multiMerge",
"memberof": "AsyncStorage",
"scope": "static",
"order": 11,
"line": 466,
"source": "multiMerge: function(\\n keyValuePairs: Array<Array<string>>,\\n callback?: ?(errors: ?Array<Error>) => void\\n ): Promise \{\\n return new Promise((resolve, reject) => \{\\n RCTAsyncStorage.multiMerge(keyValuePairs, function(errors) \{\\n var error = convertErrors(errors);\\n callback && callback(error);\\n if (error) \{\\n reject(error);\\n } else \{\\n resolve(null);\\n }\\n });\\n });\\n }",
"docblock": "/**\\n * Batch operation to merge in existing and new values for a given set of\\n * keys. This assumes that the values are stringified JSON. Returns a\\n * \`Promise\` object.\\n *\\n * **NOTE**: This is not supported by all native implementations.\\n *\\n * @param keyValuePairs Array of key-value array for the items to merge.\\n * @param callback Function that will be called with an array of any\\n * key-specific errors found.\\n * @returns A \`Promise\` object.\\n *\\n * @example <caption>Example</caption>\\n * // first user, initial values\\n * let UID234_object = \{\\n * name: 'Chris',\\n * age: 30,\\n * traits: \{hair: 'brown', eyes: 'brown'},\\n * };\\n *\\n * // first user, delta values\\n * let UID234_delta = \{\\n * age: 31,\\n * traits: \{eyes: 'blue', shoe_size: 10},\\n * };\\n *\\n * // second user, initial values\\n * let UID345_object = \{\\n * name: 'Marge',\\n * age: 25,\\n * traits: \{hair: 'blonde', eyes: 'blue'},\\n * };\\n *\\n * // second user, delta values\\n * let UID345_delta = \{\\n * age: 26,\\n * traits: \{eyes: 'green', shoe_size: 6},\\n * };\\n *\\n * let multi_set_pairs = [['UID234', JSON.stringify(UID234_object)], ['UID345', JSON.stringify(UID345_object)]]\\n * let multi_merge_pairs = [['UID234', JSON.stringify(UID234_delta)], ['UID345', JSON.stringify(UID345_delta)]]\\n *\\n * AsyncStorage.multiSet(multi_set_pairs, (err) => \{\\n * AsyncStorage.multiMerge(multi_merge_pairs, (err) => \{\\n * AsyncStorage.multiGet(['UID234','UID345'], (err, stores) => \{\\n * stores.map( (result, i, store) => \{\\n * let key = store[i][0];\\n * let val = store[i][1];\\n * console.log(key, val);\\n * });\\n * });\\n * });\\n * });\\n *\\n * // Console log results:\\n * // => UID234 \{\\"name\\":\\"Chris\\",\\"age\\":31,\\"traits\\":\{\\"shoe_size\\":10,\\"hair\\":\\"brown\\",\\"eyes\\":\\"blue\\"}}\\n * // => UID345 \{\\"name\\":\\"Marge\\",\\"age\\":26,\\"traits\\":\{\\"shoe_size\\":6,\\"hair\\":\\"blonde\\",\\"eyes\\":\\"green\\"}}\\n */\\n",
"modifiers": [
"static"
]
}
],
"type": "api",
"filepath": "Libraries/Storage/AsyncStorage.js",
"componentName": "AsyncStorage",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"asyncstorage","title":"AsyncStorage","layout":"autodocs","category":"APIs","permalink":"docs/asyncstorage.html","platform":"cross","next":"backandroid","previous":"appstate","sidebar":true,"path":"Libraries/Storage/AsyncStorage.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+89
View File
@@ -0,0 +1,89 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 26,
"source": "exitApp: function() \{\\n warning(false, 'BackAndroid is deprecated. Please use BackHandler instead.');\\n BackHandler.exitApp();\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "exitApp"
},
\{
"line": 31,
"source": "addEventListener: function (\\n eventName: BackPressEventName,\\n handler: Function\\n ): \{remove: () => void} \{\\n warning(false, 'BackAndroid is deprecated. Please use BackHandler instead.');\\n return BackHandler.addEventListener(eventName, handler);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"BackPressEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "\{remove: () => void}",
"name": "addEventListener"
},
\{
"line": 39,
"source": "removeEventListener: function(\\n eventName: BackPressEventName,\\n handler: Function\\n ): void \{\\n warning(false, 'BackAndroid is deprecated. Please use BackHandler instead.');\\n BackHandler.removeEventListener(eventName, handler);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"BackPressEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "void",
"name": "removeEventListener"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 24,
"name": "BackAndroid",
"docblock": "/**\\n * Deprecated. Use BackHandler instead.\\n */\\n",
"requires": [
\{
"name": "BackHandler"
},
\{
"name": "fbjs/lib/warning"
}
],
"filepath": "Libraries/Utilities/BackAndroid.js",
"componentName": "BackAndroid",
"componentPlatform": "android"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"backandroid","title":"BackAndroid","layout":"autodocs","category":"APIs","permalink":"docs/backandroid.html","platform":"android","next":"backhandler","previous":"asyncstorage","sidebar":true,"path":"Libraries/Utilities/BackAndroid.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+89
View File
@@ -0,0 +1,89 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 73,
"source": "exitApp: function() \{\\n DeviceEventManager.invokeDefaultBackPressHandler();\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "exitApp"
},
\{
"line": 77,
"source": "addEventListener: function (\\n eventName: BackPressEventName,\\n handler: Function\\n ): \{remove: () => void} \{\\n _backPressSubscriptions.add(handler);\\n return \{\\n remove: () => BackHandler.removeEventListener(eventName, handler),\\n };\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"BackPressEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "\{remove: () => void}",
"name": "addEventListener"
},
\{
"line": 87,
"source": "removeEventListener: function(\\n eventName: BackPressEventName,\\n handler: Function\\n ): void \{\\n _backPressSubscriptions.delete(handler);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"BackPressEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "void",
"name": "removeEventListener"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 71,
"name": "BackHandler",
"docblock": "/**\\n * Detect hardware button presses for back navigation.\\n *\\n * Android: Detect hardware back button presses, and programmatically invoke the default back button\\n * functionality to exit the app if there are no listeners or if none of the listeners return true.\\n *\\n * tvOS: Detect presses of the menu button on the TV remote. (Still to be implemented:\\n * programmatically disable menu button handling\\n * functionality to exit the app if there are no listeners or if none of the listeners return true.)\\n *\\n * iOS: Not applicable.\\n *\\n * The event subscriptions are called in reverse order (i.e. last registered subscription first),\\n * and if one subscription returns true then subscriptions registered earlier will not be called.\\n *\\n * Example:\\n *\\n * \`\`\`javascript\\n * BackHandler.addEventListener('hardwareBackPress', function() \{\\n * // this.onMainScreen and this.goBack are just examples, you need to use your own implementation here\\n * // Typically you would use the navigator here to go to the last state.\\n *\\n * if (!this.onMainScreen()) \{\\n * this.goBack();\\n * return true;\\n * }\\n * return false;\\n * });\\n * \`\`\`\\n */\\n",
"requires": [
\{
"name": "NativeModules"
},
\{
"name": "RCTDeviceEventEmitter"
}
],
"filepath": "Libraries/Utilities/BackHandler.android.js",
"componentName": "BackHandler",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"backhandler","title":"BackHandler","layout":"autodocs","category":"APIs","permalink":"docs/backhandler.html","platform":"cross","next":"cameraroll","previous":"backhandler","sidebar":true,"path":"Libraries/Utilities/BackHandler.android.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+729
View File
@@ -0,0 +1,729 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "A basic button component that should render nicely on any platform. Supports\\na minimal level of customization.\\n\\n<center><img src=\\"img/buttonExample.png\\"></img></center>\\n\\nIf this button doesn't look right for your app, you can build your own\\nbutton using [TouchableOpacity](docs/touchableopacity.html)\\nor [TouchableNativeFeedback](docs/touchablenativefeedback.html).\\nFor inspiration, look at the [source code for this button component](https://github.com/facebook/react-native/blob/master/Libraries/Components/Button.js).\\nOr, take a look at the [wide variety of button components built by the community](https://js.coach/react-native?search=button).\\n\\nExample usage:\\n\\n\`\`\`\\n<Button\\n onPress=\{onPressLearnMore}\\n title=\\"Learn More\\"\\n color=\\"#841584\\"\\n accessibilityLabel=\\"Learn more about this purple button\\"\\n/>\\n\`\`\`",
"methods": [],
"props": \{
"title": \{
"type": \{
"name": "string"
},
"required": true,
"description": "Text to display inside the button",
"flowType": \{
"name": "string"
}
},
"accessibilityLabel": \{
"type": \{
"name": "string"
},
"required": false,
"description": "Text to display for blindness accessibility features",
"flowType": \{
"name": "string",
"nullable": true
}
},
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Color of the text (iOS), or background color of the button (Android)",
"flowType": \{
"name": "string",
"nullable": true
}
},
"disabled": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "If true, disable all interactions for this component.",
"flowType": \{
"name": "boolean",
"nullable": true
}
},
"onPress": \{
"type": \{
"name": "func"
},
"required": true,
"description": "Handler to be called when the user taps the button",
"flowType": \{
"name": "signature",
"type": "function",
"raw": "() => any",
"signature": \{
"arguments": [],
"return": \{
"name": "any"
}
}
}
},
"testID": \{
"type": \{
"name": "string"
},
"required": false,
"description": "Used to locate this view in end-to-end tests.",
"flowType": \{
"name": "string",
"nullable": true
}
}
},
"type": "component",
"filepath": "Libraries/Components/Button.js",
"componentName": "Button",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"button","title":"Button","layout":"autodocs","category":"Components","permalink":"docs/button.html","platform":"cross","next":"datepickerios","previous":"activityindicator","sidebar":true,"path":"Libraries/Components/Button.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+109
View File
@@ -0,0 +1,109 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "CameraRoll",
"docblock": "/**\\n * \`CameraRoll\` provides access to the local camera roll / gallery.\\n * Before using this you must link the \`RCTCameraRoll\` library.\\n * You can refer to [Linking](docs/linking-libraries-ios.html) for help.\\n *\\n * ### Permissions\\n * The user's permission is required in order to access the Camera Roll on devices running iOS 10 or later.\\n * Add the \`NSPhotoLibraryUsageDescription\` key in your \`Info.plist\` with a string that describes how your\\n * app will use this data. This key will appear as \`Privacy - Photo Library Usage Description\` in Xcode.\\n *\\n */\\n",
"methods": [
\{
"line": 122,
"source": "= GROUP_TYPES_OPTIONS;\\n static AssetTypeOptions: Object = ASSET_TYPE_OPTIONS;\\n\\n /**\\n * \`CameraRoll.saveImageWithTag()\` is deprecated. Use \`CameraRoll.saveToCameraRoll()\` instead.\\n */\\n static saveImageWithTag(tag: string): Promise<Object> \{\\n console.warn(\\n '\`CameraRoll.saveImageWithTag()\` is deprecated. Use \`CameraRoll.saveToCameraRoll()\` instead.',\\n );\\n return this.saveToCameraRoll(tag, 'photo');\\n }",
"modifiers": [],
"params": [
\{
"typehint": null,
"name": ";"
},
\{
"typehint": "Object",
"name": "AssetTypeOptions"
},
\{
"typehint": null,
"name": "static"
},
\{
"typehint": null,
"name": "("
},
\{
"typehint": null,
"name": ":"
}
],
"tparams": null,
"returntypehint": "Promise<Object>",
"name": "="
},
\{
"line": 149,
"source": "static saveToCameraRoll(\\n tag: string,\\n type?: 'photo' | 'video',\\n ): Promise<Object> \{\\n invariant(\\n typeof tag === 'string',\\n 'CameraRoll.saveToCameraRoll must be a valid string.',\\n );\\n\\n invariant(\\n type === 'photo' || type === 'video' || type === undefined,\\n // $FlowFixMe(>=0.28.0)\\n \`The second argument to saveToCameraRoll must be 'photo' or 'video'. You passed $\{type}\`,\\n );\\n\\n let mediaType = 'photo';\\n if (type) \{\\n mediaType = type;\\n } else if (['mov', 'mp4'].indexOf(tag.split('.').slice(-1)[0]) >= 0) \{\\n mediaType = 'video';\\n }\\n\\n return RCTCameraRollManager.saveToCameraRoll(tag, mediaType);\\n }",
"docblock": "/**\\n * Saves the photo or video to the camera roll / gallery.\\n *\\n * On Android, the tag must be a local image or video URI, such as \`\\"file:///sdcard/img.png\\"\`.\\n *\\n * On iOS, the tag can be any image URI (including local, remote asset-library and base64 data URIs)\\n * or a local video file URI (remote or data URIs are not supported for saving video at this time).\\n *\\n * If the tag has a file extension of .mov or .mp4, it will be inferred as a video. Otherwise\\n * it will be treated as a photo. To override the automatic choice, you can pass an optional\\n * \`type\` parameter that must be one of 'photo' or 'video'.\\n *\\n * Returns a Promise which will resolve with the new URI.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "tag"
},
\{
"typehint": "'photo' | 'video'",
"name": "type?"
}
],
"tparams": null,
"returntypehint": "Promise<Object>",
"name": "saveToCameraRoll"
},
\{
"line": 220,
"source": "static getPhotos(params) \{\\n if (__DEV__) \{\\n checkPropTypes(\\n \{params: getPhotosParamChecker},\\n \{params},\\n 'params',\\n 'CameraRoll.getPhotos',\\n );\\n }\\n if (arguments.length > 1) \{\\n console.warn(\\n 'CameraRoll.getPhotos(tag, success, error) is deprecated. Use the returned Promise instead',\\n );\\n let successCallback = arguments[1];\\n if (__DEV__) \{\\n const callback = arguments[1];\\n successCallback = response => \{\\n checkPropTypes(\\n \{response: getPhotosReturnChecker},\\n \{response},\\n 'response',\\n 'CameraRoll.getPhotos callback',\\n );\\n callback(response);\\n };\\n }\\n const errorCallback = arguments[2] || (() => \{});\\n RCTCameraRollManager.getPhotos(params).then(\\n successCallback,\\n errorCallback,\\n );\\n }\\n // TODO: Add the __DEV__ check back in to verify the Promise result\\n return RCTCameraRollManager.getPhotos(params);\\n }",
"docblock": "/**\\n * Returns a Promise with photo identifier objects from the local camera\\n * roll of the device matching shape defined by \`getPhotosReturnChecker\`.\\n *\\n * Expects a params object of the following shape:\\n *\\n * - \`first\` : \{number} : The number of photos wanted in reverse order of the photo application (i.e. most recent first for SavedPhotos).\\n * - \`after\` : \{string} : A cursor that matches \`page_info \{ end_cursor }\` returned from a previous call to \`getPhotos\`.\\n * - \`groupTypes\` : \{string} : Specifies which group types to filter the results to. Valid values are:\\n * - \`Album\`\\n * - \`All\`\\n * - \`Event\`\\n * - \`Faces\`\\n * - \`Library\`\\n * - \`PhotoStream\`\\n * - \`SavedPhotos\` // default\\n * - \`groupName\` : \{string} : Specifies filter on group names, like 'Recent Photos' or custom album titles.\\n * - \`assetType\` : \{string} : Specifies filter on asset type. Valid values are:\\n * - \`All\`\\n * - \`Videos\`\\n * - \`Photos\` // default\\n * - \`mimeTypes\` : \{string} : Filter by mimetype (e.g. image/jpeg).\\n *\\n * Returns a Promise which when resolved will be of the following shape:\\n *\\n * - \`edges\` : \{Array<node>} An array of node objects\\n * - \`node\`: \{object} An object with the following shape:\\n * - \`type\`: \{string}\\n * - \`group_name\`: \{string}\\n * - \`image\`: \{object} : An object with the following shape:\\n * - \`uri\`: \{string}\\n * - \`height\`: \{number}\\n * - \`width\`: \{number}\\n * - \`isStored\`: \{boolean}\\n * - \`timestamp\`: \{number}\\n * - \`location\`: \{object} : An object with the following shape:\\n * - \`latitude\`: \{number}\\n * - \`longitude\`: \{number}\\n * - \`altitude\`: \{number}\\n * - \`heading\`: \{number}\\n * - \`speed\`: \{number}\\n * - \`page_info\` : \{object} : An object with the following shape:\\n * - \`has_next_page\`: \{boolean}\\n * - \`start_cursor\`: \{boolean}\\n * - \`end_cursor\`: \{boolean}\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "params"
}
],
"tparams": null,
"returntypehint": null,
"name": "getPhotos"
}
],
"type": "api",
"line": 121,
"requires": [
\{
"name": "prop-types"
},
\{
"name": "NativeModules"
},
\{
"name": "createStrictShapeTypeChecker"
},
\{
"name": "fbjs/lib/invariant"
}
],
"filepath": "Libraries/CameraRoll/CameraRoll.js",
"componentName": "CameraRoll",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"cameraroll","title":"CameraRoll","layout":"autodocs","category":"APIs","permalink":"docs/cameraroll.html","platform":"cross","next":"clipboard","previous":"backhandler","sidebar":true,"path":"Libraries/CameraRoll/CameraRoll.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+64
View File
@@ -0,0 +1,64 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 28,
"source": "getString(): Promise<string> \{\\n return Clipboard.getString();\\n }",
"docblock": "/**\\n * Get content of string type, this method returns a \`Promise\`, so you can use following code to get clipboard content\\n * \`\`\`javascript\\n * async _getContent() \{\\n * var content = await Clipboard.getString();\\n * }\\n * \`\`\`\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":4}",
"name": "getString"
},
\{
"line": 40,
"source": "setString(content: string) \{\\n Clipboard.setString(content);\\n }",
"docblock": "/**\\n * Set content of string type. You can use following code to set clipboard content\\n * \`\`\`javascript\\n * _setContent() \{\\n * Clipboard.setString('hello world');\\n * }\\n * \`\`\`\\n * @param the content to be stored in the clipboard.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "content"
}
],
"tparams": null,
"returntypehint": null,
"name": "setString"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 19,
"name": "Clipboard",
"docblock": "/**\\n * \`Clipboard\` gives you an interface for setting and getting content from Clipboard on both iOS and Android\\n */\\n",
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/Components/Clipboard/Clipboard.js",
"componentName": "Clipboard",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"clipboard","title":"Clipboard","layout":"autodocs","category":"APIs","permalink":"docs/clipboard.html","platform":"cross","next":"datepickerandroid","previous":"cameraroll","sidebar":true,"path":"Libraries/Components/Clipboard/Clipboard.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+73
View File
@@ -0,0 +1,73 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "DatePickerAndroid",
"docblock": "/**\\n * Opens the standard Android date picker dialog.\\n *\\n * ### Example\\n *\\n * \`\`\`\\n * try \{\\n * const \{action, year, month, day} = await DatePickerAndroid.open(\{\\n * // Use \`new Date()\` for current date.\\n * // May 25 2020. Month 0 is January.\\n * date: new Date(2020, 4, 25)\\n * });\\n * if (action !== DatePickerAndroid.dismissedAction) \{\\n * // Selected year, month (0-11), day\\n * }\\n * } catch (\{code, message}) \{\\n * console.warn('Cannot open date picker', message);\\n * }\\n * \`\`\`\\n */\\n",
"methods": [
\{
"line": 69,
"source": "static async open(options: Object): Promise<Object> \{\\n const optionsMs = options;\\n if (optionsMs) \{\\n _toMillis(options, 'date');\\n _toMillis(options, 'minDate');\\n _toMillis(options, 'maxDate');\\n }\\n return DatePickerModule.open(options);\\n }",
"docblock": "/**\\n * Opens the standard Android date picker dialog.\\n *\\n * The available keys for the \`options\` object are:\\n *\\n * - \`date\` (\`Date\` object or timestamp in milliseconds) - date to show by default\\n * - \`minDate\` (\`Date\` or timestamp in milliseconds) - minimum date that can be selected\\n * - \`maxDate\` (\`Date\` object or timestamp in milliseconds) - maximum date that can be selected\\n * - \`mode\` (\`enum('calendar', 'spinner', 'default')\`) - To set the date-picker mode to calendar/spinner/default\\n * - 'calendar': Show a date picker in calendar mode.\\n * - 'spinner': Show a date picker in spinner mode.\\n * - 'default': Show a default native date picker(spinner/calendar) based on android versions.\\n *\\n * Returns a Promise which will be invoked an object containing \`action\`, \`year\`, \`month\` (0-11),\\n * \`day\` if the user picked a date. If the user dismissed the dialog, the Promise will\\n * still be resolved with action being \`DatePickerAndroid.dismissedAction\` and all the other keys\\n * being undefined. **Always** check whether the \`action\` before reading the values.\\n *\\n * Note the native date picker dialog has some UI glitches on Android 4 and lower\\n * when using the \`minDate\` and \`maxDate\` options.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "Object",
"name": "options"
}
],
"tparams": null,
"returntypehint": "Promise<Object>",
"name": "open"
},
\{
"line": 82,
"source": "static get dateSetAction() \{ return 'dateSetAction'; }",
"docblock": "/**\\n * A date has been selected.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "dateSetAction"
},
\{
"line": 86,
"source": "static get dismissedAction() \{ return 'dismissedAction'; }",
"docblock": "/**\\n * The dialog has been dismissed.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "dismissedAction"
}
],
"type": "api",
"line": 47,
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js",
"componentName": "DatePickerAndroid",
"componentPlatform": "android"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"datepickerandroid","title":"DatePickerAndroid","layout":"autodocs","category":"APIs","permalink":"docs/datepickerandroid.html","platform":"android","next":"dimensions","previous":"clipboard","sidebar":true,"path":"Libraries/Components/DatePickerAndroid/DatePickerAndroid.android.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+776
View File
@@ -0,0 +1,776 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "Use \`DatePickerIOS\` to render a date/time picker (selector) on iOS. This is\\na controlled component, so you must hook in to the \`onDateChange\` callback\\nand update the \`date\` prop in order for the component to update, otherwise\\nthe user's change will be reverted immediately to reflect \`props.date\` as the\\nsource of truth.",
"displayName": "DatePickerIOS",
"methods": [],
"props": \{
"date": \{
"type": \{
"name": "instanceOf",
"value": "Date"
},
"required": true,
"description": "The currently selected date."
},
"onDateChange": \{
"type": \{
"name": "func"
},
"required": true,
"description": "Date change handler.\\n\\nThis is called when the user changes the date or time in the UI.\\nThe first and only argument is a Date object representing the new\\ndate and time."
},
"maximumDate": \{
"type": \{
"name": "instanceOf",
"value": "Date"
},
"required": false,
"description": "Maximum date.\\n\\nRestricts the range of possible date/time values."
},
"minimumDate": \{
"type": \{
"name": "instanceOf",
"value": "Date"
},
"required": false,
"description": "Minimum date.\\n\\nRestricts the range of possible date/time values."
},
"mode": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'date'",
"computed": false
},
\{
"value": "'time'",
"computed": false
},
\{
"value": "'datetime'",
"computed": false
}
]
},
"required": false,
"description": "The date picker mode.",
"defaultValue": \{
"value": "'datetime'",
"computed": false
}
},
"minuteInterval": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "1",
"computed": false
},
\{
"value": "2",
"computed": false
},
\{
"value": "3",
"computed": false
},
\{
"value": "4",
"computed": false
},
\{
"value": "5",
"computed": false
},
\{
"value": "6",
"computed": false
},
\{
"value": "10",
"computed": false
},
\{
"value": "12",
"computed": false
},
\{
"value": "15",
"computed": false
},
\{
"value": "20",
"computed": false
},
\{
"value": "30",
"computed": false
}
]
},
"required": false,
"description": "The interval at which minutes can be selected."
},
"timeZoneOffsetInMinutes": \{
"type": \{
"name": "number"
},
"required": false,
"description": "Timezone offset in minutes.\\n\\nBy default, the date picker will use the device's timezone. With this\\nparameter, it is possible to force a certain timezone offset. For\\ninstance, to show times in Pacific Standard Time, pass -7 * 60."
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/DatePicker/DatePickerIOS.ios.js",
"componentName": "DatePickerIOS",
"componentPlatform": "ios",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"datepickerios","title":"DatePickerIOS","layout":"autodocs","category":"Components","permalink":"docs/datepickerios.html","platform":"ios","next":"drawerlayoutandroid","previous":"button","sidebar":true,"path":"Libraries/Components/DatePicker/DatePickerIOS.ios.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+120
View File
@@ -0,0 +1,120 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "Dimensions",
"docblock": "/**\\n */\\n",
"methods": [
\{
"line": 31,
"source": "static set(dims: \{[key:string]: any}): void \{\\n // We calculate the window dimensions in JS so that we don't encounter loss of\\n // precision in transferring the dimensions (which could be non-integers) over\\n // the bridge.\\n if (dims && dims.windowPhysicalPixels) \{\\n // parse/stringify => Clone hack\\n dims = JSON.parse(JSON.stringify(dims));\\n\\n var windowPhysicalPixels = dims.windowPhysicalPixels;\\n dims.window = \{\\n width: windowPhysicalPixels.width / windowPhysicalPixels.scale,\\n height: windowPhysicalPixels.height / windowPhysicalPixels.scale,\\n scale: windowPhysicalPixels.scale,\\n fontScale: windowPhysicalPixels.fontScale,\\n };\\n if (Platform.OS === 'android') \{\\n // Screen and window dimensions are different on android\\n var screenPhysicalPixels = dims.screenPhysicalPixels;\\n dims.screen = \{\\n width: screenPhysicalPixels.width / screenPhysicalPixels.scale,\\n height: screenPhysicalPixels.height / screenPhysicalPixels.scale,\\n scale: screenPhysicalPixels.scale,\\n fontScale: screenPhysicalPixels.fontScale,\\n };\\n\\n // delete so no callers rely on this existing\\n delete dims.screenPhysicalPixels;\\n } else \{\\n dims.screen = dims.window;\\n }\\n // delete so no callers rely on this existing\\n delete dims.windowPhysicalPixels;\\n }\\n\\n Object.assign(dimensions, dims);\\n if (dimensionsInitialized) \{\\n // Don't fire 'change' the first time the dimensions are set.\\n eventEmitter.emit('change', \{\\n window: dimensions.window,\\n screen: dimensions.screen\\n });\\n } else \{\\n dimensionsInitialized = true;\\n }\\n }",
"docblock": "/**\\n * This should only be called from native code by sending the\\n * didUpdateDimensions event.\\n *\\n * @param \{object} dims Simple string-keyed object of dimensions to set\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{[key:string]: any}",
"name": "dims"
}
],
"tparams": null,
"returntypehint": "void",
"name": "set"
},
\{
"line": 92,
"source": "static get(dim: string): Object \{\\n invariant(dimensions[dim], 'No dimension set for key ' + dim);\\n return dimensions[dim];\\n }",
"docblock": "/**\\n * Initial dimensions are set before \`runApplication\` is called so they should\\n * be available before any other require's are run, but may be updated later.\\n *\\n * Note: Although dimensions are available immediately, they may change (e.g\\n * due to device rotation) so any rendering logic or styles that depend on\\n * these constants should try to call this function on every render, rather\\n * than caching the value (for example, using inline styles rather than\\n * setting a value in a \`StyleSheet\`).\\n *\\n * Example: \`var \{height, width} = Dimensions.get('window');\`\\n *\\n * @param \{string} dim Name of dimension as defined when calling \`set\`.\\n * @returns \{Object?} Value for the dimension.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "dim"
}
],
"tparams": null,
"returntypehint": "Object",
"name": "get"
},
\{
"line": 105,
"source": "static addEventListener(\\n type: string,\\n handler: Function\\n ) \{\\n invariant(\\n 'change' === type,\\n 'Trying to subscribe to unknown event: \\"%s\\"', type\\n );\\n eventEmitter.addListener(type, handler);\\n }",
"docblock": "/**\\n * Add an event handler. Supported events:\\n *\\n * - \`change\`: Fires when a property within the \`Dimensions\` object changes. The argument\\n * to the event handler is an object with \`window\` and \`screen\` properties whose values\\n * are the same as the return values of \`Dimensions.get('window')\` and\\n * \`Dimensions.get('screen')\`, respectively.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "addEventListener"
},
\{
"line": 119,
"source": "static removeEventListener(\\n type: string,\\n handler: Function\\n ) \{\\n invariant(\\n 'change' === type,\\n 'Trying to remove listener for unknown event: \\"%s\\"', type\\n );\\n eventEmitter.removeListener(type, handler);\\n }",
"docblock": "/**\\n * Remove an event handler.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeEventListener"
}
],
"type": "api",
"line": 24,
"requires": [
\{
"name": "DeviceInfo"
},
\{
"name": "EventEmitter"
},
\{
"name": "Platform"
},
\{
"name": "RCTDeviceEventEmitter"
},
\{
"name": "fbjs/lib/invariant"
}
],
"filepath": "Libraries/Utilities/Dimensions.js",
"componentName": "Dimensions",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"dimensions","title":"Dimensions","layout":"autodocs","category":"APIs","permalink":"docs/dimensions.html","platform":"cross","next":"easing","previous":"datepickerandroid","sidebar":true,"path":"Libraries/Utilities/Dimensions.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+794
View File
@@ -0,0 +1,794 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "React component that wraps the platform \`DrawerLayout\` (Android only). The\\nDrawer (typically used for navigation) is rendered with \`renderNavigationView\`\\nand direct children are the main view (where your content goes). The navigation\\nview is initially not visible on the screen, but can be pulled in from the\\nside of the window specified by the \`drawerPosition\` prop and its width can\\nbe set by the \`drawerWidth\` prop.\\n\\nExample:\\n\\n\`\`\`\\nrender: function() \{\\n var navigationView = (\\n <View style=\{\{flex: 1, backgroundColor: '#fff'}}>\\n <Text style=\{\{margin: 10, fontSize: 15, textAlign: 'left'}}>I'm in the Drawer!</Text>\\n </View>\\n );\\n return (\\n <DrawerLayoutAndroid\\n drawerWidth=\{300}\\n drawerPosition=\{DrawerLayoutAndroid.positions.Left}\\n renderNavigationView=\{() => navigationView}>\\n <View style=\{\{flex: 1, alignItems: 'center'}}>\\n <Text style=\{\{margin: 10, fontSize: 15, textAlign: 'right'}}>Hello</Text>\\n <Text style=\{\{margin: 10, fontSize: 15, textAlign: 'right'}}>World!</Text>\\n </View>\\n </DrawerLayoutAndroid>\\n );\\n},\\n\`\`\`",
"displayName": "DrawerLayoutAndroid",
"methods": [
\{
"name": "openDrawer",
"docblock": "Opens the drawer.",
"modifiers": [],
"params": [],
"returns": null,
"description": "Opens the drawer."
},
\{
"name": "closeDrawer",
"docblock": "Closes the drawer.",
"modifiers": [],
"params": [],
"returns": null,
"description": "Closes the drawer."
}
],
"props": \{
"keyboardDismissMode": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'on-drag'",
"computed": false
}
]
},
"required": false,
"description": "Determines whether the keyboard gets dismissed in response to a drag.\\n - 'none' (the default), drags do not dismiss the keyboard.\\n - 'on-drag', the keyboard is dismissed when a drag begins."
},
"drawerBackgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Specifies the background color of the drawer. The default value is white.\\nIf you want to set the opacity of the drawer, use rgba. Example:\\n\\n\`\`\`\\nreturn (\\n <DrawerLayoutAndroid drawerBackgroundColor=\\"rgba(0,0,0,0.5)\\">\\n </DrawerLayoutAndroid>\\n);\\n\`\`\`",
"defaultValue": \{
"value": "'white'",
"computed": false
}
},
"drawerPosition": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "DrawerConsts.DrawerPosition.Left",
"computed": true
},
\{
"value": "DrawerConsts.DrawerPosition.Right",
"computed": true
}
]
},
"required": false,
"description": "Specifies the side of the screen from which the drawer will slide in."
},
"drawerWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "Specifies the width of the drawer, more precisely the width of the view that be pulled in\\nfrom the edge of the window."
},
"drawerLockMode": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'unlocked'",
"computed": false
},
\{
"value": "'locked-closed'",
"computed": false
},
\{
"value": "'locked-open'",
"computed": false
}
]
},
"required": false,
"description": "Specifies the lock mode of the drawer. The drawer can be locked in 3 states:\\n- unlocked (default), meaning that the drawer will respond (open/close) to touch gestures.\\n- locked-closed, meaning that the drawer will stay closed and not respond to gestures.\\n- locked-open, meaning that the drawer will stay opened and not respond to gestures.\\nThe drawer may still be opened and closed programmatically (\`openDrawer\`/\`closeDrawer\`)."
},
"onDrawerSlide": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Function called whenever there is an interaction with the navigation view."
},
"onDrawerStateChanged": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Function called when the drawer state has changed. The drawer can be in 3 states:\\n- idle, meaning there is no interaction with the navigation view happening at the time\\n- dragging, meaning there is currently an interaction with the navigation view\\n- settling, meaning that there was an interaction with the navigation view, and the\\nnavigation view is now finishing its closing or opening animation"
},
"onDrawerOpen": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Function called whenever the navigation view has been opened."
},
"onDrawerClose": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Function called whenever the navigation view has been closed."
},
"renderNavigationView": \{
"type": \{
"name": "func"
},
"required": true,
"description": "The navigation view that will be rendered to the side of the screen and can be pulled in."
},
"statusBarBackgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Make the drawer take the entire screen and draw the background of the\\nstatus bar to allow it to open over the status bar. It will only have an\\neffect on API 21+."
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js",
"componentName": "DrawerLayoutAndroid",
"componentPlatform": "android",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"drawerlayoutandroid","title":"DrawerLayoutAndroid","layout":"autodocs","category":"Components","permalink":"docs/drawerlayoutandroid.html","platform":"android","next":"flatlist","previous":"datepickerios","sidebar":true,"path":"Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+329
View File
@@ -0,0 +1,329 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "Easing",
"docblock": "/**\\n * The \`Easing\` module implements common easing functions. This module is used\\n * by [Animate.timing()](docs/animate.html#timing) to convey physically\\n * believable motion in animations.\\n *\\n * You can find a visualization of some common easing functions at\\n * http://easings.net/\\n *\\n * ### Predefined animations\\n *\\n * The \`Easing\` module provides several predefined animations through the\\n * following methods:\\n *\\n * - [\`back\`](docs/easing.html#back) provides a simple animation where the\\n * object goes slightly back before moving forward\\n * - [\`bounce\`](docs/easing.html#bounce) provides a bouncing animation\\n * - [\`ease\`](docs/easing.html#ease) provides a simple inertial animation\\n * - [\`elastic\`](docs/easing.html#elastic) provides a simple spring interaction\\n *\\n * ### Standard functions\\n *\\n * Three standard easing functions are provided:\\n *\\n * - [\`linear\`](docs/easing.html#linear)\\n * - [\`quad\`](docs/easing.html#quad)\\n * - [\`cubic\`](docs/easing.html#cubic)\\n *\\n * The [\`poly\`](docs/easing.html#poly) function can be used to implement\\n * quartic, quintic, and other higher power functions.\\n *\\n * ### Additional functions\\n *\\n * Additional mathematical functions are provided by the following methods:\\n *\\n * - [\`bezier\`](docs/easing.html#bezier) provides a cubic bezier curve\\n * - [\`circle\`](docs/easing.html#circle) provides a circular function\\n * - [\`sin\`](docs/easing.html#sin) provides a sinusoidal function\\n * - [\`exp\`](docs/easing.html#exp) provides an exponential function\\n *\\n * The following helpers are used to modify other easing functions.\\n *\\n * - [\`in\`](docs/easing.html#in) runs an easing function forwards\\n * - [\`inOut\`](docs/easing.html#inout) makes any easing function symmetrical\\n * - [\`out\`](docs/easing.html#out) runs an easing function backwards\\n */\\n",
"methods": [
\{
"line": 65,
"source": "static step0(n) \{\\n return n > 0 ? 1 : 0;\\n }",
"docblock": "/**\\n * A stepping function, returns 1 for any positive value of \`n\`.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "n"
}
],
"tparams": null,
"returntypehint": null,
"name": "step0"
},
\{
"line": 72,
"source": "static step1(n) \{\\n return n >= 1 ? 1 : 0;\\n }",
"docblock": "/**\\n * A stepping function, returns 1 if \`n\` is greater than or equal to 1.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "n"
}
],
"tparams": null,
"returntypehint": null,
"name": "step1"
},
\{
"line": 82,
"source": "static linear(t) \{\\n return t;\\n }",
"docblock": "/**\\n * A linear function, \`f(t) = t\`. Position correlates to elapsed time one to\\n * one.\\n *\\n * http://cubic-bezier.com/#0,0,1,1\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "linear"
},
\{
"line": 92,
"source": "static ease(t: number): number \{\\n if (!ease) \{\\n ease = Easing.bezier(0.42, 0, 1, 1);\\n }\\n return ease(t);\\n }",
"docblock": "/**\\n * A simple inertial interaction, similar to an object slowly accelerating to\\n * speed.\\n *\\n * http://cubic-bezier.com/#.42,0,1,1\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "t"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "ease"
},
\{
"line": 105,
"source": "static quad(t) \{\\n return t * t;\\n }",
"docblock": "/**\\n * A quadratic function, \`f(t) = t * t\`. Position equals the square of elapsed\\n * time.\\n *\\n * http://easings.net/#easeInQuad\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "quad"
},
\{
"line": 115,
"source": "static cubic(t) \{\\n return t * t * t;\\n }",
"docblock": "/**\\n * A cubic function, \`f(t) = t * t * t\`. Position equals the cube of elapsed\\n * time.\\n *\\n * http://easings.net/#easeInCubic\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "cubic"
},
\{
"line": 125,
"source": "static poly(n) \{\\n return (t) => Math.pow(t, n);\\n }",
"docblock": "/**\\n * A power function. Position is equal to the Nth power of elapsed time.\\n *\\n * n = 4: http://easings.net/#easeInQuart\\n * n = 5: http://easings.net/#easeInQuint\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "n"
}
],
"tparams": null,
"returntypehint": null,
"name": "poly"
},
\{
"line": 134,
"source": "static sin(t) \{\\n return 1 - Math.cos(t * Math.PI / 2);\\n }",
"docblock": "/**\\n * A sinusoidal function.\\n *\\n * http://easings.net/#easeInSine\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "sin"
},
\{
"line": 143,
"source": "static circle(t) \{\\n return 1 - Math.sqrt(1 - t * t);\\n }",
"docblock": "/**\\n * A circular function.\\n *\\n * http://easings.net/#easeInCirc\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "circle"
},
\{
"line": 152,
"source": "static exp(t) \{\\n return Math.pow(2, 10 * (t - 1));\\n }",
"docblock": "/**\\n * An exponential function.\\n *\\n * http://easings.net/#easeInExpo\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": null,
"name": "t"
}
],
"tparams": null,
"returntypehint": null,
"name": "exp"
},
\{
"line": 171,
"source": "static elastic(bounciness: number = 1): (t: number) => number \{\\n const p = bounciness * Math.PI;\\n return (t) => 1 - Math.pow(Math.cos(t * Math.PI / 2), 3) * Math.cos(t * p);\\n }",
"docblock": "/**\\n * A simple elastic interaction, similar to a spring oscillating back and\\n * forth.\\n *\\n * Default bounciness is 1, which overshoots a little bit once. 0 bounciness\\n * doesn't overshoot at all, and bounciness of N > 1 will overshoot about N\\n * times.\\n *\\n * http://easings.net/#easeInElastic\\n *\\n * Wolfram Plots:\\n *\\n * - http://tiny.cc/elastic_b_1 (bounciness = 1, default)\\n * - http://tiny.cc/elastic_b_3 (bounciness = 3)\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "bounciness"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "elastic"
},
\{
"line": 184,
"source": "static back(s: number): (t: number) => number \{\\n if (s === undefined) \{\\n s = 1.70158;\\n }\\n return (t) => t * t * ((s + 1) * t - s);\\n }",
"docblock": "/**\\n * Use with \`Animated.parallel()\` to create a simple effect where the object\\n * animates back slightly as the animation starts.\\n *\\n * Wolfram Plot:\\n *\\n * - http://tiny.cc/back_default (s = 1.70158, default)\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "s"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "back"
},
\{
"line": 196,
"source": "static bounce(t: number): number \{\\n if (t < 1 / 2.75) \{\\n return 7.5625 * t * t;\\n }\\n\\n if (t < 2 / 2.75) \{\\n t -= 1.5 / 2.75;\\n return 7.5625 * t * t + 0.75;\\n }\\n\\n if (t < 2.5 / 2.75) \{\\n t -= 2.25 / 2.75;\\n return 7.5625 * t * t + 0.9375;\\n }\\n\\n t -= 2.625 / 2.75;\\n return 7.5625 * t * t + 0.984375;\\n }",
"docblock": "/**\\n * Provides a simple bouncing effect.\\n *\\n * http://easings.net/#easeInBounce\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "t"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "bounce"
},
\{
"line": 222,
"source": "static bezier(\\n x1: number,\\n y1: number,\\n x2: number,\\n y2: number\\n ): (t: number) => number \{\\n const _bezier = require\('bezier');\\n return _bezier(x1, y1, x2, y2);\\n }",
"docblock": "/**\\n * Provides a cubic bezier curve, equivalent to CSS Transitions'\\n * \`transition-timing-function\`.\\n *\\n * A useful tool to visualize cubic bezier curves can be found at\\n * http://cubic-bezier.com/\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "x1"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "y1"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "x2"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "y2"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "bezier"
},
\{
"line": 235,
"source": "static in(\\n easing: (t: number) => number,\\n ): (t: number) => number \{\\n return easing;\\n }",
"docblock": "/**\\n * Runs an easing function forwards.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "(t: number) => number",
"name": "easing"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "in"
},
\{
"line": 244,
"source": "static out(\\n easing: (t: number) => number,\\n ): (t: number) => number \{\\n return (t) => 1 - easing(1 - t);\\n }",
"docblock": "/**\\n * Runs an easing function backwards.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "(t: number) => number",
"name": "easing"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "out"
},
\{
"line": 255,
"source": "static inOut(\\n easing: (t: number) => number,\\n ): (t: number) => number \{\\n return (t) => \{\\n if (t < 0.5) \{\\n return easing(t * 2) / 2;\\n }\\n return 1 - easing((1 - t) * 2) / 2;\\n };\\n }",
"docblock": "/**\\n * Makes any easing function symmetrical. The easing function will run\\n * forwards for half of the duration, then backwards for the rest of the\\n * duration.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "(t: number) => number",
"name": "easing"
}
],
"tparams": null,
"returntypehint": "(t: number) => number",
"name": "inOut"
}
],
"type": "api",
"line": 61,
"requires": [],
"filepath": "Libraries/Animated/src/Easing.js",
"componentName": "Easing",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"easing","title":"Easing","layout":"autodocs","category":"APIs","permalink":"docs/easing.html","platform":"cross","next":"geolocation","previous":"dimensions","sidebar":true,"path":"Libraries/Animated/src/Easing.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
File diff suppressed because it is too large Load Diff
+142
View File
@@ -0,0 +1,142 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 83,
"source": "requestAuthorization: function() \{\\n RCTLocationObserver.requestAuthorization();\\n }",
"docblock": "/*\\n * Request suitable Location permission based on the key configured on pList.\\n * If NSLocationAlwaysUsageDescription is set, it will request Always authorization,\\n * although if NSLocationWhenInUseUsageDescription is set, it will request InUse\\n * authorization.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "requestAuthorization"
},
\{
"line": 93,
"source": "getCurrentPosition: async function(\\n geo_success: Function,\\n geo_error?: Function,\\n geo_options?: GeoOptions\\n ) \{\\n invariant(\\n typeof geo_success === 'function',\\n 'Must provide a valid geo_success callback.'\\n );\\n let hasPermission = true;\\n // Supports Android's new permission model. For Android older devices,\\n // it's always on.\\n if (Platform.OS === 'android' && Platform.Version >= 23) \{\\n hasPermission = await PermissionsAndroid.check(\\n PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,\\n );\\n if (!hasPermission) \{\\n const status = await PermissionsAndroid.request(\\n PermissionsAndroid.PERMISSIONS.ACCESS_FINE_LOCATION,\\n );\\n hasPermission = status === PermissionsAndroid.RESULTS.GRANTED;\\n }\\n }\\n if (hasPermission) \{\\n RCTLocationObserver.getCurrentPosition(\\n geo_options || \{},\\n geo_success,\\n geo_error || logError,\\n );\\n }\\n }",
"docblock": "/*\\n * Invokes the success callback once with the latest location info. Supported\\n * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool)\\n * On Android, if the location is cached this can return almost immediately,\\n * or it will request an update which might take a while.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "geo_success"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "geo_error?"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"GeoOptions\\",\\"length\\":1}",
"name": "geo_options?"
}
],
"tparams": null,
"returntypehint": null,
"name": "getCurrentPosition"
},
\{
"line": 129,
"source": "watchPosition: function(success: Function, error?: Function, options?: GeoOptions): number \{\\n if (!updatesEnabled) \{\\n RCTLocationObserver.startObserving(options || \{});\\n updatesEnabled = true;\\n }\\n var watchID = subscriptions.length;\\n subscriptions.push([\\n LocationEventEmitter.addListener(\\n 'geolocationDidChange',\\n success\\n ),\\n error ? LocationEventEmitter.addListener(\\n 'geolocationError',\\n error\\n ) : null,\\n ]);\\n return watchID;\\n }",
"docblock": "/*\\n * Invokes the success callback whenever the location changes. Supported\\n * options: timeout (ms), maximumAge (ms), enableHighAccuracy (bool), distanceFilter(m)\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "success"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "error?"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"GeoOptions\\",\\"length\\":1}",
"name": "options?"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "watchPosition"
},
\{
"line": 148,
"source": "clearWatch: function(watchID: number) \{\\n var sub = subscriptions[watchID];\\n if (!sub) \{\\n // Silently exit when the watchID is invalid or already cleared\\n // This is consistent with timers\\n return;\\n }\\n\\n sub[0].remove();\\n // array element refinements not yet enabled in Flow\\n var sub1 = sub[1]; sub1 && sub1.remove();\\n subscriptions[watchID] = undefined;\\n var noWatchers = true;\\n for (var ii = 0; ii < subscriptions.length; ii++) \{\\n if (subscriptions[ii]) \{\\n noWatchers = false; // still valid subscriptions\\n }\\n }\\n if (noWatchers) \{\\n Geolocation.stopObserving();\\n }\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "watchID"
}
],
"tparams": null,
"returntypehint": null,
"name": "clearWatch"
},
\{
"line": 171,
"source": "stopObserving: function() \{\\n if (updatesEnabled) \{\\n RCTLocationObserver.stopObserving();\\n updatesEnabled = false;\\n for (var ii = 0; ii < subscriptions.length; ii++) \{\\n var sub = subscriptions[ii];\\n if (sub) \{\\n warning(false, 'Called stopObserving with existing subscriptions.');\\n sub[0].remove();\\n // array element refinements not yet enabled in Flow\\n var sub1 = sub[1]; sub1 && sub1.remove();\\n }\\n }\\n subscriptions = [];\\n }\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "stopObserving"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 75,
"name": "Geolocation",
"docblock": "/**\\n * The Geolocation API extends the web spec:\\n * https://developer.mozilla.org/en-US/docs/Web/API/Geolocation\\n *\\n * As a browser polyfill, this API is available through the \`navigator.geolocation\`\\n * global - you do not need to \`import\` it.\\n *\\n * ### Configuration and Permissions\\n *\\n * <div class=\\"banner-crna-ejected\\">\\n * <h3>Projects with Native Code Only</h3>\\n * <p>\\n * This section only applies to projects made with <code>react-native init</code>\\n * or to those made with Create React Native App which have since ejected. For\\n * more information about ejecting, please see\\n * the <a href=\\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\\" target=\\"_blank\\">guide</a> on\\n * the Create React Native App repository.\\n * </p>\\n * </div>\\n *\\n * #### iOS\\n * You need to include the \`NSLocationWhenInUseUsageDescription\` key\\n * in Info.plist to enable geolocation when using the app. Geolocation is\\n * enabled by default when you create a project with \`react-native init\`.\\n *\\n * In order to enable geolocation in the background, you need to include the\\n * 'NSLocationAlwaysUsageDescription' key in Info.plist and add location as\\n * a background mode in the 'Capabilities' tab in Xcode.\\n *\\n * #### Android\\n * To request access to location, you need to add the following line to your\\n * app's \`AndroidManifest.xml\`:\\n *\\n * \`<uses-permission android:name=\\"android.permission.ACCESS_FINE_LOCATION\\" />\`\\n *\\n * Android API >= 18 Positions will also contain a \`mocked\` boolean to indicate if position\\n * was created from a mock provider.\\n *\\n */\\n",
"requires": [
\{
"name": "NativeEventEmitter"
},
\{
"name": "NativeModules"
},
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "logError"
},
\{
"name": "fbjs/lib/warning"
},
\{
"name": "Platform"
},
\{
"name": "PermissionsAndroid"
}
],
"filepath": "Libraries/Geolocation/Geolocation.js",
"componentName": "Geolocation",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"geolocation","title":"Geolocation","layout":"autodocs","category":"APIs","permalink":"docs/geolocation.html","platform":"cross","next":"imageeditor","previous":"easing","sidebar":true,"path":"Libraries/Geolocation/Geolocation.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+911
View File
@@ -0,0 +1,911 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "A React component for displaying different types of images,\\nincluding network images, static resources, temporary local images, and\\nimages from local disk, such as the camera roll.\\n\\nThis example shows fetching and displaying an image from local storage\\nas well as one from network and even from data provided in the \`'data:'\` uri scheme.\\n\\n> Note that for network and data images, you will need to manually specify the dimensions of your image!\\n\\n\`\`\`ReactNativeWebPlayer\\nimport React, \{ Component } from 'react';\\nimport \{ AppRegistry, View, Image } from 'react-native';\\n\\nexport default class DisplayAnImage extends Component \{\\n render() \{\\n return (\\n <View>\\n <Image\\n source=\{require\('./img/favicon.png')}\\n />\\n <Image\\n style=\{\{width: 50, height: 50}}\\n source=\{\{uri: 'https://facebook.github.io/react/img/logo_og.png'}}\\n />\\n <Image\\n style=\{\{width: 66, height: 58}}\\n source=\{\{uri: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAYAAAA6oTAqAAAAEXRFWHRTb2Z0d2FyZQBwbmdjcnVzaEB1SfMAAABQSURBVGje7dSxCQBACARB+2/ab8BEeQNhFi6WSYzYLYudDQYGBgYGBgYGBgYGBgYGBgZmcvDqYGBgmhivGQYGBgYGBgYGBgYGBgYGBgbmQw+P/eMrC5UTVAAAAABJRU5ErkJggg=='}}\\n />\\n </View>\\n );\\n }\\n}\\n\\n// skip this line if using Create React Native App\\nAppRegistry.registerComponent('DisplayAnImage', () => DisplayAnImage);\\n\`\`\`\\n\\nYou can also add \`style\` to an image:\\n\\n\`\`\`ReactNativeWebPlayer\\nimport React, \{ Component } from 'react';\\nimport \{ AppRegistry, View, Image, StyleSheet } from 'react-native';\\n\\nconst styles = StyleSheet.create(\{\\n stretch: \{\\n width: 50,\\n height: 200\\n }\\n});\\n\\nexport default class DisplayAnImageWithStyle extends Component \{\\n render() \{\\n return (\\n <View>\\n <Image\\n style=\{styles.stretch}\\n source=\{require\('./img/favicon.png')}\\n />\\n </View>\\n );\\n }\\n}\\n\\n// skip these lines if using Create React Native App\\nAppRegistry.registerComponent(\\n 'DisplayAnImageWithStyle',\\n () => DisplayAnImageWithStyle\\n);\\n\`\`\`\\n\\n### GIF and WebP support on Android\\n\\nWhen building your own native code, GIF and WebP are not supported by default on Android.\\n\\nYou will need to add some optional modules in \`android/app/build.gradle\`, depending on the needs of your app.\\n\\n\`\`\`\\ndependencies \{\\n // If your app supports Android versions before Ice Cream Sandwich (API level 14)\\n compile 'com.facebook.fresco:animated-base-support:1.3.0'\\n\\n // For animated GIF support\\n compile 'com.facebook.fresco:animated-gif:1.3.0'\\n\\n // For WebP support, including animated WebP\\n compile 'com.facebook.fresco:animated-webp:1.3.0'\\n compile 'com.facebook.fresco:webpsupport:1.3.0'\\n\\n // For WebP support, without animations\\n compile 'com.facebook.fresco:webpsupport:1.3.0'\\n}\\n\`\`\`\\n\\nAlso, if you use GIF with ProGuard, you will need to add this rule in \`proguard-rules.pro\` :\\n\`\`\`\\n-keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl \{\\n public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory, com.facebook.imagepipeline.core.ExecutorSupplier);\\n}\\n\`\`\`",
"displayName": "Image",
"methods": [
\{
"name": "getSize",
"docblock": "Retrieve the width and height (in pixels) of an image prior to displaying it.\\nThis method can fail if the image cannot be found, or fails to download.\\n\\nIn order to retrieve the image dimensions, the image may first need to be\\nloaded or downloaded, after which it will be cached. This means that in\\nprinciple you could use this method to preload images, however it is not\\noptimized for that purpose, and may in future be implemented in a way that\\ndoes not fully load/download the image data. A proper, supported way to\\npreload images will be provided as a separate API.\\n\\nDoes not work for static image resources.\\n\\n@param uri The location of the image.\\n@param success The function that will be called if the image was successfully found and width\\nand height retrieved.\\n@param failure The function that will be called if there was an error, such as failing to\\nto retrieve the image.\\n\\n@returns void\\n\\n@platform ios",
"modifiers": [
"static"
],
"params": [
\{
"name": "uri",
"description": "The location of the image.",
"type": \{
"names": [
"string"
]
}
},
\{
"name": "success",
"description": "The function that will be called if the image was successfully found and width\\nand height retrieved.",
"type": \{
"names": [
"function"
]
}
},
\{
"name": "failure",
"description": "The function that will be called if there was an error, such as failing to\\nto retrieve the image.",
"type": \{
"names": [
"function"
]
},
"optional": true
}
],
"returns": \{
"description": "void",
"type": [
null
]
},
"description": "Retrieve the width and height (in pixels) of an image prior to displaying it.\\nThis method can fail if the image cannot be found, or fails to download.\\n\\nIn order to retrieve the image dimensions, the image may first need to be\\nloaded or downloaded, after which it will be cached. This means that in\\nprinciple you could use this method to preload images, however it is not\\noptimized for that purpose, and may in future be implemented in a way that\\ndoes not fully load/download the image data. A proper, supported way to\\npreload images will be provided as a separate API.\\n\\nDoes not work for static image resources."
},
\{
"name": "prefetch",
"docblock": "Prefetches a remote image for later use by downloading it to the disk\\ncache\\n\\n@param url The remote location of the image.\\n\\n@return The prefetched image.",
"modifiers": [
"static"
],
"params": [
\{
"name": "url",
"description": "The remote location of the image.",
"type": \{
"names": [
"string"
]
}
}
],
"returns": \{
"description": "The prefetched image.",
"type": [
null
]
},
"description": "Prefetches a remote image for later use by downloading it to the disk\\ncache"
}
],
"props": \{
"style": \{
"type": \{
"name": "stylesheet",
"value": "ImageStylePropTypes"
},
"required": false,
"description": "> \`ImageResizeMode\` is an \`Enum\` for different image resizing modes, set via the\\n> \`resizeMode\` style property on \`Image\` components. The values are \`contain\`, \`cover\`,\\n> \`stretch\`, \`center\`, \`repeat\`."
},
"source": \{
"type": \{
"name": "custom",
"raw": "ImageSourcePropType"
},
"required": false,
"description": "The image source (either a remote URL or a local file resource).\\n\\nThis prop can also contain several remote URLs, specified together with\\ntheir width and height and potentially with scale/other URI arguments.\\nThe native side will then choose the best \`uri\` to display based on the\\nmeasured size of the image container. A \`cache\` property can be added to\\ncontrol how networked request interacts with the local cache.\\n\\nThe currently supported formats are \`png\`, \`jpg\`, \`jpeg\`, \`bmp\`, \`gif\`,\\n\`webp\` (Android only), \`psd\` (iOS only)."
},
"defaultSource": \{
"type": \{
"name": "union",
"value": [
\{
"name": "shape",
"value": \{
"uri": \{
"name": "string",
"required": false
},
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
},
"scale": \{
"name": "number",
"required": false
}
}
},
\{
"name": "number"
}
]
},
"required": false,
"description": "A static image to display while loading the image source.\\n\\n- \`uri\` - a string representing the resource identifier for the image, which\\nshould be either a local file path or the name of a static image resource\\n(which should be wrapped in the \`require\('./path/to/image.png')\` function).\\n- \`width\`, \`height\` - can be specified if known at build time, in which case\\nthese will be used to set the default \`<Image/>\` component dimensions.\\n- \`scale\` - used to indicate the scale factor of the image. Defaults to 1.0 if\\nunspecified, meaning that one image pixel equates to one display point / DIP.\\n- \`number\` - Opaque type returned by something like \`require\('./image.jpg')\`.\\n\\n@platform ios"
},
"accessible": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "When true, indicates the image is an accessibility element.\\n@platform ios"
},
"accessibilityLabel": \{
"type": \{
"name": "node"
},
"required": false,
"description": "The text that's read by the screen reader when the user interacts with\\nthe image.\\n@platform ios"
},
"blurRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": "blurRadius: the blur radius of the blur filter added to the image"
},
"capInsets": \{
"type": \{
"name": "custom",
"raw": "EdgeInsetsPropType"
},
"required": false,
"description": "When the image is resized, the corners of the size specified\\nby \`capInsets\` will stay a fixed size, but the center content and borders\\nof the image will be stretched. This is useful for creating resizable\\nrounded buttons, shadows, and other resizable assets. More info in the\\n[official Apple documentation](https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIImage_Class/index.html#//apple_ref/occ/instm/UIImage/resizableImageWithCapInsets).\\n\\n@platform ios"
},
"resizeMethod": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'auto'",
"computed": false
},
\{
"value": "'resize'",
"computed": false
},
\{
"value": "'scale'",
"computed": false
}
]
},
"required": false,
"description": "The mechanism that should be used to resize the image when the image's dimensions\\ndiffer from the image view's dimensions. Defaults to \`auto\`.\\n\\n- \`auto\`: Use heuristics to pick between \`resize\` and \`scale\`.\\n\\n- \`resize\`: A software operation which changes the encoded image in memory before it\\ngets decoded. This should be used instead of \`scale\` when the image is much larger\\nthan the view.\\n\\n- \`scale\`: The image gets drawn downscaled or upscaled. Compared to \`resize\`, \`scale\` is\\nfaster (usually hardware accelerated) and produces higher quality images. This\\nshould be used if the image is smaller than the view. It should also be used if the\\nimage is slightly bigger than the view.\\n\\nMore details about \`resize\` and \`scale\` can be found at http://frescolib.org/docs/resizing-rotating.html.\\n\\n@platform android"
},
"resizeMode": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'cover'",
"computed": false
},
\{
"value": "'contain'",
"computed": false
},
\{
"value": "'stretch'",
"computed": false
},
\{
"value": "'repeat'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "Determines how to resize the image when the frame doesn't match the raw\\nimage dimensions.\\n\\n- \`cover\`: Scale the image uniformly (maintain the image's aspect ratio)\\nso that both dimensions (width and height) of the image will be equal\\nto or larger than the corresponding dimension of the view (minus padding).\\n\\n- \`contain\`: Scale the image uniformly (maintain the image's aspect ratio)\\nso that both dimensions (width and height) of the image will be equal to\\nor less than the corresponding dimension of the view (minus padding).\\n\\n- \`stretch\`: Scale width and height independently, This may change the\\naspect ratio of the src.\\n\\n- \`repeat\`: Repeat the image to cover the frame of the view. The\\nimage will keep it's size and aspect ratio. (iOS only)"
},
"testID": \{
"type": \{
"name": "string"
},
"required": false,
"description": "A unique identifier for this element to be used in UI Automation\\ntesting scripts."
},
"onLayout": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked on mount and layout changes with\\n\`\{nativeEvent: \{layout: \{x, y, width, height}}}\`."
},
"onLoadStart": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked on load start.\\n\\ne.g., \`onLoadStart=\{(e) => this.setState(\{loading: true})}\`"
},
"onProgress": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked on download progress with \`\{nativeEvent: \{loaded, total}}\`.\\n@platform ios"
},
"onError": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked on load error with \`\{nativeEvent: \{error}}\`."
},
"onPartialLoad": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked when a partial load of the image is complete. The definition of\\nwhat constitutes a \\"partial load\\" is loader specific though this is meant\\nfor progressive JPEG loads.\\n@platform ios"
},
"onLoad": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked when load completes successfully."
},
"onLoadEnd": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Invoked when load either succeeds or fails."
}
},
"type": "component",
"filepath": "Libraries/Image/Image.ios.js",
"componentName": "Image",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"image","title":"Image","layout":"autodocs","category":"Components","permalink":"docs/image.html","platform":"cross","next":"keyboardavoidingview","previous":"flatlist","sidebar":true,"path":"Libraries/Image/Image.ios.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+61
View File
@@ -0,0 +1,61 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "ImageEditor",
"docblock": "/**\\n */\\n",
"methods": [
\{
"line": 62,
"source": "static cropImage(\\n uri: string,\\n cropData: ImageCropData,\\n success: (uri: string) => void,\\n failure: (error: Object) => void\\n ) \{\\n RCTImageEditingManager.cropImage(uri, cropData, success, failure);\\n }",
"docblock": "/**\\n * Crop the image specified by the URI param. If URI points to a remote\\n * image, it will be downloaded automatically. If the image cannot be\\n * loaded/downloaded, the failure callback will be called.\\n *\\n * If the cropping process is successful, the resultant cropped image\\n * will be stored in the ImageStore, and the URI returned in the success\\n * callback will point to the image in the store. Remember to delete the\\n * cropped image from the ImageStore when you are done with it.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "uri"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ImageCropData\\",\\"length\\":1}",
"name": "cropData"
},
\{
"typehint": "(uri: string) => void",
"name": "success"
},
\{
"typehint": "(error: Object) => void",
"name": "failure"
}
],
"tparams": null,
"returntypehint": null,
"name": "cropImage"
}
],
"type": "api",
"line": 51,
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/Image/ImageEditor.js",
"componentName": "ImageEditor",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"imageeditor","title":"ImageEditor","layout":"autodocs","category":"APIs","permalink":"docs/imageeditor.html","platform":"cross","next":"imagepickerios","previous":"geolocation","sidebar":true,"path":"Libraries/Image/ImageEditor.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+115
View File
@@ -0,0 +1,115 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 17,
"source": "canRecordVideos: function(callback: Function) \{\\n return RCTImagePicker.canRecordVideos(callback);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "canRecordVideos"
},
\{
"line": 20,
"source": "canUseCamera: function(callback: Function) \{\\n return RCTImagePicker.canUseCamera(callback);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "canUseCamera"
},
\{
"line": 23,
"source": "openCameraDialog: function(config: Object, successCallback: Function, cancelCallback: Function) \{\\n config = \{\\n videoMode: false,\\n ...config,\\n };\\n return RCTImagePicker.openCameraDialog(config, successCallback, cancelCallback);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "Object",
"name": "config"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "successCallback"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "cancelCallback"
}
],
"tparams": null,
"returntypehint": null,
"name": "openCameraDialog"
},
\{
"line": 30,
"source": "openSelectDialog: function(config: Object, successCallback: Function, cancelCallback: Function) \{\\n config = \{\\n showImages: true,\\n showVideos: false,\\n ...config,\\n };\\n return RCTImagePicker.openSelectDialog(config, successCallback, cancelCallback);\\n }",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "Object",
"name": "config"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "successCallback"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "cancelCallback"
}
],
"tparams": null,
"returntypehint": null,
"name": "openSelectDialog"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 16,
"name": "ImagePickerIOS",
"docblock": "/**\\n */\\n",
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/CameraRoll/ImagePickerIOS.js",
"componentName": "ImagePickerIOS",
"componentPlatform": "ios"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"imagepickerios","title":"ImagePickerIOS","layout":"autodocs","category":"APIs","permalink":"docs/imagepickerios.html","platform":"ios","next":"imagestore","previous":"imageeditor","sidebar":true,"path":"Libraries/CameraRoll/ImagePickerIOS.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+120
View File
@@ -0,0 +1,120 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "ImageStore",
"docblock": "/**\\n */\\n",
"methods": [
\{
"line": 21,
"source": "static hasImageForTag(uri: string, callback: (hasImage: bool) => void) \{\\n if (RCTImageStoreManager.hasImageForTag) \{\\n RCTImageStoreManager.hasImageForTag(uri, callback);\\n } else \{\\n console.warn('hasImageForTag() not implemented');\\n }\\n }",
"docblock": "/**\\n * Check if the ImageStore contains image data for the specified URI.\\n * @platform ios\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "uri"
},
\{
"typehint": "(hasImage: bool) => void",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "hasImageForTag"
},
\{
"line": 37,
"source": "static removeImageForTag(uri: string) \{\\n if (RCTImageStoreManager.removeImageForTag) \{\\n RCTImageStoreManager.removeImageForTag(uri);\\n } else \{\\n console.warn('removeImageForTag() not implemented');\\n }\\n }",
"docblock": "/**\\n * Delete an image from the ImageStore. Images are stored in memory and\\n * must be manually removed when you are finished with them, otherwise they\\n * will continue to use up RAM until the app is terminated. It is safe to\\n * call \`removeImageForTag()\` without first calling \`hasImageForTag()\`, it\\n * will simply fail silently.\\n * @platform ios\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "uri"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeImageForTag"
},
\{
"line": 56,
"source": "static addImageFromBase64(\\n base64ImageData: string,\\n success: (uri: string) => void,\\n failure: (error: any) => void\\n ) \{\\n RCTImageStoreManager.addImageFromBase64(base64ImageData, success, failure);\\n }",
"docblock": "/**\\n * Stores a base64-encoded image in the ImageStore, and returns a URI that\\n * can be used to access or display the image later. Images are stored in\\n * memory only, and must be manually deleted when you are finished with\\n * them by calling \`removeImageForTag()\`.\\n *\\n * Note that it is very inefficient to transfer large quantities of binary\\n * data between JS and native code, so you should avoid calling this more\\n * than necessary.\\n * @platform ios\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "base64ImageData"
},
\{
"typehint": "(uri: string) => void",
"name": "success"
},
\{
"typehint": "(error: any) => void",
"name": "failure"
}
],
"tparams": null,
"returntypehint": null,
"name": "addImageFromBase64"
},
\{
"line": 75,
"source": "static getBase64ForTag(\\n uri: string,\\n success: (base64ImageData: string) => void,\\n failure: (error: any) => void\\n ) \{\\n RCTImageStoreManager.getBase64ForTag(uri, success, failure);\\n }",
"docblock": "/**\\n * Retrieves the base64-encoded data for an image in the ImageStore. If the\\n * specified URI does not match an image in the store, the failure callback\\n * will be called.\\n *\\n * Note that it is very inefficient to transfer large quantities of binary\\n * data between JS and native code, so you should avoid calling this more\\n * than necessary. To display an image in the ImageStore, you can just pass\\n * the URI to an \`<Image/>\` component; there is no need to retrieve the\\n * base64 data.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "uri"
},
\{
"typehint": "(base64ImageData: string) => void",
"name": "success"
},
\{
"typehint": "(error: any) => void",
"name": "failure"
}
],
"tparams": null,
"returntypehint": null,
"name": "getBase64ForTag"
}
],
"type": "api",
"line": 16,
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/Image/ImageStore.js",
"componentName": "ImageStore",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"imagestore","title":"ImageStore","layout":"autodocs","category":"APIs","permalink":"docs/imagestore.html","platform":"cross","next":"interactionmanager","previous":"imagepickerios","sidebar":true,"path":"Libraries/Image/ImageStore.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+147
View File
@@ -0,0 +1,147 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"type": "style",
"filepath": "Libraries/Image/ImageStylePropTypes.js",
"componentName": "ImageStylePropTypes",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"imagestyleproptypes","title":"ImageStylePropTypes","layout":"autodocs","category":"APIs","permalink":"docs/imagestyleproptypes.html","platform":"cross","next":null,"previous":"textstyleproptypes","sidebar":true,"path":"Libraries/Image/ImageStylePropTypes.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+141
View File
@@ -0,0 +1,141 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 90,
"source": "runAfterInteractions(task: ?Task): \{then: Function, done: Function, cancel: Function} \{\\n const tasks = [];\\n const promise = new Promise(resolve => \{\\n _scheduleUpdate();\\n if (task) \{\\n tasks.push(task);\\n }\\n tasks.push(\{run: resolve, name: 'resolve ' + (task && task.name || '?')});\\n _taskQueue.enqueueTasks(tasks);\\n });\\n return \{\\n then: promise.then.bind(promise),\\n done: (...args) => \{\\n if (promise.done) \{\\n return promise.done(...args);\\n } else \{\\n console.warn('Tried to call done when not supported by current Promise implementation.');\\n }\\n },\\n cancel: function() \{\\n _taskQueue.cancelTasks(tasks);\\n },\\n };\\n }",
"docblock": "/**\\n * Schedule a function to run after all interactions have completed. Returns a cancellable\\n * \\"promise\\".\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Task\\",\\"length\\":2,\\"nullable\\":true}",
"name": "task"
}
],
"tparams": null,
"returntypehint": "\{then: Function, done: Function, cancel: Function}",
"name": "runAfterInteractions"
},
\{
"line": 118,
"source": "createInteractionHandle(): Handle \{\\n DEBUG && infoLog('create interaction handle');\\n _scheduleUpdate();\\n var handle = ++_inc;\\n _addInteractionSet.add(handle);\\n return handle;\\n }",
"docblock": "/**\\n * Notify manager that an interaction has started.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Handle\\",\\"length\\":1}",
"name": "createInteractionHandle"
},
\{
"line": 129,
"source": "clearInteractionHandle(handle: Handle) \{\\n DEBUG && infoLog('clear interaction handle');\\n invariant(\\n !!handle,\\n 'Must provide a handle to clear.'\\n );\\n _scheduleUpdate();\\n _addInteractionSet.delete(handle);\\n _deleteInteractionSet.add(handle);\\n }",
"docblock": "/**\\n * Notify manager that an interaction has completed.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Handle\\",\\"length\\":1}",
"name": "handle"
}
],
"tparams": null,
"returntypehint": null,
"name": "clearInteractionHandle"
},
\{
"line": 147,
"source": "setDeadline(deadline: number) \{\\n _deadline = deadline;\\n }",
"docblock": "/**\\n * A positive number will use setTimeout to schedule any tasks after the\\n * eventLoopRunningTime hits the deadline value, otherwise all tasks will be\\n * executed in one setImmediate batch (default).\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "deadline"
}
],
"tparams": null,
"returntypehint": null,
"name": "setDeadline"
}
],
"properties": [
\{
"name": "Events",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "Events: keyMirror(\{\\n interactionStart: true,\\n interactionComplete: true,\\n })",
"modifiers": [
"static"
],
"propertySource": "keyMirror(\{\\n interactionStart: true,\\n interactionComplete: true,\\n })"
},
\{
"name": "addListener",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "addListener: _emitter.addListener.bind(_emitter)",
"modifiers": [
"static"
],
"propertySource": "_emitter.addListener.bind(_emitter)"
}
],
"classes": [],
"superClass": null,
"type": "api",
"line": 80,
"name": "InteractionManager",
"docblock": "/**\\n * InteractionManager allows long-running work to be scheduled after any\\n * interactions/animations have completed. In particular, this allows JavaScript\\n * animations to run smoothly.\\n *\\n * Applications can schedule tasks to run after interactions with the following:\\n *\\n * \`\`\`\\n * InteractionManager.runAfterInteractions(() => \{\\n * // ...long-running synchronous task...\\n * });\\n * \`\`\`\\n *\\n * Compare this to other scheduling alternatives:\\n *\\n * - requestAnimationFrame(): for code that animates a view over time.\\n * - setImmediate/setTimeout(): run code later, note this may delay animations.\\n * - runAfterInteractions(): run code later, without delaying active animations.\\n *\\n * The touch handling system considers one or more active touches to be an\\n * 'interaction' and will delay \`runAfterInteractions()\` callbacks until all\\n * touches have ended or been cancelled.\\n *\\n * InteractionManager also allows applications to register animations by\\n * creating an interaction 'handle' on animation start, and clearing it upon\\n * completion:\\n *\\n * \`\`\`\\n * var handle = InteractionManager.createInteractionHandle();\\n * // run animation... (\`runAfterInteractions\` tasks are queued)\\n * // later, on animation completion:\\n * InteractionManager.clearInteractionHandle(handle);\\n * // queued tasks run if all handles were cleared\\n * \`\`\`\\n *\\n * \`runAfterInteractions\` takes either a plain callback function, or a\\n * \`PromiseTask\` object with a \`gen\` method that returns a \`Promise\`. If a\\n * \`PromiseTask\` is supplied, then it is fully resolved (including asynchronous\\n * dependencies that also schedule more tasks via \`runAfterInteractions\`) before\\n * starting on the next task that might have been queued up synchronously\\n * earlier.\\n *\\n * By default, queued tasks are executed together in a loop in one\\n * \`setImmediate\` batch. If \`setDeadline\` is called with a positive number, then\\n * tasks will only be executed until the deadline (in terms of js event loop run\\n * time) approaches, at which point execution will yield via setTimeout,\\n * allowing events such as touches to start interactions and block queued tasks\\n * from executing, making apps more responsive.\\n */\\n",
"requires": [
\{
"name": "BatchedBridge"
},
\{
"name": "EventEmitter"
},
\{
"name": "Set"
},
\{
"name": "TaskQueue"
},
\{
"name": "infoLog"
},
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "fbjs/lib/keyMirror"
}
],
"filepath": "Libraries/Interaction/InteractionManager.js",
"componentName": "InteractionManager",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"interactionmanager","title":"InteractionManager","layout":"autodocs","category":"APIs","permalink":"docs/interactionmanager.html","platform":"cross","next":"keyboard","previous":"imagestore","sidebar":true,"path":"Libraries/Interaction/InteractionManager.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+115
View File
@@ -0,0 +1,115 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 109,
"source": "addListener(eventName: KeyboardEventName, callback: KeyboardEventListener) \{\\n invariant(false, 'Dummy method used for documentation');\\n }",
"docblock": "/**\\n * The \`addListener\` function connects a JavaScript function to an identified native\\n * keyboard notification event.\\n *\\n * This function then returns the reference to the listener.\\n *\\n * @param \{string} eventName The \`nativeEvent\` is the string that identifies the event you're listening for. This\\n *can be any of the following:\\n *\\n * - \`keyboardWillShow\`\\n * - \`keyboardDidShow\`\\n * - \`keyboardWillHide\`\\n * - \`keyboardDidHide\`\\n * - \`keyboardWillChangeFrame\`\\n * - \`keyboardDidChangeFrame\`\\n *\\n * Note that if you set \`android:windowSoftInputMode\` to \`adjustResize\` or \`adjustNothing\`,\\n * only \`keyboardDidShow\` and \`keyboardDidHide\` events will be available on Android.\\n * \`keyboardWillShow\` as well as \`keyboardWillHide\` are generally not available on Android\\n * since there is no native corresponding event.\\n *\\n * @param \{function} callback function to be called when the event fires.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"KeyboardEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"KeyboardEventListener\\",\\"length\\":1}",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "addListener"
},
\{
"line": 119,
"source": "removeListener(eventName: KeyboardEventName, callback: Function) \{\\n invariant(false, 'Dummy method used for documentation');\\n }",
"docblock": "/**\\n * Removes a specific listener.\\n *\\n * @param \{string} eventName The \`nativeEvent\` is the string that identifies the event you're listening for.\\n * @param \{function} callback function to be called when the event fires.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"KeyboardEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "callback"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeListener"
},
\{
"line": 128,
"source": "removeAllListeners(eventName: KeyboardEventName) \{\\n invariant(false, 'Dummy method used for documentation');\\n }",
"docblock": "/**\\n * Removes all listeners for a specific event type.\\n *\\n * @param \{string} eventType The native event string listeners are watching which will be removed.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"KeyboardEventName\\",\\"length\\":1}",
"name": "eventName"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeAllListeners"
},
\{
"line": 135,
"source": "dismiss() \{\\n invariant(false, 'Dummy method used for documentation');\\n }",
"docblock": "/**\\n * Dismisses the active keyboard and removes focus.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "dismiss"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 85,
"name": "Keyboard",
"docblock": "/**\\n * \`Keyboard\` module to control keyboard events.\\n *\\n * ### Usage\\n *\\n * The Keyboard module allows you to listen for native events and react to them, as\\n * well as make changes to the keyboard, like dismissing it.\\n *\\n *\`\`\`\\n * import React, \{ Component } from 'react';\\n * import \{ Keyboard, TextInput } from 'react-native';\\n *\\n * class Example extends Component \{\\n * componentWillMount () \{\\n * this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);\\n * this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);\\n * }\\n *\\n * componentWillUnmount () \{\\n * this.keyboardDidShowListener.remove();\\n * this.keyboardDidHideListener.remove();\\n * }\\n *\\n * _keyboardDidShow () \{\\n * alert('Keyboard Shown');\\n * }\\n *\\n * _keyboardDidHide () \{\\n * alert('Keyboard Hidden');\\n * }\\n *\\n * render() \{\\n * return (\\n * <TextInput\\n * onSubmitEditing=\{Keyboard.dismiss}\\n * />\\n * );\\n * }\\n * }\\n *\`\`\`\\n */\\n",
"requires": [
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "NativeEventEmitter"
},
\{
"name": "NativeModules"
},
\{
"name": "dismissKeyboard"
}
],
"filepath": "Libraries/Components/Keyboard/Keyboard.js",
"componentName": "Keyboard",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"keyboard","title":"Keyboard","layout":"autodocs","category":"APIs","permalink":"docs/keyboard.html","platform":"cross","next":"layoutanimation","previous":"interactionmanager","sidebar":true,"path":"Libraries/Components/Keyboard/Keyboard.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+753
View File
@@ -0,0 +1,753 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "It is a component to solve the common problem of views that need to move out of the way of the virtual keyboard.\\nIt can automatically adjust either its position or bottom padding based on the position of the keyboard.",
"displayName": "KeyboardAvoidingView",
"methods": [
\{
"name": "relativeKeyboardHeight",
"docblock": null,
"modifiers": [],
"params": [
\{
"name": "keyboardFrame",
"type": \{
"names": [
"object"
]
}
}
],
"returns": \{
"type": [
null
]
}
},
\{
"name": "onKeyboardChange",
"docblock": null,
"modifiers": [],
"params": [
\{
"name": "event",
"type": \{
"names": [
"object"
]
}
}
],
"returns": null
},
\{
"name": "onLayout",
"docblock": null,
"modifiers": [],
"params": [
\{
"name": "event",
"type": \{
"names": [
"ViewLayoutEvent"
]
}
}
],
"returns": null
}
],
"props": \{
"behavior": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'height'",
"computed": false
},
\{
"value": "'position'",
"computed": false
},
\{
"value": "'padding'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"contentContainerStyle": \{
"type": \{
"name": "custom",
"raw": "ViewPropTypes.style"
},
"required": false,
"description": "The style of the content container(View) when behavior is 'position'."
},
"keyboardVerticalOffset": \{
"type": \{
"name": "number"
},
"required": true,
"description": "This is the distance between the top of the user screen and the react native view,\\nmay be non-zero in some use cases.",
"defaultValue": \{
"value": "0",
"computed": false
}
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/Keyboard/KeyboardAvoidingView.js",
"componentName": "KeyboardAvoidingView",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"keyboardavoidingview","title":"KeyboardAvoidingView","layout":"autodocs","category":"Components","permalink":"docs/keyboardavoidingview.html","platform":"cross","next":"listview","previous":"image","sidebar":true,"path":"Libraries/Components/Keyboard/KeyboardAvoidingView.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+711
View File
@@ -0,0 +1,711 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"props": \{
"display": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'none'",
"computed": false
},
\{
"value": "'flex'",
"computed": false
}
]
},
"required": false,
"description": "\`display\` sets the display type of this component.\\n\\n It works similarly to \`display\` in CSS, but only support 'flex' and 'none'.\\n 'flex' is the default."
},
"width": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`width\` sets the width of this component.\\n\\n It works similarly to \`width\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/width for more details."
},
"height": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`height\` sets the height of this component.\\n\\n It works similarly to \`height\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/height for more details."
},
"top": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`top\` is the number of logical pixels to offset the top edge of\\n this component.\\n\\n It works similarly to \`top\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/top\\n for more details of how \`top\` affects layout."
},
"left": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`left\` is the number of logical pixels to offset the left edge of\\n this component.\\n\\n It works similarly to \`left\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/left\\n for more details of how \`left\` affects layout."
},
"right": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`right\` is the number of logical pixels to offset the right edge of\\n this component.\\n\\n It works similarly to \`right\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/right\\n for more details of how \`right\` affects layout."
},
"bottom": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`bottom\` is the number of logical pixels to offset the bottom edge of\\n this component.\\n\\n It works similarly to \`bottom\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/bottom\\n for more details of how \`bottom\` affects layout."
},
"minWidth": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`minWidth\` is the minimum width for this component, in logical pixels.\\n\\n It works similarly to \`min-width\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/min-width\\n for more details."
},
"maxWidth": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`maxWidth\` is the maximum width for this component, in logical pixels.\\n\\n It works similarly to \`max-width\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/max-width\\n for more details."
},
"minHeight": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`minHeight\` is the minimum height for this component, in logical pixels.\\n\\n It works similarly to \`min-height\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/min-height\\n for more details."
},
"maxHeight": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`maxHeight\` is the maximum height for this component, in logical pixels.\\n\\n It works similarly to \`max-height\` in CSS, but in React Native you\\n must use points or percentages. Ems and other units are not supported.\\n\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/max-height\\n for more details."
},
"margin": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`margin\` has the same effect as setting each of\\n \`marginTop\`, \`marginLeft\`, \`marginBottom\`, and \`marginRight\`.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/margin\\n for more details."
},
"marginVertical": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`marginVertical\` has the same effect as setting both\\n \`marginTop\` and \`marginBottom\`."
},
"marginHorizontal": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`marginHorizontal\` has the same effect as setting\\n both \`marginLeft\` and \`marginRight\`."
},
"marginTop": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`marginTop\` works like \`margin-top\` in CSS.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-top\\n for more details."
},
"marginBottom": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`marginBottom\` works like \`margin-bottom\` in CSS.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-bottom\\n for more details."
},
"marginLeft": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`marginLeft\` works like \`margin-left\` in CSS.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-left\\n for more details."
},
"marginRight": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`marginRight\` works like \`margin-right\` in CSS.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/margin-right\\n for more details."
},
"padding": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`padding\` has the same effect as setting each of\\n \`paddingTop\`, \`paddingBottom\`, \`paddingLeft\`, and \`paddingRight\`.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/padding\\n for more details."
},
"paddingVertical": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`paddingVertical\` is like setting both of\\n \`paddingTop\` and \`paddingBottom\`."
},
"paddingHorizontal": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "Setting \`paddingHorizontal\` is like setting both of\\n \`paddingLeft\` and \`paddingRight\`."
},
"paddingTop": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`paddingTop\` works like \`padding-top\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/padding-top\\nfor more details."
},
"paddingBottom": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`paddingBottom\` works like \`padding-bottom\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/padding-bottom\\nfor more details."
},
"paddingLeft": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`paddingLeft\` works like \`padding-left\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/padding-left\\nfor more details."
},
"paddingRight": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": "\`paddingRight\` works like \`padding-right\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/padding-right\\nfor more details."
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`borderWidth\` works like \`border-width\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/border-width\\nfor more details."
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`borderTopWidth\` works like \`border-top-width\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-width\\nfor more details."
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`borderRightWidth\` works like \`border-right-width\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/border-right-width\\nfor more details."
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`borderBottomWidth\` works like \`border-bottom-width\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-width\\nfor more details."
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`borderLeftWidth\` works like \`border-left-width\` in CSS.\\nSee https://developer.mozilla.org/en-US/docs/Web/CSS/border-left-width\\nfor more details."
},
"position": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'absolute'",
"computed": false
},
\{
"value": "'relative'",
"computed": false
}
]
},
"required": false,
"description": "\`position\` in React Native is similar to regular CSS, but\\n everything is set to \`relative\` by default, so \`absolute\`\\n positioning is always just relative to the parent.\\n\\n If you want to position a child using specific numbers of logical\\n pixels relative to its parent, set the child to have \`absolute\`\\n position.\\n\\n If you want to position a child relative to something\\n that is not its parent, just don't use styles for that. Use the\\n component tree.\\n\\n See https://github.com/facebook/yoga\\n for more details on how \`position\` differs between React Native\\n and CSS."
},
"flexDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'row'",
"computed": false
},
\{
"value": "'row-reverse'",
"computed": false
},
\{
"value": "'column'",
"computed": false
},
\{
"value": "'column-reverse'",
"computed": false
}
]
},
"required": false,
"description": "\`flexDirection\` controls which directions children of a container go.\\n \`row\` goes left to right, \`column\` goes top to bottom, and you may\\n be able to guess what the other two do. It works like \`flex-direction\`\\n in CSS, except the default is \`column\`.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-direction\\n for more details."
},
"flexWrap": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'wrap'",
"computed": false
},
\{
"value": "'nowrap'",
"computed": false
}
]
},
"required": false,
"description": "\`flexWrap\` controls whether children can wrap around after they\\n hit the end of a flex container.\\n It works like \`flex-wrap\` in CSS (default: nowrap).\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/flex-wrap\\n for more details."
},
"justifyContent": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'flex-start'",
"computed": false
},
\{
"value": "'flex-end'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'space-between'",
"computed": false
},
\{
"value": "'space-around'",
"computed": false
}
]
},
"required": false,
"description": "\`justifyContent\` aligns children in the main direction.\\n For example, if children are flowing vertically, \`justifyContent\`\\n controls how they align vertically.\\n It works like \`justify-content\` in CSS (default: flex-start).\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/justify-content\\n for more details."
},
"alignItems": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'flex-start'",
"computed": false
},
\{
"value": "'flex-end'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'stretch'",
"computed": false
},
\{
"value": "'baseline'",
"computed": false
}
]
},
"required": false,
"description": "\`alignItems\` aligns children in the cross direction.\\n For example, if children are flowing vertically, \`alignItems\`\\n controls how they align horizontally.\\n It works like \`align-items\` in CSS (default: stretch).\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/align-items\\n for more details."
},
"alignSelf": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'auto'",
"computed": false
},
\{
"value": "'flex-start'",
"computed": false
},
\{
"value": "'flex-end'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'stretch'",
"computed": false
},
\{
"value": "'baseline'",
"computed": false
}
]
},
"required": false,
"description": "\`alignSelf\` controls how a child aligns in the cross direction,\\n overriding the \`alignItems\` of the parent. It works like \`align-self\`\\n in CSS (default: auto).\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/align-self\\n for more details."
},
"alignContent": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'flex-start'",
"computed": false
},
\{
"value": "'flex-end'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'stretch'",
"computed": false
},
\{
"value": "'space-between'",
"computed": false
},
\{
"value": "'space-around'",
"computed": false
}
]
},
"required": false,
"description": "\`alignContent\` controls how rows align in the cross direction,\\n overriding the \`alignContent\` of the parent.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/align-content\\n for more details."
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
},
\{
"value": "'scroll'",
"computed": false
}
]
},
"required": false,
"description": "\`overflow\` controls how a children are measured and displayed.\\n \`overflow: hidden\` causes views to be clipped while \`overflow: scroll\`\\n causes views to be measured independently of their parents main axis.\\n It works like \`overflow\` in CSS (default: visible).\\n See https://developer.mozilla.org/en/docs/Web/CSS/overflow\\n for more details.\\n \`overflow: visible\` only works on iOS. On Android, all views will clip\\n their children."
},
"flex": \{
"type": \{
"name": "number"
},
"required": false,
"description": "In React Native \`flex\` does not work the same way that it does in CSS.\\n \`flex\` is a number rather than a string, and it works\\n according to the \`Yoga\` library\\n at https://github.com/facebook/yoga\\n\\n When \`flex\` is a positive number, it makes the component flexible\\n and it will be sized proportional to its flex value. So a\\n component with \`flex\` set to 2 will take twice the space as a\\n component with \`flex\` set to 1.\\n\\n When \`flex\` is 0, the component is sized according to \`width\`\\n and \`height\` and it is inflexible.\\n\\n When \`flex\` is -1, the component is normally sized according\\n \`width\` and \`height\`. However, if there's not enough space,\\n the component will shrink to its \`minWidth\` and \`minHeight\`.\\n\\nflexGrow, flexShrink, and flexBasis work the same as in CSS."
},
"flexGrow": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"flexShrink": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"flexBasis": \{
"type": \{
"name": "union",
"value": [
\{
"name": "number"
},
\{
"name": "string"
}
]
},
"required": false,
"description": ""
},
"aspectRatio": \{
"type": \{
"name": "number"
},
"required": false,
"description": "Aspect ratio control the size of the undefined dimension of a node. Aspect ratio is a\\nnon-standard property only available in react native and not CSS.\\n\\n- On a node with a set width/height aspect ratio control the size of the unset dimension\\n- On a node with a set flex basis aspect ratio controls the size of the node in the cross axis\\n if unset\\n- On a node with a measure function aspect ratio works as though the measure function measures\\n the flex basis\\n- On a node with flex grow/shrink aspect ratio controls the size of the node in the cross axis\\n if unset\\n- Aspect ratio takes min/max dimensions into account"
},
"zIndex": \{
"type": \{
"name": "number"
},
"required": false,
"description": "\`zIndex\` controls which components display on top of others.\\n Normally, you don't use \`zIndex\`. Components render according to\\n their order in the document tree, so later components draw over\\n earlier ones. \`zIndex\` may be useful if you have animations or custom\\n modal interfaces where you don't want this behavior.\\n\\n It works like the CSS \`z-index\` property - components with a larger\\n \`zIndex\` will render on top. Think of the z-direction like it's\\n pointing from the phone into your eyeball.\\n See https://developer.mozilla.org/en-US/docs/Web/CSS/z-index for\\n more details."
},
"direction": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'inherit'",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "\`direction\` specifies the directional flow of the user interface.\\n The default is \`inherit\`, except for root node which will have\\n value based on the current locale.\\n See https://facebook.github.io/yoga/docs/rtl/\\n for more details.\\n @platform ios"
}
},
"type": "style",
"filepath": "Libraries/StyleSheet/LayoutPropTypes.js",
"componentName": "Layout Props",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"layout-props","title":"Layout Props","layout":"autodocs","category":"APIs","permalink":"docs/layout-props.html","platform":"cross","next":"shadow-props","previous":"vibrationios","sidebar":true,"path":"Libraries/StyleSheet/LayoutPropTypes.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+184
View File
@@ -0,0 +1,184 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 152,
"source": "function configureNext(config: Config, onAnimationDidEnd?: Function) \{\\n if (__DEV__) \{\\n checkConfig(config, 'config', 'LayoutAnimation.configureNext');\\n }\\n UIManager.configureNextLayoutAnimation(\\n config,\\n onAnimationDidEnd || function() \{},\\n function() \{\\n /* unused */\\n },\\n );\\n}",
"docblock": "/**\\n * Schedules an animation to happen on the next layout.\\n *\\n * @param config Specifies animation properties:\\n *\\n * - \`duration\` in milliseconds\\n * - \`create\`, config for animating in new views (see \`Anim\` type)\\n * - \`update\`, config for animating views that have been updated\\n * (see \`Anim\` type)\\n *\\n * @param onAnimationDidEnd Called when the animation finished.\\n * Only supported on iOS.\\n * @param onError Called on error. Only supported on iOS.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Config\\",\\"length\\":1}",
"name": "config"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "onAnimationDidEnd?"
}
],
"tparams": null,
"returntypehint": null,
"name": "configureNext"
},
\{
"line": 156,
"source": "function create(duration: number, type, creationProp): Config \{\\n return \{\\n duration,\\n create: \{\\n type,\\n property: creationProp,\\n },\\n update: \{\\n type,\\n },\\n delete: \{\\n type,\\n property: creationProp,\\n },\\n };\\n}",
"docblock": "/**\\n * Helper for creating a config for \`configureNext\`.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "duration"
},
\{
"typehint": null,
"name": "type"
},
\{
"typehint": null,
"name": "creationProp"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Config\\",\\"length\\":1}",
"name": "create"
},
\{
"line": 159,
"source": "function checkConfig(config: Config, location: string, name: string) \{\\n checkPropTypes(\{config: configType}, \{config}, location, name);\\n}",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Config\\",\\"length\\":1}",
"name": "config"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "location"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "name"
}
],
"tparams": null,
"returntypehint": null,
"name": "checkConfig"
}
],
"properties": [
\{
"name": "Types",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "Types",
"modifiers": [
"static"
],
"propertySource": "keyMirror(TypesEnum)"
},
\{
"name": "Properties",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "Properties",
"modifiers": [
"static"
],
"propertySource": "keyMirror(PropertiesEnum)"
},
\{
"name": "Presets",
"type": \{
"name": "ObjectExpression"
},
"docblock": "",
"source": "Presets",
"modifiers": [
"static"
],
"propertySource": "\{\\n easeInEaseOut: create(300, Types.easeInEaseOut, Properties.opacity),\\n linear: create(500, Types.linear, Properties.opacity),\\n spring: \{\\n duration: 700,\\n create: \{\\n type: Types.linear,\\n property: Properties.opacity,\\n },\\n update: \{\\n type: Types.spring,\\n springDamping: 0.4,\\n },\\n delete: \{\\n type: Types.linear,\\n property: Properties.opacity,\\n },\\n },\\n}"
},
\{
"name": "easeInEaseOut",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "easeInEaseOut: configureNext.bind(null, Presets.easeInEaseOut)",
"modifiers": [
"static"
],
"propertySource": "configureNext.bind(null, Presets.easeInEaseOut)"
},
\{
"name": "linear",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "linear: configureNext.bind(null, Presets.linear)",
"modifiers": [
"static"
],
"propertySource": "configureNext.bind(null, Presets.linear)"
},
\{
"name": "spring",
"type": \{
"name": "CallExpression"
},
"docblock": "",
"source": "spring: configureNext.bind(null, Presets.spring)",
"modifiers": [
"static"
],
"propertySource": "configureNext.bind(null, Presets.spring)"
}
],
"classes": [],
"superClass": null,
"type": "api",
"line": 137,
"name": "LayoutAnimation",
"docblock": "/**\\n * Automatically animates views to their new positions when the\\n * next layout happens.\\n *\\n * A common way to use this API is to call it before calling \`setState\`.\\n *\\n * Note that in order to get this to work on **Android** you need to set the following flags via \`UIManager\`:\\n *\\n * UIManager.setLayoutAnimationEnabledExperimental && UIManager.setLayoutAnimationEnabledExperimental(true);\\n */\\n",
"requires": [
\{
"name": "prop-types"
},
\{
"name": "UIManager"
},
\{
"name": "fbjs/lib/keyMirror"
}
],
"filepath": "Libraries/LayoutAnimation/LayoutAnimation.js",
"componentName": "LayoutAnimation",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"layoutanimation","title":"LayoutAnimation","layout":"autodocs","category":"APIs","permalink":"docs/layoutanimation.html","platform":"cross","next":"linking","previous":"keyboard","sidebar":true,"path":"Libraries/LayoutAnimation/LayoutAnimation.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+129
View File
@@ -0,0 +1,129 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "Linking",
"docblock": "/**\\n * <div class=\\"banner-crna-ejected\\">\\n * <h3>Projects with Native Code Only</h3>\\n * <p>\\n * This section only applies to projects made with <code>react-native init</code>\\n * or to those made with Create React Native App which have since ejected. For\\n * more information about ejecting, please see\\n * the <a href=\\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\\" target=\\"_blank\\">guide</a> on\\n * the Create React Native App repository.\\n * </p>\\n * </div>\\n *\\n * \`Linking\` gives you a general interface to interact with both incoming\\n * and outgoing app links.\\n *\\n * ### Basic Usage\\n *\\n * #### Handling deep links\\n *\\n * If your app was launched from an external url registered to your app you can\\n * access and handle it from any component you want with\\n *\\n * \`\`\`\\n * componentDidMount() \{\\n * Linking.getInitialURL().then((url) => \{\\n * if (url) \{\\n * console.log('Initial url is: ' + url);\\n * }\\n * }).catch(err => console.error('An error occurred', err));\\n * }\\n * \`\`\`\\n *\\n * NOTE: For instructions on how to add support for deep linking on Android,\\n * refer to [Enabling Deep Links for App Content - Add Intent Filters for Your Deep Links](http://developer.android.com/training/app-indexing/deep-linking.html#adding-filters).\\n *\\n * If you wish to receive the intent in an existing instance of MainActivity,\\n * you may set the \`launchMode\` of MainActivity to \`singleTask\` in\\n * \`AndroidManifest.xml\`. See [\`<activity>\`](http://developer.android.com/guide/topics/manifest/activity-element.html)\\n * documentation for more information.\\n *\\n * \`\`\`\\n * <activity\\n * android:name=\\".MainActivity\\"\\n * android:launchMode=\\"singleTask\\">\\n * \`\`\`\\n *\\n * NOTE: On iOS, you'll need to link \`RCTLinking\` to your project by following\\n * the steps described [here](docs/linking-libraries-ios.html#manual-linking).\\n * If you also want to listen to incoming app links during your app's\\n * execution, you'll need to add the following lines to your \`*AppDelegate.m\`:\\n *\\n * \`\`\`\\n * // iOS 9.x or newer\\n * #import <React/RCTLinkingManager.h>\\n *\\n * - (BOOL)application:(UIApplication *)application\\n * openURL:(NSURL *)url\\n * options:(NSDictionary<UIApplicationOpenURLOptionsKey,id> *)options\\n * \{\\n * return [RCTLinkingManager application:app openURL:url options:options];\\n * }\\n * \`\`\`\\n * \\n * If you're targeting iOS 8.x or older, you can use the following code instead:\\n *\\n * \`\`\`\\n * // iOS 8.x or older\\n * #import <React/RCTLinkingManager.h>\\n *\\n * - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url\\n * sourceApplication:(NSString *)sourceApplication annotation:(id)annotation\\n * \{\\n * return [RCTLinkingManager application:application openURL:url\\n * sourceApplication:sourceApplication annotation:annotation];\\n * }\\n * \`\`\`\\n *\\n *\\n * // If your app is using [Universal Links](https://developer.apple.com/library/prerelease/ios/documentation/General/Conceptual/AppSearch/UniversalLinks.html),\\n * you'll need to add the following code as well:\\n *\\n * \`\`\`\\n * - (BOOL)application:(UIApplication *)application continueUserActivity:(NSUserActivity *)userActivity\\n * restorationHandler:(void (^)(NSArray * _Nullable))restorationHandler\\n * \{\\n * return [RCTLinkingManager application:application\\n * continueUserActivity:userActivity\\n * restorationHandler:restorationHandler];\\n * }\\n * \`\`\`\\n *\\n * And then on your React component you'll be able to listen to the events on\\n * \`Linking\` as follows\\n *\\n * \`\`\`\\n * componentDidMount() \{\\n * Linking.addEventListener('url', this._handleOpenURL);\\n * },\\n * componentWillUnmount() \{\\n * Linking.removeEventListener('url', this._handleOpenURL);\\n * },\\n * _handleOpenURL(event) \{\\n * console.log(event.url);\\n * }\\n * \`\`\`\\n * #### Opening external links\\n *\\n * To start the corresponding activity for a link (web URL, email, contact etc.), call\\n *\\n * \`\`\`\\n * Linking.openURL(url).catch(err => console.error('An error occurred', err));\\n * \`\`\`\\n *\\n * If you want to check if any installed app can handle a given URL beforehand you can call\\n * \`\`\`\\n * Linking.canOpenURL(url).then(supported => \{\\n * if (!supported) \{\\n * console.log('Can\\\\'t handle url: ' + url);\\n * } else \{\\n * return Linking.openURL(url);\\n * }\\n * }).catch(err => console.error('An error occurred', err));\\n * \`\`\`\\n */\\n",
"methods": [
\{
"line": 149,
"source": "constructor() \{\\n super(LinkingManager);\\n }",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "constructor"
},
\{
"line": 157,
"source": "addEventListener(type: string, handler: Function) \{\\n this.addListener(type, handler);\\n }",
"docblock": "/**\\n * Add a handler to Linking changes by listening to the \`url\` event type\\n * and providing the handler\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "addEventListener"
},
\{
"line": 164,
"source": "removeEventListener(type: string, handler: Function ) \{\\n this.removeListener(type, handler);\\n }",
"docblock": "/**\\n * Remove a handler by passing the \`url\` event type and the handler\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "type"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": null,
"name": "removeEventListener"
},
\{
"line": 184,
"source": "openURL(url: string): Promise<any> \{\\n this._validateURL(url);\\n return LinkingManager.openURL(url);\\n }",
"docblock": "/**\\n * Try to open the given \`url\` with any of the installed apps.\\n *\\n * You can use other URLs, like a location (e.g. \\"geo:37.484847,-122.148386\\" on Android\\n * or \\"http://maps.apple.com/?ll=37.484847,-122.148386\\" on iOS), a contact,\\n * or any other URL that can be opened with the installed apps.\\n *\\n * The method returns a \`Promise\` object. If the user confirms the open dialog or the\\n * url automatically opens, the promise is resolved. If the user cancels the open dialog\\n * or there are no registered applications for the url, the promise is rejected.\\n *\\n * NOTE: This method will fail if the system doesn't know how to open the specified URL.\\n * If you're passing in a non-http(s) URL, it's best to check \{@code canOpenURL} first.\\n *\\n * NOTE: For web URLs, the protocol (\\"http://\\", \\"https://\\") must be set accordingly!\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "url"
}
],
"tparams": null,
"returntypehint": "Promise<any>",
"name": "openURL"
},
\{
"line": 199,
"source": "canOpenURL(url: string): Promise<boolean> \{\\n this._validateURL(url);\\n return LinkingManager.canOpenURL(url);\\n }",
"docblock": "/**\\n * Determine whether or not an installed app can handle a given URL.\\n *\\n * NOTE: For web URLs, the protocol (\\"http://\\", \\"https://\\") must be set accordingly!\\n *\\n * NOTE: As of iOS 9, your app needs to provide the \`LSApplicationQueriesSchemes\` key\\n * inside \`Info.plist\` or canOpenURL will always return false.\\n *\\n * @param URL the URL to open\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "url"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}],\\"length\\":4}",
"name": "canOpenURL"
},
\{
"line": 210,
"source": "getInitialURL(): Promise<?string> \{\\n return LinkingManager.getInitialURL();\\n }",
"docblock": "/**\\n * If the app launch was triggered by an app link,\\n * it will give the link url, otherwise it will give \`null\`\\n *\\n * NOTE: To support deep linking on Android, refer http://developer.android.com/training/app-indexing/deep-linking.html#handling-intents\\n */\\n",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":2,\\"nullable\\":true}],\\"length\\":5}",
"name": "getInitialURL"
}
],
"superClass": "NativeEventEmitter",
"type": "api",
"line": 147,
"requires": [
\{
"name": "NativeEventEmitter"
},
\{
"name": "NativeModules"
},
\{
"name": "Platform"
},
\{
"name": "fbjs/lib/invariant"
}
],
"filepath": "Libraries/Linking/Linking.js",
"componentName": "Linking",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"linking","title":"Linking","layout":"autodocs","category":"APIs","permalink":"docs/linking.html","platform":"cross","next":"netinfo","previous":"layoutanimation","sidebar":true,"path":"Libraries/Linking/Linking.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+863
View File
@@ -0,0 +1,863 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "DEPRECATED - use one of the new list components, such as [\`FlatList\`](docs/flatlist.html)\\nor [\`SectionList\`](docs/sectionlist.html) for bounded memory use, fewer bugs,\\nbetter performance, an easier to use API, and more features. Check out this\\n[blog post](https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html)\\nfor more details.\\n\\nListView - A core component designed for efficient display of vertically\\nscrolling lists of changing data. The minimal API is to create a\\n[\`ListView.DataSource\`](docs/listviewdatasource.html), populate it with a simple\\narray of data blobs, and instantiate a \`ListView\` component with that data\\nsource and a \`renderRow\` callback which takes a blob from the data array and\\nreturns a renderable component.\\n\\nMinimal example:\\n\\n\`\`\`\\nclass MyComponent extends Component \{\\n constructor() \{\\n super();\\n const ds = new ListView.DataSource(\{rowHasChanged: (r1, r2) => r1 !== r2});\\n this.state = \{\\n dataSource: ds.cloneWithRows(['row 1', 'row 2']),\\n };\\n }\\n\\n render() \{\\n return (\\n <ListView\\n dataSource=\{this.state.dataSource}\\n renderRow=\{(rowData) => <Text>\{rowData}</Text>}\\n />\\n );\\n }\\n}\\n\`\`\`\\n\\nListView also supports more advanced features, including sections with sticky\\nsection headers, header and footer support, callbacks on reaching the end of\\nthe available data (\`onEndReached\`) and on the set of rows that are visible\\nin the device viewport change (\`onChangeVisibleRows\`), and several\\nperformance optimizations.\\n\\nThere are a few performance operations designed to make ListView scroll\\nsmoothly while dynamically loading potentially very large (or conceptually\\ninfinite) data sets:\\n\\n * Only re-render changed rows - the rowHasChanged function provided to the\\n data source tells the ListView if it needs to re-render a row because the\\n source data has changed - see ListViewDataSource for more details.\\n\\n * Rate-limited row rendering - By default, only one row is rendered per\\n event-loop (customizable with the \`pageSize\` prop). This breaks up the\\n work into smaller chunks to reduce the chance of dropping frames while\\n rendering rows.",
"displayName": "ListView",
"methods": [
\{
"name": "getMetrics",
"docblock": "Exports some data, e.g. for perf investigations or analytics.",
"modifiers": [],
"params": [],
"returns": null,
"description": "Exports some data, e.g. for perf investigations or analytics."
},
\{
"name": "scrollTo",
"docblock": "Scrolls to a given x, y offset, either immediately or with a smooth animation.\\n\\nSee \`ScrollView#scrollTo\`.",
"modifiers": [],
"params": [
\{
"name": "...args",
"type": \{
"names": [
"Array"
]
}
}
],
"returns": null,
"description": "Scrolls to a given x, y offset, either immediately or with a smooth animation.\\n\\nSee \`ScrollView#scrollTo\`."
},
\{
"name": "scrollToEnd",
"docblock": "If this is a vertical ListView scrolls to the bottom.\\nIf this is a horizontal ListView scrolls to the right.\\n\\nUse \`scrollToEnd(\{animated: true})\` for smooth animated scrolling,\\n\`scrollToEnd(\{animated: false})\` for immediate scrolling.\\nIf no options are passed, \`animated\` defaults to true.\\n\\nSee \`ScrollView#scrollToEnd\`.",
"modifiers": [],
"params": [
\{
"name": "options",
"optional": true,
"type": \{
"names": [
"object"
]
}
}
],
"returns": null,
"description": "If this is a vertical ListView scrolls to the bottom.\\nIf this is a horizontal ListView scrolls to the right.\\n\\nUse \`scrollToEnd(\{animated: true})\` for smooth animated scrolling,\\n\`scrollToEnd(\{animated: false})\` for immediate scrolling.\\nIf no options are passed, \`animated\` defaults to true.\\n\\nSee \`ScrollView#scrollToEnd\`."
},
\{
"name": "flashScrollIndicators",
"docblock": "Displays the scroll indicators momentarily.\\n\\n@platform ios",
"modifiers": [],
"params": [],
"returns": null,
"description": "Displays the scroll indicators momentarily."
}
],
"props": \{
"dataSource": \{
"type": \{
"name": "instanceOf",
"value": "ListViewDataSource"
},
"required": true,
"description": "An instance of [ListView.DataSource](docs/listviewdatasource.html) to use"
},
"renderSeparator": \{
"type": \{
"name": "func"
},
"required": false,
"description": "(sectionID, rowID, adjacentRowHighlighted) => renderable\\n\\nIf provided, a renderable component to be rendered as the separator\\nbelow each row but not the last row if there is a section header below.\\nTake a sectionID and rowID of the row above and whether its adjacent row\\nis highlighted."
},
"renderRow": \{
"type": \{
"name": "func"
},
"required": true,
"description": "(rowData, sectionID, rowID, highlightRow) => renderable\\n\\nTakes a data entry from the data source and its ids and should return\\na renderable component to be rendered as the row. By default the data\\nis exactly what was put into the data source, but it's also possible to\\nprovide custom extractors. ListView can be notified when a row is\\nbeing highlighted by calling \`highlightRow(sectionID, rowID)\`. This\\nsets a boolean value of adjacentRowHighlighted in renderSeparator, allowing you\\nto control the separators above and below the highlighted row. The highlighted\\nstate of a row can be reset by calling highlightRow(null)."
},
"initialListSize": \{
"type": \{
"name": "number"
},
"required": true,
"description": "How many rows to render on initial component mount. Use this to make\\nit so that the first screen worth of data appears at one time instead of\\nover the course of multiple frames.",
"defaultValue": \{
"value": "10",
"computed": false
}
},
"onEndReached": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Called when all rows have been rendered and the list has been scrolled\\nto within onEndReachedThreshold of the bottom. The native scroll\\nevent is provided."
},
"onEndReachedThreshold": \{
"type": \{
"name": "number"
},
"required": true,
"description": "Threshold in pixels (virtual, not physical) for calling onEndReached.",
"defaultValue": \{
"value": "1000",
"computed": false
}
},
"pageSize": \{
"type": \{
"name": "number"
},
"required": true,
"description": "Number of rows to render per event loop. Note: if your 'rows' are actually\\ncells, i.e. they don't span the full width of your view (as in the\\nListViewGridLayoutExample), you should set the pageSize to be a multiple\\nof the number of cells per row, otherwise you're likely to see gaps at\\nthe edge of the ListView as new pages are loaded.",
"defaultValue": \{
"value": "1",
"computed": false
}
},
"renderFooter": \{
"type": \{
"name": "func"
},
"required": false,
"description": "() => renderable\\n\\nThe header and footer are always rendered (if these props are provided)\\non every render pass. If they are expensive to re-render, wrap them\\nin StaticContainer or other mechanism as appropriate. Footer is always\\nat the bottom of the list, and header at the top, on every render pass."
},
"renderHeader": \{
"type": \{
"name": "func"
},
"required": false,
"description": ""
},
"renderSectionHeader": \{
"type": \{
"name": "func"
},
"required": false,
"description": "(sectionData, sectionID) => renderable\\n\\nIf provided, a header is rendered for this section."
},
"renderScrollComponent": \{
"type": \{
"name": "func"
},
"required": true,
"description": "(props) => renderable\\n\\nA function that returns the scrollable component in which the list rows\\nare rendered. Defaults to returning a ScrollView with the given props.",
"defaultValue": \{
"value": "props => <ScrollView \{...props} />",
"computed": false
}
},
"scrollRenderAheadDistance": \{
"type": \{
"name": "number"
},
"required": true,
"description": "How early to start rendering rows before they come on screen, in\\npixels.",
"defaultValue": \{
"value": "1000",
"computed": false
}
},
"onChangeVisibleRows": \{
"type": \{
"name": "func"
},
"required": false,
"description": "(visibleRows, changedRows) => void\\n\\nCalled when the set of visible rows changes. \`visibleRows\` maps\\n\{ sectionID: \{ rowID: true }} for all the visible rows, and\\n\`changedRows\` maps \{ sectionID: \{ rowID: true | false }} for the rows\\nthat have changed their visibility, with true indicating visible, and\\nfalse indicating the view has moved out of view."
},
"removeClippedSubviews": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "A performance optimization for improving scroll perf of\\nlarge lists, used in conjunction with overflow: 'hidden' on the row\\ncontainers. This is enabled by default."
},
"stickySectionHeadersEnabled": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Makes the sections headers sticky. The sticky behavior means that it\\nwill scroll with the content at the top of the section until it reaches\\nthe top of the screen, at which point it will stick to the top until it\\nis pushed off the screen by the next section header. This property is\\nnot supported in conjunction with \`horizontal=\{true}\`. Only enabled by\\ndefault on iOS because of typical platform standards.",
"defaultValue": \{
"value": "Platform.OS === 'ios'",
"computed": false
}
},
"stickyHeaderIndices": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "number"
}
},
"required": true,
"description": "An array of child indices determining which children get docked to the\\ntop of the screen when scrolling. For example, passing\\n\`stickyHeaderIndices=\{[0]}\` will cause the first child to be fixed to the\\ntop of the scroll view. This property is not supported in conjunction\\nwith \`horizontal=\{true}\`.",
"defaultValue": \{
"value": "[]",
"computed": false
}
},
"enableEmptySections": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Flag indicating whether empty section headers should be rendered. In the future release\\nempty section headers will be rendered by default, and the flag will be deprecated.\\nIf empty sections are not desired to be rendered their indices should be excluded from sectionID object."
}
},
"composes": [
"ScrollView"
],
"type": "component",
"filepath": "Libraries/Lists/ListView/ListView.js",
"componentName": "ListView",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"listview","title":"ListView","layout":"autodocs","category":"Components","permalink":"docs/listview.html","platform":"cross","next":"maskedviewios","previous":"keyboardavoidingview","sidebar":true,"path":"Libraries/Lists/ListView/ListView.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+221
View File
@@ -0,0 +1,221 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "ListViewDataSource",
"docblock": "/**\\n * Provides efficient data processing and access to the\\n * \`ListView\` component. A \`ListViewDataSource\` is created with functions for\\n * extracting data from the input blob, and comparing elements (with default\\n * implementations for convenience). The input blob can be as simple as an\\n * array of strings, or an object with rows nested inside section objects.\\n *\\n * To update the data in the datasource, use \`cloneWithRows\` (or\\n * \`cloneWithRowsAndSections\` if you care about sections). The data in the\\n * data source is immutable, so you can't modify it directly. The clone methods\\n * suck in the new data and compute a diff for each row so ListView knows\\n * whether to re-render it or not.\\n *\\n * In this example, a component receives data in chunks, handled by\\n * \`_onDataArrived\`, which concats the new data onto the old data and updates the\\n * data source. We use \`concat\` to create a new array - mutating \`this._data\`,\\n * e.g. with \`this._data.push(newRowData)\`, would be an error. \`_rowHasChanged\`\\n * understands the shape of the row data and knows how to efficiently compare\\n * it.\\n *\\n * \`\`\`\\n * getInitialState: function() \{\\n * var ds = new ListViewDataSource(\{rowHasChanged: this._rowHasChanged});\\n * return \{ds};\\n * },\\n * _onDataArrived(newData) \{\\n * this._data = this._data.concat(newData);\\n * this.setState(\{\\n * ds: this.state.ds.cloneWithRows(this._data)\\n * });\\n * }\\n * \`\`\`\\n */\\n",
"methods": [
\{
"line": 103,
"source": "constructor(params: ParamType) \{\\n invariant(\\n params && typeof params.rowHasChanged === 'function',\\n 'Must provide a rowHasChanged function.',\\n );\\n this._rowHasChanged = params.rowHasChanged;\\n this._getRowData = params.getRowData || defaultGetRowData;\\n this._sectionHeaderHasChanged = params.sectionHeaderHasChanged;\\n this._getSectionHeaderData =\\n params.getSectionHeaderData || defaultGetSectionHeaderData;\\n\\n this._dataBlob = null;\\n this._dirtyRows = [];\\n this._dirtySections = [];\\n this._cachedRowCount = 0;\\n\\n // These two private variables are accessed by outsiders because ListView\\n // uses them to iterate over the data in this class.\\n this.rowIdentities = [];\\n this.sectionIdentities = [];\\n }",
"docblock": "/**\\n * You can provide custom extraction and \`hasChanged\` functions for section\\n * headers and rows. If absent, data will be extracted with the\\n * \`defaultGetRowData\` and \`defaultGetSectionHeaderData\` functions.\\n *\\n * The default extractor expects data of one of the following forms:\\n *\\n * \{ sectionID_1: \{ rowID_1: <rowData1>, ... }, ... }\\n *\\n * or\\n *\\n * \{ sectionID_1: [ <rowData1>, <rowData2>, ... ], ... }\\n *\\n * or\\n *\\n * [ [ <rowData1>, <rowData2>, ... ], ... ]\\n *\\n * The constructor takes in a params argument that can contain any of the\\n * following:\\n *\\n * - getRowData(dataBlob, sectionID, rowID);\\n * - getSectionHeaderData(dataBlob, sectionID);\\n * - rowHasChanged(prevRowData, nextRowData);\\n * - sectionHeaderHasChanged(prevSectionData, nextSectionData);\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ParamType\\",\\"length\\":1}",
"name": "params"
}
],
"tparams": null,
"returntypehint": null,
"name": "constructor"
},
\{
"line": 141,
"source": "cloneWithRows(\\n dataBlob: $ReadOnlyArray<any> | \{+[key: string]: any},\\n rowIdentities: ?$ReadOnlyArray<string>,\\n ): ListViewDataSource \{\\n var rowIds = rowIdentities ? [[...rowIdentities]] : null;\\n if (!this._sectionHeaderHasChanged) \{\\n this._sectionHeaderHasChanged = () => false;\\n }\\n return this.cloneWithRowsAndSections(\{s1: dataBlob}, ['s1'], rowIds);\\n }",
"docblock": "/**\\n * Clones this \`ListViewDataSource\` with the specified \`dataBlob\` and\\n * \`rowIdentities\`. The \`dataBlob\` is just an arbitrary blob of data. At\\n * construction an extractor to get the interesting information was defined\\n * (or the default was used).\\n *\\n * The \`rowIdentities\` is a 2D array of identifiers for rows.\\n * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...]. If not provided, it's\\n * assumed that the keys of the section data are the row identities.\\n *\\n * Note: This function does NOT clone the data in this data source. It simply\\n * passes the functions defined at construction to a new data source with\\n * the data specified. If you wish to maintain the existing data you must\\n * handle merging of old and new data separately and then pass that into\\n * this function as the \`dataBlob\`.\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "$ReadOnlyArray<any> | \{+[key: string]: any}",
"name": "dataBlob"
},
\{
"typehint": "?$ReadOnlyArray<string>",
"name": "rowIdentities"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ListViewDataSource\\",\\"length\\":1}",
"name": "cloneWithRows"
},
\{
"line": 163,
"source": "cloneWithRowsAndSections(\\n dataBlob: any,\\n sectionIdentities: ?Array<string>,\\n rowIdentities: ?Array<Array<string>>,\\n ): ListViewDataSource \{\\n invariant(\\n typeof this._sectionHeaderHasChanged === 'function',\\n 'Must provide a sectionHeaderHasChanged function with section data.',\\n );\\n invariant(\\n !sectionIdentities ||\\n !rowIdentities ||\\n sectionIdentities.length === rowIdentities.length,\\n 'row and section ids lengths must be the same',\\n );\\n\\n var newSource = new ListViewDataSource(\{\\n getRowData: this._getRowData,\\n getSectionHeaderData: this._getSectionHeaderData,\\n rowHasChanged: this._rowHasChanged,\\n sectionHeaderHasChanged: this._sectionHeaderHasChanged,\\n });\\n newSource._dataBlob = dataBlob;\\n if (sectionIdentities) \{\\n newSource.sectionIdentities = sectionIdentities;\\n } else \{\\n newSource.sectionIdentities = Object.keys(dataBlob);\\n }\\n if (rowIdentities) \{\\n newSource.rowIdentities = rowIdentities;\\n } else \{\\n newSource.rowIdentities = [];\\n newSource.sectionIdentities.forEach(sectionID => \{\\n newSource.rowIdentities.push(Object.keys(dataBlob[sectionID]));\\n });\\n }\\n newSource._cachedRowCount = countRows(newSource.rowIdentities);\\n\\n newSource._calculateDirtyArrays(\\n this._dataBlob,\\n this.sectionIdentities,\\n this.rowIdentities,\\n );\\n\\n return newSource;\\n }",
"docblock": "/**\\n * This performs the same function as the \`cloneWithRows\` function but here\\n * you also specify what your \`sectionIdentities\` are. If you don't care\\n * about sections you should safely be able to use \`cloneWithRows\`.\\n *\\n * \`sectionIdentities\` is an array of identifiers for sections.\\n * ie. ['s1', 's2', ...]. If not provided, it's assumed that the\\n * keys of dataBlob are the section identities.\\n *\\n * Note: this returns a new object!\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "any",
"name": "dataBlob"
},
\{
"typehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":5,\\"nullable\\":true}",
"name": "sectionIdentities"
},
\{
"typehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":4}],\\"length\\":8,\\"nullable\\":true}",
"name": "rowIdentities"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ListViewDataSource\\",\\"length\\":1}",
"name": "cloneWithRowsAndSections"
},
\{
"line": 210,
"source": "getRowCount(): number \{\\n return this._cachedRowCount;\\n }",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "getRowCount"
},
\{
"line": 214,
"source": "getRowAndSectionCount(): number \{\\n return this._cachedRowCount + this.sectionIdentities.length;\\n }",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "getRowAndSectionCount"
},
\{
"line": 221,
"source": "rowShouldUpdate(sectionIndex: number, rowIndex: number): boolean \{\\n var needsUpdate = this._dirtyRows[sectionIndex][rowIndex];\\n warning(\\n needsUpdate !== undefined,\\n 'missing dirtyBit for section, row: ' + sectionIndex + ', ' + rowIndex,\\n );\\n return needsUpdate;\\n }",
"docblock": "/**\\n * Returns if the row is dirtied and needs to be rerendered\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "sectionIndex"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "rowIndex"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}",
"name": "rowShouldUpdate"
},
\{
"line": 233,
"source": "getRowData(sectionIndex: number, rowIndex: number): any \{\\n var sectionID = this.sectionIdentities[sectionIndex];\\n var rowID = this.rowIdentities[sectionIndex][rowIndex];\\n warning(\\n sectionID !== undefined && rowID !== undefined,\\n 'rendering invalid section, row: ' + sectionIndex + ', ' + rowIndex,\\n );\\n return this._getRowData(this._dataBlob, sectionID, rowID);\\n }",
"docblock": "/**\\n * Gets the data required to render the row.\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "sectionIndex"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "rowIndex"
}
],
"tparams": null,
"returntypehint": "any",
"name": "getRowData"
},
\{
"line": 247,
"source": "getRowIDForFlatIndex(index: number): ?string \{\\n var accessIndex = index;\\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) \{\\n if (accessIndex >= this.rowIdentities[ii].length) \{\\n accessIndex -= this.rowIdentities[ii].length;\\n } else \{\\n return this.rowIdentities[ii][accessIndex];\\n }\\n }\\n return null;\\n }",
"docblock": "/**\\n * Gets the rowID at index provided if the dataSource arrays were flattened,\\n * or null of out of range indexes.\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "index"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":2,\\"nullable\\":true}",
"name": "getRowIDForFlatIndex"
},
\{
"line": 263,
"source": "getSectionIDForFlatIndex(index: number): ?string \{\\n var accessIndex = index;\\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) \{\\n if (accessIndex >= this.rowIdentities[ii].length) \{\\n accessIndex -= this.rowIdentities[ii].length;\\n } else \{\\n return this.sectionIdentities[ii];\\n }\\n }\\n return null;\\n }",
"docblock": "/**\\n * Gets the sectionID at index provided if the dataSource arrays were flattened,\\n * or null for out of range indexes.\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "index"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":2,\\"nullable\\":true}",
"name": "getSectionIDForFlatIndex"
},
\{
"line": 278,
"source": "getSectionLengths(): Array<number> \{\\n var results = [];\\n for (var ii = 0; ii < this.sectionIdentities.length; ii++) \{\\n results.push(this.rowIdentities[ii].length);\\n }\\n return results;\\n }",
"docblock": "/**\\n * Returns an array containing the number of rows in each section\\n */\\n",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}],\\"length\\":4}",
"name": "getSectionLengths"
},
\{
"line": 289,
"source": "sectionHeaderShouldUpdate(sectionIndex: number): boolean \{\\n var needsUpdate = this._dirtySections[sectionIndex];\\n warning(\\n needsUpdate !== undefined,\\n 'missing dirtyBit for section: ' + sectionIndex,\\n );\\n return needsUpdate;\\n }",
"docblock": "/**\\n * Returns if the section header is dirtied and needs to be rerendered\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "sectionIndex"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}",
"name": "sectionHeaderShouldUpdate"
},
\{
"line": 301,
"source": "getSectionHeaderData(sectionIndex: number): any \{\\n if (!this._getSectionHeaderData) \{\\n return null;\\n }\\n var sectionID = this.sectionIdentities[sectionIndex];\\n warning(\\n sectionID !== undefined,\\n 'renderSection called on invalid section: ' + sectionIndex,\\n );\\n return this._getSectionHeaderData(this._dataBlob, sectionID);\\n }",
"docblock": "/**\\n * Gets the data required to render the section header\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"number\\",\\"length\\":1}",
"name": "sectionIndex"
}
],
"tparams": null,
"returntypehint": "any",
"name": "getSectionHeaderData"
}
],
"type": "api",
"line": 77,
"requires": [
\{
"name": "fbjs/lib/invariant"
},
\{
"name": "isEmpty"
},
\{
"name": "fbjs/lib/warning"
}
],
"filepath": "Libraries/Lists/ListView/ListViewDataSource.js",
"componentName": "ListViewDataSource",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"listviewdatasource","title":"ListViewDataSource","layout":"autodocs","category":"APIs","permalink":"docs/listviewdatasource.html","platform":"cross","next":"netinfo","previous":"linking","sidebar":false,"path":"Libraries/Lists/ListView/ListViewDataSource.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+681
View File
@@ -0,0 +1,681 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "Renders the child view with a mask specified in the \`maskElement\` prop.\\n\\n\`\`\`\\nimport React from 'react';\\nimport \{ MaskedView, Text, View } from 'react-native';\\n\\nclass MyMaskedView extends React.Component \{\\n render() \{\\n return (\\n <MaskedView\\n style=\{\{ flex: 1 }}\\n maskElement=\{\\n <View style=\{styles.maskContainerStyle}>\\n <Text style=\{styles.maskTextStyle}>\\n Basic Mask\\n </Text>\\n </View>\\n }\\n >\\n <View style=\{\{ flex: 1, backgroundColor: 'blue' }} />\\n </MaskedView>\\n );\\n }\\n}\\n\`\`\`\\n\\nThe above example will render a view with a blue background that fills its\\nparent, and then mask that view with text that says \\"Basic Mask\\".\\n\\nThe alpha channel of the view rendered by the \`maskElement\` prop determines how\\nmuch of the view's content and background shows through. Fully or partially\\nopaque pixels allow the underlying content to show through but fully\\ntransparent pixels block that content.",
"methods": [],
"props": \{
"maskElement": \{
"type": \{
"name": "element"
},
"required": true,
"description": "Should be a React element to be rendered and applied as the\\nmask for the child element.",
"flowType": \{
"elements": [
\{
"name": "unknown"
}
],
"raw": "React.Element<*>"
}
},
"children": \{
"flowType": \{
"name": "any"
},
"required": true,
"description": ""
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/MaskedView/MaskedViewIOS.ios.js",
"componentName": "MaskedViewIOS",
"componentPlatform": "ios",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"maskedviewios","title":"MaskedViewIOS","layout":"autodocs","category":"Components","permalink":"docs/maskedviewios.html","platform":"ios","next":"modal","previous":"listview","sidebar":true,"path":"Libraries/Components/MaskedView/MaskedViewIOS.ios.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+793
View File
@@ -0,0 +1,793 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "The Modal component is a simple way to present content above an enclosing view.\\n\\n_Note: If you need more control over how to present modals over the rest of your app,\\nthen consider using a top-level Navigator._\\n\\n\`\`\`javascript\\nimport React, \{ Component } from 'react';\\nimport \{ Modal, Text, TouchableHighlight, View } from 'react-native';\\n\\nclass ModalExample extends Component \{\\n\\n state = \{\\n modalVisible: false,\\n }\\n\\n setModalVisible(visible) \{\\n this.setState(\{modalVisible: visible});\\n }\\n\\n render() \{\\n return (\\n <View style=\{\{marginTop: 22}}>\\n <Modal\\n animationType=\{\\"slide\\"}\\n transparent=\{false}\\n visible=\{this.state.modalVisible}\\n onRequestClose=\{() => \{alert(\\"Modal has been closed.\\")}}\\n >\\n <View style=\{\{marginTop: 22}}>\\n <View>\\n <Text>Hello World!</Text>\\n\\n <TouchableHighlight onPress=\{() => \{\\n this.setModalVisible(!this.state.modalVisible)\\n }}>\\n <Text>Hide Modal</Text>\\n </TouchableHighlight>\\n\\n </View>\\n </View>\\n </Modal>\\n\\n <TouchableHighlight onPress=\{() => \{\\n this.setModalVisible(true)\\n }}>\\n <Text>Show Modal</Text>\\n </TouchableHighlight>\\n\\n </View>\\n );\\n }\\n}\\n\`\`\`",
"methods": [],
"props": \{
"animationType": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'none'",
"computed": false
},
\{
"value": "'slide'",
"computed": false
},
\{
"value": "'fade'",
"computed": false
}
]
},
"required": false,
"description": "The \`animationType\` prop controls how the modal animates.\\n\\n- \`slide\` slides in from the bottom\\n- \`fade\` fades into view\\n- \`none\` appears without an animation\\n\\nDefault is set to \`none\`."
},
"presentationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'fullScreen'",
"computed": false
},
\{
"value": "'pageSheet'",
"computed": false
},
\{
"value": "'formSheet'",
"computed": false
},
\{
"value": "'overFullScreen'",
"computed": false
}
]
},
"required": false,
"description": "The \`presentationStyle\` prop controls how the modal appears (generally on larger devices such as iPad or plus-sized iPhones).\\nSee https://developer.apple.com/reference/uikit/uimodalpresentationstyle for details.\\n@platform ios\\n\\n- \`fullScreen\` covers the screen completely\\n- \`pageSheet\` covers portrait-width view centered (only on larger devices)\\n- \`formSheet\` covers narrow-width view centered (only on larger devices)\\n- \`overFullScreen\` covers the screen completely, but allows transparency\\n\\nDefault is set to \`overFullScreen\` or \`fullScreen\` depending on \`transparent\` property."
},
"transparent": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "The \`transparent\` prop determines whether your modal will fill the entire view. Setting this to \`true\` will render the modal over a transparent background."
},
"hardwareAccelerated": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "The \`hardwareAccelerated\` prop controls whether to force hardware acceleration for the underlying window.\\n@platform android",
"defaultValue": \{
"value": "false",
"computed": false
}
},
"visible": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "The \`visible\` prop determines whether your modal is visible.",
"defaultValue": \{
"value": "true",
"computed": false
}
},
"onRequestClose": \{
"type": \{
"name": "custom",
"raw": "Platform.OS === 'android' ? PropTypes.func.isRequired : PropTypes.func"
},
"required": false,
"description": "The \`onRequestClose\` callback is called when the user taps the hardware back button.\\n@platform android"
},
"onShow": \{
"type": \{
"name": "func"
},
"required": false,
"description": "The \`onShow\` prop allows passing a function that will be called once the modal has been shown."
},
"animated": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "",
"deprecationMessage": "Use the \`animationType\` prop instead."
},
"supportedOrientations": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'portrait'",
"computed": false
},
\{
"value": "'portrait-upside-down'",
"computed": false
},
\{
"value": "'landscape'",
"computed": false
},
\{
"value": "'landscape-left'",
"computed": false
},
\{
"value": "'landscape-right'",
"computed": false
}
]
}
},
"required": false,
"description": "The \`supportedOrientations\` prop allows the modal to be rotated to any of the specified orientations.\\nOn iOS, the modal is still restricted by what's specified in your app's Info.plist's UISupportedInterfaceOrientations field.\\nWhen using \`presentationStyle\` of \`pageSheet\` or \`formSheet\`, this property will be ignored by iOS.\\n@platform ios"
},
"onOrientationChange": \{
"type": \{
"name": "func"
},
"required": false,
"description": "The \`onOrientationChange\` callback is called when the orientation changes while the modal is being displayed.\\nThe orientation provided is only 'portrait' or 'landscape'. This callback is also called on initial render, regardless of the current orientation.\\n@platform ios"
}
},
"type": "component",
"filepath": "Libraries/Modal/Modal.js",
"componentName": "Modal",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"modal","title":"Modal","layout":"autodocs","category":"Components","permalink":"docs/modal.html","platform":"cross","next":"navigatorios","previous":"maskedviewios","sidebar":true,"path":"Libraries/Modal/Modal.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
File diff suppressed because one or more lines are too long
+122
View File
@@ -0,0 +1,122 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 176,
"source": "addEventListener(\\n eventName: ChangeEventName,\\n handler: Function\\n ): \{remove: () => void} \{\\n const listener = NetInfoEventEmitter.addListener(\\n DEVICE_CONNECTIVITY_EVENT,\\n (appStateData) => \{\\n handler(appStateData.network_info);\\n }\\n );\\n _subscriptions.set(handler, listener);\\n return \{\\n remove: () => NetInfo.removeEventListener(eventName, handler)\\n };\\n }",
"docblock": "/**\\n * Invokes the listener whenever network status changes.\\n * The listener receives one of the connectivity types listed above.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ChangeEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "\{remove: () => void}",
"name": "addEventListener"
},
\{
"line": 195,
"source": "removeEventListener(\\n eventName: ChangeEventName,\\n handler: Function\\n ): void \{\\n const listener = _subscriptions.get(handler);\\n if (!listener) \{\\n return;\\n }\\n listener.remove();\\n _subscriptions.delete(handler);\\n }",
"docblock": "/**\\n * Removes the listener for network status changes.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"ChangeEventName\\",\\"length\\":1}",
"name": "eventName"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Function\\",\\"length\\":1}",
"name": "handler"
}
],
"tparams": null,
"returntypehint": "void",
"name": "removeEventListener"
},
\{
"line": 211,
"source": "fetch(): Promise<any> \{\\n return RCTNetInfo.getCurrentConnectivity().then(resp => resp.network_info);\\n }",
"docblock": "/**\\n * Returns a promise that resolves with one of the connectivity types listed\\n * above.\\n */\\n",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "Promise<any>",
"name": "fetch"
},
\{
"line": 261,
"source": "isConnectionExpensive(): Promise<boolean> \{\\n return (\\n Platform.OS === 'android' ? RCTNetInfo.isConnectionMetered() : Promise.reject(new Error('Currently not supported on iOS'))\\n );\\n }",
"modifiers": [
"static"
],
"params": [],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}],\\"length\\":4}",
"name": "isConnectionExpensive"
}
],
"properties": [
\{
"name": "isConnected",
"type": \{
"name": "ObjectExpression"
},
"docblock": "/**\\n * An object with the same methods as above but the listener receives a\\n * boolean which represents the internet connectivity.\\n * Use this if you are only interested with whether the device has internet\\n * connectivity.\\n */\\n",
"source": "isConnected: \{\\n addEventListener(\\n eventName: ChangeEventName,\\n handler: Function\\n ): \{remove: () => void} \{\\n const listener = (connection) => \{\\n handler(_isConnected(connection));\\n };\\n _isConnectedSubscriptions.set(handler, listener);\\n NetInfo.addEventListener(\\n eventName,\\n listener\\n );\\n return \{\\n remove: () => NetInfo.isConnected.removeEventListener(eventName, handler)\\n };\\n },\\n\\n removeEventListener(\\n eventName: ChangeEventName,\\n handler: Function\\n ): void \{\\n const listener = _isConnectedSubscriptions.get(handler);\\n NetInfo.removeEventListener(\\n eventName,\\n /* $FlowFixMe(>=0.36.0 site=react_native_fb,react_native_oss) Flow error\\n * detected during the deploy of Flow v0.36.0. To see the error, remove\\n * this comment and run Flow */\\n listener\\n );\\n _isConnectedSubscriptions.delete(handler);\\n },\\n\\n fetch(): Promise<any> \{\\n return NetInfo.fetch().then(\\n (connection) => _isConnected(connection)\\n );\\n },\\n }",
"modifiers": [
"static"
],
"propertySource": ""
}
],
"classes": [],
"superClass": null,
"type": "api",
"line": 171,
"name": "NetInfo",
"docblock": "/**\\n * NetInfo exposes info about online/offline status\\n *\\n * \`\`\`\\n * NetInfo.fetch().then((reach) => \{\\n * console.log('Initial: ' + reach);\\n * });\\n * function handleFirstConnectivityChange(reach) \{\\n * console.log('First change: ' + reach);\\n * NetInfo.removeEventListener(\\n * 'change',\\n * handleFirstConnectivityChange\\n * );\\n * }\\n * NetInfo.addEventListener(\\n * 'change',\\n * handleFirstConnectivityChange\\n * );\\n * \`\`\`\\n *\\n * ### IOS\\n *\\n * Asynchronously determine if the device is online and on a cellular network.\\n *\\n * - \`none\` - device is offline\\n * - \`wifi\` - device is online and connected via wifi, or is the iOS simulator\\n * - \`cell\` - device is connected via Edge, 3G, WiMax, or LTE\\n * - \`unknown\` - error case and the network status is unknown\\n *\\n * ### Android\\n *\\n * To request network info, you need to add the following line to your\\n * app's \`AndroidManifest.xml\`:\\n *\\n * \`<uses-permission android:name=\\"android.permission.ACCESS_NETWORK_STATE\\" />\`\\n * Asynchronously determine if the device is connected and details about that connection.\\n *\\n * Android Connectivity Types.\\n *\\n * - \`NONE\` - device is offline\\n * - \`BLUETOOTH\` - The Bluetooth data connection.\\n * - \`DUMMY\` - Dummy data connection.\\n * - \`ETHERNET\` - The Ethernet data connection.\\n * - \`MOBILE\` - The Mobile data connection.\\n * - \`MOBILE_DUN\` - A DUN-specific Mobile data connection.\\n * - \`MOBILE_HIPRI\` - A High Priority Mobile data connection.\\n * - \`MOBILE_MMS\` - An MMS-specific Mobile data connection.\\n * - \`MOBILE_SUPL\` - A SUPL-specific Mobile data connection.\\n * - \`VPN\` - A virtual network using one or more native bearers. Requires API Level 21\\n * - \`WIFI\` - The WIFI data connection.\\n * - \`WIMAX\` - The WiMAX data connection.\\n * - \`UNKNOWN\` - Unknown data connection.\\n *\\n * The rest ConnectivityStates are hidden by the Android API, but can be used if necessary.\\n *\\n * ### isConnectionExpensive\\n *\\n * Available on Android. Detect if the current active connection is metered or not. A network is\\n * classified as metered when the user is sensitive to heavy data usage on that connection due to\\n * monetary costs, data limitations or battery/performance issues.\\n *\\n * \`\`\`\\n * NetInfo.isConnectionExpensive()\\n * .then(isConnectionExpensive => \{\\n * console.log('Connection is ' + (isConnectionExpensive ? 'Expensive' : 'Not Expensive'));\\n * })\\n * .catch(error => \{\\n * console.error(error);\\n * });\\n * \`\`\`\\n *\\n * ### isConnected\\n *\\n * Available on all platforms. Asynchronously fetch a boolean to determine\\n * internet connectivity.\\n *\\n * \`\`\`\\n * NetInfo.isConnected.fetch().then(isConnected => \{\\n * console.log('First, is ' + (isConnected ? 'online' : 'offline'));\\n * });\\n * function handleFirstConnectivityChange(isConnected) \{\\n * console.log('Then, is ' + (isConnected ? 'online' : 'offline'));\\n * NetInfo.isConnected.removeEventListener(\\n * 'change',\\n * handleFirstConnectivityChange\\n * );\\n * }\\n * NetInfo.isConnected.addEventListener(\\n * 'change',\\n * handleFirstConnectivityChange\\n * );\\n * \`\`\`\\n */\\n",
"requires": [
\{
"name": "Map"
},
\{
"name": "NativeEventEmitter"
},
\{
"name": "NativeModules"
},
\{
"name": "Platform"
}
],
"filepath": "Libraries/Network/NetInfo.js",
"componentName": "NetInfo",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"netinfo","title":"NetInfo","layout":"autodocs","category":"APIs","permalink":"docs/netinfo.html","platform":"cross","next":"panresponder","previous":"linking","sidebar":true,"path":"Libraries/Network/NetInfo.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+55
View File
@@ -0,0 +1,55 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"methods": [
\{
"line": 279,
"source": "create: function (config) \{\\n const interactionState = \{\\n handle: (null: ?number),\\n };\\n const gestureState = \{\\n // Useful for debugging\\n stateID: Math.random(),\\n };\\n PanResponder._initializeGestureState(gestureState);\\n const panHandlers = \{\\n onStartShouldSetResponder: function (e) \{\\n return config.onStartShouldSetPanResponder === undefined ?\\n false :\\n config.onStartShouldSetPanResponder(e, gestureState);\\n },\\n onMoveShouldSetResponder: function (e) \{\\n return config.onMoveShouldSetPanResponder === undefined ?\\n false :\\n config.onMoveShouldSetPanResponder(e, gestureState);\\n },\\n onStartShouldSetResponderCapture: function (e) \{\\n // TODO: Actually, we should reinitialize the state any time\\n // touches.length increases from 0 active to > 0 active.\\n if (e.nativeEvent.touches.length === 1) \{\\n PanResponder._initializeGestureState(gestureState);\\n }\\n gestureState.numberActiveTouches = e.touchHistory.numberActiveTouches;\\n return config.onStartShouldSetPanResponderCapture !== undefined ?\\n config.onStartShouldSetPanResponderCapture(e, gestureState) :\\n false;\\n },\\n\\n onMoveShouldSetResponderCapture: function (e) \{\\n const touchHistory = e.touchHistory;\\n // Responder system incorrectly dispatches should* to current responder\\n // Filter out any touch moves past the first one - we would have\\n // already processed multi-touch geometry during the first event.\\n if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) \{\\n return false;\\n }\\n PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\\n return config.onMoveShouldSetPanResponderCapture ?\\n config.onMoveShouldSetPanResponderCapture(e, gestureState) :\\n false;\\n },\\n\\n onResponderGrant: function (e) \{\\n if (!interactionState.handle) \{\\n interactionState.handle = InteractionManager.createInteractionHandle();\\n }\\n gestureState.x0 = currentCentroidX(e.touchHistory);\\n gestureState.y0 = currentCentroidY(e.touchHistory);\\n gestureState.dx = 0;\\n gestureState.dy = 0;\\n if (config.onPanResponderGrant) \{\\n config.onPanResponderGrant(e, gestureState);\\n }\\n // TODO: t7467124 investigate if this can be removed\\n return config.onShouldBlockNativeResponder === undefined ?\\n true :\\n config.onShouldBlockNativeResponder();\\n },\\n\\n onResponderReject: function (e) \{\\n clearInteractionHandle(interactionState, config.onPanResponderReject, e, gestureState);\\n },\\n\\n onResponderRelease: function (e) \{\\n clearInteractionHandle(interactionState, config.onPanResponderRelease, e, gestureState);\\n PanResponder._initializeGestureState(gestureState);\\n },\\n\\n onResponderStart: function (e) \{\\n const touchHistory = e.touchHistory;\\n gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\\n if (config.onPanResponderStart) \{\\n config.onPanResponderStart(e, gestureState);\\n }\\n },\\n\\n onResponderMove: function (e) \{\\n const touchHistory = e.touchHistory;\\n // Guard against the dispatch of two touch moves when there are two\\n // simultaneously changed touches.\\n if (gestureState._accountsForMovesUpTo === touchHistory.mostRecentTimeStamp) \{\\n return;\\n }\\n // Filter out any touch moves past the first one - we would have\\n // already processed multi-touch geometry during the first event.\\n PanResponder._updateGestureStateOnMove(gestureState, touchHistory);\\n if (config.onPanResponderMove) \{\\n config.onPanResponderMove(e, gestureState);\\n }\\n },\\n\\n onResponderEnd: function (e) \{\\n const touchHistory = e.touchHistory;\\n gestureState.numberActiveTouches = touchHistory.numberActiveTouches;\\n clearInteractionHandle(interactionState, config.onPanResponderEnd, e, gestureState);\\n },\\n\\n onResponderTerminate: function (e) \{\\n clearInteractionHandle(interactionState, config.onPanResponderTerminate, e, gestureState);\\n PanResponder._initializeGestureState(gestureState);\\n },\\n\\n onResponderTerminationRequest: function (e) \{\\n return config.onPanResponderTerminationRequest === undefined ?\\n true :\\n config.onPanResponderTerminationRequest(e, gestureState);\\n }\\n };\\n return \{\\n panHandlers,\\n getInteractionHandle(): ?number \{\\n return interactionState.handle;\\n },\\n };\\n }",
"docblock": "/**\\n * @param \{object} config Enhanced versions of all of the responder callbacks\\n * that provide not only the typical \`ResponderSyntheticEvent\`, but also the\\n * \`PanResponder\` gesture state. Simply replace the word \`Responder\` with\\n * \`PanResponder\` in each of the typical \`onResponder*\` callbacks. For\\n * example, the \`config\` object would look like:\\n *\\n * - \`onMoveShouldSetPanResponder: (e, gestureState) => \{...}\`\\n * - \`onMoveShouldSetPanResponderCapture: (e, gestureState) => \{...}\`\\n * - \`onStartShouldSetPanResponder: (e, gestureState) => \{...}\`\\n * - \`onStartShouldSetPanResponderCapture: (e, gestureState) => \{...}\`\\n * - \`onPanResponderReject: (e, gestureState) => \{...}\`\\n * - \`onPanResponderGrant: (e, gestureState) => \{...}\`\\n * - \`onPanResponderStart: (e, gestureState) => \{...}\`\\n * - \`onPanResponderEnd: (e, gestureState) => \{...}\`\\n * - \`onPanResponderRelease: (e, gestureState) => \{...}\`\\n * - \`onPanResponderMove: (e, gestureState) => \{...}\`\\n * - \`onPanResponderTerminate: (e, gestureState) => \{...}\`\\n * - \`onPanResponderTerminationRequest: (e, gestureState) => \{...}\`\\n * - \`onShouldBlockNativeResponder: (e, gestureState) => \{...}\`\\n *\\n * In general, for events that have capture equivalents, we update the\\n * gestureState once in the capture phase and can use it in the bubble phase\\n * as well.\\n *\\n * Be careful with onStartShould* callbacks. They only reflect updated\\n * \`gestureState\` for start/end events that bubble/capture to the Node.\\n * Once the node is the responder, you can rely on every start/end event\\n * being processed by the gesture and \`gestureState\` being updated\\n * accordingly. (numberActiveTouches) may not be totally accurate unless you\\n * are the responder.\\n */\\n",
"modifiers": [
"static"
],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"object\\",\\"length\\":1}",
"name": "config"
}
],
"tparams": null,
"returntypehint": null,
"name": "create"
}
],
"properties": [],
"classes": [],
"superClass": null,
"type": "api",
"line": 122,
"name": "PanResponder",
"docblock": "/**\\n * \`PanResponder\` reconciles several touches into a single gesture. It makes\\n * single-touch gestures resilient to extra touches, and can be used to\\n * recognize simple multi-touch gestures.\\n *\\n * By default, \`PanResponder\` holds an \`InteractionManager\` handle to block\\n * long-running JS events from interrupting active gestures.\\n *\\n * It provides a predictable wrapper of the responder handlers provided by the\\n * [gesture responder system](docs/gesture-responder-system.html).\\n * For each handler, it provides a new \`gestureState\` object alongside the\\n * native event object:\\n *\\n * \`\`\`\\n * onPanResponderMove: (event, gestureState) => \{}\\n * \`\`\`\\n *\\n * A native event is a synthetic touch event with the following form:\\n *\\n * - \`nativeEvent\`\\n * + \`changedTouches\` - Array of all touch events that have changed since the last event\\n * + \`identifier\` - The ID of the touch\\n * + \`locationX\` - The X position of the touch, relative to the element\\n * + \`locationY\` - The Y position of the touch, relative to the element\\n * + \`pageX\` - The X position of the touch, relative to the root element\\n * + \`pageY\` - The Y position of the touch, relative to the root element\\n * + \`target\` - The node id of the element receiving the touch event\\n * + \`timestamp\` - A time identifier for the touch, useful for velocity calculation\\n * + \`touches\` - Array of all current touches on the screen\\n *\\n * A \`gestureState\` object has the following:\\n *\\n * - \`stateID\` - ID of the gestureState- persisted as long as there at least\\n * one touch on screen\\n * - \`moveX\` - the latest screen coordinates of the recently-moved touch\\n * - \`moveY\` - the latest screen coordinates of the recently-moved touch\\n * - \`x0\` - the screen coordinates of the responder grant\\n * - \`y0\` - the screen coordinates of the responder grant\\n * - \`dx\` - accumulated distance of the gesture since the touch started\\n * - \`dy\` - accumulated distance of the gesture since the touch started\\n * - \`vx\` - current velocity of the gesture\\n * - \`vy\` - current velocity of the gesture\\n * - \`numberActiveTouches\` - Number of touches currently on screen\\n *\\n * ### Basic Usage\\n *\\n * \`\`\`\\n * componentWillMount: function() \{\\n * this._panResponder = PanResponder.create(\{\\n * // Ask to be the responder:\\n * onStartShouldSetPanResponder: (evt, gestureState) => true,\\n * onStartShouldSetPanResponderCapture: (evt, gestureState) => true,\\n * onMoveShouldSetPanResponder: (evt, gestureState) => true,\\n * onMoveShouldSetPanResponderCapture: (evt, gestureState) => true,\\n *\\n * onPanResponderGrant: (evt, gestureState) => \{\\n * // The gesture has started. Show visual feedback so the user knows\\n * // what is happening!\\n *\\n * // gestureState.d\{x,y} will be set to zero now\\n * },\\n * onPanResponderMove: (evt, gestureState) => \{\\n * // The most recent move distance is gestureState.move\{X,Y}\\n *\\n * // The accumulated gesture distance since becoming responder is\\n * // gestureState.d\{x,y}\\n * },\\n * onPanResponderTerminationRequest: (evt, gestureState) => true,\\n * onPanResponderRelease: (evt, gestureState) => \{\\n * // The user has released all touches while this view is the\\n * // responder. This typically means a gesture has succeeded\\n * },\\n * onPanResponderTerminate: (evt, gestureState) => \{\\n * // Another component has become the responder, so this gesture\\n * // should be cancelled\\n * },\\n * onShouldBlockNativeResponder: (evt, gestureState) => \{\\n * // Returns whether this component should block native components from becoming the JS\\n * // responder. Returns true by default. Is currently only supported on android.\\n * return true;\\n * },\\n * });\\n * },\\n *\\n * render: function() \{\\n * return (\\n * <View \{...this._panResponder.panHandlers} />\\n * );\\n * },\\n *\\n * \`\`\`\\n *\\n * ### Working Example\\n *\\n * To see it in action, try the\\n * [PanResponder example in RNTester](https://github.com/facebook/react-native/blob/master/RNTester/js/PanResponderExample.js)\\n */\\n",
"requires": [
\{
"name": "./InteractionManager"
},
\{
"name": "TouchHistoryMath"
}
],
"filepath": "Libraries/Interaction/PanResponder.js",
"componentName": "PanResponder",
"componentPlatform": "cross"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"panresponder","title":"PanResponder","layout":"autodocs","category":"APIs","permalink":"docs/panresponder.html","platform":"cross","next":"permissionsandroid","previous":"netinfo","sidebar":true,"path":"Libraries/Interaction/PanResponder.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+124
View File
@@ -0,0 +1,124 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"name": "PermissionsAndroid",
"docblock": "/**\\n * <div class=\\"banner-crna-ejected\\">\\n * <h3>Project with Native Code Required</h3>\\n * <p>\\n * This API only works in projects made with <code>react-native init</code>\\n * or in those made with Create React Native App which have since ejected. For\\n * more information about ejecting, please see\\n * the <a href=\\"https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md\\" target=\\"_blank\\">guide</a> on\\n * the Create React Native App repository.\\n * </p>\\n * </div>\\n *\\n * \`PermissionsAndroid\` provides access to Android M's new permissions model.\\n * Some permissions are granted by default when the application is installed\\n * so long as they appear in \`AndroidManifest.xml\`. However, \\"dangerous\\"\\n * permissions require a dialog prompt. You should use this module for those\\n * permissions.\\n *\\n * On devices before SDK version 23, the permissions are automatically granted\\n * if they appear in the manifest, so \`check\` and \`request\`\\n * should always be true.\\n *\\n * If a user has previously turned off a permission that you prompt for, the OS\\n * will advise your app to show a rationale for needing the permission. The\\n * optional \`rationale\` argument will show a dialog prompt only if\\n * necessary - otherwise the normal permission prompt will appear.\\n *\\n * ### Example\\n * \`\`\`\\n * async function requestCameraPermission() \{\\n * try \{\\n * const granted = await PermissionsAndroid.request(\\n * PermissionsAndroid.PERMISSIONS.CAMERA,\\n * \{\\n * 'title': 'Cool Photo App Camera Permission',\\n * 'message': 'Cool Photo App needs access to your camera ' +\\n * 'so you can take awesome pictures.'\\n * }\\n * )\\n * if (granted === PermissionsAndroid.RESULTS.GRANTED) \{\\n * console.log(\\"You can use the camera\\")\\n * } else \{\\n * console.log(\\"Camera permission denied\\")\\n * }\\n * } catch (err) \{\\n * console.warn(err)\\n * }\\n * }\\n * \`\`\`\\n */\\n",
"methods": [
\{
"line": 77,
"source": "constructor() \{\\n /**\\n * A list of specified \\"dangerous\\" permissions that require prompting the user\\n */\\n this.PERMISSIONS = \{\\n READ_CALENDAR: 'android.permission.READ_CALENDAR',\\n WRITE_CALENDAR: 'android.permission.WRITE_CALENDAR',\\n CAMERA: 'android.permission.CAMERA',\\n READ_CONTACTS: 'android.permission.READ_CONTACTS',\\n WRITE_CONTACTS: 'android.permission.WRITE_CONTACTS',\\n GET_ACCOUNTS: 'android.permission.GET_ACCOUNTS',\\n ACCESS_FINE_LOCATION: 'android.permission.ACCESS_FINE_LOCATION',\\n ACCESS_COARSE_LOCATION: 'android.permission.ACCESS_COARSE_LOCATION',\\n RECORD_AUDIO: 'android.permission.RECORD_AUDIO',\\n READ_PHONE_STATE: 'android.permission.READ_PHONE_STATE',\\n CALL_PHONE: 'android.permission.CALL_PHONE',\\n READ_CALL_LOG: 'android.permission.READ_CALL_LOG',\\n WRITE_CALL_LOG: 'android.permission.WRITE_CALL_LOG',\\n ADD_VOICEMAIL: 'com.android.voicemail.permission.ADD_VOICEMAIL',\\n USE_SIP: 'android.permission.USE_SIP',\\n PROCESS_OUTGOING_CALLS: 'android.permission.PROCESS_OUTGOING_CALLS',\\n BODY_SENSORS: 'android.permission.BODY_SENSORS',\\n SEND_SMS: 'android.permission.SEND_SMS',\\n RECEIVE_SMS: 'android.permission.RECEIVE_SMS',\\n READ_SMS: 'android.permission.READ_SMS',\\n RECEIVE_WAP_PUSH: 'android.permission.RECEIVE_WAP_PUSH',\\n RECEIVE_MMS: 'android.permission.RECEIVE_MMS',\\n READ_EXTERNAL_STORAGE: 'android.permission.READ_EXTERNAL_STORAGE',\\n WRITE_EXTERNAL_STORAGE: 'android.permission.WRITE_EXTERNAL_STORAGE',\\n };\\n\\n this.RESULTS = \{\\n GRANTED: 'granted',\\n DENIED: 'denied',\\n NEVER_ASK_AGAIN: 'never_ask_again',\\n };\\n }",
"modifiers": [],
"params": [],
"tparams": null,
"returntypehint": null,
"name": "constructor"
},
\{
"line": 123,
"source": "checkPermission(permission: string) : Promise<boolean> \{\\n console.warn('\\"PermissionsAndroid.checkPermission\\" is deprecated. Use \\"PermissionsAndroid.check\\" instead');\\n return NativeModules.PermissionsAndroid.checkPermission(permission);\\n }",
"docblock": "/**\\n * DEPRECATED - use check\\n *\\n * Returns a promise resolving to a boolean value as to whether the specified\\n * permissions has been granted\\n *\\n * @deprecated\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "permission"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}],\\"length\\":4}",
"name": "checkPermission"
},
\{
"line": 132,
"source": "check(permission: string) : Promise<boolean> \{\\n return NativeModules.PermissionsAndroid.checkPermission(permission);\\n }",
"docblock": "/**\\n * Returns a promise resolving to a boolean value as to whether the specified\\n * permissions has been granted\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "permission"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}],\\"length\\":4}",
"name": "check"
},
\{
"line": 150,
"source": "async requestPermission(permission: string, rationale?: Rationale) : Promise<boolean> \{\\n console.warn('\\"PermissionsAndroid.requestPermission\\" is deprecated. Use \\"PermissionsAndroid.request\\" instead');\\n const response = await this.request(permission, rationale);\\n return (response === this.RESULTS.GRANTED);\\n }",
"docblock": "/**\\n * DEPRECATED - use request\\n *\\n * Prompts the user to enable a permission and returns a promise resolving to a\\n * boolean value indicating whether the user allowed or denied the request\\n *\\n * If the optional rationale argument is included (which is an object with a\\n * \`title\` and \`message\`), this function checks with the OS whether it is\\n * necessary to show a dialog explaining why the permission is needed\\n * (https://developer.android.com/training/permissions/requesting.html#explain)\\n * and then shows the system permission dialog\\n *\\n * @deprecated\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "permission"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Rationale\\",\\"length\\":1}",
"name": "rationale?"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"boolean\\",\\"length\\":1}],\\"length\\":4}",
"name": "requestPermission"
},
\{
"line": 166,
"source": "async request(permission: string, rationale?: Rationale) : Promise<PermissionStatus> \{\\n if (rationale) \{\\n const shouldShowRationale = await NativeModules.PermissionsAndroid.shouldShowRequestPermissionRationale(permission);\\n\\n if (shouldShowRationale) \{\\n return new Promise((resolve, reject) => \{\\n NativeModules.DialogManagerAndroid.showAlert(\\n rationale,\\n () => reject(new Error('Error showing rationale')),\\n () => resolve(NativeModules.PermissionsAndroid.requestPermission(permission))\\n );\\n });\\n }\\n }\\n return NativeModules.PermissionsAndroid.requestPermission(permission);\\n }",
"docblock": "/**\\n * Prompts the user to enable a permission and returns a promise resolving to a\\n * string value indicating whether the user allowed or denied the request\\n *\\n * If the optional rationale argument is included (which is an object with a\\n * \`title\` and \`message\`), this function checks with the OS whether it is\\n * necessary to show a dialog explaining why the permission is needed\\n * (https://developer.android.com/training/permissions/requesting.html#explain)\\n * and then shows the system permission dialog\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}",
"name": "permission"
},
\{
"typehint": "\{\\"type\\":\\"simple\\",\\"value\\":\\"Rationale\\",\\"length\\":1}",
"name": "rationale?"
}
],
"tparams": null,
"returntypehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Promise\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"PermissionStatus\\",\\"length\\":1}],\\"length\\":4}",
"name": "request"
},
\{
"line": 188,
"source": "requestMultiple(permissions: Array<string>) : Promise<\{[permission: string]: PermissionStatus}> \{\\n return NativeModules.PermissionsAndroid.requestMultiplePermissions(permissions);\\n }",
"docblock": "/**\\n * Prompts the user to enable multiple permissions in the same dialog and\\n * returns an object with the permissions as keys and strings as values\\n * indicating whether the user allowed or denied the request\\n */\\n",
"modifiers": [],
"params": [
\{
"typehint": "\{\\"type\\":\\"generic\\",\\"value\\":[\{\\"type\\":\\"simple\\",\\"value\\":\\"Array\\",\\"length\\":1},\{\\"type\\":\\"simple\\",\\"value\\":\\"string\\",\\"length\\":1}],\\"length\\":4}",
"name": "permissions"
}
],
"tparams": null,
"returntypehint": "Promise<\{[permission: string]: PermissionStatus}>",
"name": "requestMultiple"
}
],
"type": "api",
"line": 73,
"requires": [
\{
"name": "NativeModules"
}
],
"filepath": "Libraries/PermissionsAndroid/PermissionsAndroid.js",
"componentName": "PermissionsAndroid",
"componentPlatform": "android"
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"permissionsandroid","title":"PermissionsAndroid","layout":"autodocs","category":"APIs","permalink":"docs/permissionsandroid.html","platform":"android","next":"pixelratio","previous":"panresponder","sidebar":true,"path":"Libraries/PermissionsAndroid/PermissionsAndroid.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+766
View File
@@ -0,0 +1,766 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "Renders the native picker component on iOS and Android. Example:\\n\\n <Picker\\n selectedValue=\{this.state.language}\\n onValueChange=\{(itemValue, itemIndex) => this.setState(\{language: itemValue})}>\\n <Picker.Item label=\\"Java\\" value=\\"java\\" />\\n <Picker.Item label=\\"JavaScript\\" value=\\"js\\" />\\n </Picker>",
"methods": [],
"props": \{
"style": \{
"type": \{
"name": "custom",
"raw": "pickerStyleType"
},
"required": false,
"description": "",
"flowType": \{
"name": "$FlowFixMe"
}
},
"selectedValue": \{
"type": \{
"name": "any"
},
"required": false,
"description": "Value matching value of one of the items. Can be a string or an integer.",
"flowType": \{
"name": "any"
}
},
"onValueChange": \{
"type": \{
"name": "func"
},
"required": false,
"description": "Callback for when an item is selected. This is called with the following parameters:\\n - \`itemValue\`: the \`value\` prop of the item that was selected\\n - \`itemPosition\`: the index of the selected item in this picker",
"flowType": \{
"name": "Function"
}
},
"enabled": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "If set to false, the picker will be disabled, i.e. the user will not be able to make a\\nselection.\\n@platform android",
"flowType": \{
"name": "boolean"
}
},
"mode": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'dialog'",
"computed": false
},
\{
"value": "'dropdown'",
"computed": false
}
]
},
"required": false,
"description": "On Android, specifies how to display the selection items when the user taps on the picker:\\n\\n - 'dialog': Show a modal dialog. This is the default.\\n - 'dropdown': Shows a dropdown anchored to the picker view\\n\\n@platform android",
"flowType": \{
"name": "union",
"raw": "'dialog' | 'dropdown'",
"elements": [
\{
"name": "literal",
"value": "'dialog'"
},
\{
"name": "literal",
"value": "'dropdown'"
}
]
},
"defaultValue": \{
"value": "'dialog'",
"computed": false
}
},
"itemStyle": \{
"type": \{
"name": "custom",
"raw": "itemStylePropType"
},
"required": false,
"description": "Style to apply to each of the item labels.\\n@platform ios",
"flowType": \{
"name": "$FlowFixMe"
}
},
"prompt": \{
"type": \{
"name": "string"
},
"required": false,
"description": "Prompt string for this picker, used on Android in dialog mode as the title of the dialog.\\n@platform android",
"flowType": \{
"name": "string"
}
},
"testID": \{
"type": \{
"name": "string"
},
"required": false,
"description": "Used to locate this view in end-to-end tests.",
"flowType": \{
"name": "string"
}
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/Picker/Picker.js",
"componentName": "Picker",
"componentPlatform": "cross",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"picker","title":"Picker","layout":"autodocs","category":"Components","permalink":"docs/picker.html","platform":"cross","next":"pickerios","previous":"navigatorios","sidebar":true,"path":"Libraries/Components/Picker/Picker.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;
+682
View File
@@ -0,0 +1,682 @@
/**
* @generated
*/
var React = require("React");
var Layout = require("AutodocsLayout");
var content = `\{
"description": "",
"displayName": "PickerIOS",
"methods": [],
"props": \{
"itemStyle": \{
"type": \{
"name": "custom",
"raw": "itemStylePropType"
},
"required": false,
"description": ""
},
"onValueChange": \{
"type": \{
"name": "func"
},
"required": false,
"description": ""
},
"selectedValue": \{
"type": \{
"name": "any"
},
"required": false,
"description": ""
}
},
"composes": [
"ViewPropTypes"
],
"type": "component",
"filepath": "Libraries/Components/Picker/PickerIOS.ios.js",
"componentName": "PickerIOS",
"componentPlatform": "ios",
"styles": \{
"ViewStylePropTypes": \{
"props": \{
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderTopColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRightColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderBottomColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderLeftColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'solid'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRightWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderLeftWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"elevation": \{
"type": \{
"name": "number"
},
"required": false,
"description": "(Android-only) Sets the elevation of a view, using Android's underlying\\n[elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation).\\nThis adds a drop shadow to the item and affects z-order for overlapping views.\\nOnly supported on Android 5.0+, has no effect on earlier versions.\\n@platform android"
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
},
"TextStylePropTypes": \{
"props": \{
"color": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"fontFamily": \{
"type": \{
"name": "string"
},
"required": false,
"description": ""
},
"fontSize": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"fontStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'normal'",
"computed": false
},
\{
"value": "'italic'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"fontWeight": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"normal\\"",
"computed": false
},
\{
"value": "'bold'",
"computed": false
},
\{
"value": "'100'",
"computed": false
},
\{
"value": "'200'",
"computed": false
},
\{
"value": "'300'",
"computed": false
},
\{
"value": "'400'",
"computed": false
},
\{
"value": "'500'",
"computed": false
},
\{
"value": "'600'",
"computed": false
},
\{
"value": "'700'",
"computed": false
},
\{
"value": "'800'",
"computed": false
},
\{
"value": "'900'",
"computed": false
}
]
},
"required": false,
"description": "Specifies font weight. The values 'normal' and 'bold' are supported for\\nmost fonts. Not all fonts have a variant for each of the numeric values,\\nin that case the closest one is chosen."
},
"fontVariant": \{
"type": \{
"name": "arrayOf",
"value": \{
"name": "enum",
"value": [
\{
"value": "'small-caps'",
"computed": false
},
\{
"value": "'oldstyle-nums'",
"computed": false
},
\{
"value": "'lining-nums'",
"computed": false
},
\{
"value": "'tabular-nums'",
"computed": false
},
\{
"value": "'proportional-nums'",
"computed": false
}
]
}
},
"required": false,
"description": "@platform ios"
},
"textShadowOffset": \{
"type": \{
"name": "shape",
"value": \{
"width": \{
"name": "number",
"required": false
},
"height": \{
"name": "number",
"required": false
}
}
},
"required": false,
"description": ""
},
"textShadowRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textShadowColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"letterSpacing": \{
"type": \{
"name": "number"
},
"required": false,
"description": "@platform ios"
},
"lineHeight": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"textAlign": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'left'",
"computed": false
},
\{
"value": "'right'",
"computed": false
},
\{
"value": "'center'",
"computed": false
},
\{
"value": "'justify'",
"computed": false
}
]
},
"required": false,
"description": "Specifies text alignment. The value 'justify' is only supported on iOS and\\nfallbacks to \`left\` on Android."
},
"textAlignVertical": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'top'",
"computed": false
},
\{
"value": "'bottom'",
"computed": false
},
\{
"value": "'center'",
"computed": false
}
]
},
"required": false,
"description": "@platform android"
},
"includeFontPadding": \{
"type": \{
"name": "bool"
},
"required": false,
"description": "Set to \`false\` to remove extra font padding intended to make space for certain ascenders / descenders.\\nWith some fonts, this padding can make text look slightly misaligned when centered vertically.\\nFor best results also set \`textAlignVertical\` to \`center\`. Default is true.\\n@platform android"
},
"textDecorationLine": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"none\\"",
"computed": false
},
\{
"value": "'underline'",
"computed": false
},
\{
"value": "'line-through'",
"computed": false
},
\{
"value": "'underline line-through'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"textDecorationStyle": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"solid\\"",
"computed": false
},
\{
"value": "'double'",
"computed": false
},
\{
"value": "'dotted'",
"computed": false
},
\{
"value": "'dashed'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
},
"textDecorationColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "@platform ios"
},
"writingDirection": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "\\"auto\\"",
"computed": false
},
\{
"value": "'ltr'",
"computed": false
},
\{
"value": "'rtl'",
"computed": false
}
]
},
"required": false,
"description": "@platform ios"
}
},
"composes": [
"ViewStylePropTypes"
]
},
"ImageStylePropTypes": \{
"props": \{
"resizeMode": \{
"type": \{
"name": "enum",
"computed": true,
"value": "Object.keys(ImageResizeMode)"
},
"required": false,
"description": ""
},
"backfaceVisibility": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"backgroundColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": ""
},
"borderWidth": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overflow": \{
"type": \{
"name": "enum",
"value": [
\{
"value": "'visible'",
"computed": false
},
\{
"value": "'hidden'",
"computed": false
}
]
},
"required": false,
"description": ""
},
"tintColor": \{
"type": \{
"name": "custom",
"raw": "ColorPropType"
},
"required": false,
"description": "Changes the color of all the non-transparent pixels to the tintColor."
},
"opacity": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"overlayColor": \{
"type": \{
"name": "string"
},
"required": false,
"description": "When the image has rounded corners, specifying an overlayColor will\\ncause the remaining space in the corners to be filled with a solid color.\\nThis is useful in cases which are not supported by the Android\\nimplementation of rounded corners:\\n - Certain resize modes, such as 'contain'\\n - Animated GIFs\\n\\nA typical way to use this prop is with images displayed on a solid\\nbackground and setting the \`overlayColor\` to the same color\\nas the background.\\n\\nFor details of how this works under the hood, see\\nhttp://frescolib.org/docs/rounded-corners-and-circles.html\\n\\n@platform android"
},
"borderTopLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderTopRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomLeftRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
},
"borderBottomRightRadius": \{
"type": \{
"name": "number"
},
"required": false,
"description": ""
}
},
"composes": [
"LayoutPropTypes",
"ShadowPropTypesIOS",
"TransformPropTypes"
]
}
}
}`;
var Page = React.createClass({
statics: { content: content },
render: function() {
return (
<Layout metadata={{"id":"pickerios","title":"PickerIOS","layout":"autodocs","category":"Components","permalink":"docs/pickerios.html","platform":"ios","next":"progressbarandroid","previous":"picker","sidebar":true,"path":"Libraries/Components/Picker/PickerIOS.ios.js","filename":null}}>
{content}
</Layout>
);
}
});
module.exports = Page;

Some files were not shown because too many files have changed in this diff Show More