From 66d12d9ada4a8e64897c3e2f4860eadd3e1da2f2 Mon Sep 17 00:00:00 2001 From: Mohamed Hegazy Date: Thu, 29 Dec 2016 19:26:32 -0800 Subject: [PATCH] Fix failing packages (#13624) * Use correct cases for type reference * Add missing dependency on jquery * Switch to module and add tslint * Fix failing test * Fix triple-slash reference * Remove reference to `__React` * Add import for react-native * Add missing react import * Switch to module * Switch to module, add react import * Make sure test is resilient to lib changes --- angular-localforage/index.d.ts | 2 +- datatables-buttons/index.d.ts | 2 +- ej.web.all/index.d.ts | 2 + localforage-cordovasqlitedriver/index.d.ts | 8 +- localforage-cordovasqlitedriver/tslint.json | 1 + phonegap-nfc/phonegap-nfc-tests.ts | 7 +- react-flexr/index.d.ts | 2 +- react-intl/index.d.ts | 2 - react-native-sortable-list/index.d.ts | 5 +- react-onclickoutside/index.d.ts | 2 + react-paginate/index.d.ts | 164 ++++++++++---------- reactcss/index.d.ts | 38 +++-- reactcss/reactcss-tests.tsx | 12 +- 13 files changed, 124 insertions(+), 123 deletions(-) create mode 100644 localforage-cordovasqlitedriver/tslint.json diff --git a/angular-localforage/index.d.ts b/angular-localforage/index.d.ts index 7d2c82120b..b37b27e7ee 100644 --- a/angular-localforage/index.d.ts +++ b/angular-localforage/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Stefan Steinhart // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// /// import * as angular from 'angular'; diff --git a/datatables-buttons/index.d.ts b/datatables-buttons/index.d.ts index 3bb8d5c02c..2ce52d8483 100644 --- a/datatables-buttons/index.d.ts +++ b/datatables-buttons/index.d.ts @@ -4,7 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -/// +/// declare namespace DataTables { export interface Settings { diff --git a/ej.web.all/index.d.ts b/ej.web.all/index.d.ts index a21e5127ee..41d0f2f54f 100644 --- a/ej.web.all/index.d.ts +++ b/ej.web.all/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Syncfusion // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +/// + /*! * filename: ej.web.all.d.ts * version : 14.4.0.20 diff --git a/localforage-cordovasqlitedriver/index.d.ts b/localforage-cordovasqlitedriver/index.d.ts index 676bea8cfa..7c415d3f42 100644 --- a/localforage-cordovasqlitedriver/index.d.ts +++ b/localforage-cordovasqlitedriver/index.d.ts @@ -3,9 +3,7 @@ // Definitions by: Thodoris Greasidis // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/// +/// -declare module "localforage-cordovasqlitedriver" { - var cordovaSQLiteDriver: LocalForageDriver; - export = cordovaSQLiteDriver; -} +declare var cordovaSQLiteDriver: LocalForageDriver; +export = cordovaSQLiteDriver; diff --git a/localforage-cordovasqlitedriver/tslint.json b/localforage-cordovasqlitedriver/tslint.json new file mode 100644 index 0000000000..2221e40e4a --- /dev/null +++ b/localforage-cordovasqlitedriver/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" } \ No newline at end of file diff --git a/phonegap-nfc/phonegap-nfc-tests.ts b/phonegap-nfc/phonegap-nfc-tests.ts index d1a71002ce..50eb34f293 100644 --- a/phonegap-nfc/phonegap-nfc-tests.ts +++ b/phonegap-nfc/phonegap-nfc-tests.ts @@ -97,7 +97,7 @@ let eventTarget: EventTarget = { removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean) { return; } } -let ndefTagEvent: NdefTagEvent = { +let ndefTagEvent = { bubbles: false, cancelBubble: false, cancelable: false, @@ -117,6 +117,9 @@ let ndefTagEvent: NdefTagEvent = { AT_TARGET: 0, BUBBLING_PHASE: 0, CAPTURING_PHASE: 0, - + scoped: false, + deepPath(): any { }, tag: ndefTag }; + +let event: NdefTagEvent = ndefTagEvent; \ No newline at end of file diff --git a/react-flexr/index.d.ts b/react-flexr/index.d.ts index 6b24685087..ad89e2c775 100644 --- a/react-flexr/index.d.ts +++ b/react-flexr/index.d.ts @@ -3,7 +3,7 @@ // Definitions by: Jeffery Grajkowski // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// +/// declare namespace __ReactFlexr { interface GridProps extends React.Props { diff --git a/react-intl/index.d.ts b/react-intl/index.d.ts index f4951d9039..9cc491499a 100644 --- a/react-intl/index.d.ts +++ b/react-intl/index.d.ts @@ -6,8 +6,6 @@ /// declare namespace ReactIntl { - // Import React - import React = __React; interface Locale { locale: string; diff --git a/react-native-sortable-list/index.d.ts b/react-native-sortable-list/index.d.ts index 8774c2ad1f..f0349e12e5 100644 --- a/react-native-sortable-list/index.d.ts +++ b/react-native-sortable-list/index.d.ts @@ -4,6 +4,7 @@ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped import * as React from 'react'; +import { ViewStyle } from 'react-native'; type DataKey = string | number; @@ -42,12 +43,12 @@ interface SortableListProps { /** * style of HOC */ - style?: React.ViewStyle + style?: ViewStyle /** * these styles will be applied to the inner scroll view content container */ - contentContainerStyle?: React.ViewStyle + contentContainerStyle?: ViewStyle /** * when false, rows are not sortable. The default value is true. diff --git a/react-onclickoutside/index.d.ts b/react-onclickoutside/index.d.ts index 476601d056..8f1192496e 100644 --- a/react-onclickoutside/index.d.ts +++ b/react-onclickoutside/index.d.ts @@ -3,6 +3,8 @@ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import * as React from "react"; + declare namespace ReactOnClickOutside { interface OnClickOutsideComponent { handleClickOutside(e: React.MouseEvent): void diff --git a/react-paginate/index.d.ts b/react-paginate/index.d.ts index 8ae89ce2fd..982f2fd65b 100644 --- a/react-paginate/index.d.ts +++ b/react-paginate/index.d.ts @@ -3,106 +3,104 @@ // Definitions by: Simon Hartcher // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare module "react-paginate" { - import * as React from "react"; +import * as React from "react"; - interface ReactPaginateProps { - /** - * The total number of pages. - */ - pageNum: number; +interface ReactPaginateProps { + /** + * The total number of pages. + */ + pageNum: number; - /** - * The range of pages displayed. - */ - pageRangeDisplayed: number; + /** + * The range of pages displayed. + */ + pageRangeDisplayed: number; - /** - * The number of pages to display for margins. - */ - marginPagesDisplayed: number; + /** + * The number of pages to display for margins. + */ + marginPagesDisplayed: number; - /** - * Label for the `previous` button. - */ - previousLabel?: string | JSX.Element; + /** + * Label for the `previous` button. + */ + previousLabel?: string | JSX.Element; - /** - * Label for the `next` button. - */ - nextLabel?: string | JSX.Element; + /** + * Label for the `next` button. + */ + nextLabel?: string | JSX.Element; - /** - * Label for ellipsis. - */ - breakLabel?: string | JSX.Element; + /** + * Label for ellipsis. + */ + breakLabel?: string | JSX.Element; - /** - * The classname on tag `li` of the ellipsis element. - */ - breakClassName?: string | JSX.Element; + /** + * The classname on tag `li` of the ellipsis element. + */ + breakClassName?: string | JSX.Element; - /** - * The method to call when a page is clicked. - */ - clickCallback?: Function; + /** + * The method to call when a page is clicked. + */ + clickCallback?: Function; - /** - * The initial page selected. - */ - initialSelected?: number; + /** + * The initial page selected. + */ + initialSelected?: number; - /** - * To override selected page with parent prop. - */ - forceSelected?: number; + /** + * To override selected page with parent prop. + */ + forceSelected?: number; - /** - * The classname of the pagination container. - */ - containerClassName?: string; + /** + * The classname of the pagination container. + */ + containerClassName?: string; - /** - * The classname on tag `li` of each page element. - */ - pageClassName?: string; + /** + * The classname on tag `li` of each page element. + */ + pageClassName?: string; - /** - * The classname on tag `a` of each page element. - */ - pageLinkClassName?: string; + /** + * The classname on tag `a` of each page element. + */ + pageLinkClassName?: string; - /** - * The classname for the active page. - */ - activeClassName?: string; + /** + * The classname for the active page. + */ + activeClassName?: string; - /** - * The classname on tag `li` of the `previous` button. - */ - previousClassName?: string; + /** + * The classname on tag `li` of the `previous` button. + */ + previousClassName?: string; - /** - * The classname on tag `li` of the `next` button. - */ - nextClassName?: string; + /** + * The classname on tag `li` of the `next` button. + */ + nextClassName?: string; - /** - * The classname on tag `a` of the `previous` button. - */ - previousLinkClassName?: string; + /** + * The classname on tag `a` of the `previous` button. + */ + previousLinkClassName?: string; - /** - * The classname on tag `a` of the `next` button. - */ - nextLinkClassName?: string; + /** + * The classname on tag `a` of the `next` button. + */ + nextLinkClassName?: string; - /** - * The classname for disabled `previous` and `next` buttons. - */ - disabledClassName?: string; - } - - const ReactPaginate: React.ComponentClass; - export = ReactPaginate; + /** + * The classname for disabled `previous` and `next` buttons. + */ + disabledClassName?: string; } + +declare const ReactPaginate: React.ComponentClass; +export = ReactPaginate; diff --git a/reactcss/index.d.ts b/reactcss/index.d.ts index 7f610cc342..19faf7e9fa 100644 --- a/reactcss/index.d.ts +++ b/reactcss/index.d.ts @@ -3,28 +3,26 @@ // Definitions by: Karol Janyst // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -declare namespace ReactCSS { - interface LoopableProps { - "first-child"?: boolean - "last-child"?: boolean - even?: boolean - odd?: boolean - [nthChild: string]: boolean - } +import * as React from "react" - interface HoverProps { - hover?: boolean - } - interface Classes { - default: any - [scope: string]: any - } +interface LoopableProps { + "first-child"?: boolean + "last-child"?: boolean + even?: boolean + odd?: boolean + [nthChild: string]: boolean } -declare module "reactcss" { - export type LoopableProps = ReactCSS.LoopableProps - export function hover(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass - export function loop(i: number, length: number): ReactCSS.LoopableProps - export default function reactCSS (classes: ReactCSS.Classes, ...activations: Array): any +interface HoverProps { + hover?: boolean } + +interface Classes { + default: any + [scope: string]: any +} + +export function hover(component: React.ComponentClass | React.StatelessComponent): React.ComponentClass +export function loop(i: number, length: number): LoopableProps +export default function reactCSS(classes: Classes, ...activations: Array): any diff --git a/reactcss/reactcss-tests.tsx b/reactcss/reactcss-tests.tsx index 852976b0d2..058958c7bf 100644 --- a/reactcss/reactcss-tests.tsx +++ b/reactcss/reactcss-tests.tsx @@ -1,16 +1,16 @@ import * as React from "react" import { StatelessComponent } from "react" import { render } from "react-dom" -import { default as reactCSS, hover, loop } from "reactcss" +import { default as reactCSS, hover, loop, LoopableProps, HoverProps } from "reactcss" -interface TestProps extends ReactCSS.HoverProps {} +interface TestProps extends HoverProps { } var styles: any = reactCSS({ - default : {}, - hover : {} -}, { hover : true }) + default: {}, + hover: {} +}, { hover: true }) -var loopProps: ReactCSS.LoopableProps = loop(1, 10) +var loopProps: LoopableProps = loop(1, 10) var TestComponent: StatelessComponent var Test = hover(TestComponent)