import type * as d from '../../declarations' ; import ts from 'typescript' ; export const updateComponentClass = ( transformOpts , classNode , heritageClauses , members ) => { let classModifiers = Array . isArray ( classNode . modifiers ) ? classNode . modifiers . slice ( ) : [ ] ; if ( transformOpts . module === 'cjs' ) { if ( transformOpts . componentExport === 'customelement' ) { classModifiers = classModifiers . filter ( ( m ) => { return m . kind !== ts . SyntaxKind . ExportKeyword ; } ) ; } return ts . updateClassDeclaration ( classNode , classNode . decorators , classModifiers , classNode . name , classNode . typeParameters , heritageClauses , members ) ; } return createConstClass ( transformOpts , classNode , heritageClauses , members ) ; } ; const createConstClass = ( transformOpts , classNode , heritageClauses , members ) => { const className = classNode . name ; const classModifiers = ( Array . isArray ( classNode . modifiers ) ? classNode . modifiers : [ ] ) . filter ( ( m ) => { return m . kind !== ts . SyntaxKind . ExportKeyword ; } ) ; const constModifiers = [ ] ; if ( transformOpts . componentExport !== 'customelement' ) { constModifiers . push ( ts . createModifier ( ts . SyntaxKind . ExportKeyword ) ) ; } return ts . createVariableStatement ( constModifiers , ts . createVariableDeclarationList ( [ ts . createVariableDeclaration ( className , undefined , ts . createClassExpression ( classModifiers , undefined , classNode . typeParameters , heritageClauses , members ) ) , ] , ts . NodeFlags . Let ) ) ; } ;