mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
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:
38
reactcss/index.d.ts
vendored
38
reactcss/index.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user