6
6
7
7
# Function: useComponentCollector()
8
8
9
- > ** useComponentCollector** (` context ` , ` hint ` , ` options ` ): ` object `
9
+ > ** useComponentCollector** (` context ` , ` hint ` , ` options ` ): [ ` ReturnType ` ] ( ../namespaces/useComponentCollector/type-aliases/ReturnType.md )
10
10
11
11
Get a ctx and listeners for the rule to collect function components
12
12
@@ -26,98 +26,12 @@ The hint to use
26
26
27
27
### options
28
28
29
- [ ` ComponentCollectorOptions ` ] ( ../interfaces/ComponentCollectorOptions .md ) = ` {} `
29
+ [ ` Options ` ] ( ../namespaces/useComponentCollector/type-aliases/Options .md ) = ` {} `
30
30
31
31
The options to use
32
32
33
33
## Returns
34
34
35
- ` object `
35
+ [ ` ReturnType ` ] ( ../namespaces/useComponentCollector/type-aliases/ReturnType.md )
36
36
37
37
The component collector
38
-
39
- ### ctx
40
-
41
- > ** ctx** : ` object `
42
-
43
- #### ctx.getCurrentEntry()
44
-
45
- > ** getCurrentEntry** : () => ` undefined ` \| \{ ` hookCalls ` : ` CallExpression ` [ ] ; ` isComponent ` : ` boolean ` ; ` key ` : ` string ` ; ` node ` : ` TSESTreeFunction ` ; \}
46
-
47
- ##### Returns
48
-
49
- ` undefined ` \| \{ ` hookCalls ` : ` CallExpression ` [ ] ; ` isComponent ` : ` boolean ` ; ` key ` : ` string ` ; ` node ` : ` TSESTreeFunction ` ; \}
50
-
51
- #### ctx.getAllComponents()
52
-
53
- ##### Parameters
54
-
55
- ###### node
56
-
57
- ` Program `
58
-
59
- ##### Returns
60
-
61
- ` Map ` \< ` string ` , [ ` ERFunctionComponent ` ] ( ../interfaces/ERFunctionComponent.md ) \>
62
-
63
- #### ctx.getCurrentEntries()
64
-
65
- ##### Returns
66
-
67
- ` object ` [ ]
68
-
69
- ### listeners
70
-
71
- > ** listeners** : ` object `
72
-
73
- #### listeners.: function \[ type\] ()
74
-
75
- > ` readonly ` ** : function \[ type\] ** : (` node ` ) => ` void ` = ` onFunctionEnter `
76
-
77
- ##### Parameters
78
-
79
- ###### node
80
-
81
- ` TSESTreeFunction `
82
-
83
- ##### Returns
84
-
85
- ` void `
86
-
87
- #### listeners.: function \[ type\] : exit ()
88
-
89
- > ` readonly ` ** : function \[ type\] : exit ** : () => ` undefined ` \| \{ ` hookCalls ` : ` CallExpression ` [ ] ; ` isComponent ` : ` boolean ` ; ` key ` : ` string ` ; ` node ` : ` TSESTreeFunction ` ; \} = ` onFunctionExit `
90
-
91
- ##### Returns
92
-
93
- ` undefined ` \| \{ ` hookCalls ` : ` CallExpression ` [ ] ; ` isComponent ` : ` boolean ` ; ` key ` : ` string ` ; ` node ` : ` TSESTreeFunction ` ; \}
94
-
95
- #### listeners.ArrowFunctionExpression\[ type\]\[ body.type!='BlockStatement'\] ()
96
-
97
- ##### Returns
98
-
99
- ` void `
100
-
101
- #### listeners.CallExpression\[ type\] : exit ()?
102
-
103
- ##### Parameters
104
-
105
- ###### node
106
-
107
- ` CallExpression `
108
-
109
- ##### Returns
110
-
111
- ` void `
112
-
113
- #### listeners.ReturnStatement\[ type\] ()
114
-
115
- ##### Parameters
116
-
117
- ###### node
118
-
119
- ` ReturnStatement `
120
-
121
- ##### Returns
122
-
123
- ` void `
0 commit comments