@@ -73,6 +73,7 @@ export type SvelteNode =
73
73
| SvelteShorthandAttribute
74
74
| SvelteSpreadAttribute
75
75
| SvelteDirective
76
+ | SvelteStyleDirective
76
77
| SvelteSpecialDirective
77
78
| SvelteDirectiveKey
78
79
| SvelteSpecialDirectiveKey
@@ -179,6 +180,7 @@ export interface SvelteStartTag extends BaseNode {
179
180
| SvelteShorthandAttribute
180
181
| SvelteSpreadAttribute
181
182
| SvelteDirective
183
+ | SvelteStyleDirective
182
184
| SvelteSpecialDirective
183
185
) [ ]
184
186
selfClosing : boolean
@@ -263,6 +265,7 @@ interface BaseSvelteMustacheTag extends BaseNode {
263
265
| SvelteAwaitCatchBlock
264
266
| SvelteKeyBlock
265
267
| SvelteAttribute
268
+ | SvelteStyleDirective
266
269
}
267
270
/** Node of mustache tag. e.g. `{...}``. Like JSXExpressionContainer */
268
271
export interface SvelteMustacheTagText extends BaseSvelteMustacheTag {
@@ -506,7 +509,7 @@ export interface SvelteAttribute extends BaseNode {
506
509
type : "SvelteAttribute"
507
510
key : SvelteName
508
511
boolean : boolean
509
- value : ( SvelteLiteral | ( SvelteMustacheTag & { kind : "text" } ) ) [ ]
512
+ value : ( SvelteLiteral | SvelteMustacheTagText ) [ ]
510
513
parent : SvelteStartTag
511
514
}
512
515
/** Node of shorthand attribute. e.g. `<img {src}>` */
@@ -529,7 +532,6 @@ export type SvelteDirective =
529
532
| SvelteAnimationDirective
530
533
| SvelteBindingDirective
531
534
| SvelteClassDirective
532
- | SvelteStyleDirective
533
535
| SvelteEventHandlerDirective
534
536
| SvelteLetDirective
535
537
| SvelteRefDirective
@@ -538,7 +540,7 @@ export interface SvelteDirectiveKey extends BaseNode {
538
540
type : "SvelteDirectiveKey"
539
541
name : ESTree . Identifier | SvelteName
540
542
modifiers : string [ ]
541
- parent : SvelteDirective
543
+ parent : SvelteDirective | SvelteStyleDirective
542
544
}
543
545
544
546
interface BaseSvelteDirective extends BaseNode {
@@ -563,10 +565,6 @@ export interface SvelteClassDirective extends BaseSvelteDirective {
563
565
kind : "Class"
564
566
expression : null | ESTree . Expression
565
567
}
566
- export interface SvelteStyleDirective extends BaseSvelteDirective {
567
- kind : "Style"
568
- expression : null | ESTree . Expression | SvelteLiteral
569
- }
570
568
export interface SvelteEventHandlerDirective extends BaseSvelteDirective {
571
569
kind : "EventHandler"
572
570
expression : null | ESTree . Expression
@@ -585,6 +583,26 @@ export interface SvelteTransitionDirective extends BaseSvelteDirective {
585
583
outro : boolean
586
584
expression : null | ESTree . Expression
587
585
}
586
+
587
+ /** Node of style directive. e.g. `<input style:color />` */
588
+ export type SvelteStyleDirective =
589
+ | SvelteStyleDirectiveShorthand
590
+ | SvelteStyleDirectiveLongform
591
+ interface BaseSvelteStyleDirective extends BaseNode {
592
+ type : "SvelteStyleDirective"
593
+ key : SvelteDirectiveKey
594
+ value : ( SvelteLiteral | SvelteMustacheTagText ) [ ]
595
+ parent : SvelteStartTag
596
+ }
597
+ export interface SvelteStyleDirectiveShorthand
598
+ extends BaseSvelteStyleDirective {
599
+ shorthand : true
600
+ value : [ ]
601
+ }
602
+ export interface SvelteStyleDirectiveLongform extends BaseSvelteStyleDirective {
603
+ shorthand : false
604
+ value : ( SvelteLiteral | SvelteMustacheTagText ) [ ]
605
+ }
588
606
export interface SvelteSpecialDirectiveKey extends BaseNode {
589
607
type : "SvelteSpecialDirectiveKey"
590
608
parent : SvelteSpecialDirective
0 commit comments