@@ -57,11 +57,11 @@ export interface NodeOp {
5757let nodeId : number = 0
5858let recordedNodeOps : NodeOp [ ] = [ ]
5959
60- export function logNodeOp ( op : NodeOp ) {
60+ export function logNodeOp ( op : NodeOp ) : void {
6161 recordedNodeOps . push ( op )
6262}
6363
64- export function resetOps ( ) {
64+ export function resetOps ( ) : void {
6565 recordedNodeOps = [ ]
6666}
6767
@@ -128,7 +128,7 @@ function createComment(text: string): TestComment {
128128 return node
129129}
130130
131- function setText ( node : TestText , text : string ) {
131+ function setText ( node : TestText , text : string ) : void {
132132 logNodeOp ( {
133133 type : NodeOpTypes . SET_TEXT ,
134134 targetNode : node ,
@@ -137,7 +137,11 @@ function setText(node: TestText, text: string) {
137137 node . text = text
138138}
139139
140- function insert ( child : TestNode , parent : TestElement , ref ?: TestNode | null ) {
140+ function insert (
141+ child : TestNode ,
142+ parent : TestElement ,
143+ ref ?: TestNode | null ,
144+ ) : void {
141145 let refIndex
142146 if ( ref ) {
143147 refIndex = parent . children . indexOf ( ref )
@@ -166,7 +170,7 @@ function insert(child: TestNode, parent: TestElement, ref?: TestNode | null) {
166170 }
167171}
168172
169- function remove ( child : TestNode , logOp = true ) {
173+ function remove ( child : TestNode , logOp = true ) : void {
170174 const parent = child . parentNode
171175 if ( parent ) {
172176 if ( logOp ) {
@@ -188,7 +192,7 @@ function remove(child: TestNode, logOp = true) {
188192 }
189193}
190194
191- function setElementText ( el : TestElement , text : string ) {
195+ function setElementText ( el : TestElement , text : string ) : void {
192196 logNodeOp ( {
193197 type : NodeOpTypes . SET_ELEMENT_TEXT ,
194198 targetNode : el ,
@@ -228,11 +232,23 @@ function querySelector(): never {
228232 throw new Error ( 'querySelector not supported in test renderer.' )
229233}
230234
231- function setScopeId ( el : TestElement , id : string ) {
235+ function setScopeId ( el : TestElement , id : string ) : void {
232236 el . props [ id ] = ''
233237}
234238
235- export const nodeOps = {
239+ export const nodeOps : {
240+ insert : typeof insert
241+ remove : typeof remove
242+ createElement : typeof createElement
243+ createText : typeof createText
244+ createComment : typeof createComment
245+ setText : typeof setText
246+ setElementText : typeof setElementText
247+ parentNode : typeof parentNode
248+ nextSibling : typeof nextSibling
249+ querySelector : typeof querySelector
250+ setScopeId : typeof setScopeId
251+ } = {
236252 insert,
237253 remove,
238254 createElement,
0 commit comments