@cerebral/inferno
Advanced tools
Comparing version 3.2.0-1521141520687 to 3.2.0-1521491486243
@@ -1,16 +0,22 @@ | ||
import { InfernoChildren, VNode, Component } from 'inferno'; | ||
import { InfernoChildren, VNode, Component } from 'inferno' | ||
/* eslint-disable-next-line no-unused-vars */ | ||
import { BaseControllerClass, Sequence } from 'cerebral' | ||
// TODO: Replace these type with Inferno JSX support | ||
type ComponentState = {}; | ||
type Validator<T> = (object: T, key: string, componentName: string, ...rest: any[]) => Error | null; | ||
type ValidationMap<T> = {[K in keyof T]?: Validator<T> }; | ||
type ComponentState = {} | ||
type Validator<T> = ( | ||
object: T, | ||
key: string, | ||
componentName: string, | ||
...rest: any[] | ||
) => Error | null | ||
type ValidationMap<T> = { [K in keyof T]?: Validator<T> } | ||
interface ComponentClass<P = {}> { | ||
new (props?: P, context?: any): Component<P, ComponentState>; | ||
propTypes?: ValidationMap<P>; | ||
contextTypes?: ValidationMap<any>; | ||
childContextTypes?: ValidationMap<any>; | ||
defaultProps?: Partial<P>; | ||
displayName?: string; | ||
new (props?: P, context?: any): Component<P, ComponentState> | ||
propTypes?: ValidationMap<P> | ||
contextTypes?: ValidationMap<any> | ||
childContextTypes?: ValidationMap<any> | ||
defaultProps?: Partial<P> | ||
displayName?: string | ||
} | ||
@@ -20,19 +26,21 @@ | ||
interface StatelessComponent<P = {}> { | ||
(props: P & { children?: InfernoChildren }, context?: any): InfernoJSXElement<any> | null; | ||
propTypes?: ValidationMap<P>; | ||
contextTypes?: ValidationMap<any>; | ||
defaultProps?: Partial<P>; | ||
displayName?: string; | ||
(props: P & { children?: InfernoChildren }, context?: any): InfernoJSXElement< | ||
any | ||
> | null | ||
propTypes?: ValidationMap<P> | ||
contextTypes?: ValidationMap<any> | ||
defaultProps?: Partial<P> | ||
displayName?: string | ||
} | ||
type ComponentType<P = {}> = ComponentClass<P> | StatelessComponent<P>; | ||
type ComponentType<P = {}> = ComponentClass<P> | StatelessComponent<P> | ||
declare global { | ||
namespace JSX { | ||
interface Element extends InfernoJSXElement<any> {} | ||
namespace JSX { | ||
interface Element extends InfernoJSXElement<any> {} | ||
interface IntrinsicElements { | ||
[elemName: string]: any; | ||
} | ||
interface IntrinsicElements { | ||
[elemName: string]: any | ||
} | ||
} | ||
} | ||
@@ -42,13 +50,17 @@ | ||
interface SignalsMap { | ||
[signalName: string]: Sequence | ||
[signalName: string]: Sequence | ||
} | ||
export const StateContainer: ComponentClass<{state: any, signals: SignalsMap}> | ||
export const Container: ComponentClass<{controller: BaseControllerClass}> | ||
export const StateContainer: ComponentClass<{ state: any; signals: SignalsMap }> | ||
export const Container: ComponentClass<{ controller: BaseControllerClass }> | ||
/* eslint-disable-next-line no-unused-vars */ | ||
type PropsMap<T> = { | ||
[P in keyof T]: any; // TODO: use correct type than Tag<any> | ||
[P in keyof T]: any // TODO: use correct type than Tag<any> | ||
} | ||
// Props are signal/state props, EProps are external props | ||
export function connect<Props, EProps = {}>(props: Props, comp: ComponentType<PropsMap<Props> & EProps>): ComponentClass<EProps> | ||
export function connect<Props, EProps = {}>( | ||
props: Props, | ||
comp: ComponentType<PropsMap<Props> & EProps> | ||
): ComponentClass<EProps> |
{ | ||
"name": "@cerebral/inferno", | ||
"version": "3.2.0-1521141520687", | ||
"version": "3.2.0-1521491486243", | ||
"description": "Inferno view for Cerebral", | ||
@@ -18,3 +18,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"cerebral": "^4.2.0-1521141520687" | ||
"cerebral": "^4.2.0-1521491486243" | ||
}, | ||
@@ -25,3 +25,3 @@ "scripts": { | ||
"prepublish": "npm run build", | ||
"test": "mocha -r test/setup --compilers js:babel-register \"src/**/*.test.js\" \"test/**/*.test.js\"", | ||
"test": "mocha -r test/setup --require babel-register \"src/**/*.test.js\" \"test/**/*.test.js\"", | ||
"test:watch": "npm run test -- --watch" | ||
@@ -28,0 +28,0 @@ }, |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23357
292