diff --git a/types/rangy/index.d.ts b/types/rangy/index.d.ts index 1edb9c3c23..b6615b9aad 100644 --- a/types/rangy/index.d.ts +++ b/types/rangy/index.d.ts @@ -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; diff --git a/types/rangy/rangy-tests.ts b/types/rangy/rangy-tests.ts index fac44c868c..de2ec468f0 100644 --- a/types/rangy/rangy-tests.ts +++ b/types/rangy/rangy-tests.ts @@ -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()); } diff --git a/types/react-native/index.d.ts b/types/react-native/index.d.ts index 07f2dd1741..4db13a47e0 100644 --- a/types/react-native/index.d.ts +++ b/types/react-native/index.d.ts @@ -1,6 +1,6 @@ // Type definitions for react-native 0.44 // Project: https://github.com/facebook/react-native -// Definitions by: Eloy Durán , Fedor Nezhivoi , HuHuanming +// Definitions by: Eloy Durán , Fedor Nezhivoi , HuHuanming , Jeremi Stadler // 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; } // diff --git a/types/react-navigation/index.d.ts b/types/react-navigation/index.d.ts index ffa936f6d0..083139a165 100644 --- a/types/react-navigation/index.d.ts +++ b/types/react-navigation/index.d.ts @@ -621,3 +621,6 @@ export interface NavgationComponentProps { }, } } + +export const TabBarTop: React.ReactElement; +export const TabBarBottom: React.ReactElement; diff --git a/types/react-navigation/react-navigation-tests.tsx b/types/react-navigation/react-navigation-tests.tsx index a88a5d3a0b..2493d92f84 100644 --- a/types/react-navigation/react-navigation-tests.tsx +++ b/types/react-navigation/react-navigation-tests.tsx @@ -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: , - tabBarLabel: 'label' + tabBarLabel: 'label', +} + +const tabNavigatorConfig: TabNavigatorConfig = { + lazy: true, + tabBarComponent: TabBarTop, } diff --git a/types/react-router/index.d.ts b/types/react-router/index.d.ts index d5bc7240c7..384cb2289e 100644 --- a/types/react-router/index.d.ts +++ b/types/react-router/index.d.ts @@ -65,7 +65,7 @@ export interface RouteProps { location?: H.Location; component?: React.SFC | undefined> | React.ComponentClass | undefined>; render?: ((props: RouteComponentProps) => React.ReactNode); - children?: ((props: RouteComponentProps) => React.ReactNode | React.ReactNode); + children?: ((props: RouteComponentProps) => React.ReactNode) | React.ReactNode; path?: string; exact?: boolean; strict?: boolean; diff --git a/types/react-router/test/Children.tsx b/types/react-router/test/Children.tsx new file mode 100644 index 0000000000..c3dea4f482 --- /dev/null +++ b/types/react-router/test/Children.tsx @@ -0,0 +1,22 @@ +import * as React from 'react'; +import { Route } from 'react-router'; + +function RouteWithFunctionChildrenAttribute() { + return
Hello!
} />; +} + +function RouteWithFunctionJsxChildren() { + return + {() =>
Hello!
} +
; +} + +function RouteWithElementChildrenAttribute() { + return Hello!} />; +} + +function RouteWithElementJsxChildren() { + return + {
Hello!
} +
; +} diff --git a/types/react-router/tsconfig.json b/types/react-router/tsconfig.json index df074843df..f3a225ece1 100644 --- a/types/react-router/tsconfig.json +++ b/types/react-router/tsconfig.json @@ -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",