++ */const se={target:ae.ScriptTarget.ES2021,module:ae.ModuleKind.ESNext,experimentalDecorators:!0,skipDefaultLibCheck:!0,skipLibCheck:!0,allowJs:!0,moduleResolution:ae.ModuleResolutionKind.NodeNext,jsx:ae.JsxEmit.ReactJSX,jsxImportSource:"@ui5/webcomponents-base",lib:["dom","esnext"]};class ce{constructor(){this.compilerOptions=se,this.serviceHost=new _e(self.origin,se),this.service=ae.createLanguageService(this.serviceHost,ae.createDocumentRegistry())}}class _e{constructor(e,t){this.files=new Map,this.packageRoot=e,this.compilerOptions=t}updateFileContentIfNeeded(e,t){const n=this.files.get(e);n&&n.content!==t?(n.content=t,n.version+=1):this.files.set(e,{content:t,version:0})}sync(e){e.forEach(((e,t)=>this.updateFileContentIfNeeded(t,e))),this._removeDeletedFiles(e)}_removeDeletedFiles(e){this.getScriptFileNames().forEach((t=>{t.includes("node_modules")||e.has(t)||this.files.delete(t)}))}getCompilationSettings(){return this.compilerOptions}getScriptFileNames(){return[...this.files.keys()]}getScriptVersion(e){var t,n;return null!==(n=null===(t=this.files.get(e))||void 0===t?void 0:t.version.toString())&&void 0!==n?n:"-1"}fileExists(e){return this.files.has(e)}readFile(e){var t;return null===(t=this.files.get(e))||void 0===t?void 0:t.content}getScriptSnapshot(e){if(this.fileExists(e))return ae.ScriptSnapshot.fromString(this.readFile(e))}getCurrentDirectory(){return this.packageRoot}getDefaultLibFileName(){return"__lib.d.ts"}}
0 commit comments