Skip to content

Commit

Permalink
Fix failing packages (DefinitelyTyped#13624)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
mhegazy authored Dec 30, 2016
1 parent 66c9b3c commit 66d12d9
Show file tree
Hide file tree
Showing 13 changed files with 143 additions and 142 deletions.
2 changes: 1 addition & 1 deletion angular-localforage/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Definitions by: Stefan Steinhart <https://github.com/reppners>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="localForage" />
/// <reference types="localforage" />
/// <reference types="angular" />

import * as angular from 'angular';
Expand Down
2 changes: 1 addition & 1 deletion datatables-buttons/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="jquery" />
/// <reference types="jquery.dataTables"/>
/// <reference types="jquery.datatables"/>

declare namespace DataTables {
export interface Settings {
Expand Down
2 changes: 2 additions & 0 deletions ej.web.all/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Definitions by: Syncfusion <https://github.com/syncfusion/>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="jquery" />

/*!
* filename: ej.web.all.d.ts
* version : 14.4.0.20
Expand Down
8 changes: 3 additions & 5 deletions localforage-cordovasqlitedriver/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@
// Definitions by: Thodoris Greasidis <https://github.com/thgreasi>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="localForage" />
/// <reference types="localforage" />

declare module "localforage-cordovasqlitedriver" {
var cordovaSQLiteDriver: LocalForageDriver;
export = cordovaSQLiteDriver;
}
declare var cordovaSQLiteDriver: LocalForageDriver;
export = cordovaSQLiteDriver;
1 change: 1 addition & 0 deletions localforage-cordovasqlitedriver/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "../tslint.json" }
7 changes: 5 additions & 2 deletions phonegap-nfc/phonegap-nfc-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
2 changes: 1 addition & 1 deletion react-flexr/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// Definitions by: Jeffery Grajkowski <https://github.com/pushplay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

// <reference types="react" />
/// <reference types="react" />

declare namespace __ReactFlexr {
interface GridProps extends React.Props<Grid> {
Expand Down
2 changes: 0 additions & 2 deletions react-intl/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
///<reference types="react" />

declare namespace ReactIntl {
// Import React
import React = __React;

interface Locale {
locale: string;
Expand Down
5 changes: 3 additions & 2 deletions react-native-sortable-list/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as React from 'react';
import { ViewStyle } from 'react-native';

type DataKey = string | number;

Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions react-onclickoutside/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Definitions by: Karol Janyst <https://github.com/LKay>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

import * as React from "react";

declare namespace ReactOnClickOutside {
interface OnClickOutsideComponent {
handleClickOutside(e: React.MouseEvent<any>): void
Expand Down
202 changes: 100 additions & 102 deletions react-paginate/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,106 +3,104 @@
// Definitions by: Simon Hartcher <https://github.com/deevus>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

declare module "react-paginate" {
import * as React from "react";

interface ReactPaginateProps {
/**
* The total number of pages.
*/
pageNum: number;

/**
* The range of pages displayed.
*/
pageRangeDisplayed: number;

/**
* The number of pages to display for margins.
*/
marginPagesDisplayed: number;

/**
* Label for the `previous` button.
*/
previousLabel?: string | JSX.Element;

/**
* Label for the `next` button.
*/
nextLabel?: string | JSX.Element;

/**
* Label for ellipsis.
*/
breakLabel?: 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 initial page selected.
*/
initialSelected?: number;

/**
* To override selected page with parent prop.
*/
forceSelected?: number;

/**
* The classname of the pagination container.
*/
containerClassName?: 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 for the active page.
*/
activeClassName?: 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 `a` of the `previous` button.
*/
previousLinkClassName?: 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<ReactPaginateProps>;
export = ReactPaginate;
import * as React from "react";

interface ReactPaginateProps {
/**
* The total number of pages.
*/
pageNum: number;

/**
* The range of pages displayed.
*/
pageRangeDisplayed: number;

/**
* The number of pages to display for margins.
*/
marginPagesDisplayed: number;

/**
* Label for the `previous` button.
*/
previousLabel?: string | JSX.Element;

/**
* Label for the `next` button.
*/
nextLabel?: string | JSX.Element;

/**
* Label for ellipsis.
*/
breakLabel?: 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 initial page selected.
*/
initialSelected?: number;

/**
* To override selected page with parent prop.
*/
forceSelected?: number;

/**
* The classname of the pagination container.
*/
containerClassName?: 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 for the active page.
*/
activeClassName?: 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 `a` of the `previous` button.
*/
previousLinkClassName?: string;

/**
* The classname on tag `a` of the `next` button.
*/
nextLinkClassName?: string;

/**
* The classname for disabled `previous` and `next` buttons.
*/
disabledClassName?: string;
}

declare const ReactPaginate: React.ComponentClass<ReactPaginateProps>;
export = ReactPaginate;
38 changes: 18 additions & 20 deletions reactcss/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,26 @@
// Definitions by: Karol Janyst <https://github.com/LKay>
// 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<A>(component: React.ComponentClass<A> | React.StatelessComponent<A>): React.ComponentClass<A>
export function loop(i: number, length: number): ReactCSS.LoopableProps
export default function reactCSS (classes: ReactCSS.Classes, ...activations: Array<any>): any
interface HoverProps {
hover?: boolean
}

interface Classes {
default: any
[scope: string]: any
}

export function hover<A>(component: React.ComponentClass<A> | React.StatelessComponent<A>): React.ComponentClass<A>
export function loop(i: number, length: number): LoopableProps
export default function reactCSS(classes: Classes, ...activations: Array<any>): any
12 changes: 6 additions & 6 deletions reactcss/reactcss-tests.tsx
Original file line number Diff line number Diff line change
@@ -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<TestProps>
var Test = hover(TestComponent)
Expand Down

0 comments on commit 66d12d9

Please sign in to comment.