@@ -342,6 +342,18 @@ export class SpacesVisitor<P> extends JavaScriptVisitor<P> {
342342 } ) ;
343343 }
344344
345+ protected async visitTypeDeclaration ( typeDeclaration : JS . TypeDeclaration , p : P ) : Promise < J | undefined > {
346+ const ret = await super . visitTypeDeclaration ( typeDeclaration , p ) as JS . TypeDeclaration ;
347+ return produce ( ret , draft => {
348+ if ( draft . modifiers . length > 0 ) {
349+ draft . name . before . whitespace = " " ;
350+ }
351+ draft . name . element . prefix . whitespace = " " ;
352+ draft . initializer . before . whitespace = this . style . aroundOperators . assignment ? " " : "" ;
353+ draft . initializer . element . prefix . whitespace = this . style . aroundOperators . assignment ? " " : "" ;
354+ } ) ;
355+ }
356+
345357 protected async visitTypeInfo ( typeInfo : JS . TypeInfo , p : P ) : Promise < J | undefined > {
346358 const ret = await super . visitTypeInfo ( typeInfo , p ) as JS . TypeInfo ;
347359 return produceAsync ( ret , async draft => {
@@ -794,6 +806,16 @@ export class MinimumViableSpacingVisitor<P> extends JavaScriptVisitor<P> {
794806 } ) ;
795807 }
796808
809+ protected async visitTypeDeclaration ( typeDeclaration : JS . TypeDeclaration , p : P ) : Promise < J | undefined > {
810+ const ret = await super . visitTypeDeclaration ( typeDeclaration , p ) as JS . TypeDeclaration ;
811+ return produce ( ret , draft => {
812+ if ( draft . modifiers . length > 0 ) {
813+ draft . name . before . whitespace = " " ;
814+ }
815+ draft . name . element . prefix . whitespace = " " ;
816+ } ) ;
817+ }
818+
797819 protected async visitVariableDeclarations ( v : J . VariableDeclarations , p : P ) : Promise < J | undefined > {
798820 let ret = await super . visitVariableDeclarations ( v , p ) as J . VariableDeclarations ;
799821 let first = ret . leadingAnnotations . length === 0 ;
0 commit comments