88 *
99 * For example, mapping known exports into a list of manifest declarations.
1010 */
11- import * as tsModule from ' typescript' ;
12- import { isSimpleType , toSimpleType } from ' ts-simple-type' ;
13- import { ComponentDeclaration } from ' ../../analyze/types/component-declaration' ;
11+ import * as tsModule from " typescript" ;
12+ import { isSimpleType , toSimpleType } from " ts-simple-type" ;
13+ import { ComponentDeclaration } from " ../../analyze/types/component-declaration" ;
1414import {
1515 getMixinHeritageClauses ,
1616 getSuperclassHeritageClause
17- } from ' ../../analyze/util/component-declaration-util' ;
18- import { findParent , getNodeName } from ' ../../analyze/util/ast-util' ;
19- import { getJsDoc } from ' ../../analyze/util/js-doc-util' ;
20- import { getTypeHintFromType } from ' ../../util/get-type-hint-from-type' ;
21- import { AnalyzerResult } from ' ../../analyze/types/analyzer-result' ;
22- import * as schema from ' custom-elements-manifest' ;
23- import { TransformerContext } from ' ../transformer-context' ;
17+ } from " ../../analyze/util/component-declaration-util" ;
18+ import { findParent , getNodeName } from " ../../analyze/util/ast-util" ;
19+ import { getJsDoc } from " ../../analyze/util/js-doc-util" ;
20+ import { getTypeHintFromType } from " ../../util/get-type-hint-from-type" ;
21+ import { AnalyzerResult } from " ../../analyze/types/analyzer-result" ;
22+ import * as schema from " custom-elements-manifest" ;
23+ import { TransformerContext } from " ../transformer-context" ;
2424import {
2525 typeToSchemaType ,
2626 getSummaryFromJsDoc ,
2727 getParameterFromJsDoc ,
2828 getReturnFromJsDoc ,
2929 getReferenceFromHeritageClause ,
3030 getInheritedFromReference
31- } from ' ./utils' ;
31+ } from " ./utils" ;
3232
3333/**
3434 * Computes the exported symbols of a result (e.g. variables, functions, etc.)
@@ -60,7 +60,7 @@ function* getExportedDeclarationsFromResult(
6060 const jsDoc = getJsDoc ( variableStatement , tsModule ) ;
6161
6262 yield {
63- kind : ' variable' ,
63+ kind : " variable" ,
6464 name : node . name . getText ( ) ,
6565 description : jsDoc ?. description ,
6666 type : typeToSchemaType ( context , context . checker . getTypeAtLocation ( node ) ) ,
@@ -101,7 +101,7 @@ function* getExportedDeclarationsFromResult(
101101 const { description : returnDescription , typeHint : returnTypeHint } = getReturnFromJsDoc ( jsDoc ) ;
102102
103103 yield {
104- kind : ' function' ,
104+ kind : " function" ,
105105 name : node . name . getText ( ) ,
106106 description : jsDoc ?. description ,
107107 summary : getSummaryFromJsDoc ( jsDoc ) ,
@@ -124,11 +124,11 @@ function* getClassFieldsForComponent(
124124 declaration : ComponentDeclaration ,
125125 context : TransformerContext
126126) : IterableIterator < schema . ClassField > {
127- const visibility = context . config . visibility ?? ' public' ;
127+ const visibility = context . config . visibility ?? " public" ;
128128 for ( const member of declaration . members ) {
129129 if ( member . visibility === visibility && member . propName != null ) {
130130 yield {
131- kind : ' field' ,
131+ kind : " field" ,
132132 name : member . propName ,
133133 privacy : member . visibility ,
134134 description : member . jsDoc ?. description ,
@@ -151,7 +151,7 @@ function* getMethodsForComponent(
151151 declaration : ComponentDeclaration ,
152152 context : TransformerContext
153153) : IterableIterator < schema . ClassMethod > {
154- const visibility = context . config . visibility ?? ' public' ;
154+ const visibility = context . config . visibility ?? " public" ;
155155 for ( const method of declaration . methods ) {
156156 const parameters : schema . Parameter [ ] = [ ] ;
157157 const node = method . node ;
@@ -190,7 +190,7 @@ function* getMethodsForComponent(
190190 ) ;
191191
192192 yield {
193- kind : ' method' ,
193+ kind : " method" ,
194194 name : method . name ,
195195 privacy : method . visibility ,
196196 description : method . jsDoc ?. description ,
@@ -228,20 +228,20 @@ function* getEventsFromComponent(
228228 declaration : ComponentDeclaration ,
229229 context : TransformerContext
230230) : IterableIterator < schema . Event > {
231- const visibility = context . config . visibility ?? ' public' ;
231+ const visibility = context . config . visibility ?? " public" ;
232232 for ( const event of declaration . events ) {
233233 if ( event . visibility === visibility ) {
234- const type = event . type ?.( ) ?? { kind : ' ANY' } ;
234+ const type = event . type ?.( ) ?? { kind : " ANY" } ;
235235 const simpleType = isSimpleType ( type ) ? type : toSimpleType ( type , context . checker ) ;
236236 const typeName =
237- simpleType . kind === ' GENERIC_ARGUMENTS' ? simpleType . target . name : simpleType . name ;
237+ simpleType . kind === " GENERIC_ARGUMENTS" ? simpleType . target . name : simpleType . name ;
238238 yield {
239239 description : event . jsDoc ?. description ,
240240 name : event . name ,
241241 inheritedFrom : getInheritedFromReference ( declaration , event , context ) ,
242242 type :
243- typeName === null || typeName === undefined || simpleType . kind === ' ANY'
244- ? { text : ' Event' }
243+ typeName === null || typeName === undefined || simpleType . kind === " ANY"
244+ ? { text : " Event" }
245245 : { text : typeName }
246246 } ;
247247 }
@@ -260,7 +260,7 @@ function* getSlotsFromComponent(
260260 for ( const slot of declaration . slots ) {
261261 yield {
262262 description : slot . jsDoc ?. description ,
263- name : slot . name ?? ''
263+ name : slot . name ?? ""
264264 } ;
265265 }
266266}
@@ -274,7 +274,7 @@ function* getAttributesFromComponent(
274274 declaration : ComponentDeclaration ,
275275 context : TransformerContext
276276) : IterableIterator < schema . Attribute > {
277- const visibility = context . config . visibility ?? ' public' ;
277+ const visibility = context . config . visibility ?? " public" ;
278278 for ( const member of declaration . members ) {
279279 if ( member . visibility === visibility && member . attrName ) {
280280 const type = getTypeHintFromType (
@@ -341,7 +341,7 @@ function getDeclarationForComponent(
341341 result : AnalyzerResult ,
342342 context : TransformerContext
343343) : schema . Declaration | undefined {
344- if ( declaration . kind === ' interface' ) {
344+ if ( declaration . kind === " interface" ) {
345345 return undefined ;
346346 }
347347
@@ -364,7 +364,7 @@ function getDeclarationForComponent(
364364 }
365365
366366 const classDecl : schema . ClassDeclaration = {
367- kind : ' class' ,
367+ kind : " class" ,
368368 name,
369369 superclass : superClass ,
370370 mixins : mixins . length > 0 ? mixins : undefined ,
0 commit comments