Function
| Static Public Summary | ||
| public |
isClassOrComponent(refClass: *, inst: *): * Returns a boolean which indicates if the provided anyInst matches any of the following conditions (given class A extends React.Component {...} and class B extends class A {...}): |
|
| public |
isClassOrComponentFactory(refClass: *): * Returns a function in the format |
|
| public |
isDerivedClass(refClass: *, derivedClassB: *): * Returns a boolean which indicates if the provided |
|
| public |
isDerivedComponent(refBaseClass: *, componentA: *): * Returns a boolean which indicates that the provided |
|
| public |
isExactClass(refClass: *, classA: *): * Returns a boolean which indicates that the provided |
|
| public |
isExactComponent(refClass: *, componentA: *): * Returns a boolean which indicates that the provided |
|
| public |
isInstanceOf(refClass: *, classA: *): * Returns a boolean which indicates that the provided |
|
| public |
renderJSDOM(component: *, window: *): * |
|
| public |
renderState(component: *, window: *): * |
|
Static Public
public isClassOrComponent(refClass: *, inst: *): * source
import {isClassOrComponent} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates if the provided anyInst matches any of the following conditions (given class A extends React.Component {...} and class B extends class A {...}):
(1) a reference to refClass (A === A),
(2) an instance of refClass (new A()),
(3) a React Element provided refClass as the type (React.createElement(A))
TODO: (4) a DOM Node which has been rendered with a React Element, type refClass
(5) a reference to a derived class (B === A whereas class B extends A {...})
(6) an instance of a derived class (new B() given class B extends A {...})
(7) a React Element with a derived class as the type (React.createElement(B))
TODO: (8) a DOM Node which has been rendered with a React Element, type derived refClass
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference type as defined in a class declaration. |
|
| inst | * | Anything really, but mostly instances of things. |
Return:
| * | A boolean indicating whether inst is a reference to refClass, a reference to a class derived from refClass, an instance of refClass, an instance of a derived class, or a React Element of type refClass, or a React Element of a derived refClass, or a mounted DOM Node. |
public isClassOrComponentFactory(refClass: *): * source
import {isClassOrComponentFactory} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a function in the format (anyInst) => boolean which returns a boolean
which indicates if the provided anyInst matches any of the following conditions
(given class A extends React.Component {...} and class B extends class A {...}),
where A refers to the type provided in refClass:
(1) a reference to refClass (A === A),
(2) an instance of refClass (new A()),
(3) a React Element provided refClass as the type (React.createElement(A))
TODO: (4) a DOM Node which has been rendered with a React Element, type refClass
(5) a reference to a derived class (B === A whereas class B extends A {...})
(6) an instance of a derived class (new B() given class B extends A {...})
(7) a React Element with a derived class as the type (React.createElement(B))
TODO: (8) a DOM Node which has been rendered with a React Element, type derived from refClass
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference type as defined in a class declaration. |
Return:
| * | A function of the type |
public isDerivedClass(refClass: *, derivedClassB: *): * source
import {isDerivedClass} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates if the provided derivedClassB matches
the following true when the following two conditions are met:
refClass is a type and derivedClassB is a type extended from refClass.
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference class (function). |
|
| derivedClassB | * | The actual derived class (function). |
Return:
| * |
|
public isDerivedComponent(refBaseClass: *, componentA: *): * source
import {isDerivedComponent} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates that the provided derivedComponentB component
is a React Component as created by React.createElement() instantiated using
the refBaseClass base type and is true only when the following conditions
are met:
(1) refBaseClass is a type (function), and
(2) refBaseClass has been extended to a secondary class, such as class B extends A {}
(3) derivedComponentB is created using React.createElement(B)
(4) You are interested in seeing if this Component element is of type derived from A
Params:
| Name | Type | Attribute | Description |
| refBaseClass | * | The reference base class (function). |
|
| componentA | * | The actual component (object). |
Return:
| * |
|
public isExactClass(refClass: *, classA: *): * source
import {isExactClass} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates that the provided classA matches
the provided refClass and is true only when the following conditions
are met:
(1) refClass is a type (function), and
(2) classA is that exact same type (function).
It is an equality test that returns true for any
refClass === classA if and only if refClass and classA are
functions, as class A {} transpiles to a function declaration.
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference class (function). |
|
| classA | * | The actual class (function). |
Return:
| * |
|
public isExactComponent(refClass: *, componentA: *): * source
import {isExactComponent} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates that the provided componentA component
is a React Component as created by React.createElement() instantiated using
the refClass type and is true only when the following conditions
are met:
(1) refClass is a type (function), and
(2) componentA is created using React.createElement(refClass)
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference class (function). |
|
| componentA | * | The actual component (object). |
Return:
| * |
|
public isInstanceOf(refClass: *, classA: *): * source
import {isInstanceOf} from 'ink-splat/src/utils/isClassOrComponent.js'Returns a boolean which indicates that the provided inst matches
is an instance of the provided refClass class and is true only
when the following conditions are met:
(1) refClass is a type (function), and
(2) inst is an object which an instance of refClass
It is an equality test that returns true for any
refClass === classA if and only if refClass and classA are
functions, as class A {} transpiles to a function declaration.
Params:
| Name | Type | Attribute | Description |
| refClass | * | The reference class (function). |
|
| classA | * | The actual class (function). |
Return:
| * |
|
public renderJSDOM(component: *, window: *): * source
import renderJSDOM from 'ink-splat/src/tests/renderers/jsdomRenderer.js'Params:
| Name | Type | Attribute | Description |
| component | * | ||
| window | * |
|
Return:
| * |
public renderState(component: *, window: *): * source
import renderState from 'ink-splat/src/tests/renderers/stateRenderer.js'Params:
| Name | Type | Attribute | Description |
| component | * | ||
| window | * |
|
Return:
| * |
