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
This commit is contained in:
Mohamed Hegazy
2016-12-29 19:26:32 -08:00
committed by GitHub
parent 66c9b3c740
commit 66d12d9ada
13 changed files with 124 additions and 123 deletions

38
reactcss/index.d.ts vendored
View File

@@ -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

View File

@@ -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)