Home Reference Source

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 (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:

public

isDerivedClass(refClass: *, derivedClassB: *): *

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.

public

isDerivedComponent(refBaseClass: *, componentA: *): *

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:

public

isExactClass(refClass: *, classA: *): *

Returns a boolean which indicates that the provided classA matches the provided refClass and is true only when the following conditions are met:

public

isExactComponent(refClass: *, componentA: *): *

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:

public

isInstanceOf(refClass: *, classA: *): *

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:

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:

NameTypeAttributeDescription
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:

NameTypeAttributeDescription
refClass *

The reference type as defined in a class declaration.

Return:

*

A function of the type (anyInst) => boolean which returns 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 of refClass or a derived refClass.

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:

NameTypeAttributeDescription
refClass *

The reference class (function).

derivedClassB *

The actual derived class (function).

Return:

*

true when derivedClassB.prototype instanceof refBaseClass and both are functions, false otherwise.

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:

NameTypeAttributeDescription
refBaseClass *

The reference base class (function).

componentA *

The actual component (object).

Return:

*

true when refClass === classA and both are functions, false otherwise.

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:

NameTypeAttributeDescription
refClass *

The reference class (function).

classA *

The actual class (function).

Return:

*

true when refClass === classA and both are functions, false otherwise.

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:

NameTypeAttributeDescription
refClass *

The reference class (function).

componentA *

The actual component (object).

Return:

*

true when refClass === classA and both are functions, false otherwise.

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:

NameTypeAttributeDescription
refClass *

The reference class (function).

classA *

The actual class (function).

Return:

*

true when refClass === classA and both are functions, false otherwise.

public renderJSDOM(component: *, window: *): * source

Params:

NameTypeAttributeDescription
component *
window *
  • optional

Return:

*

public renderState(component: *, window: *): * source

Params:

NameTypeAttributeDescription
component *
window *
  • optional

Return:

*