Skip to content

Commit 9ec9567

Browse files
hramosfacebook-github-bot
authored andcommitted
Flatten jsdocs to markdown plaintext
Differential Revision: D6261799 fbshipit-source-id: 269e151c5d136c1d508d9f2a060c0c670d0fe0f2
1 parent 7df58e2 commit 9ec9567

File tree

124 files changed

+19508
-66
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+19508
-66
lines changed

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,11 @@ Please make sure the following is done when submitting a pull request:
9696

9797
1. Fork [the repository](https://github.com/facebook/react-native) and create your branch from `master`.
9898
2. Add the copyright notice to the top of any new files you've added.
99-
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)!
99+
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)!
100100
4. Make sure your code lints (`npm run lint`).
101101
5. If you haven't already, [sign the CLA](https://code.facebook.com/cla).
102102

103-
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.
103+
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.
104104

105105
> **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.
106106
@@ -116,7 +116,7 @@ See [What is a Test Plan?](https://medium.com/@martinkonicek/what-is-a-test-plan
116116

117117
#### Continuous integration tests
118118

119-
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).
119+
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).
120120

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

docs/AndroidUIPerformance.md

-7
This file was deleted.

docs/Images.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Images
44
layout: docs
55
category: Guides
66
permalink: docs/images.html
7-
next: animations
7+
next: animations
88
previous: navigation
99
---
1010

docs/NativeMethodsMixin.md

-7
This file was deleted.

docs/RunningOnDeviceAndroid.md

-7
This file was deleted.

docs/RunningOnDeviceIOS.md

-7
This file was deleted.

docs/StyleGuide.md

Whitespace-only changes.

docs/accessibilityinfo.md

+156
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
---
2+
id: accessibilityinfo
3+
title: AccessibilityInfo
4+
layout: docs
5+
category: APIs
6+
permalink: docs/accessibilityinfo.html
7+
next: actionsheetios
8+
previous: webview
9+
---
10+
11+
Sometimes it's useful to know whether or not the device has a screen reader that is currently active. The
12+
`AccessibilityInfo` API is designed for this purpose. You can use it to query the current state of the
13+
screen reader as well as to register to be notified when the state of the screen reader changes.
14+
15+
Here's a small example illustrating how to use `AccessibilityInfo`:
16+
17+
```javascript
18+
class ScreenReaderStatusExample extends React.Component {
19+
state = {
20+
screenReaderEnabled: false,
21+
}
22+
23+
componentDidMount() {
24+
AccessibilityInfo.addEventListener(
25+
'change',
26+
this._handleScreenReaderToggled
27+
);
28+
AccessibilityInfo.fetch().done((isEnabled) => {
29+
this.setState({
30+
screenReaderEnabled: isEnabled
31+
});
32+
});
33+
}
34+
35+
componentWillUnmount() {
36+
AccessibilityInfo.removeEventListener(
37+
'change',
38+
this._handleScreenReaderToggled
39+
);
40+
}
41+
42+
_handleScreenReaderToggled = (isEnabled) => {
43+
this.setState({
44+
screenReaderEnabled: isEnabled,
45+
});
46+
}
47+
48+
render() {
49+
return (
50+
<View>
51+
<Text>
52+
The screen reader is {this.state.screenReaderEnabled ? 'enabled' : 'disabled'}.
53+
</Text>
54+
</View>
55+
);
56+
}
57+
}
58+
```
59+
60+
61+
### Methods
62+
63+
- [`fetch`](docs/accessibilityinfo.html#fetch)
64+
- [`addEventListener`](docs/accessibilityinfo.html#addeventlistener)
65+
- [`setAccessibilityFocus`](docs/accessibilityinfo.html#setaccessibilityfocus)
66+
- [`announceForAccessibility`](docs/accessibilityinfo.html#announceforaccessibility)
67+
- [`removeEventListener`](docs/accessibilityinfo.html#removeeventlistener)
68+
69+
70+
71+
72+
---
73+
74+
# Reference
75+
76+
## Methods
77+
78+
### `fetch()`
79+
80+
```javascript
81+
static fetch()
82+
```
83+
84+
85+
Query whether a screen reader is currently enabled. Returns a promise which
86+
resolves to a boolean. The result is `true` when a screen reader is enabled
87+
and `false` otherwise.
88+
89+
90+
91+
92+
---
93+
94+
### `addEventListener()`
95+
96+
```javascript
97+
static addEventListener(eventName, handler)
98+
```
99+
100+
101+
Add an event handler. Supported events:
102+
103+
- `change`: Fires when the state of the screen reader changes. The argument
104+
to the event handler is a boolean. The boolean is `true` when a screen
105+
reader is enabled and `false` otherwise.
106+
- `announcementFinished`: iOS-only event. Fires when the screen reader has
107+
finished making an announcement. The argument to the event handler is a dictionary
108+
with these keys:
109+
- `announcement`: The string announced by the screen reader.
110+
- `success`: A boolean indicating whether the announcement was successfully made.
111+
112+
113+
114+
115+
---
116+
117+
### `setAccessibilityFocus()`
118+
119+
```javascript
120+
static setAccessibilityFocus(reactTag)
121+
```
122+
123+
124+
iOS-Only. Set accessibility focus to a react component.
125+
126+
127+
128+
129+
---
130+
131+
### `announceForAccessibility()`
132+
133+
```javascript
134+
static announceForAccessibility(announcement)
135+
```
136+
137+
138+
iOS-Only. Post a string to be announced by the screen reader.
139+
140+
141+
142+
143+
---
144+
145+
### `removeEventListener()`
146+
147+
```javascript
148+
static removeEventListener(eventName, handler)
149+
```
150+
151+
152+
Remove an event handler.
153+
154+
155+
156+

docs/actionsheetios.md

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
id: actionsheetios
3+
title: ActionSheetIOS
4+
layout: docs
5+
category: APIs
6+
permalink: docs/actionsheetios.html
7+
next: alert
8+
previous: accessibilityinfo
9+
---
10+
11+
12+
13+
### Methods
14+
15+
- [`showActionSheetWithOptions`](docs/actionsheetios.html#showactionsheetwithoptions)
16+
- [`showShareActionSheetWithOptions`](docs/actionsheetios.html#showshareactionsheetwithoptions)
17+
18+
19+
20+
21+
---
22+
23+
# Reference
24+
25+
## Methods
26+
27+
### `showActionSheetWithOptions()`
28+
29+
```javascript
30+
static showActionSheetWithOptions(options, callback)
31+
```
32+
33+
34+
Display an iOS action sheet. The `options` object must contain one or more
35+
of:
36+
37+
- `options` (array of strings) - a list of button titles (required)
38+
- `cancelButtonIndex` (int) - index of cancel button in `options`
39+
- `destructiveButtonIndex` (int) - index of destructive button in `options`
40+
- `title` (string) - a title to show above the action sheet
41+
- `message` (string) - a message to show below the title
42+
43+
The 'callback' function takes one parameter, the zero-based index
44+
of the selected item.
45+
46+
Minimal example:
47+
48+
```
49+
ActionSheetIOS.showActionSheetWithOptions({
50+
options: ['Remove', 'Cancel'],
51+
destructiveButtonIndex: 1,
52+
cancelButtonIndex: 0,
53+
},
54+
(buttonIndex) => {
55+
if (buttonIndex === 1) { // destructive action }
56+
});
57+
```
58+
59+
60+
61+
62+
63+
---
64+
65+
### `showShareActionSheetWithOptions()`
66+
67+
```javascript
68+
static showShareActionSheetWithOptions(options, failureCallback, successCallback)
69+
```
70+
71+
72+
Display the iOS share sheet. The `options` object should contain
73+
one or both of `message` and `url` and can additionally have
74+
a `subject` or `excludedActivityTypes`:
75+
76+
- `url` (string) - a URL to share
77+
- `message` (string) - a message to share
78+
- `subject` (string) - a subject for the message
79+
- `excludedActivityTypes` (array) - the activities to exclude from the ActionSheet
80+
81+
NOTE: if `url` points to a local file, or is a base64-encoded
82+
uri, the file it points to will be loaded and shared directly.
83+
In this way, you can share images, videos, PDF files, etc.
84+
85+
The 'failureCallback' function takes one parameter, an error object.
86+
The only property defined on this object is an optional `stack` property
87+
of type `string`.
88+
89+
The 'successCallback' function takes two parameters:
90+
91+
- a boolean value signifying success or failure
92+
- a string that, in the case of success, indicates the method of sharing
93+
94+
95+
96+

0 commit comments

Comments
 (0)