This commit is contained in:
Brian Lee
2017-05-30 13:27:50 -07:00
8 changed files with 74 additions and 6 deletions
+6 -1
View File
@@ -39,6 +39,7 @@ interface RangySelection extends Selection {
refresh(checkForChanges?:boolean):any;
toHtml():string;
getAllRanges():RangyRange[];
getRangeAt(idx:number):RangyRange;
getNativeTextRange():any;
setSingleRange(range:RangyRange):any;
setRanges(ranges:RangyRange[]):any;
@@ -46,6 +47,8 @@ interface RangySelection extends Selection {
moveToBookmark(bookmark:Object):any;
saveRanges():Object;
restoreRanges(saved:Object):any;
saveCharacterRanges(containerNode:Node):Object;
restoreCharacterRanges(containerNode:Node, characterRanges:Object):any;
detach():any;
inspect():string;
}
@@ -62,5 +65,7 @@ interface RangyStatic {
initialized:boolean;
supported:boolean;
}
declare module 'rangy' {
export = rangy;
}
declare var rangy:RangyStatic;
+5
View File
@@ -81,6 +81,7 @@ function testSelection() {
selection.detach();
let ranges:RangyRange[] = selection.getAllRanges();
let range:RangyRange = selection.getRangeAt(0);
selection.getBookmark(new Node);
let nativeTextRange:TextRange = selection.getNativeTextRange();
assertString(selection.inspect());
@@ -94,4 +95,8 @@ function testSelection() {
selection.setRanges(ranges);
selection.setSingleRange(getRangyRange());
assertString(selection.toHtml());
var node:Node = new Node();
object = selection.saveCharacterRanges(node);
selection.restoreCharacterRanges(node, object);
assertString(selection.toHtml());
}
+26 -2
View File
@@ -1,6 +1,6 @@
// Type definitions for react-native 0.44
// Project: https://github.com/facebook/react-native
// Definitions by: Eloy Durán <https://github.com/alloy>, Fedor Nezhivoi <https://github.com/gyzerok>, HuHuanming <https://github.com/huhuanming>
// Definitions by: Eloy Durán <https://github.com/alloy>, Fedor Nezhivoi <https://github.com/gyzerok>, HuHuanming <https://github.com/huhuanming>, Jeremi Stadler <https://github.com/jeremistadler>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1
@@ -804,6 +804,17 @@ export interface TextPropertiesAndroid {
* Lets the user select text, to use the native copy and paste functionality.
*/
selectable?: boolean
/**
* The highlight color of the text.
*/
selectionColor?: string
/**
* Set text break strategy on Android API Level 23+
* default is `highQuality`.
*/
textBreakStrategy?: "simple" | "highQuality" | "balanced"
}
// https://facebook.github.io/react-native/docs/text.html#props
@@ -993,7 +1004,10 @@ export interface TextInputIOSProperties {
*/
selectionState?: DocumentSelectionState
/**
* If false, disables spell-check style (i.e. red underlines). The default value is inherited from autoCorrect
*/
spellCheck?: boolean
}
/**
@@ -8822,6 +8836,13 @@ export function processColor(color: any): number;
export function __spread(target: any, ...sources: any[]): any;
type ErrorHandlerCallback = (error: any, isFatal?: boolean) => void;
export interface ErrorUtils {
setGlobalHandler: (callback: ErrorHandlerCallback) => void;
getGlobalHandler: () => ErrorHandlerCallback;
}
export interface GlobalStatic {
/**
@@ -8842,6 +8863,9 @@ export interface GlobalStatic {
*/
originalXMLHttpRequest: Object;
XMLHttpRequest: Object;
__BUNDLE_START_TIME__: number;
ErrorUtils: ErrorUtils;
}
//
+3
View File
@@ -621,3 +621,6 @@ export interface NavgationComponentProps<T> {
},
}
}
export const TabBarTop: React.ReactElement<any>;
export const TabBarBottom: React.ReactElement<any>;
@@ -3,7 +3,10 @@ import { View } from 'react-native';
import {
addNavigationHelpers,
StackNavigator,
TabNavigatorScreenOptions
TabNavigatorScreenOptions,
TabNavigatorConfig,
TabBarTop,
TabBarBottom,
} from 'react-navigation';
const Start = (
@@ -34,5 +37,10 @@ const tabNavigatorScreenOptions: TabNavigatorScreenOptions = {
title: 'title',
tabBarVisible: true,
tabBarIcon: <View />,
tabBarLabel: 'label'
tabBarLabel: 'label',
}
const tabNavigatorConfig: TabNavigatorConfig = {
lazy: true,
tabBarComponent: TabBarTop,
}
+1 -1
View File
@@ -65,7 +65,7 @@ export interface RouteProps {
location?: H.Location;
component?: React.SFC<RouteComponentProps<any> | undefined> | React.ComponentClass<RouteComponentProps<any> | undefined>;
render?: ((props: RouteComponentProps<any>) => React.ReactNode);
children?: ((props: RouteComponentProps<any>) => React.ReactNode | React.ReactNode);
children?: ((props: RouteComponentProps<any>) => React.ReactNode) | React.ReactNode;
path?: string;
exact?: boolean;
strict?: boolean;
+22
View File
@@ -0,0 +1,22 @@
import * as React from 'react';
import { Route } from 'react-router';
function RouteWithFunctionChildrenAttribute() {
return <Route path="/" children={() => <div>Hello!</div>} />;
}
function RouteWithFunctionJsxChildren() {
return <Route path="/">
{() => <div>Hello!</div>}
</Route>;
}
function RouteWithElementChildrenAttribute() {
return <Route path="/" children={<div>Hello!</div>} />;
}
function RouteWithElementJsxChildren() {
return <Route path="/">
{<div>Hello!</div>}
</Route>;
}
+1
View File
@@ -18,6 +18,7 @@
"test/Animation.tsx",
"test/Auth.tsx",
"test/Basic.tsx",
"test/Children.tsx",
"test/CustomLink.tsx",
"test/ModalGallery.tsx",
"test/NavigateWithContext.tsx",