@@ -8,7 +8,8 @@ import { EventDeclaration } from "../../../analyze/types/event-types";
8
8
import { JsDoc } from "../../../analyze/types/js-doc" ;
9
9
import { flatten } from "../../util" ;
10
10
import { WcaCliConfig } from "../../wca-cli-arguments" ;
11
- import { HtmlData , HtmlDataAttribute , HtmlDataEvent , HtmlDataProperty , HtmlDataSlot , HtmlDataTag } from "./vscode-html-data" ;
11
+ import { HtmlData , HtmlDataAttribute , HtmlDataEvent , HtmlDataProperty , HtmlDataSlot , HtmlDataTag , HtmlDataCssProperty } from "./vscode-html-data" ;
12
+ import { ComponentCSSProperty } from "../../../analyze" ;
12
13
13
14
/**
14
15
* Transforms results to json.
@@ -49,15 +50,26 @@ function definitionToHtmlDataTag(definition: ComponentDefinition, checker: TypeC
49
50
const slots = definition . declaration . slots
50
51
. map ( e => componentSlotToHtmlDataSlot ( e , checker ) )
51
52
. filter ( ( val ) : val is NonNullable < typeof val > => val != null ) ;
52
-
53
+ const cssProperties = definition . declaration . cssProperties
54
+ . map ( p => componentCssPropToHtmlCssProp ( p , checker ) )
55
+ . filter ( ( val ) : val is NonNullable < typeof val > => val != null ) ;
53
56
return {
54
57
name : definition . tagName ,
55
58
description : getDescriptionFromJsDoc ( definition . declaration . jsDoc ) ,
56
59
jsDoc : getJsDocTextFromJsDoc ( definition . declaration . jsDoc ) ,
57
60
attributes,
58
61
properties,
59
62
events,
60
- slots
63
+ slots,
64
+ cssProperties
65
+ } ;
66
+ }
67
+
68
+ function componentCssPropToHtmlCssProp ( prop : ComponentCSSProperty , checker : TypeChecker ) : HtmlDataCssProperty | undefined {
69
+ return {
70
+ name : prop . name || "" ,
71
+ description : getDescriptionFromJsDoc ( prop . jsDoc ) ,
72
+ jsDoc : getJsDocTextFromJsDoc ( prop . jsDoc )
61
73
} ;
62
74
}
63
75
0 commit comments