// Type definitions for JSnoX 2.1 // Project: https://github.com/af/jsnox // Definitions by: Steve Baker // Dovydas Navickas // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.8 import * as React from "react"; /* * JSnoX requires an object with a createElement method. * This will normally be the React object but could be something else */ interface ReactLikeObject { createElement

(type: React.ComponentClass

| string, props: P, children: React.ReactNode): React.ReactElement

; } type Module = (reactObj: ReactLikeObject) => CreateElement; interface CreateElement { /** * Renders an HTML element from the given spec string, with children but without * extra props. * @param specString A string that defines a component in a way that resembles * CSS selectors. Eg. "input:email#foo.bar.baz[name=email][required]" * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */

(specString: string, children: React.ReactNode): React.DOMElement; /** * Renders an HTML element from the given spec string, with optional props * and children * @param specString A string that defines a component in a way that resembles * CSS selectors. Eg. "input:email#foo.bar.baz[name=email][required]" * @param props Object of html attribute key-value pairs * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */

(specString: string, props?: React.HTMLAttributes<{}>, children?: React.ReactNode): React.DOMElement; /** * Renders a React component, with children but no props * @param component A plain React component (created from React.createClass()) or * component factory (created from React.createFactory()) * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */

(component: React.ComponentClass

, children: React.ReactNode): React.ReactElement

; /** * Renders a React component, with optional props and children * @param component A plain React component (created from React.createClass()) or * component factory (created from React.createFactory()) * @param props Props object to pass to the component * @param children A single React node (string or ReactElement) or array of nodes. * Note that unlike with React itself, multiple children must be placed into an array. */

(component: React.ComponentClass

, props?: P, children?: React.ReactNode): React.ReactElement

; } declare var exports: Module; export = exports;