diff --git a/.vscode/typings/react-native/react-native.d.ts b/.vscode/typings/react-native/react-native.d.ts new file mode 100644 index 0000000000..0e25262a0a --- /dev/null +++ b/.vscode/typings/react-native/react-native.d.ts @@ -0,0 +1,3480 @@ +// Type definitions for react-native 0.14 +// Project: https://github.com/facebook/react-native +// Definitions by: Bruno Grieder +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// USING: these definitions are meant to be used with the TSC compiler target set to ES6 +// +// USAGE EXAMPLES: check the RNTSExplorer project at https://github.com/bgrieder/RNTSExplorer +// +// CONTRIBUTING: please open pull requests and make sure that the changes do not break RNTSExplorer (they should not) +// Do not hesitate to open a pull request against RNTSExplorer to provide an example for a case not covered by the current App +// +// CREDITS: This work is based on an original work made by Bernd Paradies: https://github.com/bparadie +// +/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +/// + +//so we know what is "original" React +import React = __React; + +//react-native "extends" react +declare namespace __React { + + + /** + * Represents the completion of an asynchronous operation + * @see lib.es6.d.ts + */ + export interface Promise { + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then( onfulfilled?: ( value: T ) => TResult | Promise, onrejected?: ( reason: any ) => TResult | Promise ): Promise; + + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch( onrejected?: ( reason: any ) => T | Promise ): Promise; + + + // not in lib.es6.d.ts but called by react-native + done( callback?: ( value: T ) => void ): void; + } + + export interface PromiseConstructor { + /** + * A reference to the prototype. + */ + prototype: Promise; + + /** + * Creates a new Promise. + * @param init A callback used to initialize the promise. This callback is passed two arguments: + * a resolve callback used resolve the promise with a value or the result of another promise, + * and a reject callback used to reject the promise with a provided reason or error. + */ + new ( init: ( resolve: ( value?: T | Promise ) => void, reject: ( reason?: any ) => void ) => void ): Promise; + + ( init: ( resolve: ( value?: T | Promise ) => void, reject: ( reason?: any ) => void ) => void ): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + all( values: (T | Promise)[] ): Promise; + + /** + * Creates a Promise that is resolved with an array of results when all of the provided Promises + * resolve, or rejected when any Promise is rejected. + * @param values An array of values. + * @returns A new Promise. + */ + all( values: Promise[] ): Promise; + + /** + * Creates a Promise that is resolved or rejected when any of the provided Promises are resolved + * or rejected. + * @param values An array of Promises. + * @returns A new Promise. + */ + race( values: (T | Promise)[] ): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject( reason: any ): Promise; + + /** + * Creates a new rejected promise for the provided reason. + * @param reason The reason the promise was rejected. + * @returns A new rejected Promise. + */ + reject( reason: any ): Promise; + + /** + * Creates a new resolved promise for the provided value. + * @param value A promise. + * @returns A promise whose internal state matches the provided promise. + */ + resolve( value: T | Promise ): Promise; + + /** + * Creates a new resolved promise . + * @returns A resolved promise. + */ + resolve(): Promise; + } + + // @see lib.es6.d.ts + export var Promise: PromiseConstructor; + + //TODO: BGR: Replace with ComponentClass ? + // node_modules/react-tools/src/classic/class/ReactClass.js + export interface ReactClass { + // TODO: + } + + // see react-jsx.d.ts + export function createElement

( type: React.ReactType, + props?: P, + ...children: React.ReactNode[] ): React.ReactElement

; + + + export type Runnable = ( appParameters: any ) => void; + + + // Similar to React.SyntheticEvent except for nativeEvent + interface NativeSyntheticEvent { + bubbles: boolean + cancelable: boolean + currentTarget: EventTarget + defaultPrevented: boolean + eventPhase: number + isTrusted: boolean + nativeEvent: T + preventDefault(): void + stopPropagation(): void + target: EventTarget + timeStamp: Date + type: string + } + + export interface NativeTouchEvent { + /** + * Array of all touch events that have changed since the last event + */ + changedTouches: NativeTouchEvent[] + + /** + * The ID of the touch + */ + identifier: string + + /** + * The X position of the touch, relative to the element + */ + locationX: number + + /** + * The Y position of the touch, relative to the element + */ + locationY: number + + /** + * The X position of the touch, relative to the screen + */ + pageX: number + + /** + * The Y position of the touch, relative to the screen + */ + pageY: number + + /** + * The node id of the element receiving the touch event + */ + target: string + + /** + * A time identifier for the touch, useful for velocity calculation + */ + timestamp: number + + /** + * Array of all current touches on the screen + */ + touches : NativeTouchEvent[] + } + + export interface GestureResponderEvent extends NativeSyntheticEvent { + } + + + export interface PointProperties { + x: number + y: number + } + + export interface Insets { + top?: number + left?: number + bottom?: number + right?: number + } + + /** + * //FIXME: need to find documentation on which compoenent is a native (i.e. non composite component) + */ + export interface NativeComponent { + setNativeProps: ( props: Object ) => void + } + + /** + * //FIXME: need to find documentation on which component is a TTouchable and can implement that interface + * @see React.DOMAtributes + */ + export interface Touchable { + onTouchStart?: ( event: GestureResponderEvent ) => void + onTouchMove?: ( event: GestureResponderEvent ) => void + onTouchEnd?: ( event: GestureResponderEvent ) => void + onTouchCancel?: ( event: GestureResponderEvent ) => void + onTouchEndCapture?: ( event: GestureResponderEvent ) => void + } + + export type AppConfig = { + appKey: string; + component: ReactClass; + run?: Runnable; + } + + // https://github.com/facebook/react-native/blob/master/Libraries/AppRegistry/AppRegistry.js + export class AppRegistry { + static registerConfig( config: AppConfig[] ): void; + + static registerComponent( appKey: string, getComponentFunc: () => React.ComponentClass ): string; + + static registerRunnable( appKey: string, func: Runnable ): string; + + static runApplication( appKey: string, appParameters: any ): void; + } + + export interface LayoutAnimationTypes { + spring: string + linear: string + easeInEaseOut: string + easeIn: string + easeOut: string + } + + export interface LayoutAnimationProperties { + opacity: string + scaleXY: string + } + + export interface LayoutAnimationAnim { + duration?: number + delay?: number + springDamping?: number + initialVelocity?: number + type?: string //LayoutAnimationTypes + property?: string //LayoutAnimationProperties + } + + export interface LayoutAnimationConfig { + duration: number + create?: LayoutAnimationAnim + update?: LayoutAnimationAnim + delete?: LayoutAnimationAnim + } + + export interface LayoutAnimationStatic { + + configureNext: ( config: LayoutAnimationConfig, onAnimationDidEnd?: () => void, onError?: ( error?: any ) => void ) => void + create: ( duration: number, type?: string, creationProp?: string ) => LayoutAnimationConfig + Types: LayoutAnimationTypes + Properties: LayoutAnimationProperties + configChecker: ( conf: {config: LayoutAnimationConfig}, name: string, next: string ) => void + Presets : { + easeInEaseOut: LayoutAnimationConfig + linear:LayoutAnimationConfig + spring: LayoutAnimationConfig + } + } + + + /** + * Flex Prop Types + * @see https://facebook.github.io/react-native/docs/flexbox.html#proptypes + * @see LayoutPropTypes.js + */ + export interface FlexStyle { + + alignItems?: string; //enum('flex-start', 'flex-end', 'center', 'stretch') + alignSelf?: string// enum('auto', 'flex-start', 'flex-end', 'center', 'stretch') + borderBottomWidth?: number + borderLeftWidth?: number + borderRightWidth?: number + borderTopWidth?: number + borderWidth?: number + bottom?: number + flex?: number + flexDirection?: string // enum('row', 'column') + flexWrap?: string // enum('wrap', 'nowrap') + height?: number + justifyContent?: string // enum('flex-start', 'flex-end', 'center', 'space-between', 'space-around') + left?: number + margin?: number + marginBottom?: number + marginHorizontal?: number + marginLeft?: number + marginRight?: number + marginTop?: number + marginVertical?: number + padding?: number + paddingBottom?: number + paddingHorizontal?: number + paddingLeft?: number + paddingRight?: number + paddingTop?: number + paddingVertical?: number + position?: string // enum('absolute', 'relative') + right?: number + top?: number + width?: number + } + + + export interface TransformsStyle { + + transform?: [{perspective: number}, {rotate: string}, {rotateX: string}, {rotateY: string}, {rotateZ: string}, {scale: number}, {scaleX: number}, {scaleY: number}, {translateX: number}, {translateY: number}, {skewX: string}, {skewY: string}] + transformMatrix?: Array + rotation?: number + scaleX?: number + scaleY?: number + translateX?: number + translateY?: number + } + + + export interface StyleSheetProperties { + // TODO: + } + + export interface LayoutRectangle { + x: number; + y: number; + width: number; + height: number; + } + + // @see TextProperties.onLayout + export interface LayoutChangeEvent { + nativeEvent: { + layout: LayoutRectangle + } + } + + // @see https://facebook.github.io/react-native/docs/text.html#style + export interface TextStyle extends ViewStyle { + color?: string + fontFamily?: string + fontSize?: number + fontStyle?: string // 'normal' | 'italic'; + fontWeight?: string // enum("normal", 'bold', '100', '200', '300', '400', '500', '600', '700', '800', '900') + letterSpacing?: number + lineHeight?: number + textAlign?: string // enum("auto", 'left', 'right', 'center') + textDecorationLine?: string // enum("none", 'underline', 'line-through', 'underline line-through') + textDecorationStyle?: string // enum("solid", 'double', 'dotted', 'dashed') + textDecorationColor?: string + writingDirection?: string; //enum("auto", 'ltr', 'rtl') + //containerBackgroundColor?: string + } + + export interface TextPropertiesIOS { + + /** + * When true, no visual change is made when text is pressed down. + * By default, a gray oval highlights the text on press down. + */ + suppressHighlighting?: boolean + } + + // https://facebook.github.io/react-native/docs/text.html#props + export interface TextProperties extends React.Props { + + /** + * Specifies should fonts scale to respect Text Size accessibility setting on iOS. + */ + allowFontScaling?: boolean + + /** + * Used to truncate the text with an elipsis after computing the text layout, including line wrapping, such that the total number of lines does not exceed this number. + */ + numberOfLines?: number + + /** + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void + + /** + * This function is called on press. + * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting). + */ + onPress?: () => void + + /** + * @see https://facebook.github.io/react-native/docs/text.html#style + */ + style?: TextStyle + + /** + * Used to locate this view in end-to-end tests. + */ + testID?: string + } + + /** + * A React component for displaying text which supports nesting, styling, and touch handling. + */ + export interface TextStatic extends React.ComponentClass { + + } + + + /** + * IOS Specific properties for TextInput + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputIOSProperties { + + /** + * If true, the text field will blur when submitted. + * The default value is true. + */ + blurOnSubmit?: boolean + + /** + * enum('never', 'while-editing', 'unless-editing', 'always') + * When the clear button should appear on the right side of the text view + */ + clearButtonMode?: string + + /** + * If true, clears the text field automatically when editing begins + */ + clearTextOnFocus?: boolean + + /** + * If true, the keyboard disables the return key when there is no text and automatically enables it when there is text. + * The default value is false. + */ + enablesReturnKeyAutomatically?: boolean + + /** + * Callback that is called when a key is pressed. + * Pressed key value is passed as an argument to the callback handler. + * Fires before onChange callbacks. + */ + onKeyPress?: () => void + + /** + * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') + * Determines how the return key should look. + */ + returnKeyType?: string + + /** + * If true, all text will automatically be selected on focus + */ + selectTextOnFocus?: boolean + + /** + * //FIXME: requires typing + * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document + */ + selectionState?: any + + + } + + /** + * Android Specific properties for TextInput + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputAndroidProperties { + + /** + * Sets the number of lines for a TextInput. + * Use it with multiline set to true to be able to fill the lines. + */ + numberOfLines?: number + + /** + * enum('start', 'center', 'end') + * Set the position of the cursor from where editing will begin. + */ + textAlign?: string + + /** + * enum('top', 'center', 'bottom') + * Aligns text vertically within the TextInput. + */ + textAlignVertical?: string + + /** + * The color of the textInput underline. + */ + underlineColorAndroid?: string + } + + + /** + * @see https://facebook.github.io/react-native/docs/textinput.html#props + */ + export interface TextInputProperties extends TextInputIOSProperties, TextInputAndroidProperties, React.Props { + + /** + * Can tell TextInput to automatically capitalize certain characters. + * characters: all characters, + * words: first letter of each word + * sentences: first letter of each sentence (default) + * none: don't auto capitalize anything + * + * https://facebook.github.io/react-native/docs/textinput.html#autocapitalize + */ + autoCapitalize?: string + + /** + * If false, disables auto-correct. + * The default value is true. + */ + autoCorrect?: boolean + + /** + * If true, focuses the input on componentDidMount. + * The default value is false. + */ + autoFocus?: boolean + + /** + * Provides an initial value that will change when the user starts typing. + * Useful for simple use-cases where you don't want to deal with listening to events + * and updating the value prop to keep the controlled state in sync. + */ + defaultValue?: string + + /** + * If false, text is not editable. The default value is true. + */ + editable?: boolean + + /** + * enum("default", 'numeric', 'email-address', "ascii-capable", 'numbers-and-punctuation', 'url', 'number-pad', 'phone-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search') + * Determines which keyboard to open, e.g.numeric. + * The following values work across platforms: - default - numeric - email-address + */ + keyboardType?: string + + /** + * Limits the maximum number of characters that can be entered. + * Use this instead of implementing the logic in JS to avoid flicker. + */ + maxLength?: number + + /** + * If true, the text input can be multiple lines. The default value is false. + */ + multiline?: boolean + + /** + * Callback that is called when the text input is blurred + */ + onBlur?: () => void + + /** + * Callback that is called when the text input's text changes. + */ + onChange?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * Callback that is called when the text input's text changes. + * Changed text is passed as an argument to the callback handler. + */ + onChangeText?: ( text: string ) => void + + /** + * Callback that is called when text input ends. + */ + onEndEditing?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * Callback that is called when the text input is focused + */ + onFocus?: () => void + + /** + * Invoked on mount and layout changes with {x, y, width, height}. + */ + onLayout?: ( event: {nativeEvent: {x: number, y: number, width: number, height: number}} ) => void + + /** + * Callback that is called when the text input's submit button is pressed. + */ + onSubmitEditing?: ( event: {nativeEvent: {text: string}} ) => void + + /** + * //FIXME: Not part of the doc but found in examples + */ + password?: boolean + + /** + * The string that will be rendered before text input has been entered + */ + placeholder?: string + + /** + * The text color of the placeholder string + */ + placeholderTextColor?: string + + /** + * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. + * The default value is false. + */ + secureTextEntry?: boolean + + /** + * Styles + */ + style?: TextStyle + + /** + * Used to locate this view in end-to-end tests + */ + testID?: string + + /** + * The value to show for the text input. TextInput is a controlled component, + * which means the native value will be forced to match this value prop if provided. + * For most uses this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. + * In addition to simply setting the same value, either set editable={false}, + * or set/update maxLength to prevent unwanted edits without flicker. + */ + value?: string + } + + export interface TextInputStatic extends NativeComponent, React.ComponentClass { + blur: () => void + focus: () => void + } + + + /** + * Gesture recognition on mobile devices is much more complicated than web. + * A touch can go through several phases as the app determines what the user's intention is. + * For example, the app needs to determine if the touch is scrolling, sliding on a widget, or tapping. + * This can even change during the duration of a touch. There can also be multiple simultaneous touches. + * + * The touch responder system is needed to allow components to negotiate these touch interactions + * without any additional knowledge about their parent or child components. + * This system is implemented in ResponderEventPlugin.js, which contains further details and documentation. + * + * Best Practices + * Users can feel huge differences in the usability of web apps vs. native, and this is one of the big causes. + * Every action should have the following attributes: + * Feedback/highlighting- show the user what is handling their touch, and what will happen when they release the gesture + * Cancel-ability- when making an action, the user should be able to abort it mid-touch by dragging their finger away + * + * These features make users more comfortable while using an app, + * because it allows people to experiment and interact without fear of making mistakes. + * + * TouchableHighlight and Touchable* + * The responder system can be complicated to use. + * So we have provided an abstract Touchable implementation for things that should be "tappable". + * This uses the responder system and allows you to easily configure tap interactions declaratively. + * Use TouchableHighlight anywhere where you would use a button or link on web. + */ + export interface GestureResponderHandlers { + + /** + * A view can become the touch responder by implementing the correct negotiation methods. + * There are two methods to ask the view if it wants to become responder: + */ + + /** + * Does this view want to become responder on the start of a touch? + */ + onStartShouldSetResponder?: ( event: GestureResponderEvent ) => boolean + + /** + * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness? + */ + onMoveShouldSetResponder?: ( event: GestureResponderEvent ) => boolean + + /** + * If the View returns true and attempts to become the responder, one of the following will happen: + */ + + /** + * The View is now responding for touch events. + * This is the time to highlight and show the user what is happening + */ + onResponderGrant?: ( event: GestureResponderEvent ) => void + + /** + * Something else is the responder right now and will not release it + */ + onResponderReject?: ( event: GestureResponderEvent ) => void + + /** + * If the view is responding, the following handlers can be called: + */ + + /** + * The user is moving their finger + */ + onResponderMove?: ( event: GestureResponderEvent ) => void + + /** + * Fired at the end of the touch, ie "touchUp" + */ + onResponderRelease?: ( event: GestureResponderEvent ) => void + + /** + * Something else wants to become responder. + * Should this view release the responder? Returning true allows release + */ + onResponderTerminationRequest?: ( event: GestureResponderEvent ) => boolean + + /** + * The responder has been taken from the View. + * Might be taken by other views after a call to onResponderTerminationRequest, + * or might be taken by the OS without asking (happens with control center/ notification center on iOS) + */ + onResponderTerminate?: ( event: GestureResponderEvent ) => void + + /** + * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, + * where the deepest node is called first. + * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. + * This is desirable in most cases, because it makes sure all controls and buttons are usable. + * + * However, sometimes a parent will want to make sure that it becomes responder. + * This can be handled by using the capture phase. + * Before the responder system bubbles up from the deepest component, + * it will do a capture phase, firing on*ShouldSetResponderCapture. + * So if a parent View wants to prevent the child from becoming responder on a touch start, + * it should have a onStartShouldSetResponderCapture handler which returns true. + */ + onStartShouldSetResponderCapture?: ( event: GestureResponderEvent ) => boolean + + /** + * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, + * where the deepest node is called first. + * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. + * This is desirable in most cases, because it makes sure all controls and buttons are usable. + * + * However, sometimes a parent will want to make sure that it becomes responder. + * This can be handled by using the capture phase. + * Before the responder system bubbles up from the deepest component, + * it will do a capture phase, firing on*ShouldSetResponderCapture. + * So if a parent View wants to prevent the child from becoming responder on a touch start, + * it should have a onStartShouldSetResponderCapture handler which returns true. + */ + onMoveShouldSetResponderCapture?: () => void; + + } + + // @see https://facebook.github.io/react-native/docs/view.html#style + export interface ViewStyle extends FlexStyle, TransformsStyle { + backgroundColor?: string; + borderBottomColor?: string; + borderBottomLeftRadius?: number; + borderBottomRightRadius?: number; + borderColor?: string; + borderLeftColor?: string; + borderRadius?: number; + borderRightColor?: string; + borderTopColor?: string; + borderTopLeftRadius?: number; + borderTopRightRadius?: number; + opacity?: number; + overflow?: string; // enum('visible', 'hidden') + shadowColor?: string; + shadowOffset?: {width: number, height: number}; + shadowOpacity?: number; + shadowRadius?: number; + } + + + export interface ViewPropertiesIOS { + + /** + * Provides additional traits to screen reader. + * By default no traits are provided unless specified otherwise in element + * + * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') + */ + accessibilityTraits?: string | string[]; + + /** + * Whether this view should be rendered as a bitmap before compositing. + * + * On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; + * for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view + * and quickly composite it during each frame. + * + * Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. + * Test and measure when using this property. + */ + shouldRasterizeIOS?: boolean + } + + export interface ViewPropertiesAndroid { + + /** + * Indicates to accessibility services to treat UI component like a native one. + * Works for Android only. + * + * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) + */ + accessibilityComponentType?: string + + + /** + * Indicates to accessibility services whether the user should be notified when this view changes. + * Works for Android API >= 19 only. + * See http://developer.android.com/reference/android/view/View.html#attr_android:accessibilityLiveRegion for references. + */ + accessibilityLiveRegion?: string + + /** + * Views that are only used to layout their children or otherwise don't draw anything + * may be automatically removed from the native hierarchy as an optimization. + * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. + */ + collapsable?: boolean + + + /** + * Controls how view is important for accessibility which is if it fires accessibility events + * and if it is reported to accessibility services that query the screen. + * Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references. + * + * Possible values: + * 'auto' - The system determines whether the view is important for accessibility - default (recommended). + * 'yes' - The view is important for accessibility. + * 'no' - The view is not important for accessibility. + * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views. + */ + importantForAccessibility?: string + + + /** + * Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. + * The default (false) falls back to drawing the component and its children + * with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. + * This default may be noticeable and undesired in the case where the View you are setting an opacity on + * has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background). + * + * Rendering offscreen to preserve correct alpha behavior is extremely expensive + * and hard to debug for non-native developers, which is why it is not turned on by default. + * If you do need to enable this property for an animation, + * consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). + * If that property is enabled, this View will be rendered off-screen once, + * saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU. + */ + needsOffscreenAlphaCompositing?: boolean + + + /** + * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. + * + * On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: + * in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be + * re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation. + */ + renderToHardwareTextureAndroid?: boolean; + + } + + /** + * @see https://facebook.github.io/react-native/docs/view.html#props + */ + export interface ViewProperties extends ViewPropertiesAndroid, ViewPropertiesIOS, GestureResponderHandlers, Touchable, React.Props { + + /** + * Overrides the text that's read by the screen reader when the user interacts with the element. By default, the label is constructed by traversing all the children and accumulating all the Text nodes separated by space. + */ + accessibilityLabel?: string; + + /** + * When true, indicates that the view is an accessibility element. + * By default, all the touchable elements are accessible. + */ + accessible?: boolean; + + /** + * When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gesture. + */ + onAcccessibilityTap?: () => void; + + /** + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void; + + /** + * When accessible is true, the system will invoke this function when the user performs the magic tap gesture. + */ + onMagicTap?: () => void; + + /** + * + * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class: + * + * .box-none { + * pointer-events: none; + * } + * .box-none * { + * pointer-events: all; + * } + * + * box-only is the equivalent of + * + * .box-only { + * pointer-events: all; + * } + * .box-only * { + * pointer-events: none; + * } + * + * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, + * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform. + */ + pointerEvents?: string; + + /** + * + * This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews, + * most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. + * The subviews must also have overflow: hidden, as should the containing view (or one of its superviews). + */ + removeClippedSubviews?: boolean + + style?: ViewStyle; + + /** + * Used to locate this view in end-to-end tests. + */ + testID?: string; + } + + /** + * The most fundamental component for building UI, View is a container that supports layout with flexbox, style, some touch handling, + * and accessibility controls, and is designed to be nested inside other views and to have 0 to many children of any type. + * View maps directly to the native view equivalent on whatever platform React is running on, + * whether that is a UIView,

, android.view, etc. + */ + export interface ViewStatic extends NativeComponent, React.ComponentClass { + + } + + /** + * //FIXME: No documentation extracted from code comment on WebView.ios.js + */ + export interface NavState { + + url?: string + title?: string + loading?: boolean + canGoBack?: boolean + canGoForward?: boolean; + + [key: string]: any + } + + export interface WebViewPropertiesAndroid { + + /** + * Used for android only, JS is enabled by default for WebView on iOS + */ + javaScriptEnabledAndroid?: boolean + } + + export interface WebViewPropertiesIOS { + + /** + * Used for iOS only, sets whether the webpage scales to fit the view and the user can change the scale + */ + scalesPageToFit?: boolean + } + + /** + * @see https://facebook.github.io/react-native/docs/webview.html#props + */ + export interface WebViewProperties extends WebViewPropertiesAndroid, WebViewPropertiesIOS, React.Props { + + automaticallyAdjustContentInsets?: boolean + + bounces?: boolean + + contentInset?: Insets + + html?: string + + /** + * Sets the JS to be injected when the webpage loads. + */ + injectedJavaScript?: string + + onNavigationStateChange?: ( event: NavState ) => void + + /** + * Allows custom handling of any webview requests by a JS handler. + * Return true or false from this method to continue loading the request. + */ + onShouldStartLoadWithRequest?: () => boolean + + /** + * view to show if there's an error + */ + renderError?: () => ViewStatic + + /** + * loading indicator to show + */ + renderLoading?: () => ViewStatic + + scrollEnabled?: boolean + + startInLoadingState?: boolean + + style?: ViewStyle + + url: string + } + + + export interface WebViewStatic extends React.ComponentClass { + + goBack: () => void + goForward: () => void + reload: () => void + } + + + /** + * @see + */ + export interface SegmentedControlIOSProperties { + /// TODO + } + + + export interface NavigatorIOSProperties extends React.Props { + + /** + * NavigatorIOS uses "route" objects to identify child views, their props, and navigation bar configuration. + * "push" and all the other navigation operations expect routes to be like this + */ + initialRoute?: Route + + /** + * The default wrapper style for components in the navigator. + * A common use case is to set the backgroundColor for every page + */ + itemWrapperStyle?: ViewStyle + + /** + * A Boolean value that indicates whether the navigation bar is hidden + */ + navigationBarHidden?: boolean + + /** + * A Boolean value that indicates whether to hide the 1px hairline shadow + */ + shadowHidden?: boolean + + /** + * The color used for buttons in the navigation bar + */ + tintColor?: string + + /** + * The text color of the navigation bar title + */ + titleTextColor?: string + + /** + * A Boolean value that indicates whether the navigation bar is translucent + */ + translucent?: boolean + + /** + * NOT IN THE DOC BUT IN THE EXAMPLES + */ + style?: ViewStyle + } + + /** + * A navigator is an object of navigation functions that a view can call. + * It is passed as a prop to any component rendered by NavigatorIOS. + * + * Navigator functions are also available on the NavigatorIOS component: + * + * @see https://facebook.github.io/react-native/docs/navigatorios.html#navigator + */ + export interface NavigationIOS { + /** + * Navigate forward to a new route + */ + push: ( route: Route ) => void + + /** + * Go back one page + */ + pop: () => void + + /** + * Go back N pages at once. When N=1, behavior matches pop() + */ + popN: ( n: number ) => void + + /** + * Replace the route for the current page and immediately load the view for the new route + */ + replace: ( route: Route ) => void + + /** + * Replace the route/view for the previous page + */ + replacePrevious: ( route: Route ) => void + + /** + * Replaces the previous route/view and transitions back to it + */ + replacePreviousAndPop: ( route: Route ) => void + + /** + * Replaces the top item and popToTop + */ + resetTo: ( route: Route ) => void + + /** + * Go back to the item for a particular route object + */ + popToRoute( route: Route ): void + + /** + * Go back to the top item + */ + popToTop(): void + } + + export interface NavigatorIOSStatic extends NavigationIOS, React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/activityindicatorios.html#props + */ + export interface ActivityIndicatorIOSProperties extends React.Props { + + /** + * Whether to show the indicator (true, the default) or hide it (false). + */ + animating?: boolean + + /** + * The foreground color of the spinner (default is gray). + */ + color?: string + + /** + * Whether the indicator should hide when not animating (true by default). + */ + hidesWhenStopped?: boolean + + /** + * Invoked on mount and layout changes with + */ + onLayout?: ( event: {nativeEvent: { layout: {x: number, y: number , width: number, height: number}}} ) => void + + /** + * Size of the indicator. + * Small has a height of 20, large has a height of 36. + * + * enum('small', 'large') + */ + size?: string + + style?: ViewStyle + } + + export interface ActivityIndicatorIOSStatic extends React.ComponentClass { + } + + + export interface DatePickerIOSProperties extends React.Props { + + /** + * The currently selected date. + */ + date?: Date + + + /** + * Maximum date. + * Restricts the range of possible date/time values. + */ + maximumDate?: Date + + /** + * Maximum date. + * Restricts the range of possible date/time values. + */ + minimumDate?: Date + + /** + * enum(1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30) + * The interval at which minutes can be selected. + */ + minuteInterval?: number + + /** + * enum('date', 'time', 'datetime') + * The date picker mode. + */ + mode?: string + + /** + * Date change handler. + * This is called when the user changes the date or time in the UI. + * The first and only argument is a Date object representing the new date and time. + */ + onDateChange?: ( newDate: Date ) => void + + /** + * Timezone offset in minutes. + * By default, the date picker will use the device's timezone. With this parameter, it is possible to force a certain timezone offset. + * For instance, to show times in Pacific Standard Time, pass -7 * 60. + */ + timeZoneOffsetInMinutes?: number + + } + + export interface DatePickerIOSStatic extends React.ComponentClass { + } + + + /** + * @see PickerIOS.ios.js + */ + export interface PickerIOSItemProperties extends React.Props { + value?: string | number + label?: string + } + + /** + * @see PickerIOS.ios.js + */ + export interface PickerIOSItemStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/pickerios.html + * @see PickerIOS.ios.js + */ + export interface PickerIOSProperties extends React.Props { + + onValueChange?: ( value: string | number ) => void + + selectedValue?: string | number + + style?: ViewStyle + } + + /** + * @see https://facebook.github.io/react-native/docs/pickerios.html + * @see PickerIOS.ios.js + */ + export interface PickerIOSStatic extends React.ComponentClass { + + Item: PickerIOSItemStatic + } + + + /** + * @see https://facebook.github.io/react-native/docs/sliderios.html + */ + export interface SliderIOSProperties extends React.Props { + + /** + * If true the user won't be able to move the slider. Default value is false. + */ + disabled?: boolean + + /** + * Initial maximum value of the slider. Default value is 1. + */ + maximumValue?: number + + /** + * The color used for the track to the right of the button. Overrides the default blue gradient image. + */ + maximumTrackTintColor?: string + + /** + * Initial minimum value of the slider. Default value is 0. + */ + minimumValue?: number + + /** + * The color used for the track to the left of the button. Overrides the default blue gradient image. + */ + minimumTrackTintColor?: string + + /** + * Callback called when the user finishes changing the value (e.g. when the slider is released). + */ + onSlidingComplete?: () => void + + /** + * Callback continuously called while the user is dragging the slider. + */ + onValueChange?: ( value: number ) => void + + /** + * Step value of the slider. + * The value should be between 0 and (maximumValue - minimumValue). + * Default value is 0. + */ + step?: number + + /** + * Used to style and layout the Slider. + * @see StyleSheet.js and ViewStylePropTypes.js for more info. + */ + style?: ViewStyle + + /** + * Initial value of the slider. + * The value should be between minimumValue and maximumValue, which default to 0 and 1 respectively. + * Default value is 0. + * + * This is not a controlled component, e.g. if you don't update the value, the component won't be reset to its inital value. + */ + value?: number + } + + export interface SliderIOSStatic extends React.ComponentClass { + + } + + /** + * //FIXME: no dcumentation, inferred + * @see SwitchIOS.ios.js + */ + export interface SwitchIOSStyle extends ViewStyle { + height?: number + width?: number + } + + + /** + * https://facebook.github.io/react-native/docs/switchios.html#props + */ + export interface SwitchIOSProperties extends React.Props { + + /** + * If true the user won't be able to toggle the switch. Default value is false. + */ + disabled?: boolean + + /** + * Background color when the switch is turned on. + */ + onTintColor?: string + + /** + * Callback that is called when the user toggles the switch. + */ + onValueChange?: ( value: boolean ) => void + + /** + * Background color for the switch round button. + */ + thumbTintColor?: string + + /** + * Background color when the switch is turned off. + */ + tintColor?: string + + /** + * The value of the switch, if true the switch will be turned on. Default value is false. + */ + value?: boolean + + style?: SwitchIOSStyle + } + + /** + * + * Use SwitchIOS to render a boolean input on iOS. + * + * This is a controlled component, so you must hook in to the onValueChange callback and update the value prop in order for the component to update, + * otherwise the user's change will be reverted immediately to reflect props.value as the source of truth. + * + * @see https://facebook.github.io/react-native/docs/switchios.html + */ + export interface SwitchIOSStatic extends React.ComponentClass { + + } + + + /** + * @see ImageResizeMode.js + */ + export interface ImageResizeModeStatic { + /** + * contain - The image will be resized such that it will be completely + * visible, contained within the frame of the View. + */ + contain: string + /** + * cover - The image will be resized such that the entire area of the view + * is covered by the image, potentially clipping parts of the image. + */ + cover: string + /** + * stretch - The image will be stretched to fill the entire frame of the + * view without clipping. This may change the aspect ratio of the image, + * distoring it. Only supported on iOS. + */ + stretch: string + } + + /** + * Image style + * @see https://facebook.github.io/react-native/docs/image.html#style + */ + export interface ImageStyle extends FlexStyle, TransformsStyle { + resizeMode?: string //Object.keys(ImageResizeMode) + backgroundColor?: string + borderColor?: string + borderWidth?: number + borderRadius?: number + overflow?: string // enum('visible', 'hidden') + tintColor?: string + opacity?: number + } + + export interface ImagePropertiesIOS { + /** + * The text that's read by the screen reader when the user interacts with the image. + */ + accessibilityLabel?: string; + + /** + * When true, indicates the image is an accessibility element. + */ + accessible?: boolean; + + /** + * When the image is resized, the corners of the size specified by capInsets will stay a fixed size, + * but the center content and borders of the image will be stretched. + * This is useful for creating resizable rounded buttons, shadows, and other resizable assets. + * More info on Apple documentation + */ + capInsets?: Insets + + /** + * A static image to display while downloading the final image off the network. + */ + defaultSource?: {uri: string} + + /** + * Invoked on load error with {nativeEvent: {error}} + */ + onError?: ( error: {nativeEvent: any} ) => void + + /** + * Invoked when load completes successfully + */ + onLoad?: () => void + + /** + * Invoked when load either succeeds or fails + */ + onLoadEnd?: () => void + + /** + * Invoked on load start + */ + onLoadStart?: () => void + + /** + * Invoked on download progress with {nativeEvent: {loaded, total}} + */ + onProgress?: ()=> void + } + + /** + * @see https://facebook.github.io/react-native/docs/image.html + */ + export interface ImageProperties extends ImagePropertiesIOS, React.Props { + /** + * onLayout function + * + * Invoked on mount and layout changes with + * + * {nativeEvent: { layout: {x, y, width, height}}}. + */ + onLayout?: ( event: LayoutChangeEvent ) => void; + + + /** + * Determines how to resize the image when the frame doesn't match the raw image dimensions. + * + * enum('cover', 'contain', 'stretch') + */ + resizeMode?: string; + + /** + * uri is a string representing the resource identifier for the image, + * which could be an http address, a local file path, + * or the name of a static image resource (which should be wrapped in the require('image!name') function). + */ + source: {uri: string} | string; + + /** + * + * Style + */ + style?: ImageStyle; + + /** + * A unique identifier for this element to be used in UI Automation testing scripts. + */ + testID?: string; + + } + + export interface ImageStatic extends React.ComponentClass { + uri: string; + resizeMode: ImageResizeModeStatic + } + + + /** + * @see https://facebook.github.io/react-native/docs/listview.html#props + */ + export interface ListViewProperties extends ScrollViewProperties, React.Props { + + dataSource?: ListViewDataSource + + /** + * How many rows to render on initial component mount. Use this to make + * it so that the first screen worth of data apears at one time instead of + * over the course of multiple frames. + */ + initialListSize?: number + + /** + * (visibleRows, changedRows) => void + * + * Called when the set of visible rows changes. `visibleRows` maps + * { sectionID: { rowID: true }} for all the visible rows, and + * `changedRows` maps { sectionID: { rowID: true | false }} for the rows + * that have changed their visibility, with true indicating visible, and + * false indicating the view has moved out of view. + */ + onChangeVisibleRows?: ( visibleRows: Array<{[sectionId: string]: {[rowID: string]: boolean}}>, changedRows: Array<{[sectionId: string]: {[rowID: string]: boolean}}> ) => void + + /** + * Called when all rows have been rendered and the list has been scrolled + * to within onEndReachedThreshold of the bottom. The native scroll + * event is provided. + */ + onEndReached?: () => void + + /** + * Threshold in pixels for onEndReached. + */ + onEndReachedThreshold?: number + + /** + * Number of rows to render per event loop. + */ + pageSize?: number + + /** + * An experimental performance optimization for improving scroll perf of + * large lists, used in conjunction with overflow: 'hidden' on the row + * containers. Use at your own risk. + */ + removeClippedSubviews?: boolean + + /** + * () => renderable + * + * The header and footer are always rendered (if these props are provided) + * on every render pass. If they are expensive to re-render, wrap them + * in StaticContainer or other mechanism as appropriate. Footer is always + * at the bottom of the list, and header at the top, on every render pass. + */ + renderFooter?: () => React.ReactElement + + /** + * () => renderable + * + * The header and footer are always rendered (if these props are provided) + * on every render pass. If they are expensive to re-render, wrap them + * in StaticContainer or other mechanism as appropriate. Footer is always + * at the bottom of the list, and header at the top, on every render pass. + */ + renderHeader?: () => React.ReactElement + + /** + * (rowData, sectionID, rowID) => renderable + * Takes a data entry from the data source and its ids and should return + * a renderable component to be rendered as the row. By default the data + * is exactly what was put into the data source, but it's also possible to + * provide custom extractors. + */ + renderRow?: ( rowData: any, sectionID: string | number, rowID: string | number, highlightRow?: boolean ) => React.ReactElement + + + /** + * A function that returns the scrollable component in which the list rows are rendered. + * Defaults to returning a ScrollView with the given props. + */ + renderScrollComponent?: ( props: ScrollViewProperties ) => React.ReactElement + + /** + * (sectionData, sectionID) => renderable + * + * If provided, a sticky header is rendered for this section. The sticky + * behavior means that it will scroll with the content at the top of the + * section until it reaches the top of the screen, at which point it will + * stick to the top until it is pushed off the screen by the next section + * header. + */ + renderSectionHeader?: ( sectionData: any, sectionId: string | number ) => React.ReactElement + + + /** + * (sectionID, rowID, adjacentRowHighlighted) => renderable + * If provided, a renderable component to be rendered as the separator below each row + * but not the last row if there is a section header below. + * Take a sectionID and rowID of the row above and whether its adjacent row is highlighted. + */ + renderSeparator?: ( sectionID: string | number, rowID: string | number, adjacentRowHighlighted?: boolean ) => React.ReactElement + + /** + * How early to start rendering rows before they come on screen, in + * pixels. + */ + scrollRenderAheadDistance?: number + } + + export interface ListViewStatic extends React.ComponentClass { + DataSource: ListViewDataSource; + } + + + export interface MapViewAnnotation { + latitude?: number + longitude?: number + animateDrop?: boolean + title?: string + subtitle?: string + hasLeftCallout?: boolean + hasRightCallout?: boolean + onLeftCalloutPress?: () => void + onRightCalloutPress?: () => void + id?: string + } + + export interface MapViewRegion { + latitude: number + longitude: number + latitudeDelta: number + longitudeDelta: number + } + + export interface MapViewPropertiesIOS { + + /** + * If false points of interest won't be displayed on the map. + * Default value is true. + */ + showsPointsOfInterest?: boolean + } + + export interface MapViewProperties extends MapViewPropertiesIOS, Touchable, React.Props { + + /** + * Map annotations with title/subtitle. + */ + annotations?: MapViewAnnotation[] + + /** + * Insets for the map's legal label, originally at bottom left of the map. See EdgeInsetsPropType.js for more information. + */ + legalLabelInsets?: Insets + + /** + * The map type to be displayed. + * standard: standard road map (default) + * satellite: satellite view + * hybrid: satellite view with roads and points of interest overlayed + * + * enum('standard', 'satellite', 'hybrid') + */ + mapType?: string + + /** + * Maximum size of area that can be displayed. + */ + maxDelta?: number + + /** + * Minimum size of area that can be displayed. + */ + minDelta?: number + + /** + * Callback that is called once, when the user taps an annotation. + */ + onAnnotationPress?: () => void + + /** + * Callback that is called continuously when the user is dragging the map. + */ + onRegionChange?: ( region: MapViewRegion ) => void + + /** + * Callback that is called once, when the user is done moving the map. + */ + onRegionChangeComplete?: ( region: MapViewRegion ) => void + + /** + * When this property is set to true and a valid camera is associated with the map, + * the camera’s pitch angle is used to tilt the plane of the map. + * + * When this property is set to false, the camera’s pitch angle is ignored and + * the map is always displayed as if the user is looking straight down onto it. + */ + pitchEnabled?: boolean + + /** + * The region to be displayed by the map. + * The region is defined by the center coordinates and the span of coordinates to display. + */ + region?: MapViewRegion + + /** + * When this property is set to true and a valid camera is associated with the map, + * the camera’s heading angle is used to rotate the plane of the map around its center point. + * + * When this property is set to false, the camera’s heading angle is ignored and the map is always oriented + * so that true north is situated at the top of the map view + */ + rotateEnabled?: boolean + + /** + * If false the user won't be able to change the map region being displayed. + * Default value is true. + */ + scrollEnabled?: boolean + + /** + * If true the app will ask for the user's location and focus on it. + * Default value is false. + * + * NOTE: You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, + * otherwise it is going to fail silently! + */ + showsUserLocation?: boolean + + /** + * Used to style and layout the MapView. + * See StyleSheet.js and ViewStylePropTypes.js for more info. + */ + style?: ViewStyle + + /** + * If false the user won't be able to pinch/zoom the map. + * Default value is true. + */ + zoomEnabled?: boolean + } + + /** + * @see https://facebook.github.io/react-native/docs/mapview.html#content + */ + export interface MapViewStatic extends React.ComponentClass { + } + + + export interface TouchableWithoutFeedbackAndroidProperties { + + /** + * Indicates to accessibility services to treat UI component like a native one. + * Works for Android only. + * + * @enum('none', 'button', 'radiobutton_checked', 'radiobutton_unchecked' ) + */ + accessibilityComponentType?: string + } + + export interface TouchableWithoutFeedbackIOSProperties { + + /** + * Provides additional traits to screen reader. + * By default no traits are provided unless specified otherwise in element + * + * @enum('none', 'button', 'link', 'header', 'search', 'image', 'selected', 'plays', 'key', 'text','summary', 'disabled', 'frequentUpdates', 'startsMedia', 'adjustable', 'allowsDirectInteraction', 'pageTurn') + */ + accessibilityTraits?: string | string[]; + + } + + /** + * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html#props + */ + export interface TouchableWithoutFeedbackProperties extends TouchableWithoutFeedbackAndroidProperties, TouchableWithoutFeedbackIOSProperties { + + + /** + * Called when the touch is released, but not if cancelled (e.g. by a scroll that steals the responder lock). + */ + accessible?: boolean + + /** + * Delay in ms, from onPressIn, before onLongPress is called. + */ + delayLongPress?: number; + + /** + * Delay in ms, from the start of the touch, before onPressIn is called. + */ + delayPressIn?: number; + + /** + * Delay in ms, from the release of the touch, before onPressOut is called. + */ + delayPressOut?: number; + + /** + * Invoked on mount and layout changes with + * {nativeEvent: {layout: {x, y, width, height}}} + */ + onLayout?: ( event: LayoutChangeEvent ) => void + + onLongPress?: () => void; + + /** + * Called when the touch is released, + * but not if cancelled (e.g. by a scroll that steals the responder lock). + */ + onPress?: () => void; + + onPressIn?: () => void; + + onPressOut?: () => void; + + /** + * //FIXME: not in doc but available in exmaples + */ + style?: ViewStyle + } + + + export interface TouchableWithoutFeedbackProps extends TouchableWithoutFeedbackProperties, React.Props { + + } + + /** + * Do not use unless you have a very good reason. + * All the elements that respond to press should have a visual feedback when touched. + * This is one of the primary reason a "web" app doesn't feel "native". + * + * @see https://facebook.github.io/react-native/docs/touchablewithoutfeedback.html + */ + export interface TouchableWithoutFeedbackStatic extends React.ComponentClass { + + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchablehighlight.html#props + */ + export interface TouchableHighlightProperties extends TouchableWithoutFeedbackProperties, React.Props { + + /** + * Determines what the opacity of the wrapped view should be when touch is active. + */ + activeOpacity?: number + + /** + * + * Called immediately after the underlay is hidden + */ + onHideUnderlay?: () => void + + /** + * Called immediately after the underlay is shown + */ + onShowUnderlay?: () => void + + /** + * @see https://facebook.github.io/react-native/docs/view.html#style + */ + style?: ViewStyle + + + /** + * The color of the underlay that will show through when the touch is active. + */ + underlayColor?: string + } + + /** + * A wrapper for making views respond properly to touches. + * On press down, the opacity of the wrapped view is decreased, + * which allows the underlay color to show through, darkening or tinting the view. + * The underlay comes from adding a view to the view hierarchy, + * which can sometimes cause unwanted visual artifacts if not used correctly, + * for example if the backgroundColor of the wrapped view isn't explicitly set to an opaque color. + * + * NOTE: TouchableHighlight supports only one child + * If you wish to have several child components, wrap them in a View. + * + * @see https://facebook.github.io/react-native/docs/touchablehighlight.html + */ + export interface TouchableHighlightStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props + */ + export interface TouchableOpacityProperties extends TouchableWithoutFeedbackProperties, React.Props { + /** + * Determines what the opacity of the wrapped view should be when touch is active. + * Defaults to 0.2 + */ + activeOpacity?: number + } + + /** + * A wrapper for making views respond properly to touches. + * On press down, the opacity of the wrapped view is decreased, dimming it. + * This is done without actually changing the view hierarchy, + * and in general is easy to add to an app without weird side-effects. + * + * @see https://facebook.github.io/react-native/docs/touchableopacity.html + */ + export interface TouchableOpacityStatic extends React.ComponentClass { + } + + + /** + * @see https://facebook.github.io/react-native/docs/touchableopacity.html#props + */ + export interface TouchableNativeFeedbackProperties extends TouchableWithoutFeedbackProperties, React.Props { + /** + * Determines the type of background drawable that's going to be used to display feedback. + * It takes an object with type property and extra data depending on the type. + * It's recommended to use one of the following static methods to generate that dictionary: + * 1) TouchableNativeFeedback.SelectableBackground() - will create object that represents android theme's default background for selectable elements (?android:attr/selectableItemBackground) + * 2) TouchableNativeFeedback.SelectableBackgroundBorderless() - will create object that represent android theme's default background for borderless selectable elements (?android:attr/selectableItemBackgroundBorderless). Available on android API level 21+ + * 3) TouchableNativeFeedback.Ripple(color, borderless) - will create object that represents ripple drawable with specified color (as a string). If property borderless evaluates to true the ripple will render outside of the view bounds (see native actionbar buttons as an example of that behavior). This background type is available on Android API level 21+ + */ + background?: any + } + + /** + * A wrapper for making views respond properly to touches (Android only). + * On Android this component uses native state drawable to display touch feedback. + * At the moment it only supports having a single View instance as a child node, + * as it's implemented by replacing that View with another instance of RCTView node with some additional properties set. + * + * Background drawable of native feedback touchable can be customized with background property. + * + * @see https://facebook.github.io/react-native/docs/touchablenativefeedback.html#content + */ + export interface TouchableNativeFeedbackStatic extends React.ComponentClass { + SelectableBackground: () => TouchableNativeFeedbackStatic + SelectableBackgroundBorderless: () => TouchableNativeFeedbackStatic + Ripple: ( color: string, borderless?: boolean ) => TouchableNativeFeedbackStatic + } + + + export interface LeftToRightGesture { + //TODO: + } + + export interface AnimationInterpolator { + //TODO: + } + + // see /NavigatorSceneConfigs.js + export interface SceneConfig { + // A list of all gestures that are enabled on this scene + gestures: { + pop: LeftToRightGesture, + }, + + // Rebound spring parameters when transitioning FROM this scene + springFriction: number; + springTension: number; + + // Velocity to start at when transitioning without gesture + defaultTransitionVelocity: number; + + // Animation interpolators for horizontal transitioning: + animationInterpolators: { + into: AnimationInterpolator, + out: AnimationInterpolator + }; + + } + + // see /NavigatorSceneConfigs.js + export interface SceneConfigs { + FloatFromBottom: SceneConfig; + FloatFromRight: SceneConfig; + PushFromRight: SceneConfig; + FloatFromLeft: SceneConfig; + HorizontalSwipeJump: SceneConfig; + } + + export interface Route { + component?: ComponentClass + id?: string + title?: string + passProps?: Object; + + //anything else + [key: string]: any + + //Commonly found properties + backButtonTitle?: string + content?: string + message?: string; + index?: number + onRightButtonPress?: () => void + rightButtonTitle?: string + sceneConfig?: SceneConfig + wrapperStyle?: any + } + + + /** + * @see https://facebook.github.io/react-native/docs/navigator.html#content + */ + export interface NavigatorProperties extends React.Props { + /** + * Optional function that allows configuration about scene animations and gestures. + * Will be invoked with the route and should return a scene configuration object + * @param route + */ + configureScene?: ( route: Route ) => SceneConfig + /** + * Specify a route to start on. + * A route is an object that the navigator will use to identify each scene to render. + * initialRoute must be a route in the initialRouteStack if both props are provided. + * The initialRoute will default to the last item in the initialRouteStack. + */ + initialRoute?: Route + /** + * Provide a set of routes to initially mount. + * Required if no initialRoute is provided. + * Otherwise, it will default to an array containing only the initialRoute + */ + initialRouteStack?: Route[] + + /** + * Optionally provide a navigation bar that persists across scene transitions + */ + navigationBar?: React.ReactElement + + /** + * Optionally provide the navigator object from a parent Navigator + */ + navigator?: Navigator + + /** + * @deprecated Use navigationContext.addListener('willfocus', callback) instead. + */ + onDidFocus?: Function + + /** + * @deprecated Use navigationContext.addListener('willfocus', callback) instead. + */ + onWillFocus?: Function + + /** + * Required function which renders the scene for a given route. + * Will be invoked with the route and the navigator object + * @param route + * @param navigator + */ + renderScene?: ( route: Route, navigator: Navigator ) => React.ReactElement + + /** + * Styles to apply to the container of each scene + */ + sceneStyle?: ViewStyle + + /** + * //FIXME: not found in doc but found in examples + */ + debugOverlay?: boolean + + } + + /** + * Use Navigator to transition between different scenes in your app. + * To accomplish this, provide route objects to the navigator to identify each scene, + * and also a renderScene function that the navigator can use to render the scene for a given route. + * + * To change the animation or gesture properties of the scene, provide a configureScene prop to get the config object for a given route. + * See Navigator.SceneConfigs for default animations and more info on scene config options. + * @see https://facebook.github.io/react-native/docs/navigator.html + */ + export interface NavigatorStatic extends React.ComponentClass { + SceneConfigs: SceneConfigs; + NavigationBar: NavigatorStatic.NavigationBarStatic; + BreadcrumbNavigationBar: NavigatorStatic.BreadcrumbNavigationBarStatic + + getContext( self: any ): NavigatorStatic; + + /** + * returns the current list of routes + */ + getCurrentRoutes(): Route[]; + + /** + * Jump backward without unmounting the current scen + */ + jumpBack(): void; + + /** + * Jump forward to the next scene in the route stack + */ + jumpForward(): void; + + /** + * Transition to an existing scene without unmounting + */ + jumpTo( route: Route ): void; + + /** + * Navigate forward to a new scene, squashing any scenes that you could jumpForward to + */ + push( route: Route ): void; + + /** + * Transition back and unmount the current scene + */ + pop(): void; + + /** + * Replace the current scene with a new route + */ + replace( route: Route ): void; + + /** + * Replace a scene as specified by an index + */ + replaceAtIndex( route: Route, index: number ): void; + + /** + * Replace the previous scene + */ + replacePrevious( route: Route ): void; + + /** + * Reset every scene with an array of routes + */ + immediatelyResetRouteStack( routes: Route[] ): void; + + /** + * Pop to a particular scene, as specified by its route. All scenes after it will be unmounted + */ + popToRoute( route: Route ): void; + + /** + * Pop to the first scene in the stack, unmounting every other scene + */ + popToTop(): void; + + } + + namespace NavigatorStatic { + + + export interface NavState { + routeStack: Route[] + idStack: number[] + presentedIndex: number + } + + export interface NavigationBarStyle { + //TODO @see NavigationBarStyle.ios.js + } + + + export interface NavigationBarRouteMapper { + Title: ( route: Route, nav: Navigator, index: number, navState: NavState ) => React.ReactElement; + LeftButton: ( route: Route, nav: Navigator, index: number, navState: NavState )=> React.ReactElement; + RightButton: ( route: Route, nav: Navigator, index: number, navState: NavState )=> React.ReactElement; + } + + /** + * @see NavigatorNavigationBar.js + */ + export interface NavigationBarProperties extends React.Props { + navigator?: Navigator + routeMapper?: NavigationBarRouteMapper + navState?: NavState + style?: ViewStyle + } + + export interface NavigationBarStatic extends React.ComponentClass { + Styles: NavigationBarStyle + + } + + export type NavigationBar = NavigationBarStatic + export var NavigationBar: NavigationBarStatic + + + export interface BreadcrumbNavigationBarStyle { + //TODO &see NavigatorBreadcrumbNavigationBar.js + } + + export interface BreadcrumbNavigationBarRouteMapper { + rightContentForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + titleContentForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + iconForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + //in samples... + separatorForRoute: ( route: Route, navigator: Navigator ) => React.ReactElement + } + + /** + * @see NavigatorNavigationBar.js + */ + export interface BreadcrumbNavigationBarProperties extends React.Props { + navigator?: Navigator + routeMapper?: BreadcrumbNavigationBarRouteMapper + navState?: NavState + style?: ViewStyle + } + + export interface BreadcrumbNavigationBarStatic extends React.ComponentClass { + Styles: BreadcrumbNavigationBarStyle + } + + export type BreadcrumbNavigationBar = BreadcrumbNavigationBarStatic + var BreadcrumbNavigationBar: BreadcrumbNavigationBarStatic + + } + + + export interface StyleSheetStatic extends React.ComponentClass { + create( styles: T ): T; + } + + /** + * //FIXME: Could not find docs. Inferred from examples and jscode : ListViewDataSource.js + */ + export interface DataSourceAssetCallback { + rowHasChanged?: ( r1: any, r2: any ) => boolean + sectionHeaderHasChanged?: ( h1: any, h2: any ) => boolean + getRowData?: ( dataBlob: any, sectionID: number | string, rowID: number | string ) => T + getSectionHeaderData?: ( dataBlob: any, sectionID: number | string ) => T + } + + /** + * //FIXME: Could not find docs. Inferred from examples and js code: ListViewDataSource.js + */ + export interface ListViewDataSource { + new( onAsset: DataSourceAssetCallback ): ListViewDataSource; + /** + * Clones this `ListViewDataSource` with the specified `dataBlob` and + * `rowIdentities`. The `dataBlob` is just an aribitrary blob of data. At + * construction an extractor to get the interesting informatoin was defined + * (or the default was used). + * + * The `rowIdentities` is is a 2D array of identifiers for rows. + * ie. [['a1', 'a2'], ['b1', 'b2', 'b3'], ...]. If not provided, it's + * assumed that the keys of the section data are the row identities. + * + * Note: This function does NOT clone the data in this data source. It simply + * passes the functions defined at construction to a new data source with + * the data specified. If you wish to maintain the existing data you must + * handle merging of old and new data separately and then pass that into + * this function as the `dataBlob`. + */ + cloneWithRows( dataBlob: Array | {[key: string ]: any}, rowIdentities?: Array ): ListViewDataSource + + /** + * This performs the same function as the `cloneWithRows` function but here + * you also specify what your `sectionIdentities` are. If you don't care + * about sections you should safely be able to use `cloneWithRows`. + * + * `sectionIdentities` is an array of identifiers for sections. + * ie. ['s1', 's2', ...]. If not provided, it's assumed that the + * keys of dataBlob are the section identities. + * + * Note: this returns a new object! + */ + cloneWithRowsAndSections( dataBlob: Array | {[key: string]: any}, sectionIdentities?: Array, rowIdentities?: Array> ): ListViewDataSource + + getRowCount(): number + + /** + * Gets the data required to render the row. + */ + getRowData( sectionIndex: number, rowIndex: number ): any + + /** + * Gets the rowID at index provided if the dataSource arrays were flattened, + * or null of out of range indexes. + */ + getRowIDForFlatIndex( index: number ): string + + /** + * Gets the sectionID at index provided if the dataSource arrays were flattened, + * or null for out of range indexes. + */ + getSectionIDForFlatIndex( index: number ): string + + /** + * Returns an array containing the number of rows in each section + */ + getSectionLengths(): Array + + /** + * Returns if the section header is dirtied and needs to be rerendered + */ + sectionHeaderShouldUpdate( sectionIndex: number ): boolean + + /** + * Gets the data required to render the section header + */ + getSectionHeaderData( sectionIndex: number ): any + } + + + /** + * @see https://facebook.github.io/react-native/docs/tabbarios-item.html#props + */ + export interface TabBarItemProperties extends React.Props { + + /** + * Little red bubble that sits at the top right of the icon. + */ + badge?: string | number + + /** + * A custom icon for the tab. It is ignored when a system icon is defined. + */ + icon?: {uri: string} | string + + /** + * Callback when this tab is being selected, + * you should change the state of your component to set selected={true}. + */ + onPress?: () => void + + /** + * It specifies whether the children are visible or not. If you see a blank content, you probably forgot to add a selected one. + */ + selected?: boolean + + /** + * A custom icon when the tab is selected. + * It is ignored when a system icon is defined. If left empty, the icon will be tinted in blue. + */ + selectedIcon?: {uri: string} | string; + + /** + * React style object. + */ + style?: ViewStyle + + /** + * Items comes with a few predefined system icons. + * Note that if you are using them, the title and selectedIcon will be overridden with the system ones. + * + * enum('bookmarks', 'contacts', 'downloads', 'favorites', 'featured', 'history', 'more', 'most-recent', 'most-viewed', 'recents', 'search', 'top-rated') + */ + systemIcon: string + + /** + * Text that appears under the icon. It is ignored when a system icon is defined. + */ + title?: string + + } + + export interface TabBarItemStatic extends React.ComponentClass { + } + + /** + * @see https://facebook.github.io/react-native/docs/tabbarios.html#props + */ + export interface TabBarIOSProperties extends React.Props { + + /** + * Background color of the tab bar + */ + barTintColor?: string + + style?: ViewStyle + + /** + * Color of the currently selected tab icon + */ + tintColor?: string + + /** + * A Boolean value that indicates whether the tab bar is translucent + */ + translucent?: boolean + } + + export interface TabBarIOSStatic extends React.ComponentClass { + Item: TabBarItemStatic; + } + + + export interface PixelRatioStatic { + get(): number; + } + + export interface DeviceEventSubscriptionStatic { + remove(): void; + } + + export interface DeviceEventEmitterStatic { + addListener( type: string, onReceived: ( data: T ) => void ): DeviceEventSubscription; + } + + // Used by Dimensions below + export interface ScaledSize { + width: number; + height: number; + scale: number; + } + + + export interface InteractionManagerStatic { + runAfterInteractions( fn: () => void ): void; + } + + + export interface ScrollViewStyle extends FlexStyle, TransformsStyle { + + backfaceVisibility?:string //enum('visible', 'hidden') + backgroundColor?: string + borderColor?: string + borderTopColor?: string + borderRightColor?: string + borderBottomColor?: string + borderLeftColor?: string + borderRadius?: number + borderTopLeftRadius?: number + borderTopRightRadius?: number + borderBottomLeftRadius?: number + borderBottomRightRadius?: number + borderStyle?: string //enum('solid', 'dotted', 'dashed') + borderWidth?: number + borderTopWidth?: number + borderRightWidth?: number + borderBottomWidth?: number + borderLeftWidth?: number + opacity?: number + overflow?: string //enum('visible', 'hidden') + shadowColor?: string + shadowOffset?: {width: number; height: number} + shadowOpacity?: number + shadowRadius?: number + } + + + export interface ScrollViewIOSProperties { + + /** + * When true the scroll view bounces horizontally when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is true when `horizontal={true}` and false otherwise. + */ + alwaysBounceHorizontal?: boolean + /** + * When true the scroll view bounces vertically when it reaches the end + * even if the content is smaller than the scroll view itself. The default + * value is false when `horizontal={true}` and true otherwise. + */ + alwaysBounceVertical?: boolean + + /** + * Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar/ toolbar. + * The default value is true. + */ + automaticallyAdjustContentInsets?: boolean // true + + /** + * When true the scroll view bounces when it reaches the end of the + * content if the content is larger then the scroll view along the axis of + * the scroll direction. When false it disables all bouncing even if + * the `alwaysBounce*` props are true. The default value is true. + */ + bounces?: boolean + /** + * When true gestures can drive zoom past min/max and the zoom will animate + * to the min/max value at gesture end otherwise the zoom will not exceed + * the limits. + */ + bouncesZoom?: boolean + + /** + * When false once tracking starts won't try to drag if the touch moves. + * The default value is true. + */ + canCancelContentTouches?: boolean + + /** + * When true the scroll view automatically centers the content when the + * content is smaller than the scroll view bounds; when the content is + * larger than the scroll view this property has no effect. The default + * value is false. + */ + centerContent?: boolean + + + /** + * The amount by which the scroll view content is inset from the edges of the scroll view. + * Defaults to {0, 0, 0, 0}. + */ + contentInset?: Insets // zeros + + /** + * Used to manually set the starting scroll offset. + * The default value is {x: 0, y: 0} + */ + contentOffset?: PointProperties // zeros + + /** + * A floating-point number that determines how quickly the scroll view + * decelerates after the user lifts their finger. Reasonable choices include + * - Normal: 0.998 (the default) + * - Fast: 0.9 + */ + decelerationRate?: number + + /** + * When true the ScrollView will try to lock to only vertical or horizontal + * scrolling while dragging. The default value is false. + */ + directionalLockEnabled?: boolean + + /** + * The maximum allowed zoom scale. The default value is 1.0. + */ + maximumZoomScale?: number + + /** + * The minimum allowed zoom scale. The default value is 1.0. + */ + minimumZoomScale?: number + + /** + * Called when a scrolling animation ends. + */ + onScrollAnimationEnd?: () => void + + /** + * When true the scroll view stops on multiples of the scroll view's size + * when scrolling. This can be used for horizontal pagination. The default + * value is false. + */ + pagingEnabled?: boolean + + /** + * When false, the content does not scroll. The default value is true + */ + scrollEnabled?: boolean // true + + /** + * This controls how often the scroll event will be fired while scrolling (in events per seconds). + * A higher number yields better accuracy for code that is tracking the scroll position, + * but can lead to scroll performance problems due to the volume of information being send over the bridge. + * The default value is zero, which means the scroll event will be sent only once each time the view is scrolled. + */ + scrollEventThrottle?: number // null + + /** + * The amount by which the scroll view indicators are inset from the edges of the scroll view. + * This should normally be set to the same value as the contentInset. + * Defaults to {0, 0, 0, 0}. + */ + scrollIndicatorInsets?: Insets //zeroes + + /** + * When true the scroll view scrolls to top when the status bar is tapped. + * The default value is true. + */ + scrollsToTop?: boolean + + /** + * When snapToInterval is set, snapToAlignment will define the relationship of the the snapping to the scroll view. + * - start (the default) will align the snap at the left (horizontal) or top (vertical) + * - center will align the snap in the center + * - end will align the snap at the right (horizontal) or bottom (vertical) + */ + snapToAlignment?: string + + /** + * When set, causes the scroll view to stop at multiples of the value of snapToInterval. + * This can be used for paginating through children that have lengths smaller than the scroll view. + * Used in combination with snapToAlignment. + */ + snapToInterval?: number + + /** + * An array of child indices determining which children get docked to the + * top of the screen when scrolling. For example passing + * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the + * top of the scroll view. This property is not supported in conjunction + * with `horizontal={true}`. + */ + stickyHeaderIndices?: number[] + + /** + * The current scale of the scroll view content. The default value is 1.0. + */ + zoomScale?: number + } + + export interface ScrollViewProperties extends ScrollViewIOSProperties, Touchable { + + /** + * These styles will be applied to the scroll view content container which + * wraps all of the child views. Example: + * + * return ( + * + * + * ); + * ... + * var styles = StyleSheet.create({ + * contentContainer: { + * paddingVertical: 20 + * } + * }); + */ + contentContainerStyle?: ViewStyle + + /** + * When true the scroll view's children are arranged horizontally in a row + * instead of vertically in a column. The default value is false. + */ + horizontal?: boolean + + /** + * Determines whether the keyboard gets dismissed in response to a drag. + * - 'none' (the default) drags do not dismiss the keyboard. + * - 'onDrag' the keyboard is dismissed when a drag begins. + * - 'interactive' the keyboard is dismissed interactively with the drag + * and moves in synchrony with the touch; dragging upwards cancels the + * dismissal. + */ + keyboardDismissMode?: string + + /** + * When false tapping outside of the focused text input when the keyboard + * is up dismisses the keyboard. When true the scroll view will not catch + * taps and the keyboard will not dismiss automatically. The default value + * is false. + */ + keyboardShouldPersistTaps?: boolean + + /** + * Fires at most once per frame during scrolling. + * The frequency of the events can be contolled using the scrollEventThrottle prop. + */ + onScroll?: (event?: { nativeEvent: NativeScrollEvent }) => void + + /** + * Experimental: When true offscreen child views (whose `overflow` value is + * `hidden`) are removed from their native backing superview when offscreen. + * This canimprove scrolling performance on long lists. The default value is + * false. + */ + removeClippedSubviews?: boolean + + /** + * When true, shows a horizontal scroll indicator. + */ + showsHorizontalScrollIndicator?: boolean + + /** + * When true, shows a vertical scroll indicator. + */ + showsVerticalScrollIndicator?: boolean + + /** + * Style + */ + style?: ScrollViewStyle + } + + export interface ScrollViewProps extends ScrollViewProperties, React.Props { + + } + + interface ScrollViewStatic extends React.ComponentClass { + + } + + + export interface NativeScrollRectangle { + left: number; + top: number; + bottom: number; + right: number; + } + + export interface NativeScrollPoint { + x: number; + y: number; + } + + export interface NativeScrollSize { + height: number; + width: number; + } + + export interface NativeScrollEvent { + contentInset: NativeScrollRectangle; + contentOffset: NativeScrollPoint; + contentSize: NativeScrollSize; + layoutMeasurement: NativeScrollSize; + zoomScale: number; + } + + + ////////////////////////////////////////////////////////////////////////// + // + // A P I s + // + ////////////////////////////////////////////////////////////////////////// + + /** + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ActionSheetIOSOptions { + title?: string + options?: string[] + cancelButtonIndex?: number + destructiveButtonIndex?: number + } + + /** + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ShareActionSheetIOSOptions { + message?: string + url?: string + } + + /** + * @see https://facebook.github.io/react-native/docs/actionsheetios.html#content + * //FIXME: no documentation - inferred from RCTACtionSheetManager.m + */ + export interface ActionSheetIOSStatic { + showActionSheetWithOptions: ( options: ActionSheetIOSOptions, callback: ( buttonIndex: number ) => void ) => void + showShareActionSheetWithOptions: ( options: ShareActionSheetIOSOptions, failureCallback: ( error: Error ) => void, successCallback: ( success: boolean, method: string ) => void ) => void + } + + + /** + * //FIXME: No documentation - inferred from RCTAdSupport.m + */ + export interface AdSupportIOSStatic { + getAdvertisingId: ( onSuccess: ( deviceId: string ) => void, onFailure: ( err: Error ) => void ) => void + getAdvertisingTrackingEnabled: ( onSuccess: ( hasTracking: boolean ) => void, onFailure: ( err: Error ) => void ) => void + } + + interface AlertIOSButton { + text: string + onPress?: () => void + } + + /** + * Launches an alert dialog with the specified title and message. + * + * Optionally provide a list of buttons. + * Tapping any button will fire the respective onPress callback and dismiss the alert. + * By default, the only button will be an 'OK' button + * + * The last button in the list will be considered the 'Primary' button and it will appear bold. + * + * @see https://facebook.github.io/react-native/docs/alertios.html#content + */ + export interface AlertIOSStatic { + alert: ( title: string, message?: string, buttons?: Array, type?: string ) => void + prompt: ( title: string, value?: string, buttons?: Array, callback?: ( value?: string ) => void ) => void + } + + + /** + * AppStateIOS can tell you if the app is in the foreground or background, + * and notify you when the state changes. + * + * AppStateIOS is frequently used to determine the intent and proper behavior + * when handling push notifications. + * + * iOS App States + * active - The app is running in the foreground + * background - The app is running in the background. The user is either in another app or on the home screen + * inactive - This is a transition state that currently never happens for typical React Native apps. + * + * For more information, see Apple's documentation: https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/TheAppLifeCycle/TheAppLifeCycle.html + * + * @see https://facebook.github.io/react-native/docs/appstateios.html#content + */ + export interface AppStateIOSStatic { + currentState: string + addEventListener( type: string, listener: ( state: string ) => void ): void + removeEventListener( type: string, listener: ( state: string ) => void ): void + } + + /** + * AsyncStorage is a simple, asynchronous, persistent, key-value storage system that is global to the app. + * It should be used instead of LocalStorage. + * + * 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. + * + * @see https://facebook.github.io/react-native/docs/asyncstorage.html#content + */ + export interface AsyncStorageStatic { + + /** + * Fetches key and passes the result to callback, along with an Error if there is any. + */ + getItem( key: string, callback?: ( error?: Error, result?: string ) => void ): Promise + + /** + * Sets value for key and calls callback on completion, along with an Error if there is any + */ + setItem( key: string, value: string, callback?: ( error?: Error ) => void ): Promise + + removeItem( key: string, callback?: ( error?: Error ) => void ): Promise + + /** + * Merges existing value with input value, assuming they are stringified json. Returns a Promise object. + * Not supported by all native implementation + */ + mergeItem( key: string, value: string, callback?: ( error?: Error ) => void ): Promise + + /** + * Erases all AsyncStorage for all clients, libraries, etc. You probably don't want to call this. + * Use removeItem or multiRemove to clear only your own keys instead. + */ + clear( callback?: ( error?: Error ) => void ): Promise + + /** + * Gets all keys known to the app, for all callers, libraries, etc + */ + getAllKeys( callback?: ( error?: Error, keys?: string[] ) => void ): Promise + + /** + * multiGet invokes callback with an array of key-value pair arrays that matches the input format of multiSet + */ + multiGet( keys: string[], callback?: ( errors?: Error[], result?: string[][] ) => void ): Promise + + /** + * multiSet and multiMerge take arrays of key-value array pairs that match the output of multiGet, + * + * multiSet([['k1', 'val1'], ['k2', 'val2']], cb); + */ + multiSet( keyValuePairs: string[][], callback?: ( errors?: Error[] ) => void ): Promise + + /** + * Delete all the keys in the keys array. + */ + multiRemove( keys: string[], callback?: ( errors?: Error[] ) => void ): Promise + + /** + * Merges existing values with input values, assuming they are stringified json. + * Returns a Promise object. + * + * Not supported by all native implementations. + */ + multiMerge( keyValuePairs: string[][], callback?: ( errors?: Error[] ) => void ): Promise + } + + + export interface CameraRollFetchParams { + first: number; + after?: string; + groupTypes: string; // 'Album','All','Event','Faces','Library','PhotoStream','SavedPhotos' + groupName?: string + assetType?: string + } + + export interface CameraRollNodeInfo { + image: Image; + group_name: string; + timestamp: number; + location: any; + } + + export interface CameraRollEdgeInfo { + node: CameraRollNodeInfo; + } + + export interface CameraRollAssetInfo { + edges: CameraRollEdgeInfo[]; + page_info: { + has_next_page: boolean; + end_cursor: string; + }; + } + + /** + * CameraRoll provides access to the local camera roll / gallery. + */ + export interface CameraRollStatic { + + GroupTypesOptions: string[] //'Album','All','Event','Faces','Library','PhotoStream','SavedPhotos' + + /** + * Saves the image to the camera roll / gallery. + * + * The CameraRoll API is not yet implemented for Android. + * + * @tag On Android, this is a local URI, such as "file:///sdcard/img.png". + * On iOS, the tag can be one of the following: + * local URI + * assets-library tag + * a tag not maching any of the above, which means the image data will be stored in memory (and consume memory as long as the process is alive) + * + * @param successCallback Invoked with the value of tag on success. + * @param errorCallback Invoked with error message on error. + */ + saveImageWithTag( tag: string, successCallback: ( tag?: string ) => void, errorCallback: ( error: Error ) => void ): void + + /** + * Invokes callback with photo identifier objects from the local camera roll of the device matching shape defined by getPhotosReturnChecker. + * + * @param {object} params See getPhotosParamChecker. + * @param {function} callback Invoked with arg of shape defined by getPhotosReturnChecker on success. + * @param {function} errorCallback Invoked with error message on error. + */ + getPhotos( fetch: CameraRollFetchParams, + callback: ( assetInfo: CameraRollAssetInfo ) => void, + errorCallback: ( error: Error )=> void ): void; + } + + export interface FetchableListenable { + fetch: () => Promise + + /** + * eventName is expected to be `change` + * //FIXME: No doc - inferred from NetInfo.js + */ + addEventListener: ( eventName: string, listener: ( result: T ) => void ) => void + + /** + * eventName is expected to be `change` + * //FIXME: No doc - inferred from NetInfo.js + */ + removeEventListener: ( eventName: string, listener: ( result: T ) => void ) => void + } + + /** + * NetInfo exposes info about online/offline status + * + * Asynchronously determine if the device is online and on a cellular network. + * + * - `none` - device is offline + * - `wifi` - device is online and connected via wifi, or is the iOS simulator + * - `cell` - device is connected via Edge, 3G, WiMax, or LTE + * - `unknown` - error case and the network status is unknown + + * @see https://facebook.github.io/react-native/docs/netinfo.html#content + */ + export interface NetInfoStatic extends FetchableListenable { + + /** + * + * Available on all platforms. + * Asynchronously fetch a boolean to determine internet connectivity. + */ + isConnected: FetchableListenable + + //FIXME: Documentation missing + isConnectionMetered: any + } + + + export interface PanResponderGestureState { + + /** + * ID of the gestureState- persisted as long as there at least one touch on + */ + stateID: number + + /** + * the latest screen coordinates of the recently-moved touch + */ + moveX: number + + /** + * the latest screen coordinates of the recently-moved touch + */ + moveY: number + + /** + * the screen coordinates of the responder grant + */ + x0: number + + /** + * the screen coordinates of the responder grant + */ + y0: number + + /** + * accumulated distance of the gesture since the touch started + */ + dx: number + + /** + * accumulated distance of the gesture since the touch started + */ + dy: number + + /** + * current velocity of the gesture + */ + vx: number + + /** + * current velocity of the gesture + */ + vy: number + + /** + * Number of touches currently on screeen + */ + numberActiveTouches: number + + + // All `gestureState` accounts for timeStamps up until: + _accountsForMovesUpTo: number + } + + + /** + * @see documentation of GestureResponderHandlers + */ + export interface PanResponderCallbacks { + onMoveShouldSetPanResponder?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onStartShouldSetPanResponder?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderGrant?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderMove?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderRelease?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderTerminate?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + + onMoveShouldSetPanResponderCapture?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onStartShouldSetPanResponderCapture?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + onPanResponderReject?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderStart?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderEnd?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => void + onPanResponderTerminationRequest?: ( e: GestureResponderEvent, gestureState: PanResponderGestureState ) => boolean + } + + export interface PanResponderInstance { + panHandlers: GestureResponderHandlers + } + + /** + * PanResponder reconciles several touches into a single gesture. + * It makes single-touch gestures resilient to extra touches, + * and can be used to recognize simple multi-touch gestures. + * + * It provides a predictable wrapper of the responder handlers provided by the gesture responder system. + * For each handler, it provides a new gestureState object alongside the normal event. + */ + export interface PanResponderStatic { + /** + * @param config Enhanced versions of all of the responder callbacks + * that provide not only the typical `ResponderSyntheticEvent`, but also the + * `PanResponder` gesture state. Simply replace the word `Responder` with + * `PanResponder` in each of the typical `onResponder*` callbacks. For + * example, the `config` object would look like: + * + * - `onMoveShouldSetPanResponder: (e, gestureState) => {...}` + * - `onMoveShouldSetPanResponderCapture: (e, gestureState) => {...}` + * - `onStartShouldSetPanResponder: (e, gestureState) => {...}` + * - `onStartShouldSetPanResponderCapture: (e, gestureState) => {...}` + * - `onPanResponderReject: (e, gestureState) => {...}` + * - `onPanResponderGrant: (e, gestureState) => {...}` + * - `onPanResponderStart: (e, gestureState) => {...}` + * - `onPanResponderEnd: (e, gestureState) => {...}` + * - `onPanResponderRelease: (e, gestureState) => {...}` + * - `onPanResponderMove: (e, gestureState) => {...}` + * - `onPanResponderTerminate: (e, gestureState) => {...}` + * - `onPanResponderTerminationRequest: (e, gestureState) => {...}` + * + * In general, for events that have capture equivalents, we update the + * gestureState once in the capture phase and can use it in the bubble phase + * as well. + * + * Be careful with onStartShould* callbacks. They only reflect updated + * `gestureState` for start/end events that bubble/capture to the Node. + * Once the node is the responder, you can rely on every start/end event + * being processed by the gesture and `gestureState` being updated + * accordingly. (numberActiveTouches) may not be totally accurate unless you + * are the responder. + */ + create( config: PanResponderCallbacks ): PanResponderInstance + } + + export interface PushNotificationPermissions { + alert?: boolean + badge?: boolean + sound?: boolean + } + + export interface PushNotification { + + + /** + * An alias for `getAlert` to get the notification's main message string + */ + getMessage(): string | Object + + /** + * Gets the sound string from the `aps` object + */ + getSound(): string + + /** + * Gets the notification's main message from the `aps` object + */ + getAlert(): string | Object + + /** + * Gets the badge count number from the `aps` object + */ + getBadgeCount(): number + + /** + * Gets the data object on the notif + */ + getData(): Object + + } + + + /** + * Handle push notifications for your app, including permission handling and icon badge number. + * @see https://facebook.github.io/react-native/docs/pushnotificationios.html#content + * + * //FIXME: BGR: The documentation seems completely off compared to the actual js implementation. I could never get the example to run + */ + export interface PushNotificationIOSStatic { + + /** + * Sets the badge number for the app icon on the home screen + */ + setApplicationIconBadgeNumber( number: number ): void + + /** + * Gets the current badge number for the app icon on the home screen + */ + getApplicationIconBadgeNumber( callback: ( badge: number ) => void ): void + + /** + * Attaches a listener to remote notifications while the app is running in the + * foreground or the background. + * + * The handler will get be invoked with an instance of `PushNotificationIOS` + * + * The type MUST be 'notification' + */ + addEventListener( type: string, handler: ( notification: PushNotification ) => void ):void + + /** + * Requests all notification permissions from iOS, prompting the user's + * dialog box. + */ + requestPermissions(): void + + /** + * See what push permissions are currently enabled. `callback` will be + * invoked with a `permissions` object: + * + * - `alert` :boolean + * - `badge` :boolean + * - `sound` :boolean + */ + checkPermissions( callback: ( permissions: PushNotificationPermissions ) => void ): void + + /** + * Removes the event listener. Do this in `componentWillUnmount` to prevent + * memory leaks + */ + removeEventListener( type: string, handler: ( notification: PushNotification ) => void ): void + + /** + * An initial notification will be available if the app was cold-launched + * from a notification. + * + * The first caller of `popInitialNotification` will get the initial + * notification object, or `null`. Subsequent invocations will return null. + */ + popInitialNotification(): PushNotification + } + + + /** + * @enum('default', 'light-content') + */ + export type StatusBarStyle = string + + /** + * @enum('none','fade', 'slide') + */ + type StatusBarAnimation = string + + + /** + * //FIXME: No documentation is available (although this is self explanatory) + * + * @see https://facebook.github.io/react-native/docs/statusbarios.html#content + */ + export interface StatusBarIOSStatic { + + setStyle(style: StatusBarStyle, animated?: boolean): void + + setHidden(hidden: boolean, animation?: StatusBarAnimation): void + + setNetworkActivityIndicatorVisible(visible: boolean): void + } + + /** + * The Vibration API is exposed at VibrationIOS.vibrate(). + * On iOS, calling this function will trigger a one second vibration. + * The vibration is asynchronous so this method will return immediately. + * + * There will be no effect on devices that do not support Vibration, eg. the iOS simulator. + * + * Vibration patterns are currently unsupported. + * + * @see https://facebook.github.io/react-native/docs/vibrationios.html#content + */ + export interface VibrationIOSStatic { + vibrate(): void + } + + ////////////////////////////////////////////////////////////////////////// + // + // R E - E X P O R T S + // + ////////////////////////////////////////////////////////////////////////// + + // export var AppRegistry: AppRegistryStatic; + + + export var ActivityIndicatorIOS: ActivityIndicatorIOSStatic + export type ActivityIndicatorIOS = ActivityIndicatorIOSStatic + + export var DatePickerIOS: DatePickerIOSStatic + export type DatePickerIOS = DatePickerIOSStatic + + export var Image: ImageStatic + export type Image = ImageStatic + + export var LayoutAnimation: LayoutAnimationStatic + export type LayoutAnimation = LayoutAnimationStatic + + export var ListView: ListViewStatic + export type ListView = ListViewStatic + + export var MapView: MapViewStatic + export type MapView = MapViewStatic + + export var Navigator: NavigatorStatic + export type Navigator = NavigatorStatic + + export var NavigatorIOS: NavigatorIOSStatic + export type NavigatorIOS = NavigatorIOSStatic + + export var PickerIOS: PickerIOSStatic + export type PickerIOS = PickerIOSStatic + + export var SliderIOS: SliderIOSStatic + export type SliderIOS = SliderIOSStatic + + export var ScrollView: ScrollViewStatic + export type ScrollView = ScrollViewStatic + + export var StyleSheet: StyleSheetStatic + export type StyleSheet = StyleSheetStatic + + export var SwitchIOS: SwitchIOSStatic + export type SwitchIOS = SwitchIOSStatic + + export var TabBarIOS: TabBarIOSStatic + export type TabBarIOS = TabBarIOSStatic + + export var Text: TextStatic + export type Text = TextStatic + + export var TextInput: TextInputStatic + export type TextInput = TextInputStatic + + export var TouchableHighlight: TouchableHighlightStatic + export type TouchableHighlight = TouchableHighlightStatic + + export var TouchableNativeFeedback: TouchableNativeFeedbackStatic + export type TouchableNativeFeedback = TouchableNativeFeedbackStatic + + export var TouchableOpacity: TouchableOpacityStatic + export type TouchableOpacity = TouchableOpacityStatic + + export var TouchableWithoutFeedback: TouchableWithoutFeedbackStatic + export type TouchableWithoutFeedback= TouchableWithoutFeedbackStatic + + export var View: ViewStatic + export type View = ViewStatic + + export var WebView: WebViewStatic + export type WebView = WebViewStatic + + + //////////// APIS ////////////// + export var ActionSheetIOS: ActionSheetIOSStatic + export type ActionSheetIOS = ActionSheetIOSStatic + + export var AdSupportIOS: AdSupportIOSStatic + export type AdSupportIOS = AdSupportIOSStatic + + export var AlertIOS: AlertIOSStatic + export type AlertIOS = AlertIOSStatic + + export var AppStateIOS: AppStateIOSStatic + export type AppStateIOS = AppStateIOSStatic + + export var AsyncStorage: AsyncStorageStatic + export type AsyncStorage = AsyncStorageStatic + + export var CameraRoll: CameraRollStatic + export type CameraRoll = CameraRollStatic + + export var NetInfo: NetInfoStatic + export type NetInfo = NetInfoStatic + + export var PanResponder: PanResponderStatic + export type PanResponder = PanResponderStatic + + export var PushNotificationIOS: PushNotificationIOSStatic + export type PushNotificationIOS = PushNotificationIOSStatic + + export var StatusBarIOS: StatusBarIOSStatic + export type StatusBarIOS = StatusBarIOSStatic + + export var VibrationIOS: VibrationIOSStatic + export type VibrationIOS = VibrationIOSStatic + + + // + // /TODO: BGR: These are leftovers of the initial port that must be revisited + // + + export var SegmentedControlIOS: React.ComponentClass + + export var PixelRatio: PixelRatioStatic + export var DeviceEventEmitter: DeviceEventEmitterStatic + export var DeviceEventSubscription: DeviceEventSubscriptionStatic + export type DeviceEventSubscription = DeviceEventSubscriptionStatic + export var InteractionManager: InteractionManagerStatic + + ////////////////////////////////////////////////////////////////////////// + // + // Additional ( and controversial) + // + ////////////////////////////////////////////////////////////////////////// + + export function __spread( target: any, ...sources: any[] ): any; + + + export interface GlobalStatic { + + /** + * Accepts a function as its only argument and calls that function before the next repaint. + * It is an essential building block for animations that underlies all of the JavaScript-based animation APIs. + * In general, you shouldn't need to call this yourself - the animation API's will manage frame updates for you. + * @see https://facebook.github.io/react-native/docs/animations.html#requestanimationframe + */ + requestAnimationFrame( fn: () => void ) : void; + + } + + // + // Add-Ons + // + namespace addons { + + //FIXME: Documentation ? + export interface TestModuleStatic { + + verifySnapshot: ( done: ( indicator?: any ) => void ) => void + markTestPassed: ( indicator: any ) => void + markTestCompleted: () => void + } + + export var TestModule: TestModuleStatic + export type TestModule = TestModuleStatic + } + + +} + +declare module "react-native" { + + import ReactNative = __React + export = ReactNative +} + +declare var global: __React.GlobalStatic + +declare function require( name: string ): any + + +//TODO: BGR: this is a left-over from the initial port. Not sure it makes any sense +declare module "Dimensions" { + import * as React from 'react-native'; + + interface Dimensions { + get( what: string ): React.ScaledSize; + } + + var ExportDimensions: Dimensions; + export = ExportDimensions; +} diff --git a/.vscode/typings/react/react-addons-create-fragment.d.ts b/.vscode/typings/react/react-addons-create-fragment.d.ts new file mode 100644 index 0000000000..b2332eae1e --- /dev/null +++ b/.vscode/typings/react/react-addons-create-fragment.d.ts @@ -0,0 +1,16 @@ +// Type definitions for React v0.14 (react-addons-create-fragment) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + namespace __Addons { + export function createFragment(object: { [key: string]: ReactNode }): ReactFragment; + } +} + +declare module "react-addons-create-fragment" { + export = __React.__Addons.createFragment; +} diff --git a/.vscode/typings/react/react-addons-css-transition-group.d.ts b/.vscode/typings/react/react-addons-css-transition-group.d.ts new file mode 100644 index 0000000000..f55335ccbc --- /dev/null +++ b/.vscode/typings/react/react-addons-css-transition-group.d.ts @@ -0,0 +1,40 @@ +// Type definitions for React v0.14 (react-addons-css-transition-group) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// + +declare namespace __React { + interface CSSTransitionGroupTransitionName { + enter: string; + enterActive?: string; + leave: string; + leaveActive?: string; + appear?: string; + appearActive?: string; + } + + interface CSSTransitionGroupProps extends TransitionGroupProps { + transitionName: string | CSSTransitionGroupTransitionName; + transitionAppear?: boolean; + transitionAppearTimeout?: number; + transitionEnter?: boolean; + transitionEnterTimeout?: number; + transitionLeave?: boolean; + transitionLeaveTimeout?: number; + } + + type CSSTransitionGroup = ComponentClass; + + namespace __Addons { + export var CSSTransitionGroup: __React.CSSTransitionGroup; + } +} + +declare module "react-addons-css-transition-group" { + var CSSTransitionGroup: __React.CSSTransitionGroup; + type CSSTransitionGroup = __React.CSSTransitionGroup; + export = CSSTransitionGroup; +} diff --git a/.vscode/typings/react/react-addons-linked-state-mixin.d.ts b/.vscode/typings/react/react-addons-linked-state-mixin.d.ts new file mode 100644 index 0000000000..52fd17930c --- /dev/null +++ b/.vscode/typings/react/react-addons-linked-state-mixin.d.ts @@ -0,0 +1,32 @@ +// Type definitions for React v0.14 (react-addons-linked-state-mixin) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface ReactLink { + value: T; + requestChange(newValue: T): void; + } + + interface LinkedStateMixin extends Mixin { + linkState(key: string): ReactLink; + } + + interface HTMLAttributes { + checkedLink?: ReactLink; + valueLink?: ReactLink; + } + + namespace __Addons { + export var LinkedStateMixin: LinkedStateMixin; + } +} + +declare module "react-addons-linked-state-mixin" { + var LinkedStateMixin: __React.LinkedStateMixin; + type LinkedStateMixin = __React.LinkedStateMixin; + export = LinkedStateMixin; +} diff --git a/.vscode/typings/react/react-addons-perf.d.ts b/.vscode/typings/react/react-addons-perf.d.ts new file mode 100644 index 0000000000..20416a060c --- /dev/null +++ b/.vscode/typings/react/react-addons-perf.d.ts @@ -0,0 +1,46 @@ +// Type definitions for React v0.14 (react-addons-perf) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface ComponentPerfContext { + current: string; + owner: string; + } + + interface NumericPerfContext { + [key: string]: number; + } + + interface Measurements { + exclusive: NumericPerfContext; + inclusive: NumericPerfContext; + render: NumericPerfContext; + counts: NumericPerfContext; + writes: NumericPerfContext; + displayNames: { + [key: string]: ComponentPerfContext; + }; + totalTime: number; + } + + namespace __Addons { + namespace Perf { + export function start(): void; + export function stop(): void; + export function printInclusive(measurements: Measurements[]): void; + export function printExclusive(measurements: Measurements[]): void; + export function printWasted(measurements: Measurements[]): void; + export function printDOM(measurements: Measurements[]): void; + export function getLastMeasurements(): Measurements[]; + } + } +} + +declare module "react-addons-perf" { + import Perf = __React.__Addons.Perf; + export = Perf; +} diff --git a/.vscode/typings/react/react-addons-pure-render-mixin.d.ts b/.vscode/typings/react/react-addons-pure-render-mixin.d.ts new file mode 100644 index 0000000000..3c154e6b5d --- /dev/null +++ b/.vscode/typings/react/react-addons-pure-render-mixin.d.ts @@ -0,0 +1,20 @@ +// Type definitions for React v0.14 (react-addons-pure-render-mixin) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface PureRenderMixin extends Mixin {} + + namespace __Addons { + export var PureRenderMixin: PureRenderMixin; + } +} + +declare module "react-addons-pure-render-mixin" { + var PureRenderMixin: __React.PureRenderMixin; + type PureRenderMixin = __React.PureRenderMixin; + export = PureRenderMixin; +} diff --git a/.vscode/typings/react/react-addons-test-utils.d.ts b/.vscode/typings/react/react-addons-test-utils.d.ts new file mode 100644 index 0000000000..3b77ac4c5e --- /dev/null +++ b/.vscode/typings/react/react-addons-test-utils.d.ts @@ -0,0 +1,155 @@ +// Type definitions for React v0.14 (react-addons-test-utils) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface SyntheticEventData { + altKey?: boolean; + button?: number; + buttons?: number; + clientX?: number; + clientY?: number; + changedTouches?: TouchList; + charCode?: boolean; + clipboardData?: DataTransfer; + ctrlKey?: boolean; + deltaMode?: number; + deltaX?: number; + deltaY?: number; + deltaZ?: number; + detail?: number; + getModifierState?(key: string): boolean; + key?: string; + keyCode?: number; + locale?: string; + location?: number; + metaKey?: boolean; + pageX?: number; + pageY?: number; + relatedTarget?: EventTarget; + repeat?: boolean; + screenX?: number; + screenY?: number; + shiftKey?: boolean; + targetTouches?: TouchList; + touches?: TouchList; + view?: AbstractView; + which?: number; + } + + interface EventSimulator { + (element: Element, eventData?: SyntheticEventData): void; + (component: Component, eventData?: SyntheticEventData): void; + } + + interface MockedComponentClass { + new(): any; + } + + class ShallowRenderer { + getRenderOutput>(): E; + getRenderOutput(): ReactElement; + render(element: ReactElement, context?: any): void; + unmount(): void; + } + + namespace __Addons { + namespace TestUtils { + namespace Simulate { + export var blur: EventSimulator; + export var change: EventSimulator; + export var click: EventSimulator; + export var cut: EventSimulator; + export var doubleClick: EventSimulator; + export var drag: EventSimulator; + export var dragEnd: EventSimulator; + export var dragEnter: EventSimulator; + export var dragExit: EventSimulator; + export var dragLeave: EventSimulator; + export var dragOver: EventSimulator; + export var dragStart: EventSimulator; + export var drop: EventSimulator; + export var focus: EventSimulator; + export var input: EventSimulator; + export var keyDown: EventSimulator; + export var keyPress: EventSimulator; + export var keyUp: EventSimulator; + export var mouseDown: EventSimulator; + export var mouseEnter: EventSimulator; + export var mouseLeave: EventSimulator; + export var mouseMove: EventSimulator; + export var mouseOut: EventSimulator; + export var mouseOver: EventSimulator; + export var mouseUp: EventSimulator; + export var paste: EventSimulator; + export var scroll: EventSimulator; + export var submit: EventSimulator; + export var touchCancel: EventSimulator; + export var touchEnd: EventSimulator; + export var touchMove: EventSimulator; + export var touchStart: EventSimulator; + export var wheel: EventSimulator; + } + + export function renderIntoDocument( + element: DOMElement): Element; + export function renderIntoDocument

( + element: ReactElement

): Component; + export function renderIntoDocument>( + element: ReactElement): C; + + export function mockComponent( + mocked: MockedComponentClass, mockTagName?: string): typeof TestUtils; + + export function isElementOfType( + element: ReactElement, type: ReactType): boolean; + export function isDOMComponent(instance: ReactInstance): boolean; + export function isCompositeComponent(instance: ReactInstance): boolean; + export function isCompositeComponentWithType( + instance: ReactInstance, + type: ComponentClass): boolean; + + export function findAllInRenderedTree( + root: Component, + fn: (i: ReactInstance) => boolean): ReactInstance[]; + + export function scryRenderedDOMComponentsWithClass( + root: Component, + className: string): Element[]; + export function findRenderedDOMComponentWithClass( + root: Component, + className: string): Element; + + export function scryRenderedDOMComponentsWithTag( + root: Component, + tagName: string): Element[]; + export function findRenderedDOMComponentWithTag( + root: Component, + tagName: string): Element; + + export function scryRenderedComponentsWithType

( + root: Component, + type: ComponentClass

): Component[]; + export function scryRenderedComponentsWithType>( + root: Component, + type: ComponentClass): C[]; + + export function findRenderedComponentWithType

( + root: Component, + type: ComponentClass

): Component; + export function findRenderedComponentWithType>( + root: Component, + type: ComponentClass): C; + + export function createRenderer(): ShallowRenderer; + } + } +} + +declare module "react-addons-test-utils" { + import TestUtils = __React.__Addons.TestUtils; + export = TestUtils; +} diff --git a/.vscode/typings/react/react-addons-transition-group.d.ts b/.vscode/typings/react/react-addons-transition-group.d.ts new file mode 100644 index 0000000000..9178eb5163 --- /dev/null +++ b/.vscode/typings/react/react-addons-transition-group.d.ts @@ -0,0 +1,26 @@ +// Type definitions for React v0.14 (react-addons-transition-group) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + + interface TransitionGroupProps { + component?: ReactType; + childFactory?: (child: ReactElement) => ReactElement; + } + + type TransitionGroup = ComponentClass; + + namespace __Addons { + export var TransitionGroup: __React.TransitionGroup; + } +} + +declare module "react-addons-transition-group" { + var TransitionGroup: __React.TransitionGroup; + type TransitionGroup = __React.TransitionGroup; + export = TransitionGroup; +} diff --git a/.vscode/typings/react/react-addons-update.d.ts b/.vscode/typings/react/react-addons-update.d.ts new file mode 100644 index 0000000000..11649799d0 --- /dev/null +++ b/.vscode/typings/react/react-addons-update.d.ts @@ -0,0 +1,35 @@ +// Type definitions for React v0.14 (react-addons-update) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + interface UpdateSpecCommand { + $set?: any; + $merge?: {}; + $apply?(value: any): any; + } + + interface UpdateSpecPath { + [key: string]: UpdateSpec; + } + + type UpdateSpec = UpdateSpecCommand | UpdateSpecPath; + + interface UpdateArraySpec extends UpdateSpecCommand { + $push?: any[]; + $unshift?: any[]; + $splice?: any[][]; + } + + namespace __Addons { + export function update(value: any[], spec: UpdateArraySpec): any[]; + export function update(value: {}, spec: UpdateSpec): any; + } +} + +declare module "react-addons-update" { + export = __React.__Addons.update; +} diff --git a/.vscode/typings/react/react-dom.d.ts b/.vscode/typings/react/react-dom.d.ts new file mode 100644 index 0000000000..80a0c604e3 --- /dev/null +++ b/.vscode/typings/react/react-dom.d.ts @@ -0,0 +1,66 @@ +// Type definitions for React v0.14 (react-dom) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// + +declare namespace __React { + namespace __DOM { + function findDOMNode(instance: ReactInstance): E; + function findDOMNode(instance: ReactInstance): Element; + + function render

( + element: DOMElement

, + container: Element, + callback?: (element: Element) => any): Element; + function render( + element: ClassicElement

, + container: Element, + callback?: (component: ClassicComponent) => any): ClassicComponent; + function render( + element: ReactElement

, + container: Element, + callback?: (component: Component) => any): Component; + + function unmountComponentAtNode(container: Element): boolean; + + var version: string; + + function unstable_batchedUpdates(callback: (a: A, b: B) => any, a: A, b: B): void; + function unstable_batchedUpdates(callback: (a: A) => any, a: A): void; + function unstable_batchedUpdates(callback: () => any): void; + + function unstable_renderSubtreeIntoContainer

( + parentComponent: Component, + nextElement: DOMElement

, + container: Element, + callback?: (element: Element) => any): Element; + function unstable_renderSubtreeIntoContainer( + parentComponent: Component, + nextElement: ClassicElement

, + container: Element, + callback?: (component: ClassicComponent) => any): ClassicComponent; + function unstable_renderSubtreeIntoContainer( + parentComponent: Component, + nextElement: ReactElement

, + container: Element, + callback?: (component: Component) => any): Component; + } + + namespace __DOMServer { + function renderToString(element: ReactElement): string; + function renderToStaticMarkup(element: ReactElement): string; + var version: string; + } +} + +declare module "react-dom" { + import DOM = __React.__DOM; + export = DOM; +} + +declare module "react-dom/server" { + import DOMServer = __React.__DOMServer; + export = DOMServer; +} diff --git a/.vscode/typings/react/react-global.d.ts b/.vscode/typings/react/react-global.d.ts new file mode 100644 index 0000000000..1c50ce7e4b --- /dev/null +++ b/.vscode/typings/react/react-global.d.ts @@ -0,0 +1,22 @@ +// Type definitions for React v0.14 (namespace) +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +/// +/// +/// +/// +/// +/// +/// +/// +/// +/// + +import React = __React; +import ReactDOM = __React.__DOM; + +declare namespace __React { + export import addons = __React.__Addons; +} diff --git a/.vscode/typings/react/react.d.ts b/.vscode/typings/react/react.d.ts new file mode 100644 index 0000000000..e9b88dde27 --- /dev/null +++ b/.vscode/typings/react/react.d.ts @@ -0,0 +1,2274 @@ +// Type definitions for React v0.14 +// Project: http://facebook.github.io/react/ +// Definitions by: Asana , AssureSign , Microsoft +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare namespace __React { + + // + // React Elements + // ---------------------------------------------------------------------- + + type ReactType = string | ComponentClass | StatelessComponent; + + interface ReactElement

> { + type: string | ComponentClass

| StatelessComponent

; + props: P; + key: string | number; + ref: string | ((component: Component | Element) => any); + } + + interface ClassicElement

extends ReactElement

{ + type: ClassicComponentClass

; + ref: string | ((component: ClassicComponent) => any); + } + + interface DOMElement

> extends ReactElement

{ + type: string; + ref: string | ((element: Element) => any); + } + + interface ReactHTMLElement extends DOMElement> { + ref: string | ((element: HTMLElement) => any); + } + + interface ReactSVGElement extends DOMElement { + ref: string | ((element: SVGElement) => any); + } + + // + // Factories + // ---------------------------------------------------------------------- + + interface Factory

{ + (props?: P, ...children: ReactNode[]): ReactElement

; + } + + interface ClassicFactory

extends Factory

{ + (props?: P, ...children: ReactNode[]): ClassicElement

; + } + + interface DOMFactory

> extends Factory

{ + (props?: P, ...children: ReactNode[]): DOMElement

; + } + + type HTMLFactory = DOMFactory>; + type SVGFactory = DOMFactory; + + // + // React Nodes + // http://facebook.github.io/react/docs/glossary.html + // ---------------------------------------------------------------------- + + type ReactText = string | number; + type ReactChild = ReactElement | ReactText; + + // Should be Array but type aliases cannot be recursive + type ReactFragment = {} | Array; + type ReactNode = ReactChild | ReactFragment | boolean; + + // + // Top Level API + // ---------------------------------------------------------------------- + + function createClass(spec: ComponentSpec): ClassicComponentClass

; + + function createFactory

(type: string): DOMFactory

; + function createFactory

(type: ClassicComponentClass

): ClassicFactory

; + function createFactory

(type: ComponentClass

| StatelessComponent

): Factory

; + + function createElement

( + type: string, + props?: P, + ...children: ReactNode[]): DOMElement

; + function createElement

( + type: ClassicComponentClass

, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function createElement

( + type: ComponentClass

| StatelessComponent

, + props?: P, + ...children: ReactNode[]): ReactElement

; + + function cloneElement

( + element: DOMElement

, + props?: P, + ...children: ReactNode[]): DOMElement

; + function cloneElement

( + element: ClassicElement

, + props?: P, + ...children: ReactNode[]): ClassicElement

; + function cloneElement

( + element: ReactElement

, + props?: P, + ...children: ReactNode[]): ReactElement

; + + function isValidElement(object: {}): boolean; + + var DOM: ReactDOM; + var PropTypes: ReactPropTypes; + var Children: ReactChildren; + + // + // Component API + // ---------------------------------------------------------------------- + + type ReactInstance = Component | Element; + + // Base component for plain JS classes + class Component implements ComponentLifecycle { + constructor(props?: P, context?: any); + setState(f: (prevState: S, props: P) => S, callback?: () => any): void; + setState(state: S, callback?: () => any): void; + forceUpdate(callBack?: () => any): void; + render(): JSX.Element; + props: P; + state: S; + context: {}; + refs: { + [key: string]: ReactInstance + }; + } + + interface ClassicComponent extends Component { + replaceState(nextState: S, callback?: () => any): void; + isMounted(): boolean; + getInitialState?(): S; + } + + interface ChildContextProvider { + getChildContext(): CC; + } + + // + // Class Interfaces + // ---------------------------------------------------------------------- + + interface StatelessComponent

{ + (props?: P, context?: any): ReactElement; + propTypes?: ValidationMap

; + contextTypes?: ValidationMap; + defaultProps?: P; + displayName?: string; + } + + interface ComponentClass

{ + new(props?: P, context?: any): Component; + propTypes?: ValidationMap

; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + defaultProps?: P; + } + + interface ClassicComponentClass

extends ComponentClass

{ + new(props?: P, context?: any): ClassicComponent; + getDefaultProps?(): P; + displayName?: string; + } + + // + // Component Specs and Lifecycle + // ---------------------------------------------------------------------- + + interface ComponentLifecycle { + componentWillMount?(): void; + componentDidMount?(): void; + componentWillReceiveProps?(nextProps: P, nextContext: any): void; + shouldComponentUpdate?(nextProps: P, nextState: S, nextContext: any): boolean; + componentWillUpdate?(nextProps: P, nextState: S, nextContext: any): void; + componentDidUpdate?(prevProps: P, prevState: S, prevContext: any): void; + componentWillUnmount?(): void; + } + + interface Mixin extends ComponentLifecycle { + mixins?: Mixin; + statics?: { + [key: string]: any; + }; + + displayName?: string; + propTypes?: ValidationMap; + contextTypes?: ValidationMap; + childContextTypes?: ValidationMap; + + getDefaultProps?(): P; + getInitialState?(): S; + } + + interface ComponentSpec extends Mixin { + render(): ReactElement; + + [propertyName: string]: any; + } + + // + // Event System + // ---------------------------------------------------------------------- + + interface SyntheticEvent { + bubbles: boolean; + cancelable: boolean; + currentTarget: EventTarget; + defaultPrevented: boolean; + eventPhase: number; + isTrusted: boolean; + nativeEvent: Event; + preventDefault(): void; + stopPropagation(): void; + target: EventTarget; + timeStamp: Date; + type: string; + } + + interface ClipboardEvent extends SyntheticEvent { + clipboardData: DataTransfer; + } + + interface CompositionEvent extends SyntheticEvent { + data: string; + } + + interface DragEvent extends SyntheticEvent { + dataTransfer: DataTransfer; + } + + interface FocusEvent extends SyntheticEvent { + relatedTarget: EventTarget; + } + + interface FormEvent extends SyntheticEvent { + } + + interface KeyboardEvent extends SyntheticEvent { + altKey: boolean; + charCode: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + key: string; + keyCode: number; + locale: string; + location: number; + metaKey: boolean; + repeat: boolean; + shiftKey: boolean; + which: number; + } + + interface MouseEvent extends SyntheticEvent { + altKey: boolean; + button: number; + buttons: number; + clientX: number; + clientY: number; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + pageX: number; + pageY: number; + relatedTarget: EventTarget; + screenX: number; + screenY: number; + shiftKey: boolean; + } + + interface TouchEvent extends SyntheticEvent { + altKey: boolean; + changedTouches: TouchList; + ctrlKey: boolean; + getModifierState(key: string): boolean; + metaKey: boolean; + shiftKey: boolean; + targetTouches: TouchList; + touches: TouchList; + } + + interface UIEvent extends SyntheticEvent { + detail: number; + view: AbstractView; + } + + interface WheelEvent extends SyntheticEvent { + deltaMode: number; + deltaX: number; + deltaY: number; + deltaZ: number; + } + + // + // Event Handler Types + // ---------------------------------------------------------------------- + + interface EventHandler { + (event: E): void; + } + + type ReactEventHandler = EventHandler; + + type ClipboardEventHandler = EventHandler; + type CompositionEventHandler = EventHandler; + type DragEventHandler = EventHandler; + type FocusEventHandler = EventHandler; + type FormEventHandler = EventHandler; + type KeyboardEventHandler = EventHandler; + type MouseEventHandler = EventHandler; + type TouchEventHandler = EventHandler; + type UIEventHandler = EventHandler; + type WheelEventHandler = EventHandler; + + // + // Props / DOM Attributes + // ---------------------------------------------------------------------- + + interface Props { + children?: ReactNode; + key?: string | number; + ref?: string | ((component: T) => any); + } + + interface HTMLProps extends HTMLAttributes, Props { + } + + interface SVGProps extends SVGAttributes, Props { + } + + interface DOMAttributes { + dangerouslySetInnerHTML?: { + __html: string; + }; + + // Clipboard Events + onCopy?: ClipboardEventHandler; + onCut?: ClipboardEventHandler; + onPaste?: ClipboardEventHandler; + + // Composition Events + onCompositionEnd?: CompositionEventHandler; + onCompositionStart?: CompositionEventHandler; + onCompositionUpdate?: CompositionEventHandler; + + // Focus Events + onFocus?: FocusEventHandler; + onBlur?: FocusEventHandler; + + // Form Events + onChange?: FormEventHandler; + onInput?: FormEventHandler; + onSubmit?: FormEventHandler; + + // Image Events + onLoad?: ReactEventHandler; + onError?: ReactEventHandler; // also a Media Event + + // Keyboard Events + onKeyDown?: KeyboardEventHandler; + onKeyPress?: KeyboardEventHandler; + onKeyUp?: KeyboardEventHandler; + + // Media Events + onAbort?: ReactEventHandler; + onCanPlay?: ReactEventHandler; + onCanPlayThrough?: ReactEventHandler; + onDurationChange?: ReactEventHandler; + onEmptied?: ReactEventHandler; + onEncrypted?: ReactEventHandler; + onEnded?: ReactEventHandler; + onLoadedData?: ReactEventHandler; + onLoadedMetadata?: ReactEventHandler; + onLoadStart?: ReactEventHandler; + onPause?: ReactEventHandler; + onPlay?: ReactEventHandler; + onPlaying?: ReactEventHandler; + onProgress?: ReactEventHandler; + onRateChange?: ReactEventHandler; + onSeeked?: ReactEventHandler; + onSeeking?: ReactEventHandler; + onStalled?: ReactEventHandler; + onSuspend?: ReactEventHandler; + onTimeUpdate?: ReactEventHandler; + onVolumeChange?: ReactEventHandler; + onWaiting?: ReactEventHandler; + + // MouseEvents + onClick?: MouseEventHandler; + onContextMenu?: MouseEventHandler; + onDoubleClick?: MouseEventHandler; + onDrag?: DragEventHandler; + onDragEnd?: DragEventHandler; + onDragEnter?: DragEventHandler; + onDragExit?: DragEventHandler; + onDragLeave?: DragEventHandler; + onDragOver?: DragEventHandler; + onDragStart?: DragEventHandler; + onDrop?: DragEventHandler; + onMouseDown?: MouseEventHandler; + onMouseEnter?: MouseEventHandler; + onMouseLeave?: MouseEventHandler; + onMouseMove?: MouseEventHandler; + onMouseOut?: MouseEventHandler; + onMouseOver?: MouseEventHandler; + onMouseUp?: MouseEventHandler; + + // Selection Events + onSelect?: ReactEventHandler; + + // Touch Events + onTouchCancel?: TouchEventHandler; + onTouchEnd?: TouchEventHandler; + onTouchMove?: TouchEventHandler; + onTouchStart?: TouchEventHandler; + + // UI Events + onScroll?: UIEventHandler; + + // Wheel Events + onWheel?: WheelEventHandler; + } + + // This interface is not complete. Only properties accepting + // unitless numbers are listed here (see CSSProperty.js in React) + interface CSSProperties { + boxFlex?: number; + boxFlexGroup?: number; + columnCount?: number; + flex?: number | string; + flexGrow?: number; + flexShrink?: number; + fontWeight?: number | string; + lineClamp?: number; + lineHeight?: number | string; + opacity?: number; + order?: number; + orphans?: number; + widows?: number; + zIndex?: number; + zoom?: number; + + fontSize?: number | string; + + // SVG-related properties + fillOpacity?: number; + strokeOpacity?: number; + strokeWidth?: number; + + // Remaining properties auto-extracted from http://docs.webplatform.org. + // License: http://docs.webplatform.org/wiki/Template:CC-by-3.0 + /** + * Aligns a flex container's lines within the flex container when there is extra space in the cross-axis, similar to how justify-content aligns individual items within the main-axis. + */ + alignContent?: any; + + /** + * Sets the default alignment in the cross axis for all of the flex container's items, including anonymous flex items, similarly to how justify-content aligns items along the main axis. + */ + alignItems?: any; + + /** + * Allows the default alignment to be overridden for individual flex items. + */ + alignSelf?: any; + + /** + * This property allows precise alignment of elements, such as graphics, that do not have a baseline-table or lack the desired baseline in their baseline-table. With the alignment-adjust property, the position of the baseline identified by the alignment-baseline can be explicitly determined. It also determines precisely the alignment point for each glyph within a textual element. + */ + alignmentAdjust?: any; + + alignmentBaseline?: any; + + /** + * Defines a length of time to elapse before an animation starts, allowing an animation to begin execution some time after it is applied. + */ + animationDelay?: any; + + /** + * Defines whether an animation should run in reverse on some or all cycles. + */ + animationDirection?: any; + + /** + * Specifies how many times an animation cycle should play. + */ + animationIterationCount?: any; + + /** + * Defines the list of animations that apply to the element. + */ + animationName?: any; + + /** + * Defines whether an animation is running or paused. + */ + animationPlayState?: any; + + /** + * Allows changing the style of any element to platform-based interface elements or vice versa. + */ + appearance?: any; + + /** + * Determines whether or not the “back” side of a transformed element is visible when facing the viewer. + */ + backfaceVisibility?: any; + + /** + * This property describes how the element's background images should blend with each other and the element's background color. + * The value is a list of blend modes that corresponds to each background image. Each element in the list will apply to the corresponding element of background-image. If a property doesn’t have enough comma-separated values to match the number of layers, the UA must calculate its used value by repeating the list of values until there are enough. + */ + backgroundBlendMode?: any; + + backgroundColor?: any; + + backgroundComposite?: any; + + /** + * Applies one or more background images to an element. These can be any valid CSS image, including url() paths to image files or CSS gradients. + */ + backgroundImage?: any; + + /** + * Specifies what the background-position property is relative to. + */ + backgroundOrigin?: any; + + /** + * Sets the horizontal position of a background image. + */ + backgroundPositionX?: any; + + /** + * Background-repeat defines if and how background images will be repeated after they have been sized and positioned + */ + backgroundRepeat?: any; + + /** + * Obsolete - spec retired, not implemented. + */ + baselineShift?: any; + + /** + * Non standard. Sets or retrieves the location of the Dynamic HTML (DHTML) behavior. + */ + behavior?: any; + + /** + * Shorthand property that defines the different properties of all four sides of an element's border in a single declaration. It can be used to set border-width, border-style and border-color, or a subset of these. + */ + border?: any; + + /** + * Defines the shape of the border of the bottom-left corner. + */ + borderBottomLeftRadius?: any; + + /** + * Defines the shape of the border of the bottom-right corner. + */ + borderBottomRightRadius?: any; + + /** + * Sets the width of an element's bottom border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderBottomWidth?: any; + + /** + * Border-collapse can be used for collapsing the borders between table cells + */ + borderCollapse?: any; + + /** + * The CSS border-color property sets the color of an element's four borders. This property can have from one to four values, made up of the elementary properties: • border-top-color + * • border-right-color + * • border-bottom-color + * • border-left-color The default color is the currentColor of each of these values. + * If you provide one value, it sets the color for the element. Two values set the horizontal and vertical values, respectively. Providing three values sets the top, vertical, and bottom values, in that order. Four values set all for sides: top, right, bottom, and left, in that order. + */ + borderColor?: any; + + /** + * Specifies different corner clipping effects, such as scoop (inner curves), bevel (straight cuts) or notch (cut-off rectangles). Works along with border-radius to specify the size of each corner effect. + */ + borderCornerShape?: any; + + /** + * The property border-image-source is used to set the image to be used instead of the border style. If this is set to none the border-style is used instead. + */ + borderImageSource?: any; + + /** + * The border-image-width CSS property defines the offset to use for dividing the border image in nine parts, the top-left corner, central top edge, top-right-corner, central right edge, bottom-right corner, central bottom edge, bottom-left corner, and central right edge. They represent inward distance from the top, right, bottom, and left edges. + */ + borderImageWidth?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's left border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the left border — border-left-width, border-left-style and border-left-color. + */ + borderLeft?: any; + + /** + * The CSS border-left-color property sets the color of an element's left border. This page explains the border-left-color value, but often you will find it more convenient to fix the border's left color as part of a shorthand set, either border-left or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderLeftColor?: any; + + /** + * Sets the style of an element's left border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderLeftStyle?: any; + + /** + * Sets the width of an element's left border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderLeftWidth?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's right border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the right border — border-right-width, border-right-style and border-right-color. + */ + borderRight?: any; + + /** + * Sets the color of an element's right border. This page explains the border-right-color value, but often you will find it more convenient to fix the border's right color as part of a shorthand set, either border-right or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderRightColor?: any; + + /** + * Sets the style of an element's right border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderRightStyle?: any; + + /** + * Sets the width of an element's right border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderRightWidth?: any; + + /** + * Specifies the distance between the borders of adjacent cells. + */ + borderSpacing?: any; + + /** + * Sets the style of an element's four borders. This property can have from one to four values. With only one value, the value will be applied to all four borders; otherwise, this works as a shorthand property for each of border-top-style, border-right-style, border-bottom-style, border-left-style, where each border style may be assigned a separate value. + */ + borderStyle?: any; + + /** + * Shorthand property that defines the border-width, border-style and border-color of an element's top border in a single declaration. Note that you can use the corresponding longhand properties to set specific individual properties of the top border — border-top-width, border-top-style and border-top-color. + */ + borderTop?: any; + + /** + * Sets the color of an element's top border. This page explains the border-top-color value, but often you will find it more convenient to fix the border's top color as part of a shorthand set, either border-top or border-color. + * Colors can be defined several ways. For more information, see Usage. + */ + borderTopColor?: any; + + /** + * Sets the rounding of the top-left corner of the element. + */ + borderTopLeftRadius?: any; + + /** + * Sets the rounding of the top-right corner of the element. + */ + borderTopRightRadius?: any; + + /** + * Sets the style of an element's top border. To set all four borders, use the shorthand property, border-style. Otherwise, you can set the borders individually with border-top-style, border-right-style, border-bottom-style, border-left-style. + */ + borderTopStyle?: any; + + /** + * Sets the width of an element's top border. To set all four borders, use the border-width shorthand property which sets the values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderTopWidth?: any; + + /** + * Sets the width of an element's four borders. This property can have from one to four values. This is a shorthand property for setting values simultaneously for border-top-width, border-right-width, border-bottom-width, and border-left-width. + */ + borderWidth?: any; + + /** + * Obsolete. + */ + boxAlign?: any; + + /** + * Breaks a box into fragments creating new borders, padding and repeating backgrounds or lets it stay as a continuous box on a page break, column break, or, for inline elements, at a line break. + */ + boxDecorationBreak?: any; + + /** + * Deprecated + */ + boxDirection?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies the direction to add successive rows or columns when the value of box-lines is set to multiple. + */ + boxLineProgression?: any; + + /** + * Do not use. This property has been replaced by the flex-wrap property. + * Gets or sets a value that specifies whether child elements wrap onto multiple lines or columns based on the space available in the object. + */ + boxLines?: any; + + /** + * Do not use. This property has been replaced by flex-order. + * Specifies the ordinal group that a child element of the object belongs to. This ordinal value identifies the display order (along the axis defined by the box-orient property) for the group. + */ + boxOrdinalGroup?: any; + + /** + * The CSS break-after property allows you to force a break on multi-column layouts. More specifically, it allows you to force a break after an element. It allows you to determine if a break should occur, and what type of break it should be. The break-after CSS property describes how the page, column or region break behaves after the generated box. If there is no generated box, the property is ignored. + */ + breakAfter?: any; + + /** + * Control page/column/region breaks that fall above a block of content + */ + breakBefore?: any; + + /** + * Control page/column/region breaks that fall within a block of content + */ + breakInside?: any; + + /** + * The clear CSS property specifies if an element can be positioned next to or must be positioned below the floating elements that precede it in the markup. + */ + clear?: any; + + /** + * Deprecated; see clip-path. + * Lets you specify the dimensions of an absolutely positioned element that should be visible, and the element is clipped into this shape, and displayed. + */ + clip?: any; + + /** + * Clipping crops an graphic, so that only a portion of the graphic is rendered, or filled. This clip-rule property, when used with the clip-path property, defines which clip rule, or algorithm, to use when filling the different parts of a graphics. + */ + clipRule?: any; + + /** + * The color property sets the color of an element's foreground content (usually text), accepting any standard CSS color from keywords and hex values to RGB(a) and HSL(a). + */ + color?: any; + + /** + * Specifies how to fill columns (balanced or sequential). + */ + columnFill?: any; + + /** + * The column-gap property controls the width of the gap between columns in multi-column elements. + */ + columnGap?: any; + + /** + * Sets the width, style, and color of the rule between columns. + */ + columnRule?: any; + + /** + * Specifies the color of the rule between columns. + */ + columnRuleColor?: any; + + /** + * Specifies the width of the rule between columns. + */ + columnRuleWidth?: any; + + /** + * The column-span CSS property makes it possible for an element to span across all columns when its value is set to all. An element that spans more than one column is called a spanning element. + */ + columnSpan?: any; + + /** + * Specifies the width of columns in multi-column elements. + */ + columnWidth?: any; + + /** + * This property is a shorthand property for setting column-width and/or column-count. + */ + columns?: any; + + /** + * The counter-increment property accepts one or more names of counters (identifiers), each one optionally followed by an integer which specifies the value by which the counter should be incremented (e.g. if the value is 2, the counter increases by 2 each time it is invoked). + */ + counterIncrement?: any; + + /** + * The counter-reset property contains a list of one or more names of counters, each one optionally followed by an integer (otherwise, the integer defaults to 0.) Each time the given element is invoked, the counters specified by the property are set to the given integer. + */ + counterReset?: any; + + /** + * The cue property specifies sound files (known as an "auditory icon") to be played by speech media agents before and after presenting an element's content; if only one file is specified, it is played both before and after. The volume at which the file(s) should be played, relative to the volume of the main element, may also be specified. The icon files may also be set separately with the cue-before and cue-after properties. + */ + cue?: any; + + /** + * The cue-after property specifies a sound file (known as an "auditory icon") to be played by speech media agents after presenting an element's content; the volume at which the file should be played may also be specified. The shorthand property cue sets cue sounds for both before and after the element is presented. + */ + cueAfter?: any; + + /** + * The direction CSS property specifies the text direction/writing direction. The rtl is used for Hebrew or Arabic text, the ltr is for other languages. + */ + direction?: any; + + /** + * This property specifies the type of rendering box used for an element. It is a shorthand property for many other display properties. + */ + display?: any; + + /** + * The ‘fill’ property paints the interior of the given graphical element. The area to be painted consists of any areas inside the outline of the shape. To determine the inside of the shape, all subpaths are considered, and the interior is determined according to the rules associated with the current value of the ‘fill-rule’ property. The zero-width geometric outline of a shape is included in the area to be painted. + */ + fill?: any; + + /** + * The ‘fill-rule’ property indicates the algorithm which is to be used to determine what parts of the canvas are included inside the shape. For a simple, non-intersecting path, it is intuitively clear what region lies "inside"; however, for a more complex path, such as a path that intersects itself or where one subpath encloses another, the interpretation of "inside" is not so obvious. + * The ‘fill-rule’ property provides two options for how the inside of a shape is determined: + */ + fillRule?: any; + + /** + * Applies various image processing effects. This property is largely unsupported. See Compatibility section for more information. + */ + filter?: any; + + /** + * Obsolete, do not use. This property has been renamed to align-items. + * Specifies the alignment (perpendicular to the layout axis defined by the flex-direction property) of child elements of the object. + */ + flexAlign?: any; + + /** + * The flex-basis CSS property describes the initial main size of the flex item before any free space is distributed according to the flex factors described in the flex property (flex-grow and flex-shrink). + */ + flexBasis?: any; + + /** + * The flex-direction CSS property describes how flex items are placed in the flex container, by setting the direction of the flex container's main axis. + */ + flexDirection?: any; + + /** + * The flex-flow CSS property defines the flex container's main and cross axis. It is a shorthand property for the flex-direction and flex-wrap properties. + */ + flexFlow?: any; + + /** + * Do not use. This property has been renamed to align-self + * Specifies the alignment (perpendicular to the layout axis defined by flex-direction) of child elements of the object. + */ + flexItemAlign?: any; + + /** + * Do not use. This property has been renamed to align-content. + * Specifies how a flexbox's lines align within the flexbox when there is extra space along the axis that is perpendicular to the axis defined by the flex-direction property. + */ + flexLinePack?: any; + + /** + * Gets or sets a value that specifies the ordinal group that a flexbox element belongs to. This ordinal value identifies the display order for the group. + */ + flexOrder?: any; + + /** + * Elements which have the style float are floated horizontally. These elements can move as far to the left or right of the containing element. All elements after the floating element will flow around it, but elements before the floating element are not impacted. If several floating elements are placed after each other, they will float next to each other as long as there is room. + */ + float?: any; + + /** + * Flows content from a named flow (specified by a corresponding flow-into) through selected elements to form a dynamic chain of layout regions. + */ + flowFrom?: any; + + /** + * The font property is shorthand that allows you to do one of two things: you can either set up six of the most mature font properties in one line, or you can set one of a choice of keywords to adopt a system font setting. + */ + font?: any; + + /** + * The font-family property allows one or more font family names and/or generic family names to be specified for usage on the selected element(s)' text. The browser then goes through the list; for each character in the selection it applies the first font family that has an available glyph for that character. + */ + fontFamily?: any; + + /** + * The font-kerning property allows contextual adjustment of inter-glyph spacing, i.e. the spaces between the characters in text. This property controls metric kerning - that utilizes adjustment data contained in the font. Optical Kerning is not supported as yet. + */ + fontKerning?: any; + + /** + * The font-size-adjust property adjusts the font-size of the fallback fonts defined with font-family, so that the x-height is the same no matter what font is used. This preserves the readability of the text when fallback happens. + */ + fontSizeAdjust?: any; + + /** + * Allows you to expand or condense the widths for a normal, condensed, or expanded font face. + */ + fontStretch?: any; + + /** + * The font-style property allows normal, italic, or oblique faces to be selected. Italic forms are generally cursive in nature while oblique faces are typically sloped versions of the regular face. Oblique faces can be simulated by artificially sloping the glyphs of the regular face. + */ + fontStyle?: any; + + /** + * This value specifies whether the user agent is allowed to synthesize bold or oblique font faces when a font family lacks bold or italic faces. + */ + fontSynthesis?: any; + + /** + * The font-variant property enables you to select the small-caps font within a font family. + */ + fontVariant?: any; + + /** + * Fonts can provide alternate glyphs in addition to default glyph for a character. This property provides control over the selection of these alternate glyphs. + */ + fontVariantAlternates?: any; + + /** + * Lays out one or more grid items bound by 4 grid lines. Shorthand for setting grid-column-start, grid-column-end, grid-row-start, and grid-row-end in a single declaration. + */ + gridArea?: any; + + /** + * Controls a grid item's placement in a grid area, particularly grid position and a grid span. Shorthand for setting grid-column-start and grid-column-end in a single declaration. + */ + gridColumn?: any; + + /** + * Controls a grid item's placement in a grid area as well as grid position and a grid span. The grid-column-end property (with grid-row-start, grid-row-end, and grid-column-start) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + gridColumnEnd?: any; + + /** + * Determines a grid item's placement by specifying the starting grid lines of a grid item's grid area . A grid item's placement in a grid area consists of a grid position and a grid span. See also ( grid-row-start, grid-row-end, and grid-column-end) + */ + gridColumnStart?: any; + + /** + * Gets or sets a value that indicates which row an element within a Grid should appear in. Shorthand for setting grid-row-start and grid-row-end in a single declaration. + */ + gridRow?: any; + + /** + * Determines a grid item’s placement by specifying the block-end. A grid item's placement in a grid area consists of a grid position and a grid span. The grid-row-end property (with grid-row-start, grid-column-start, and grid-column-end) determines a grid item's placement by specifying the grid lines of a grid item's grid area. + */ + gridRowEnd?: any; + + /** + * Specifies a row position based upon an integer location, string value, or desired row size. + * css/properties/grid-row is used as short-hand for grid-row-position and grid-row-position + */ + gridRowPosition?: any; + + gridRowSpan?: any; + + /** + * Specifies named grid areas which are not associated with any particular grid item, but can be referenced from the grid-placement properties. The syntax of the grid-template-areas property also provides a visualization of the structure of the grid, making the overall layout of the grid container easier to understand. + */ + gridTemplateAreas?: any; + + /** + * Specifies (with grid-template-rows) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + gridTemplateColumns?: any; + + /** + * Specifies (with grid-template-columns) the line names and track sizing functions of the grid. Each sizing function can be specified as a length, a percentage of the grid container’s size, a measurement of the contents occupying the column or row, or a fraction of the free space in the grid. + */ + gridTemplateRows?: any; + + /** + * Sets the height of an element. The content area of the element height does not include the padding, border, and margin of the element. + */ + height?: any; + + /** + * Specifies the minimum number of characters in a hyphenated word + */ + hyphenateLimitChars?: any; + + /** + * Indicates the maximum number of successive hyphenated lines in an element. The ‘no-limit’ value means that there is no limit. + */ + hyphenateLimitLines?: any; + + /** + * Specifies the maximum amount of trailing whitespace (before justification) that may be left in a line before hyphenation is triggered to pull part of a word from the next line back up into the current one. + */ + hyphenateLimitZone?: any; + + /** + * Specifies whether or not words in a sentence can be split by the use of a manual or automatic hyphenation mechanism. + */ + hyphens?: any; + + imeMode?: any; + + layoutGrid?: any; + + layoutGridChar?: any; + + layoutGridLine?: any; + + layoutGridMode?: any; + + layoutGridType?: any; + + /** + * Sets the left edge of an element + */ + left?: any; + + /** + * The letter-spacing CSS property specifies the spacing behavior between text characters. + */ + letterSpacing?: any; + + /** + * Deprecated. Gets or sets line-breaking rules for text in selected languages such as Japanese, Chinese, and Korean. + */ + lineBreak?: any; + + /** + * Shorthand property that sets the list-style-type, list-style-position and list-style-image properties in one declaration. + */ + listStyle?: any; + + /** + * This property sets the image that will be used as the list item marker. When the image is available, it will replace the marker set with the 'list-style-type' marker. That also means that if the image is not available, it will show the style specified by list-style-property + */ + listStyleImage?: any; + + /** + * Specifies if the list-item markers should appear inside or outside the content flow. + */ + listStylePosition?: any; + + /** + * Specifies the type of list-item marker in a list. + */ + listStyleType?: any; + + /** + * The margin property is shorthand to allow you to set all four margins of an element at once. Its equivalent longhand properties are margin-top, margin-right, margin-bottom and margin-left. Negative values are also allowed. + */ + margin?: any; + + /** + * margin-bottom sets the bottom margin of an element. + */ + marginBottom?: any; + + /** + * margin-left sets the left margin of an element. + */ + marginLeft?: any; + + /** + * margin-right sets the right margin of an element. + */ + marginRight?: any; + + /** + * margin-top sets the top margin of an element. + */ + marginTop?: any; + + /** + * The marquee-direction determines the initial direction in which the marquee content moves. + */ + marqueeDirection?: any; + + /** + * The 'marquee-style' property determines a marquee's scrolling behavior. + */ + marqueeStyle?: any; + + /** + * This property is shorthand for setting mask-image, mask-mode, mask-repeat, mask-position, mask-clip, mask-origin, mask-composite and mask-size. Omitted values are set to their original properties' initial values. + */ + mask?: any; + + /** + * This property is shorthand for setting mask-border-source, mask-border-slice, mask-border-width, mask-border-outset, and mask-border-repeat. Omitted values are set to their original properties' initial values. + */ + maskBorder?: any; + + /** + * This property specifies how the images for the sides and the middle part of the mask image are scaled and tiled. The first keyword applies to the horizontal sides, the second one applies to the vertical ones. If the second keyword is absent, it is assumed to be the same as the first, similar to the CSS border-image-repeat property. + */ + maskBorderRepeat?: any; + + /** + * This property specifies inward offsets from the top, right, bottom, and left edges of the mask image, dividing it into nine regions: four corners, four edges, and a middle. The middle image part is discarded and treated as fully transparent black unless the fill keyword is present. The four values set the top, right, bottom and left offsets in that order, similar to the CSS border-image-slice property. + */ + maskBorderSlice?: any; + + /** + * Specifies an image to be used as a mask. An image that is empty, fails to download, is non-existent, or cannot be displayed is ignored and does not mask the element. + */ + maskBorderSource?: any; + + /** + * This property sets the width of the mask box image, similar to the CSS border-image-width property. + */ + maskBorderWidth?: any; + + /** + * Determines the mask painting area, which defines the area that is affected by the mask. The painted content of an element may be restricted to this area. + */ + maskClip?: any; + + /** + * For elements rendered as a single box, specifies the mask positioning area. For elements rendered as multiple boxes (e.g., inline boxes on several lines, boxes on several pages) specifies which boxes box-decoration-break operates on to determine the mask positioning area(s). + */ + maskOrigin?: any; + + /** + * This property must not be used. It is no longer included in any standard or standard track specification, nor is it implemented in any browser. It is only used when the text-align-last property is set to size. It controls allowed adjustments of font-size to fit line content. + */ + maxFontSize?: any; + + /** + * Sets the maximum height for an element. It prevents the height of the element to exceed the specified value. If min-height is specified and is greater than max-height, max-height is overridden. + */ + maxHeight?: any; + + /** + * Sets the maximum width for an element. It limits the width property to be larger than the value specified in max-width. + */ + maxWidth?: any; + + /** + * Sets the minimum height for an element. It prevents the height of the element to be smaller than the specified value. The value of min-height overrides both max-height and height. + */ + minHeight?: any; + + /** + * Sets the minimum width of an element. It limits the width property to be not smaller than the value specified in min-width. + */ + minWidth?: any; + + /** + * The CSS outline property is a shorthand property for setting one or more of the individual outline properties outline-style, outline-width and outline-color in a single rule. In most cases the use of this shortcut is preferable and more convenient. + * Outlines differ from borders in the following ways: • Outlines do not take up space, they are drawn above the content. + * • Outlines may be non-rectangular. They are rectangular in Gecko/Firefox. Internet Explorer attempts to place the smallest contiguous outline around all elements or shapes that are indicated to have an outline. Opera draws a non-rectangular shape around a construct. + */ + outline?: any; + + /** + * The outline-color property sets the color of the outline of an element. An outline is a line that is drawn around elements, outside the border edge, to make the element stand out. + */ + outlineColor?: any; + + /** + * The outline-offset property offsets the outline and draw it beyond the border edge. + */ + outlineOffset?: any; + + /** + * The overflow property controls how extra content exceeding the bounding box of an element is rendered. It can be used in conjunction with an element that has a fixed width and height, to eliminate text-induced page distortion. + */ + overflow?: any; + + /** + * Specifies the preferred scrolling methods for elements that overflow. + */ + overflowStyle?: any; + + /** + * The overflow-x property is a specific case of the generic overflow property. It controls how extra content exceeding the x-axis of the bounding box of an element is rendered. + */ + overflowX?: any; + + /** + * The padding optional CSS property sets the required padding space on one to four sides of an element. The padding area is the space between an element and its border. Negative values are not allowed but decimal values are permitted. The element size is treated as fixed, and the content of the element shifts toward the center as padding is increased. + * The padding property is a shorthand to avoid setting each side separately (padding-top, padding-right, padding-bottom, padding-left). + */ + padding?: any; + + /** + * The padding-bottom CSS property of an element sets the padding space required on the bottom of an element. The padding area is the space between the content of the element and its border. Contrary to margin-bottom values, negative values of padding-bottom are invalid. + */ + paddingBottom?: any; + + /** + * The padding-left CSS property of an element sets the padding space required on the left side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-left values, negative values of padding-left are invalid. + */ + paddingLeft?: any; + + /** + * The padding-right CSS property of an element sets the padding space required on the right side of an element. The padding area is the space between the content of the element and its border. Contrary to margin-right values, negative values of padding-right are invalid. + */ + paddingRight?: any; + + /** + * The padding-top CSS property of an element sets the padding space required on the top of an element. The padding area is the space between the content of the element and its border. Contrary to margin-top values, negative values of padding-top are invalid. + */ + paddingTop?: any; + + /** + * The page-break-after property is supported in all major browsers. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakAfter?: any; + + /** + * The page-break-before property sets the page-breaking behavior before an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakBefore?: any; + + /** + * Sets the page-breaking behavior inside an element. With CSS3, page-break-* properties are only aliases of the break-* properties. The CSS3 Fragmentation spec defines breaks for all CSS box fragmentation. + */ + pageBreakInside?: any; + + /** + * The pause property determines how long a speech media agent should pause before and after presenting an element. It is a shorthand for the pause-before and pause-after properties. + */ + pause?: any; + + /** + * The pause-after property determines how long a speech media agent should pause after presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseAfter?: any; + + /** + * The pause-before property determines how long a speech media agent should pause before presenting an element. It may be replaced by the shorthand property pause, which sets pause time before and after. + */ + pauseBefore?: any; + + /** + * The perspective property defines how far an element is placed from the view on the z-axis, from the screen to the viewer. + * Perspective defines how an object is viewed. In graphic arts, perspective is the representation on a flat surface of what the viewer's eye would see in a 3D space. (See Wikipedia for more information about graphical perspective and for related illustrations.) + * The illusion of perspective on a flat surface, such as a computer screen, is created by projecting points on the flat surface as they would appear if the flat surface were a window through which the viewer was looking at the object. In discussion of virtual environments, this flat surface is called a projection plane. + */ + perspective?: any; + + /** + * The perspective-origin property establishes the origin for the perspective property. It effectively sets the X and Y position at which the viewer appears to be looking at the children of the element. + * When used with perspective, perspective-origin changes the appearance of an object, as if a viewer were looking at it from a different origin. An object appears differently if a viewer is looking directly at it versus looking at it from below, above, or from the side. Thus, the perspective-origin is like a vanishing point. + * The default value of perspective-origin is 50% 50%. This displays an object as if the viewer's eye were positioned directly at the center of the screen, both top-to-bottom and left-to-right. A value of 0% 0% changes the object as if the viewer was looking toward the top left angle. A value of 100% 100% changes the appearance as if viewed toward the bottom right angle. + */ + perspectiveOrigin?: any; + + /** + * The pointer-events property allows you to control whether an element can be the target for the pointing device (e.g, mouse, pen) events. + */ + pointerEvents?: any; + + /** + * The position property controls the type of positioning used by an element within its parent elements. The effect of the position property depends on a lot of factors, for example the position property of parent elements. + */ + position?: any; + + /** + * Obsolete: unsupported. + * This property determines whether or not a full-width punctuation mark character should be trimmed if it appears at the beginning of a line, so that its "ink" lines up with the first glyph in the line above and below. + */ + punctuationTrim?: any; + + /** + * Sets the type of quotation marks for embedded quotations. + */ + quotes?: any; + + /** + * Controls whether the last region in a chain displays additional 'overset' content according its default overflow property, or if it displays a fragment of content as if it were flowing into a subsequent region. + */ + regionFragment?: any; + + /** + * The rest-after property determines how long a speech media agent should pause after presenting an element's main content, before presenting that element's exit cue sound. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restAfter?: any; + + /** + * The rest-before property determines how long a speech media agent should pause after presenting an intro cue sound for an element, before presenting that element's main content. It may be replaced by the shorthand property rest, which sets rest time before and after. + */ + restBefore?: any; + + /** + * Specifies the position an element in relation to the right side of the containing element. + */ + right?: any; + + rubyAlign?: any; + + rubyPosition?: any; + + /** + * Defines the alpha channel threshold used to extract a shape from an image. Can be thought of as a "minimum opacity" threshold; that is, a value of 0.5 means that the shape will enclose all the pixels that are more than 50% opaque. + */ + shapeImageThreshold?: any; + + /** + * A future level of CSS Shapes will define a shape-inside property, which will define a shape to wrap content within the element. See Editor's Draft and CSSWG wiki page on next-level plans + */ + shapeInside?: any; + + /** + * Adds a margin to a shape-outside. In effect, defines a new shape that is the smallest contour around all the points that are the shape-margin distance outward perpendicular to each point on the underlying shape. For points where a perpendicular direction is not defined (e.g., a triangle corner), takes all points on a circle centered at the point and with a radius of the shape-margin distance. This property accepts only non-negative values. + */ + shapeMargin?: any; + + /** + * Declares a shape around which text should be wrapped, with possible modifications from the shape-margin property. The shape defined by shape-outside and shape-margin changes the geometry of a float element's float area. + */ + shapeOutside?: any; + + /** + * The speak property determines whether or not a speech synthesizer will read aloud the contents of an element. + */ + speak?: any; + + /** + * The speak-as property determines how the speech synthesizer interprets the content: words as whole words or as a sequence of letters, numbers as a numerical value or a sequence of digits, punctuation as pauses in speech or named punctuation characters. + */ + speakAs?: any; + + /** + * The tab-size CSS property is used to customise the width of a tab (U+0009) character. + */ + tabSize?: any; + + /** + * The 'table-layout' property controls the algorithm used to lay out the table cells, rows, and columns. + */ + tableLayout?: any; + + /** + * The text-align CSS property describes how inline content like text is aligned in its parent block element. text-align does not control the alignment of block elements itself, only their inline content. + */ + textAlign?: any; + + /** + * The text-align-last CSS property describes how the last line of a block element or a line before line break is aligned in its parent block element. + */ + textAlignLast?: any; + + /** + * The text-decoration CSS property is used to set the text formatting to underline, overline, line-through or blink. + * underline and overline decorations are positioned under the text, line-through over it. + */ + textDecoration?: any; + + /** + * Sets the color of any text decoration, such as underlines, overlines, and strike throughs. + */ + textDecorationColor?: any; + + /** + * Sets what kind of line decorations are added to an element, such as underlines, overlines, etc. + */ + textDecorationLine?: any; + + textDecorationLineThrough?: any; + + textDecorationNone?: any; + + textDecorationOverline?: any; + + /** + * Specifies what parts of an element’s content are skipped over when applying any text decoration. + */ + textDecorationSkip?: any; + + /** + * This property specifies the style of the text decoration line drawn on the specified element. The intended meaning for the values are the same as those of the border-style-properties. + */ + textDecorationStyle?: any; + + textDecorationUnderline?: any; + + /** + * The text-emphasis property will apply special emphasis marks to the elements text. Slightly similar to the text-decoration property only that this property can have affect on the line-height. It also is noted that this is shorthand for text-emphasis-style and for text-emphasis-color. + */ + textEmphasis?: any; + + /** + * The text-emphasis-color property specifies the foreground color of the emphasis marks. + */ + textEmphasisColor?: any; + + /** + * The text-emphasis-style property applies special emphasis marks to an element's text. + */ + textEmphasisStyle?: any; + + /** + * This property helps determine an inline box's block-progression dimension, derived from the text-height and font-size properties for non-replaced elements, the height or the width for replaced elements, and the stacked block-progression dimension for inline-block elements. The block-progression dimension determines the position of the padding, border and margin for the element. + */ + textHeight?: any; + + /** + * Specifies the amount of space horizontally that should be left on the first line of the text of an element. This horizontal spacing is at the beginning of the first line and is in respect to the left edge of the containing block box. + */ + textIndent?: any; + + textJustifyTrim?: any; + + textKashidaSpace?: any; + + /** + * The text-line-through property is a shorthand property for text-line-through-style, text-line-through-color and text-line-through-mode. (Considered obsolete; use text-decoration instead.) + */ + textLineThrough?: any; + + /** + * Specifies the line colors for the line-through text decoration. + * (Considered obsolete; use text-decoration-color instead.) + */ + textLineThroughColor?: any; + + /** + * Sets the mode for the line-through text decoration, determining whether the text decoration affects the space characters or not. + * (Considered obsolete; use text-decoration-skip instead.) + */ + textLineThroughMode?: any; + + /** + * Specifies the line style for line-through text decoration. + * (Considered obsolete; use text-decoration-style instead.) + */ + textLineThroughStyle?: any; + + /** + * Specifies the line width for the line-through text decoration. + */ + textLineThroughWidth?: any; + + /** + * The text-overflow shorthand CSS property determines how overflowed content that is not displayed is signaled to the users. It can be clipped, display an ellipsis ('…', U+2026 HORIZONTAL ELLIPSIS) or a Web author-defined string. It covers the two long-hand properties text-overflow-mode and text-overflow-ellipsis + */ + textOverflow?: any; + + /** + * The text-overline property is the shorthand for the text-overline-style, text-overline-width, text-overline-color, and text-overline-mode properties. + */ + textOverline?: any; + + /** + * Specifies the line color for the overline text decoration. + */ + textOverlineColor?: any; + + /** + * Sets the mode for the overline text decoration, determining whether the text decoration affects the space characters or not. + */ + textOverlineMode?: any; + + /** + * Specifies the line style for overline text decoration. + */ + textOverlineStyle?: any; + + /** + * Specifies the line width for the overline text decoration. + */ + textOverlineWidth?: any; + + /** + * The text-rendering CSS property provides information to the browser about how to optimize when rendering text. Options are: legibility, speed or geometric precision. + */ + textRendering?: any; + + /** + * Obsolete: unsupported. + */ + textScript?: any; + + /** + * The CSS text-shadow property applies one or more drop shadows to the text and of an element. Each shadow is specified as an offset from the text, along with optional color and blur radius values. + */ + textShadow?: any; + + /** + * This property transforms text for styling purposes. (It has no effect on the underlying content.) + */ + textTransform?: any; + + /** + * Unsupported. + * This property will add a underline position value to the element that has an underline defined. + */ + textUnderlinePosition?: any; + + /** + * After review this should be replaced by text-decoration should it not? + * This property will set the underline style for text with a line value for underline, overline, and line-through. + */ + textUnderlineStyle?: any; + + /** + * This property specifies how far an absolutely positioned box's top margin edge is offset below the top edge of the box's containing block. For relatively positioned boxes, the offset is with respect to the top edges of the box itself (i.e., the box is given a position in the normal flow, then offset from that position according to these properties). + */ + top?: any; + + /** + * Determines whether touch input may trigger default behavior supplied by the user agent, such as panning or zooming. + */ + touchAction?: any; + + /** + * CSS transforms allow elements styled with CSS to be transformed in two-dimensional or three-dimensional space. Using this property, elements can be translated, rotated, scaled, and skewed. The value list may consist of 2D and/or 3D transform values. + */ + transform?: any; + + /** + * This property defines the origin of the transformation axes relative to the element to which the transformation is applied. + */ + transformOrigin?: any; + + /** + * This property allows you to define the relative position of the origin of the transformation grid along the z-axis. + */ + transformOriginZ?: any; + + /** + * This property specifies how nested elements are rendered in 3D space relative to their parent. + */ + transformStyle?: any; + + /** + * The transition CSS property is a shorthand property for transition-property, transition-duration, transition-timing-function, and transition-delay. It allows to define the transition between two states of an element. + */ + transition?: any; + + /** + * Defines when the transition will start. A value of ‘0s’ means the transition will execute as soon as the property is changed. Otherwise, the value specifies an offset from the moment the property is changed, and the transition will delay execution by that offset. + */ + transitionDelay?: any; + + /** + * The 'transition-duration' property specifies the length of time a transition animation takes to complete. + */ + transitionDuration?: any; + + /** + * The 'transition-property' property specifies the name of the CSS property to which the transition is applied. + */ + transitionProperty?: any; + + /** + * Sets the pace of action within a transition + */ + transitionTimingFunction?: any; + + /** + * The unicode-bidi CSS property specifies the level of embedding with respect to the bidirectional algorithm. + */ + unicodeBidi?: any; + + /** + * unicode-range allows you to set a specific range of characters to be downloaded from a font (embedded using @font-face) and made available for use on the current page. + */ + unicodeRange?: any; + + /** + * This is for all the high level UX stuff. + */ + userFocus?: any; + + /** + * For inputing user content + */ + userInput?: any; + + /** + * The vertical-align property controls how inline elements or text are vertically aligned compared to the baseline. If this property is used on table-cells it controls the vertical alignment of content of the table cell. + */ + verticalAlign?: any; + + /** + * The visibility property specifies whether the boxes generated by an element are rendered. + */ + visibility?: any; + + /** + * The voice-balance property sets the apparent position (in stereo sound) of the synthesized voice for spoken media. + */ + voiceBalance?: any; + + /** + * The voice-duration property allows the author to explicitly set the amount of time it should take a speech synthesizer to read an element's content, for example to allow the speech to be synchronized with other media. With a value of auto (the default) the length of time it takes to read the content is determined by the content itself and the voice-rate property. + */ + voiceDuration?: any; + + /** + * The voice-family property sets the speaker's voice used by a speech media agent to read an element. The speaker may be specified as a named character (to match a voice option in the speech reading software) or as a generic description of the age and gender of the voice. Similar to the font-family property for visual media, a comma-separated list of fallback options may be given in case the speech reader does not recognize the character name or cannot synthesize the requested combination of generic properties. + */ + voiceFamily?: any; + + /** + * The voice-pitch property sets pitch or tone (high or low) for the synthesized speech when reading an element; the pitch may be specified absolutely or relative to the normal pitch for the voice-family used to read the text. + */ + voicePitch?: any; + + /** + * The voice-range property determines how much variation in pitch or tone will be created by the speech synthesize when reading an element. Emphasized text, grammatical structures and punctuation may all be rendered as changes in pitch, this property determines how strong or obvious those changes are; large ranges are associated with enthusiastic or emotional speech, while small ranges are associated with flat or mechanical speech. + */ + voiceRange?: any; + + /** + * The voice-rate property sets the speed at which the voice synthesized by a speech media agent will read content. + */ + voiceRate?: any; + + /** + * The voice-stress property sets the level of vocal emphasis to be used for synthesized speech reading the element. + */ + voiceStress?: any; + + /** + * The voice-volume property sets the volume for spoken content in speech media. It replaces the deprecated volume property. + */ + voiceVolume?: any; + + /** + * The white-space property controls whether and how white space inside the element is collapsed, and whether lines may wrap at unforced "soft wrap" opportunities. + */ + whiteSpace?: any; + + /** + * Obsolete: unsupported. + */ + whiteSpaceTreatment?: any; + + /** + * Specifies the width of the content area of an element. The content area of the element width does not include the padding, border, and margin of the element. + */ + width?: any; + + /** + * The word-break property is often used when there is long generated content that is strung together without and spaces or hyphens to beak apart. A common case of this is when there is a long URL that does not have any hyphens. This case could potentially cause the breaking of the layout as it could extend past the parent element. + */ + wordBreak?: any; + + /** + * The word-spacing CSS property specifies the spacing behavior between "words". + */ + wordSpacing?: any; + + /** + * An alias of css/properties/overflow-wrap, word-wrap defines whether to break words when the content exceeds the boundaries of its container. + */ + wordWrap?: any; + + /** + * Specifies how exclusions affect inline content within block-level elements. Elements lay out their inline content in their content area but wrap around exclusion areas. + */ + wrapFlow?: any; + + /** + * Set the value that is used to offset the inner wrap shape from other shapes. Inline content that intersects a shape with this property will be pushed by this shape's margin. + */ + wrapMargin?: any; + + /** + * Obsolete and unsupported. Do not use. + * This CSS property controls the text when it reaches the end of the block in which it is enclosed. + */ + wrapOption?: any; + + /** + * writing-mode specifies if lines of text are laid out horizontally or vertically, and the direction which lines of text and blocks progress. + */ + writingMode?: any; + + + [propertyName: string]: any; + } + + interface HTMLAttributes extends DOMAttributes { + // React-specific Attributes + defaultChecked?: boolean; + defaultValue?: string | string[]; + + // Standard HTML Attributes + accept?: string; + acceptCharset?: string; + accessKey?: string; + action?: string; + allowFullScreen?: boolean; + allowTransparency?: boolean; + alt?: string; + async?: boolean; + autoComplete?: string; + autoFocus?: boolean; + autoPlay?: boolean; + capture?: boolean; + cellPadding?: number | string; + cellSpacing?: number | string; + charSet?: string; + challenge?: string; + checked?: boolean; + classID?: string; + className?: string; + cols?: number; + colSpan?: number; + content?: string; + contentEditable?: boolean; + contextMenu?: string; + controls?: boolean; + coords?: string; + crossOrigin?: string; + data?: string; + dateTime?: string; + default?: boolean; + defer?: boolean; + dir?: string; + disabled?: boolean; + download?: any; + draggable?: boolean; + encType?: string; + form?: string; + formAction?: string; + formEncType?: string; + formMethod?: string; + formNoValidate?: boolean; + formTarget?: string; + frameBorder?: number | string; + headers?: string; + height?: number | string; + hidden?: boolean; + high?: number; + href?: string; + hrefLang?: string; + htmlFor?: string; + httpEquiv?: string; + icon?: string; + id?: string; + inputMode?: string; + integrity?: string; + is?: string; + keyParams?: string; + keyType?: string; + kind?: string; + label?: string; + lang?: string; + list?: string; + loop?: boolean; + low?: number; + manifest?: string; + marginHeight?: number; + marginWidth?: number; + max?: number | string; + maxLength?: number; + media?: string; + mediaGroup?: string; + method?: string; + min?: number | string; + minLength?: number; + multiple?: boolean; + muted?: boolean; + name?: string; + noValidate?: boolean; + open?: boolean; + optimum?: number; + pattern?: string; + placeholder?: string; + poster?: string; + preload?: string; + radioGroup?: string; + readOnly?: boolean; + rel?: string; + required?: boolean; + role?: string; + rows?: number; + rowSpan?: number; + sandbox?: string; + scope?: string; + scoped?: boolean; + scrolling?: string; + seamless?: boolean; + selected?: boolean; + shape?: string; + size?: number; + sizes?: string; + span?: number; + spellCheck?: boolean; + src?: string; + srcDoc?: string; + srcLang?: string; + srcSet?: string; + start?: number; + step?: number | string; + style?: CSSProperties; + summary?: string; + tabIndex?: number; + target?: string; + title?: string; + type?: string; + useMap?: string; + value?: string | string[]; + width?: number | string; + wmode?: string; + wrap?: string; + + // RDFa Attributes + about?: string; + datatype?: string; + inlist?: any; + prefix?: string; + property?: string; + resource?: string; + typeof?: string; + vocab?: string; + + // Non-standard Attributes + autoCapitalize?: string; + autoCorrect?: string; + autoSave?: string; + color?: string; + itemProp?: string; + itemScope?: boolean; + itemType?: string; + itemID?: string; + itemRef?: string; + results?: number; + security?: string; + unselectable?: boolean; + } + + interface SVGAttributes extends HTMLAttributes { + clipPath?: string; + cx?: number | string; + cy?: number | string; + d?: string; + dx?: number | string; + dy?: number | string; + fill?: string; + fillOpacity?: number | string; + fontFamily?: string; + fontSize?: number | string; + fx?: number | string; + fy?: number | string; + gradientTransform?: string; + gradientUnits?: string; + markerEnd?: string; + markerMid?: string; + markerStart?: string; + offset?: number | string; + opacity?: number | string; + patternContentUnits?: string; + patternUnits?: string; + points?: string; + preserveAspectRatio?: string; + r?: number | string; + rx?: number | string; + ry?: number | string; + spreadMethod?: string; + stopColor?: string; + stopOpacity?: number | string; + stroke?: string; + strokeDasharray?: string; + strokeLinecap?: string; + strokeMiterlimit?: string; + strokeOpacity?: number | string; + strokeWidth?: number | string; + textAnchor?: string; + transform?: string; + version?: string; + viewBox?: string; + x1?: number | string; + x2?: number | string; + x?: number | string; + xlinkActuate?: string; + xlinkArcrole?: string; + xlinkHref?: string; + xlinkRole?: string; + xlinkShow?: string; + xlinkTitle?: string; + xlinkType?: string; + xmlBase?: string; + xmlLang?: string; + xmlSpace?: string; + y1?: number | string; + y2?: number | string; + y?: number | string; + } + + // + // React.DOM + // ---------------------------------------------------------------------- + + interface ReactDOM { + // HTML + a: HTMLFactory; + abbr: HTMLFactory; + address: HTMLFactory; + area: HTMLFactory; + article: HTMLFactory; + aside: HTMLFactory; + audio: HTMLFactory; + b: HTMLFactory; + base: HTMLFactory; + bdi: HTMLFactory; + bdo: HTMLFactory; + big: HTMLFactory; + blockquote: HTMLFactory; + body: HTMLFactory; + br: HTMLFactory; + button: HTMLFactory; + canvas: HTMLFactory; + caption: HTMLFactory; + cite: HTMLFactory; + code: HTMLFactory; + col: HTMLFactory; + colgroup: HTMLFactory; + data: HTMLFactory; + datalist: HTMLFactory; + dd: HTMLFactory; + del: HTMLFactory; + details: HTMLFactory; + dfn: HTMLFactory; + dialog: HTMLFactory; + div: HTMLFactory; + dl: HTMLFactory; + dt: HTMLFactory; + em: HTMLFactory; + embed: HTMLFactory; + fieldset: HTMLFactory; + figcaption: HTMLFactory; + figure: HTMLFactory; + footer: HTMLFactory; + form: HTMLFactory; + h1: HTMLFactory; + h2: HTMLFactory; + h3: HTMLFactory; + h4: HTMLFactory; + h5: HTMLFactory; + h6: HTMLFactory; + head: HTMLFactory; + header: HTMLFactory; + hr: HTMLFactory; + html: HTMLFactory; + i: HTMLFactory; + iframe: HTMLFactory; + img: HTMLFactory; + input: HTMLFactory; + ins: HTMLFactory; + kbd: HTMLFactory; + keygen: HTMLFactory; + label: HTMLFactory; + legend: HTMLFactory; + li: HTMLFactory; + link: HTMLFactory; + main: HTMLFactory; + map: HTMLFactory; + mark: HTMLFactory; + menu: HTMLFactory; + menuitem: HTMLFactory; + meta: HTMLFactory; + meter: HTMLFactory; + nav: HTMLFactory; + noscript: HTMLFactory; + object: HTMLFactory; + ol: HTMLFactory; + optgroup: HTMLFactory; + option: HTMLFactory; + output: HTMLFactory; + p: HTMLFactory; + param: HTMLFactory; + picture: HTMLFactory; + pre: HTMLFactory; + progress: HTMLFactory; + q: HTMLFactory; + rp: HTMLFactory; + rt: HTMLFactory; + ruby: HTMLFactory; + s: HTMLFactory; + samp: HTMLFactory; + script: HTMLFactory; + section: HTMLFactory; + select: HTMLFactory; + small: HTMLFactory; + source: HTMLFactory; + span: HTMLFactory; + strong: HTMLFactory; + style: HTMLFactory; + sub: HTMLFactory; + summary: HTMLFactory; + sup: HTMLFactory; + table: HTMLFactory; + tbody: HTMLFactory; + td: HTMLFactory; + textarea: HTMLFactory; + tfoot: HTMLFactory; + th: HTMLFactory; + thead: HTMLFactory; + time: HTMLFactory; + title: HTMLFactory; + tr: HTMLFactory; + track: HTMLFactory; + u: HTMLFactory; + ul: HTMLFactory; + "var": HTMLFactory; + video: HTMLFactory; + wbr: HTMLFactory; + + // SVG + svg: SVGFactory; + circle: SVGFactory; + defs: SVGFactory; + ellipse: SVGFactory; + g: SVGFactory; + image: SVGFactory; + line: SVGFactory; + linearGradient: SVGFactory; + mask: SVGFactory; + path: SVGFactory; + pattern: SVGFactory; + polygon: SVGFactory; + polyline: SVGFactory; + radialGradient: SVGFactory; + rect: SVGFactory; + stop: SVGFactory; + text: SVGFactory; + tspan: SVGFactory; + } + + // + // React.PropTypes + // ---------------------------------------------------------------------- + + interface Validator { + (object: T, key: string, componentName: string): Error; + } + + interface Requireable extends Validator { + isRequired: Validator; + } + + interface ValidationMap { + [key: string]: Validator; + } + + interface ReactPropTypes { + any: Requireable; + array: Requireable; + bool: Requireable; + func: Requireable; + number: Requireable; + object: Requireable; + string: Requireable; + node: Requireable; + element: Requireable; + instanceOf(expectedClass: {}): Requireable; + oneOf(types: any[]): Requireable; + oneOfType(types: Validator[]): Requireable; + arrayOf(type: Validator): Requireable; + objectOf(type: Validator): Requireable; + shape(type: ValidationMap): Requireable; + } + + // + // React.Children + // ---------------------------------------------------------------------- + + interface ReactChildren { + map(children: ReactNode, fn: (child: ReactChild, index: number) => T): T[]; + forEach(children: ReactNode, fn: (child: ReactChild, index: number) => any): void; + count(children: ReactNode): number; + only(children: ReactNode): ReactElement; + toArray(children: ReactNode): ReactChild[]; + } + + // + // Browser Interfaces + // https://github.com/nikeee/2048-typescript/blob/master/2048/js/touch.d.ts + // ---------------------------------------------------------------------- + + interface AbstractView { + styleMedia: StyleMedia; + document: Document; + } + + interface Touch { + identifier: number; + target: EventTarget; + screenX: number; + screenY: number; + clientX: number; + clientY: number; + pageX: number; + pageY: number; + } + + interface TouchList { + [index: number]: Touch; + length: number; + item(index: number): Touch; + identifiedTouch(identifier: number): Touch; + } +} + +declare module "react" { + export = __React; +} + +declare namespace JSX { + import React = __React; + + interface Element extends React.ReactElement { } + interface ElementClass extends React.Component { + render(): JSX.Element; + } + interface ElementAttributesProperty { props: {}; } + + interface IntrinsicAttributes { + key?: string | number; + } + + interface IntrinsicClassAttributes { + ref?: string | ((classInstance: T) => void); + } + + interface IntrinsicElements { + // HTML + a: React.HTMLProps; + abbr: React.HTMLProps; + address: React.HTMLProps; + area: React.HTMLProps; + article: React.HTMLProps; + aside: React.HTMLProps; + audio: React.HTMLProps; + b: React.HTMLProps; + base: React.HTMLProps; + bdi: React.HTMLProps; + bdo: React.HTMLProps; + big: React.HTMLProps; + blockquote: React.HTMLProps; + body: React.HTMLProps; + br: React.HTMLProps; + button: React.HTMLProps; + canvas: React.HTMLProps; + caption: React.HTMLProps; + cite: React.HTMLProps; + code: React.HTMLProps; + col: React.HTMLProps; + colgroup: React.HTMLProps; + data: React.HTMLProps; + datalist: React.HTMLProps; + dd: React.HTMLProps; + del: React.HTMLProps; + details: React.HTMLProps; + dfn: React.HTMLProps; + dialog: React.HTMLProps; + div: React.HTMLProps; + dl: React.HTMLProps; + dt: React.HTMLProps; + em: React.HTMLProps; + embed: React.HTMLProps; + fieldset: React.HTMLProps; + figcaption: React.HTMLProps; + figure: React.HTMLProps; + footer: React.HTMLProps; + form: React.HTMLProps; + h1: React.HTMLProps; + h2: React.HTMLProps; + h3: React.HTMLProps; + h4: React.HTMLProps; + h5: React.HTMLProps; + h6: React.HTMLProps; + head: React.HTMLProps; + header: React.HTMLProps; + hr: React.HTMLProps; + html: React.HTMLProps; + i: React.HTMLProps; + iframe: React.HTMLProps; + img: React.HTMLProps; + input: React.HTMLProps; + ins: React.HTMLProps; + kbd: React.HTMLProps; + keygen: React.HTMLProps; + label: React.HTMLProps; + legend: React.HTMLProps; + li: React.HTMLProps; + link: React.HTMLProps; + main: React.HTMLProps; + map: React.HTMLProps; + mark: React.HTMLProps; + menu: React.HTMLProps; + menuitem: React.HTMLProps; + meta: React.HTMLProps; + meter: React.HTMLProps; + nav: React.HTMLProps; + noscript: React.HTMLProps; + object: React.HTMLProps; + ol: React.HTMLProps; + optgroup: React.HTMLProps; + option: React.HTMLProps; + output: React.HTMLProps; + p: React.HTMLProps; + param: React.HTMLProps; + picture: React.HTMLProps; + pre: React.HTMLProps; + progress: React.HTMLProps; + q: React.HTMLProps; + rp: React.HTMLProps; + rt: React.HTMLProps; + ruby: React.HTMLProps; + s: React.HTMLProps; + samp: React.HTMLProps; + script: React.HTMLProps; + section: React.HTMLProps; + select: React.HTMLProps; + small: React.HTMLProps; + source: React.HTMLProps; + span: React.HTMLProps; + strong: React.HTMLProps; + style: React.HTMLProps; + sub: React.HTMLProps; + summary: React.HTMLProps; + sup: React.HTMLProps; + table: React.HTMLProps; + tbody: React.HTMLProps; + td: React.HTMLProps; + textarea: React.HTMLProps; + tfoot: React.HTMLProps; + th: React.HTMLProps; + thead: React.HTMLProps; + time: React.HTMLProps; + title: React.HTMLProps; + tr: React.HTMLProps; + track: React.HTMLProps; + u: React.HTMLProps; + ul: React.HTMLProps; + "var": React.HTMLProps; + video: React.HTMLProps; + wbr: React.HTMLProps; + + // SVG + svg: React.SVGProps; + + circle: React.SVGProps; + clipPath: React.SVGProps; + defs: React.SVGProps; + ellipse: React.SVGProps; + g: React.SVGProps; + image: React.SVGProps; + line: React.SVGProps; + linearGradient: React.SVGProps; + mask: React.SVGProps; + path: React.SVGProps; + pattern: React.SVGProps; + polygon: React.SVGProps; + polyline: React.SVGProps; + radialGradient: React.SVGProps; + rect: React.SVGProps; + stop: React.SVGProps; + text: React.SVGProps; + tspan: React.SVGProps; + } +} diff --git a/package.json b/package.json index a3a9174366..b2ea24a147 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,6 @@ "@types/chai": "^3.4.33", "@types/enzyme": "^2.4.32", "@types/graphql": "^0.8.5", - "@types/immutable": "^3.8.3", "@types/invariant": "^2.2.27", "@types/isomorphic-fetch": "0.0.30", "@types/jest": "^15.1.32", diff --git a/test/react-web/client/graphql/queries.test.tsx b/test/react-web/client/graphql/queries.test.tsx index 82f27f4470..ef4dd894b6 100644 --- a/test/react-web/client/graphql/queries.test.tsx +++ b/test/react-web/client/graphql/queries.test.tsx @@ -172,7 +172,8 @@ describe('queries', () => { class ErrorContainer extends React.Component { componentWillReceiveProps({ data }) { // tslint:disable-line expect(data.error).toBeTruthy(); - expect(data.error instanceof ApolloError).toBe(true); + expect(data.error.networkError).toBeTruthy(); + // expect(data.error instanceof ApolloError).toBe(true); done(); } render() {