@@ -19,7 +19,7 @@ import { add_event_handler } from '../shared/add_event_handlers';
1919import { add_action } from '../shared/add_actions' ;
2020import bind_this from '../shared/bind_this' ;
2121import { is_head } from '../shared/is_head' ;
22- import { Identifier , ExpressionStatement , CallExpression } from 'estree' ;
22+ import { Identifier , ExpressionStatement , CallExpression , Node } from 'estree' ;
2323import EventHandler from './EventHandler' ;
2424import { extract_names } from 'periscopic' ;
2525import Action from '../../../nodes/Action' ;
@@ -534,7 +534,7 @@ export default class ElementWrapper extends Wrapper {
534534 . filter ( ( attr ) => ! ( attr instanceof SpreadAttributeWrapper ) && ! attr . property_name )
535535 . map ( ( attr ) => p `${ ( attr as StyleAttributeWrapper | AttributeWrapper ) . name } : true` ) ;
536536
537- let reference ;
537+ let reference : string | ReturnType < typeof x > ;
538538 if ( this . node . tag_expr . node . type === 'Literal' ) {
539539 if ( this . node . namespace ) {
540540 reference = `"${ this . node . tag_expr . node . value } "` ;
@@ -634,7 +634,7 @@ export default class ElementWrapper extends Wrapper {
634634 // media bindings — awkward special case. The native timeupdate events
635635 // fire too infrequently, so we need to take matters into our
636636 // own hands
637- let animation_frame ;
637+ let animation_frame : Identifier | undefined ;
638638 if ( binding_group . events [ 0 ] === 'timeupdate' ) {
639639 animation_frame = block . get_unique_name ( `${ this . var . name } _animationframe` ) ;
640640 block . add_variable ( animation_frame ) ;
@@ -874,9 +874,7 @@ export default class ElementWrapper extends Wrapper {
874874 }
875875 }
876876
877- add_transitions (
878- block : Block
879- ) {
877+ add_transitions ( block : Block ) {
880878 const { intro, outro } = this . node ;
881879 if ( ! intro && ! outro ) return ;
882880
@@ -933,7 +931,7 @@ export default class ElementWrapper extends Wrapper {
933931
934932 const fn = this . renderer . reference ( intro . name ) ;
935933
936- let intro_block ;
934+ let intro_block : Node [ ] ;
937935
938936 if ( outro ) {
939937 intro_block = b `
@@ -1032,7 +1030,7 @@ export default class ElementWrapper extends Wrapper {
10321030 ${ outro && b `@add_transform(${ this . var } , ${ rect } );` }
10331031 ` ) ;
10341032
1035- let params ;
1033+ let params : Node | ReturnType < typeof x > ;
10361034 if ( this . node . animation . expression ) {
10371035 params = this . node . animation . expression . manipulate ( block ) ;
10381036
@@ -1060,8 +1058,8 @@ export default class ElementWrapper extends Wrapper {
10601058 const has_spread = this . node . attributes . some ( attr => attr . is_spread ) ;
10611059 this . node . classes . forEach ( class_directive => {
10621060 const { expression, name } = class_directive ;
1063- let snippet ;
1064- let dependencies ;
1061+ let snippet : Node | string ;
1062+ let dependencies : Set < string > ;
10651063 if ( expression ) {
10661064 snippet = expression . manipulate ( block ) ;
10671065 dependencies = expression . dependencies ;
@@ -1105,7 +1103,7 @@ export default class ElementWrapper extends Wrapper {
11051103 const { name, expression, should_cache } = style_directive ;
11061104
11071105 const snippet = expression . manipulate ( block ) ;
1108- let cached_snippet ;
1106+ let cached_snippet : Identifier | undefined ;
11091107 if ( should_cache ) {
11101108 cached_snippet = block . get_unique_name ( `style_${ name . replace ( regex_minus_signs , '_' ) } ` ) ;
11111109 block . add_variable ( cached_snippet , snippet ) ;
@@ -1136,7 +1134,7 @@ export default class ElementWrapper extends Wrapper {
11361134 } ) ;
11371135 }
11381136
1139- add_manual_style_scoping ( block ) {
1137+ add_manual_style_scoping ( block : Block ) {
11401138 if ( this . node . needs_manual_style_scoping ) {
11411139 const updater = b `@toggle_class(${ this . var } , "${ this . node . component . stylesheet . id } ", true);` ;
11421140 block . chunks . hydrate . push ( updater ) ;
@@ -1151,7 +1149,7 @@ const regex_dollar_signs = /\$/g;
11511149function to_html ( wrappers : Array < ElementWrapper | TextWrapper | MustacheTagWrapper | RawMustacheTagWrapper > , block : Block , literal : any , state : any , can_use_raw_text ?: boolean ) {
11521150 wrappers . forEach ( wrapper => {
11531151 if ( wrapper instanceof TextWrapper ) {
1154- // Don't add the <pre>/<textare > newline logic here because pre/textarea.innerHTML
1152+ // Don't add the <pre>/<textarea > newline logic here because pre/textarea.innerHTML
11551153 // would keep the leading newline, too, only someParent.innerHTML = '..<pre/textarea>..' won't
11561154
11571155 if ( ( wrapper as TextWrapper ) . use_space ( ) ) state . quasi . value . raw += ' ' ;
0 commit comments