wip: move type declarations out of setup
This commit is contained in:
		
							parent
							
								
									c0d86070fd
								
							
						
					
					
						commit
						a44d53003e
					
				| @ -344,10 +344,17 @@ export function compileScriptSetup( | |||||||
|     ) { |     ) { | ||||||
|       const index = node.id.start! + startOffset |       const index = node.id.start! + startOffset | ||||||
|       s.overwrite(index, index + emitVar.length, '__emit__') |       s.overwrite(index, index + emitVar.length, '__emit__') | ||||||
|       s.move(start, end, 0) |  | ||||||
|       emitType = `typeof __emit__` |       emitType = `typeof __emit__` | ||||||
|       extractEmits(node, typeDeclaredEmits) |       extractEmits(node, typeDeclaredEmits) | ||||||
|     } |     } | ||||||
|  | 
 | ||||||
|  |     // move all type declarations to outer scope
 | ||||||
|  |     if ( | ||||||
|  |       node.type.startsWith('TS') || | ||||||
|  |       (node.type === 'ExportNamedDeclaration' && node.exportKind === 'type') | ||||||
|  |     ) { | ||||||
|  |       s.move(start, end, 0) | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // check default export to make sure it doesn't reference setup scope
 |   // check default export to make sure it doesn't reference setup scope
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user