Skip to content

Commit

Permalink
Flatten jsdocs to markdown plaintext
Browse files Browse the repository at this point in the history
Differential Revision: D6261799

fbshipit-source-id: 269e151c5d136c1d508d9f2a060c0c670d0fe0f2
  • Loading branch information
hramos authored and facebook-github-bot committed Nov 8, 2017
1 parent 7df58e2 commit 9ec9567
Show file tree
Hide file tree
Showing 124 changed files with 19,508 additions and 66 deletions.
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ Please make sure the following is done when submitting a pull request:

1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`.
2. Add the copyright notice to the top of any new files you've added.
3. Describe your [**test plan**](/react-native/docs/contributing.html#test-plan) in your pull request description. Make sure to [test your changes](/react-native/docs/testing.html)!
3. Describe your [**test plan**](https://facebook.github.io/react-native/docs/contributing.html#test-plan) in your pull request description. Make sure to [test your changes](https://facebook.github.io/react-native/docs/testing.html)!
4. Make sure your code lints (`npm run lint`).
5. If you haven't already, [sign the CLA](https://code.facebook.com/cla).

All pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](/react-native/docs/contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.
All pull requests should be opened against the `master` branch. After opening your pull request, ensure [**all tests pass**](https://facebook.github.io/react-native/docs/contributing.html#contrinuous-integration-tests) on Circle CI. If a test fails and you believe it is unrelated to your change, leave a comment on the pull request explaining why.

> **Note:** It is not necessary to keep clicking `Merge master to your branch` on the PR page. You would want to merge master if there are conflicts or tests are failing. The Facebook-GitHub-Bot ultimately squashes all commits to a single one before merging your PR.
Expand All @@ -116,7 +116,7 @@ See [What is a Test Plan?](https://medium.com/@martinkonicek/what-is-a-test-plan

#### Continuous integration tests

Make sure all **tests pass** on [Circle CI][circle]. PRs that break tests are unlikely to be merged. Learn more about [testing your changes here](/react-native/docs/testing.html).
Make sure all **tests pass** on [Circle CI][circle]. PRs that break tests are unlikely to be merged. Learn more about [testing your changes here](https://facebook.github.io/react-native/docs/testing.html).

[circle]: http://circleci.com/gh/facebook/react-native

Expand Down
7 changes: 0 additions & 7 deletions docs/AndroidUIPerformance.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/Images.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ title: Images
layout: docs
category: Guides
permalink: docs/images.html
next: animations
next: animations
previous: navigation
---

Expand Down
7 changes: 0 additions & 7 deletions docs/NativeMethodsMixin.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/RunningOnDeviceAndroid.md

This file was deleted.

7 changes: 0 additions & 7 deletions docs/RunningOnDeviceIOS.md

This file was deleted.

Empty file removed docs/StyleGuide.md
Empty file.
156 changes: 156 additions & 0 deletions docs/accessibilityinfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
---
id: accessibilityinfo
title: AccessibilityInfo
layout: docs
category: APIs
permalink: docs/accessibilityinfo.html
next: actionsheetios
previous: webview
---

Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The
`AccessibilityInfo` API is designed for this purpose. You can use it to query the current state of the
screen reader as well as to register to be notified when the state of the screen reader changes.

Here's a small example illustrating how to use `AccessibilityInfo`:

```javascript
class ScreenReaderStatusExample extends React.Component {
state = {
screenReaderEnabled: false,
}

componentDidMount() {
AccessibilityInfo.addEventListener(
'change',
this._handleScreenReaderToggled
);
AccessibilityInfo.fetch().done((isEnabled) => {
this.setState({
screenReaderEnabled: isEnabled
});
});
}

componentWillUnmount() {
AccessibilityInfo.removeEventListener(
'change',
this._handleScreenReaderToggled
);
}

_handleScreenReaderToggled = (isEnabled) => {
this.setState({
screenReaderEnabled: isEnabled,
});
}

render() {
return (
<View>
<Text>
The screen reader is {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.
</Text>
</View>
);
}
}
```


### Methods

- [`fetch`](docs/accessibilityinfo.html#fetch)
- [`addEventListener`](docs/accessibilityinfo.html#addeventlistener)
- [`setAccessibilityFocus`](docs/accessibilityinfo.html#setaccessibilityfocus)
- [`announceForAccessibility`](docs/accessibilityinfo.html#announceforaccessibility)
- [`removeEventListener`](docs/accessibilityinfo.html#removeeventlistener)




---

# Reference

## Methods

### `fetch()`

```javascript
static fetch()
```


Query whether a screen reader is currently enabled. Returns a promise which
resolves to a boolean. The result is `true` when a screen reader is enabled
and `false` otherwise.




---

### `addEventListener()`

```javascript
static addEventListener(eventName, handler)
```


Add an event handler. Supported events:

- `change`: Fires when the state of the screen reader changes. The argument
to the event handler is a boolean. The boolean is `true` when a screen
reader is enabled and `false` otherwise.
- `announcementFinished`: iOS-only event. Fires when the screen reader has
finished making an announcement. The argument to the event handler is a dictionary
with these keys:
- `announcement`: The string announced by the screen reader.
- `success`: A boolean indicating whether the announcement was successfully made.




---

### `setAccessibilityFocus()`

```javascript
static setAccessibilityFocus(reactTag)
```


iOS-Only. Set accessibility focus to a react component.




---

### `announceForAccessibility()`

```javascript
static announceForAccessibility(announcement)
```


iOS-Only. Post a string to be announced by the screen reader.




---

### `removeEventListener()`

```javascript
static removeEventListener(eventName, handler)
```


Remove an event handler.




96 changes: 96 additions & 0 deletions docs/actionsheetios.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
id: actionsheetios
title: ActionSheetIOS
layout: docs
category: APIs
permalink: docs/actionsheetios.html
next: alert
previous: accessibilityinfo
---



### Methods

- [`showActionSheetWithOptions`](docs/actionsheetios.html#showactionsheetwithoptions)
- [`showShareActionSheetWithOptions`](docs/actionsheetios.html#showshareactionsheetwithoptions)




---

# Reference

## Methods

### `showActionSheetWithOptions()`

```javascript
static showActionSheetWithOptions(options, callback)
```


Display an iOS action sheet. The `options` object must contain one or more
of:

- `options` (array of strings) - a list of button titles (required)
- `cancelButtonIndex` (int) - index of cancel button in `options`
- `destructiveButtonIndex` (int) - index of destructive button in `options`
- `title` (string) - a title to show above the action sheet
- `message` (string) - a message to show below the title

The 'callback' function takes one parameter, the zero-based index
of the selected item.

Minimal example:

```
ActionSheetIOS.showActionSheetWithOptions({
options: ['Remove', 'Cancel'],
destructiveButtonIndex: 1,
cancelButtonIndex: 0,
},
(buttonIndex) => {
if (buttonIndex === 1) { // destructive action }
});
```





---

### `showShareActionSheetWithOptions()`

```javascript
static showShareActionSheetWithOptions(options, failureCallback, successCallback)
```


Display the iOS share sheet. The `options` object should contain
one or both of `message` and `url` and can additionally have
a `subject` or `excludedActivityTypes`:

- `url` (string) - a URL to share
- `message` (string) - a message to share
- `subject` (string) - a subject for the message
- `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet

NOTE: if `url` points to a local file, or is a base64-encoded
uri, the file it points to will be loaded and shared directly.
In this way, you can share images, videos, PDF files, etc.

The 'failureCallback' function takes one parameter, an error object.
The only property defined on this object is an optional `stack` property
of type `string`.

The 'successCallback' function takes two parameters:

- a boolean value signifying success or failure
- a string that, in the case of success, indicates the method of sharing




Loading

0 comments on commit 9ec9567

Please sign in to comment.