@@ -5,10 +5,14 @@ import { baseWarn, pluckModuleFunction } from '../helpers'
5
5
import baseDirectives from '../directives/index'
6
6
import { camelize , no } from 'shared/util'
7
7
8
+ type TransformFunction = ( el : ASTElement , code : string ) => string
9
+ type DataGenFunction = ( el : ASTElement ) => string
10
+ type DirctiveFunction = ( el : ASTElement , dir : ASTDirective , warn : Function ) => boolean
11
+
8
12
// configurable state
9
13
let warn
10
- let transforms
11
- let dataGenFns
14
+ let transforms : Array < TransformFunction >
15
+ let dataGenFns : Array < DataGenFunction >
12
16
let platformDirectives
13
17
let isPlatformReservedTag
14
18
let staticRenderFns
@@ -225,7 +229,7 @@ function genDirectives (el: ASTElement): string | void {
225
229
for ( i = 0 , l = dirs . length ; i < l ; i ++ ) {
226
230
dir = dirs [ i ]
227
231
needRuntime = true
228
- const gen = platformDirectives [ dir . name ] || baseDirectives [ dir . name ]
232
+ const gen : DirctiveFunction = platformDirectives [ dir . name ] || baseDirectives [ dir . name ]
229
233
if ( gen ) {
230
234
// compile-time directive that manipulates AST.
231
235
// returns true if it also needs a runtime counterpart.
@@ -317,11 +321,11 @@ function getNormalizationType (children): number {
317
321
return 0
318
322
}
319
323
320
- function needsNormalization ( el ) {
324
+ function needsNormalization ( el : ASTElement ) {
321
325
return el . for || el . tag === 'template' || el . tag === 'slot'
322
326
}
323
327
324
- function maybeComponent ( el ) {
328
+ function maybeComponent ( el : ASTElement ) {
325
329
return el . type === 1 && ! isPlatformReservedTag ( el . tag )
326
330
}
327
331
0 commit comments