Docs - Update built docs

This commit is contained in:
2019-09-09 17:43:58 +05:30
parent 21231fcb11
commit 977a376cad
10 changed files with 111 additions and 42 deletions
+42 -3
View File
@@ -18,7 +18,21 @@
**findNodeByComponent**(`node`: [FiberNode](_mocked_types_index_.md#fibernode) | null, `expectedClassOrFunction`: `React.ComponentType`): *[FiberNode](_mocked_types_index_.md#fibernode) | null*
*Defined in [findNode.ts:32](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/findNode.ts#L32)*
*Defined in [findNode.ts:63](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/findNode.ts#L63)*
Find node by component (i.e. class or function by reference), till first match.
Matches against class and function by reference.
Returns null if no match is found.
**`note`** Medium chance of collision, medium data access needed.
This is safer than findNodeByComponentName, as different components with the same name won't collide.
But, two instances of the same component will still collide.
Needs access to component class or function.
**`example`**
// returns FiberNode for first usage of AccordionMenu
findNodeByComponent(startNode, AccordionMenu);
**Parameters:**
@@ -35,7 +49,20 @@ ___
**findNodeByComponentName**(`node`: [FiberNode](_mocked_types_index_.md#fibernode) | null, `expectedName`: string): *[FiberNode](_mocked_types_index_.md#fibernode) | null*
*Defined in [findNode.ts:4](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/findNode.ts#L4)*
*Defined in [findNode.ts:19](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/findNode.ts#L19)*
Find node by component name, till first match.
Matches against class and function name, doesn't match html-like nodes.
Returns null if no match is found.
**`note`** Highest chance of collision, least data access needed.
Different components with same name will collide.
Needs access to component name.
**`example`**
// returns FiberNode for first usage of 'AccordionMenu'
findNodeByComponentName(startNode, "AccordionMenu");
**Parameters:**
@@ -52,7 +79,19 @@ ___
**findNodeByComponentRef**(`node`: [FiberNode](_mocked_types_index_.md#fibernode) | null, `expectedClassInstance`: `Component`): *[FiberNode](_mocked_types_index_.md#fibernode) | null*
*Defined in [findNode.ts:63](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/findNode.ts#L63)*
*Defined in [findNode.ts:108](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/findNode.ts#L108)*
Find node by component instance ref, till first match.
Matches against class instances by reference.
Returns null if no match is found.
**`note`** Least chance of collision, maximum data access needed.
Needs access to component instance (through React ref usually).
**`example`**
// menuRef=createRef(); <AccordionMenu ref={menuRef}>
findNodeByComponentRef(startNode, menuRef.current);
**Parameters:**
+2 -2
View File
@@ -25,7 +25,7 @@
Ƭ **FiberNode**: *[FiberNodeForComponentClass](../interfaces/_mocked_types_index_.fibernodeforcomponentclass.md) | [FiberNodeForFunctionComponent](../interfaces/_mocked_types_index_.fibernodeforfunctioncomponent.md) | [FiberNodeForInstrinsicElement](../interfaces/_mocked_types_index_.fibernodeforinstrinsicelement.md) | [FiberNodeForTextNode](../interfaces/_mocked_types_index_.fibernodefortextnode.md)*
*Defined in [mocked-types/index.ts:11](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/mocked-types/index.ts#L11)*
*Defined in [mocked-types/index.ts:11](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/mocked-types/index.ts#L11)*
___
@@ -33,4 +33,4 @@ ___
Ƭ **FiberNodeisHTMLLike**: *[FiberNodeForInstrinsicElement](../interfaces/_mocked_types_index_.fibernodeforinstrinsicelement.md) | [FiberNodeForTextNode](../interfaces/_mocked_types_index_.fibernodefortextnode.md)*
*Defined in [mocked-types/index.ts:67](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/mocked-types/index.ts#L67)*
*Defined in [mocked-types/index.ts:67](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/mocked-types/index.ts#L67)*
+2 -2
View File
@@ -17,7 +17,7 @@
**traverse**(`node`: [FiberNode](_mocked_types_index_.md#fibernode), `fn`: function): *void*
*Defined in [traverse.ts:4](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/traverse.ts#L4)*
*Defined in [traverse.ts:4](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/traverse.ts#L4)*
**Parameters:**
@@ -41,7 +41,7 @@ ___
**traverseGenerator**(`node`: [FiberNode](_mocked_types_index_.md#fibernode), `__namedParameters`: object): *`IterableIterator<FiberNode>`*
*Defined in [traverse.ts:15](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/traverse.ts#L15)*
*Defined in [traverse.ts:15](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/traverse.ts#L15)*
**Parameters:**
+9 -9
View File
@@ -24,7 +24,7 @@
**doesElementContainRootFiberNode**(`element`: `Element`): *boolean*
*Defined in [utils.ts:65](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L65)*
*Defined in [utils.ts:65](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L65)*
**Parameters:**
@@ -40,7 +40,7 @@ ___
**getRootFiberNodeFromDOM**(`startElement?`: [Element](../interfaces/_mocked_types_index_.fibernodedomcontainer.md#element)): *[FiberNode](_mocked_types_index_.md#fibernode) | null*
*Defined in [utils.ts:82](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L82)*
*Defined in [utils.ts:82](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L82)*
Util to find root React Fiber node from html DOM tree.
Returns null, if not found.SHould be called after ReactDOM.render is finished.
@@ -59,7 +59,7 @@ ___
**isConstructorComponentClass**(`ctr`: `React.ElementType` | null): *boolean*
*Defined in [utils.ts:42](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L42)*
*Defined in [utils.ts:42](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L42)*
**Parameters:**
@@ -75,7 +75,7 @@ ___
**isConstructorFunctionComponent**(`ctr`: `React.ElementType` | null): *boolean*
*Defined in [utils.ts:59](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L59)*
*Defined in [utils.ts:59](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L59)*
**Parameters:**
@@ -91,7 +91,7 @@ ___
**isConstructorHtmlLike**(`ctr`: `React.ElementType` | null): *boolean*
*Defined in [utils.ts:33](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L33)*
*Defined in [utils.ts:33](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L33)*
**Parameters:**
@@ -107,7 +107,7 @@ ___
**isNodeComponentClass**(`node`: [FiberNode](_mocked_types_index_.md#fibernode)): *boolean*
*Defined in [utils.ts:27](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L27)*
*Defined in [utils.ts:27](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L27)*
**Parameters:**
@@ -123,7 +123,7 @@ ___
**isNodeFunctionComponent**(`node`: [FiberNode](_mocked_types_index_.md#fibernode)): *boolean*
*Defined in [utils.ts:21](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L21)*
*Defined in [utils.ts:21](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L21)*
**Parameters:**
@@ -139,7 +139,7 @@ ___
**isNodeHtmlLike**(`node`: [FiberNode](_mocked_types_index_.md#fibernode)): *boolean*
*Defined in [utils.ts:11](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L11)*
*Defined in [utils.ts:11](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L11)*
**Parameters:**
@@ -155,7 +155,7 @@ ___
**isNodeNotHtmlLike**(`node`: [FiberNode](_mocked_types_index_.md#fibernode)): *boolean*
*Defined in [utils.ts:15](https://github.com/bendtherules/react-fiber-traverse/blob/18ea2e7/src/utils.ts#L15)*
*Defined in [utils.ts:15](https://github.com/bendtherules/react-fiber-traverse/blob/21231fc/src/utils.ts#L15)*
**Parameters:**