1- /** @import { Program, Property, Statement, VariableDeclarator } from 'estree' */
1+ /** @import * as ESTree from 'estree' */
22/** @import { AST, ValidatedCompileOptions, ValidatedModuleCompileOptions } from '#compiler' */
33/** @import { ComponentServerTransformState, ComponentVisitors, ServerTransformState, Visitors } from './types.js' */
44/** @import { Analysis, ComponentAnalysis } from '../../types.js' */
@@ -86,7 +86,7 @@ const template_visitors = {
8686/**
8787 * @param {ComponentAnalysis } analysis
8888 * @param {ValidatedCompileOptions } options
89- * @returns {Program }
89+ * @returns {ESTree. Program }
9090 */
9191export function server_component ( analysis , options ) {
9292 /** @type {ComponentServerTransformState } */
@@ -106,11 +106,11 @@ export function server_component(analysis, options) {
106106 skip_hydration_boundaries : false
107107 } ;
108108
109- const module = /** @type {Program } */ (
109+ const module = /** @type {ESTree. Program } */ (
110110 walk ( /** @type {AST.SvelteNode } */ ( analysis . module . ast ) , state , global_visitors )
111111 ) ;
112112
113- const instance = /** @type {Program } */ (
113+ const instance = /** @type {ESTree. Program } */ (
114114 walk (
115115 /** @type {AST.SvelteNode } */ ( analysis . instance . ast ) ,
116116 { ...state , scopes : analysis . instance . scopes } ,
@@ -131,7 +131,7 @@ export function server_component(analysis, options) {
131131 )
132132 ) ;
133133
134- const template = /** @type {Program } */ (
134+ const template = /** @type {ESTree. Program } */ (
135135 walk (
136136 /** @type {AST.SvelteNode } */ ( analysis . template . ast ) ,
137137 { ...state , scopes : analysis . template . scopes } ,
@@ -140,7 +140,7 @@ export function server_component(analysis, options) {
140140 )
141141 ) ;
142142
143- /** @type {VariableDeclarator[] } */
143+ /** @type {ESTree. VariableDeclarator[] } */
144144 const legacy_reactive_declarations = [ ] ;
145145
146146 for ( const [ node ] of analysis . reactive_statements ) {
@@ -192,7 +192,7 @@ export function server_component(analysis, options) {
192192 b . function_declaration (
193193 b . id ( '$$render_inner' ) ,
194194 [ b . id ( '$$renderer' ) ] ,
195- b . block ( /** @type {Statement[] } */ ( rest ) )
195+ b . block ( /** @type {ESTree. Statement[] } */ ( rest ) )
196196 ) ,
197197 b . do_while (
198198 b . unary ( '!' , b . id ( '$$settled' ) ) ,
@@ -219,7 +219,7 @@ export function server_component(analysis, options) {
219219
220220 // Propagate values of bound props upwards if they're undefined in the parent and have a value.
221221 // Don't do this as part of the props retrieval because people could eagerly mutate the prop in the instance script.
222- /** @type {Property[] } */
222+ /** @type {ESTree. Property[] } */
223223 const props = [ ] ;
224224
225225 for ( const [ name , binding ] of analysis . instance . scope . declarations ) {
@@ -239,8 +239,8 @@ export function server_component(analysis, options) {
239239 }
240240
241241 let component_block = b . block ( [
242- .../** @type {Statement[] } */ ( instance . body ) ,
243- .../** @type {Statement[] } */ ( template . body )
242+ .../** @type {ESTree. Statement[] } */ ( instance . body ) ,
243+ .../** @type {ESTree. Statement[] } */ ( template . body )
244244 ] ) ;
245245
246246 if ( analysis . instance . has_await ) {
@@ -395,7 +395,7 @@ export function server_component(analysis, options) {
395395/**
396396 * @param {Analysis } analysis
397397 * @param {ValidatedModuleCompileOptions } options
398- * @returns {Program }
398+ * @returns {ESTree. Program }
399399 */
400400export function server_module ( analysis , options ) {
401401 /** @type {ServerTransformState } */
@@ -411,7 +411,7 @@ export function server_module(analysis, options) {
411411 state_fields : new Map ( )
412412 } ;
413413
414- const module = /** @type {Program } */ (
414+ const module = /** @type {ESTree. Program } */ (
415415 walk ( /** @type {AST.SvelteNode } */ ( analysis . module . ast ) , state , global_visitors )
416416 ) ;
417417
0 commit comments