From 09a4985fd2bed58df7970d01c62dc1b323f040f8 Mon Sep 17 00:00:00 2001 From: Nicolas Gallagher Date: Thu, 28 Sep 2017 14:49:33 -0700 Subject: [PATCH] Remove markdown component and api docs --- docs/apis/AppRegistry.md | 60 ---- docs/apis/AppState.md | 60 ---- docs/apis/AsyncStorage.md | 71 ----- docs/apis/Clipboard.md | 16 - docs/apis/Dimensions.md | 13 - docs/apis/I18nManager.md | 25 -- docs/apis/NetInfo.md | 88 ------ docs/apis/PixelRatio.md | 51 ---- docs/apis/Platform.md | 45 --- docs/apis/StyleSheet.md | 80 ----- docs/apis/Vibration.md | 35 --- docs/components/ActivityIndicator.md | 70 ----- docs/components/Button.md | 43 --- docs/components/Image.md | 167 ----------- docs/components/ProgressBar.md | 27 -- docs/components/ScrollView.md | 134 --------- docs/components/Switch.md | 76 ----- docs/components/Text.md | 161 ---------- docs/components/TextInput.md | 226 -------------- docs/components/TouchableWithoutFeedback.md | 46 --- docs/components/View.md | 317 -------------------- 21 files changed, 1811 deletions(-) delete mode 100644 docs/apis/AppRegistry.md delete mode 100644 docs/apis/AppState.md delete mode 100644 docs/apis/AsyncStorage.md delete mode 100644 docs/apis/Clipboard.md delete mode 100644 docs/apis/Dimensions.md delete mode 100644 docs/apis/I18nManager.md delete mode 100644 docs/apis/NetInfo.md delete mode 100644 docs/apis/PixelRatio.md delete mode 100644 docs/apis/Platform.md delete mode 100644 docs/apis/StyleSheet.md delete mode 100644 docs/apis/Vibration.md delete mode 100644 docs/components/ActivityIndicator.md delete mode 100644 docs/components/Button.md delete mode 100644 docs/components/Image.md delete mode 100644 docs/components/ProgressBar.md delete mode 100644 docs/components/ScrollView.md delete mode 100644 docs/components/Switch.md delete mode 100644 docs/components/Text.md delete mode 100644 docs/components/TextInput.md delete mode 100644 docs/components/TouchableWithoutFeedback.md delete mode 100644 docs/components/View.md diff --git a/docs/apis/AppRegistry.md b/docs/apis/AppRegistry.md deleted file mode 100644 index e2ba875d..00000000 --- a/docs/apis/AppRegistry.md +++ /dev/null @@ -1,60 +0,0 @@ -# AppRegistry - -`AppRegistry` is the control point for registering, running, prerendering, and -unmounting all apps. App root components should register themselves with -`AppRegistry.registerComponent`. Apps can be run by invoking -`AppRegistry.runApplication` (see the [getting started guide](../guides/getting-started.md) for more details). - -To "stop" an application when a view should be destroyed, call -`AppRegistry.unmountApplicationComponentAtRootTag` with the tag that was passed -into `runApplication`. These should always be used as a pair. - -## Methods - -(web) static **getApplication**(appKey:string, appParameters: object) - -Returns the given application element. Use this for server-side rendering. -Return object is of type `{ element: ReactElement; stylesheets: [ ReactElement ] }`. - -static **registerConfig**(config: Array) - -Registry multiple applications. `AppConfig` is of type `{ appKey: string; -component: ComponentProvider; run?: Function }`. - -static **registerComponent**(appKey: string, getComponentFunc: ComponentProvider) - -Register a component provider under the given `appKey`. - -static **registerRunnable**(appKey: string, run: Function) - -Register a custom render function for an application. The function will receive -the `appParameters` passed to `runApplication`. - -static **getAppKeys**() - -Returns all registered app keys. - -static **runApplication**(appKey: string, appParameters?: object) - -Runs the application that was registered under `appKey`. The `appParameters` -must include the `rootTag` into which the application is rendered, and -optionally any `initialProps`. - -On web, if the `rootTag` is a sub-section of your application it should be -styled as `position:relative` and given an explicit height. - -static **unmountApplicationComponentAtRootTag**(rootTag: HTMLElement) - -To "stop" an application when a view should be destroyed, call -`AppRegistry.unmountApplicationComponentAtRootTag` with the tag that was passed -into `runApplication` - -## Example - -```js -AppRegistry.registerComponent('MyApp', () => AppComponent) -AppRegistry.runApplication('MyApp', { - initialProps: {}, - rootTag: document.getElementById('react-root') -}) -``` diff --git a/docs/apis/AppState.md b/docs/apis/AppState.md deleted file mode 100644 index 06223db6..00000000 --- a/docs/apis/AppState.md +++ /dev/null @@ -1,60 +0,0 @@ -## AppState - -`AppState` can tell you if the app is in the foreground or background, and -notify you when the state changes. - -States - -* `active` - The app is running in the foreground -* `background` - The app is running in the background (i.e., the user has not focused the app's tab). - -## Properties - -static **currentState** - -Returns the current state of the app: `active` or `background`. - -## Methods - -static **addEventListener**(type: string, handler: Function) - -Add a handler to `AppState` changes by listening to the `change` event type and -providing the `handler`. The handler is called with the app state value. - -static **removeEventListener**(type: string, handler: Function) - -Remove a handler by passing the change event `type` and the `handler`. - -## Examples - -To see the current state, you can check `AppState.currentState`, which will be -kept up-to-date. This example will only ever appear to say "Current state is: -active" because the app is only visible to the user when in the `active` state, -and the null state will happen only momentarily. - -```js -class Example extends React.Component { - constructor(props) { - super(props) - this.state = { currentAppState: AppState.currentState } - } - - componentDidMount() { - AppState.addEventListener('change', this._handleAppStateChange); - } - - componentWillUnmount() { - AppState.removeEventListener('change', this._handleAppStateChange); - } - - _handleAppStateChange = (currentAppState) => { - this.setState({ currentAppState }); - } - - render() { - return ( - Current state is: {this.state.currentAppState} - ) - } -} -``` diff --git a/docs/apis/AsyncStorage.md b/docs/apis/AsyncStorage.md deleted file mode 100644 index 6c83b3cf..00000000 --- a/docs/apis/AsyncStorage.md +++ /dev/null @@ -1,71 +0,0 @@ -# AsyncStorage - -`AsyncStorage` is a simple, asynchronous, persistent, key-value storage system -that is global to the domain. It's a facade over, and should be used instead of -`window.localStorage` to provide an asynchronous API and multi functions. Each -method returns a `Promise` object. - -It is recommended that you use an abstraction on top of `AsyncStorage` instead -of `AsyncStorage` directly for anything more than light usage since it operates -globally. - -The batched functions are useful for executing a lot of operations at once, -allowing for optimizations to provide the convenience of a single promise after -all operations are complete. - -## Methods - -static **clear**() - -Erases all AsyncStorage. You probably don't want to call this - use -`removeItem` or `multiRemove` to clear only your own keys instead. Returns a -Promise object. - -static **getAllKeys**() - -Gets all known keys. Returns a Promise object. - -static **getItem**(key: string) - -Fetches the value of the given key. Returns a Promise object. - -static **mergeItem**(key: string, value: string) - -Merges existing value with input value, assuming they are stringified JSON. -Returns a Promise object. - -static **multiGet**(keys: Array) - -`multiGet` results in an array of key-value pair arrays that matches the input -format of `multiSet`. Returns a Promise object. - -```js -multiGet(['k1', 'k2']) -> [['k1', 'val1'], ['k2', 'val2']] -``` - -static **multiMerge**(keyValuePairs: Array>) - -multiMerge takes an array of key-value array pairs that match the output of -`multiGet`. It merges existing values with input values, assuming they are -stringified JSON. Returns a Promise object. - -static **multiRemove**(keys: Array) - -Delete all the keys in the keys array. Returns a Promise object. - -static **multiSet**(keyValuePairs: Array>) - -`multiSet` takes an array of key-value array pairs that match the output of -`multiGet`. Returns a Promise object. - -```js -multiSet([['k1', 'val1'], ['k2', 'val2']]); -``` - -static **removeItem**(key: string) - -Removes the value of the given key. Returns a Promise object. - -static **setItem**(key: string, value: string) - -Sets the value of the given key. Returns a Promise object. diff --git a/docs/apis/Clipboard.md b/docs/apis/Clipboard.md deleted file mode 100644 index 84de7d87..00000000 --- a/docs/apis/Clipboard.md +++ /dev/null @@ -1,16 +0,0 @@ -# Clipboard - -Clipboard gives you an interface for setting to the clipboard. (Getting -clipboard content is not supported on web.) - -## Methods - -static **getString**() - -Returns a `Promise` of an empty string. - -static **setString**(content: string): boolean - -Copies a string to the clipboard. On web, some browsers may not support copying -to the clipboard, therefore, this function returns a boolean to indicate if the -copy was successful. diff --git a/docs/apis/Dimensions.md b/docs/apis/Dimensions.md deleted file mode 100644 index 20a7b09f..00000000 --- a/docs/apis/Dimensions.md +++ /dev/null @@ -1,13 +0,0 @@ -# Dimensions - -Note: dimensions may change (e.g due to device rotation) so any rendering logic -or styles that depend on these constants should try to call this function on -every render, rather than caching the value. - -## Methods - -static **get**(dimension: string) - -Get a dimension (e.g., `"window"` or `"screen"`). - -Example: `const { height, width } = Dimensions.get('window')` diff --git a/docs/apis/I18nManager.md b/docs/apis/I18nManager.md deleted file mode 100644 index 0d76feec..00000000 --- a/docs/apis/I18nManager.md +++ /dev/null @@ -1,25 +0,0 @@ -# I18nManager - -Control and set the layout and writing direction of the application. - -## Properties - -**isRTL**: bool = false - -Whether the application is currently in RTL mode. - -## Methods - -static **allowRTL**(allowRTL: bool) - -Allow the application to display in RTL mode. - -static **forceRTL**(forceRTL: bool) - -Force the application to display in RTL mode. - -static **setPreferredLanguageRTL**(isRTL: bool) - -Set the application's preferred writing direction to RTL. You will need to -determine the user's preferred locale server-side (from HTTP headers) and -decide whether it's an RTL language. diff --git a/docs/apis/NetInfo.md b/docs/apis/NetInfo.md deleted file mode 100644 index 67312985..00000000 --- a/docs/apis/NetInfo.md +++ /dev/null @@ -1,88 +0,0 @@ -# NetInfo - -`NetInfo` asynchronously determines the online/offline status of the -application and depending on browser support via -[NetworkInformation API](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation), -additional information about the connection. - -EffectiveConnectionType: - -* `4g` -* `3g` -* `2g` -* `slow-2g` -* `unknown` - -ConnectionType: - -* `bluetooth` - The user agent is using a Bluetooth connection. -* `cellular` - The user agent is using a cellular connection (e.g., EDGE, HSPA, LTE, etc.). -* `ethernet` - The user agent is using an Ethernet connection. -* `mixed` - The user agent is using multiple connection types. -* `none` - The user agent will not contact the network (offline). -* `other` - The user agent is using a connection type that is not one of enumerated connection types. -* `unknown` - The user agent has established a network connection, but is unable to determine what is the underlying connection technology. -* `wifi` - The user agent is using a Wi-Fi connection. -* `wimax` - The user agent is using a WiMAX connection. - -## Methods - -Note that support for retrieving the connection type depends upon browswer -support and the current platform. It will default to `unknown` when -support is missing. - -static **addEventListener**(eventName: ChangeEventName, handler: Function) - -static **getConnectionInfo**(): Promise - -static **removeEventListener**(eventName: ChangeEventName, handler: Function) - -## Properties - -**isConnected**: bool = true - -Available on all user agents. Asynchronously fetch a boolean to determine -internet connectivity. Use this if you are only interested with whether the device has internet connectivity. - -**isConnected.addEventListener**(eventName: ChangeEventName, handler: Function) - -**isConnected.getConnectionInfo**(): Promise - -**isConnected.removeEventListener**(eventName: ChangeEventName, handler: Function) - -## Examples - -Fetching the connection type: - -```js -NetInfo.getConnectionInfo().then(({ effectiveType, type }) => { - console.log('Effective connection type:', effectiveType); - console.log('Connection type:', type); -}); -``` - -Subscribing to changes in the connection type: - -```js -const handleConnectivityTypeChange = ({ effectiveType }) => { - console.log('Current effective connection type:', effectiveType); -} -NetInfo.addEventListener('connectionChange', handleConnectivityTypeChange); -``` - -Fetching the connection status: - -```js -NetInfo.isConnected.getConnectionInfo().then((isConnected) => { - console.log('Connection status:', (isConnected ? 'online' : 'offline')); -}); -``` - -Subscribing to changes in the connection status: - -```js -const handleConnectivityStatusChange = (isConnected) => { - console.log('Current connection status:', (isConnected ? 'online' : 'offline')); -} -NetInfo.isConnected.addEventListener('connectionChange', handleConnectivityStatusChange); -``` diff --git a/docs/apis/PixelRatio.md b/docs/apis/PixelRatio.md deleted file mode 100644 index 0acc3e09..00000000 --- a/docs/apis/PixelRatio.md +++ /dev/null @@ -1,51 +0,0 @@ -# PixelRatio - -`PixelRatio` gives access to the device pixel density. - -## Methods - -static **get**() - -Returns the device pixel density. Some examples: - -* PixelRatio.get() === 1 - * mdpi Android devices (160 dpi) -* PixelRatio.get() === 1.5 - * hdpi Android devices (240 dpi) -* PixelRatio.get() === 2 - * iPhone 4, 4S - * iPhone 5, 5c, 5s - * iPhone 6 - * xhdpi Android devices (320 dpi) -* PixelRatio.get() === 3 - * iPhone 6 plus - * xxhdpi Android devices (480 dpi) -* PixelRatio.get() === 3.5 - * Nexus 6 - -static **getPixelSizeForLayoutSize**(layoutSize: number) - -Converts a layout size (dp) to pixel size (px). Guaranteed to return an integer -number. - -static **roundToNearestPixel**(layoutSize: number) - -Rounds a layout size (dp) to the nearest layout size that corresponds to an -integer number of pixels. For example, on a device with a PixelRatio of 3, -`PixelRatio.roundToNearestPixel(8.4)` = `8.33`, which corresponds to exactly -`(8.33 * 3)` = `25` pixels. - -## Examples - -Fetching a correctly sized image. You should get a higher resolution image if -you are on a high pixel density device. A good rule of thumb is to multiply the -size of the image you display by the pixel ratio. - -```js -const image = getImage({ - width: PixelRatio.getPixelSizeForLayoutSize(200), - height: PixelRatio.getPixelSizeForLayoutSize(100), -}); - - -``` diff --git a/docs/apis/Platform.md b/docs/apis/Platform.md deleted file mode 100644 index e6e2e191..00000000 --- a/docs/apis/Platform.md +++ /dev/null @@ -1,45 +0,0 @@ -# Platform - -Detect what is the platform in which the app is running. This piece of -functionality can be useful when only small parts of a component are platform -specific. - -## Properties - -**OS**: string - -`Platform.OS` will be `web` when running in a Web browser. - -```js -import { Platform } from 'react-native'; - -const styles = StyleSheet.create({ - height: (Platform.OS === 'web') ? 200 : 100, -}); -``` - -## Methods - -**select**(object): any - -`Platform.select` takes an object containing `Platform.OS` as keys and returns -the value for the platform you are currently running on. - -```js -import { Platform } from 'react-native'; - -const containerStyles = { - flex: 1, - ...Platform.select({ - android: { - backgroundColor: 'blue' - }, - ios: { - backgroundColor: 'red' - }, - web: { - backgroundColor: 'green' - } - }) -}); -``` diff --git a/docs/apis/StyleSheet.md b/docs/apis/StyleSheet.md deleted file mode 100644 index c5104a3d..00000000 --- a/docs/apis/StyleSheet.md +++ /dev/null @@ -1,80 +0,0 @@ -# StyleSheet - -The `StyleSheet` abstraction converts predefined styles to (vendor-prefixed) -CSS without requiring a compile-time step. Styles that cannot be resolved -outside of the render loop (e.g., dynamic positioning) are usually applied as -inline styles. Read more about [how to style your -application](../guides/style.md). - -## Methods - -**create**(obj: {[key: string]: any}) - -Each key of the object passed to `create` must define a style object. - -**flatten**: function - -Flattens an array of styles into a single style object. - -(web) **getStyleSheets**: function - -Returns an array of stylesheets (`{ id, textContent }`). Useful for -compile-time or server-side rendering. - -## Properties - -**absoluteFill**: number - -A very common pattern is to create overlays with position absolute and zero positioning, -so `absoluteFill` can be used for convenience and to reduce duplication of these repeated -styles. - -```js - -``` - -**absoluteFillObject**: object - -Sometimes you may want `absoluteFill` but with a couple tweaks - `absoluteFillObject` can be -used to create a customized entry in a `StyleSheet`, e.g.: - -```js -const styles = StyleSheet.create({ - wrapper: { - ...StyleSheet.absoluteFillObject, - backgroundColor: 'transparent', - top: 10 - } -}) -``` - -**hairlineWidth**: number - -## Example - -```js - - - - -const styles = StyleSheet.create({ - container: { - borderRadius: 4, - borderWidth: 0.5, - borderColor: '#d6d7da', - }, - title: { - fontSize: 19, - fontWeight: 'bold', - }, - activeTitle: { - color: 'red', - } -}) -``` diff --git a/docs/apis/Vibration.md b/docs/apis/Vibration.md deleted file mode 100644 index 6640bf57..00000000 --- a/docs/apis/Vibration.md +++ /dev/null @@ -1,35 +0,0 @@ -# Vibration - -Vibration is described as a pattern of on-off pulses, which may be of varying -lengths. The pattern may consist of either a single integer, describing the -number of milliseconds to vibrate, or an array of integers describing a pattern -of vibrations and pauses. Vibration is controlled with a single method: -`Vibration.vibrate()`. - -The vibration is asynchronous so this method will return immediately. There -will be no effect on devices that do not support vibration. - -## Methods - -static **cancel**() - -Stop the vibration. - -static **vibrate**(pattern) - -Start the vibration pattern. - -## Examples - -Vibrate once for 200ms: - -```js -Vibration.vibrate(200); -Vibration.vibrate([200]); -``` - -Vibrate for 200ms, pause for 100ms, vibrate for 200ms: - -```js -Vibration.vibrate([200, 100, 200]); -``` diff --git a/docs/components/ActivityIndicator.md b/docs/components/ActivityIndicator.md deleted file mode 100644 index eac4425b..00000000 --- a/docs/components/ActivityIndicator.md +++ /dev/null @@ -1,70 +0,0 @@ -# ActivityIndicator - -## Props - -[...View props](./View.md) - -**animating**: boolean = true - -Whether to show the indicator or hide it. - -**color**: ?color = '#1976D2' - -The foreground color of the spinner. - -**hidesWhenStopped**: ?boolean = true - -Whether the indicator should hide when not animating. - -**size**: ?enum('small, 'large') | number = 'small' - -Size of the indicator. Small has a height of `20`, large has a height of `36`. - -## Examples - -```js -import React, { Component } from 'react' -import { ActivityIndicator, StyleSheet, View } from 'react-native' - -class ToggleAnimatingActivityIndicator extends Component { - constructor(props) { - super(props) - this.state = { animating: true } - } - - componentDidMount: function() { - this.setToggleTimeout(); - } - - render() { - return ( - - ); - } - - _setToggleTimeout() { - setTimeout(() => { - this.setState({ animating: !this.state.animating }) - this._setToggleTimeout() - }, 1200) - } -}) - -const styles = StyleSheet.create({ - centering: { - alignItems: 'center', - justifyContent: 'center' - }, - gray: { - backgroundColor: '#cccccc' - }, - horizontal: { - flexDirection: 'row', - justifyContent: 'space-around' - } -}) -``` diff --git a/docs/components/Button.md b/docs/components/Button.md deleted file mode 100644 index 7253ed1c..00000000 --- a/docs/components/Button.md +++ /dev/null @@ -1,43 +0,0 @@ -# Button - -A basic button component. Supports a minimal level of customization. You can -build your own custom button using `TouchableOpacity` or -`TouchableNativeFeedback`. - -## Props - -**accessibilityLabel**: ?string - -Overrides the text that's read by a screen reader when the user interacts -with the element. - -**color**: ?string - -Background color of the button. - -**disabled**: ?boolean - -If `true`, disable all interactions for this element. - -**onPress**: function - -This function is called on press. - -**testID**: ?string - -Used to locate this view in end-to-end tests. - -**title**: string - -Text to display inside the button. - -## Examples - -```js -