fix(ts_web): resolve TypeScript nullability and event typing issues across web components
This commit is contained in:
@@ -203,7 +203,7 @@ export class DeesDataviewCodebox extends DeesElement {
|
||||
</style>
|
||||
<div
|
||||
class="mainbox"
|
||||
@contextmenu="${(eventArg) => {
|
||||
@contextmenu="${(eventArg: MouseEvent) => {
|
||||
DeesContextmenu.openContextMenuWithOptions(eventArg, [
|
||||
{
|
||||
name: 'About',
|
||||
@@ -241,7 +241,7 @@ export class DeesDataviewCodebox extends DeesElement {
|
||||
private codeToDisplayStore = '';
|
||||
private highlightJs: HLJSApi | null = null;
|
||||
|
||||
public async updated(_changedProperties) {
|
||||
public async updated(_changedProperties: Map<string, any>) {
|
||||
super.updated(_changedProperties);
|
||||
console.log('highlighting now');
|
||||
console.log(this.childNodes);
|
||||
@@ -267,11 +267,11 @@ export class DeesDataviewCodebox extends DeesElement {
|
||||
this.highlightJs = await DeesServiceLibLoader.getInstance().loadHighlightJs();
|
||||
}
|
||||
|
||||
const localCodeNode = this.shadowRoot.querySelector('code');
|
||||
const localCodeNode = this.shadowRoot!.querySelector('code');
|
||||
const highlightedHtml = this.highlightJs.highlight(this.codeToDisplayStore, {
|
||||
language: this.progLang,
|
||||
ignoreIllegals: true,
|
||||
});
|
||||
localCodeNode.innerHTML = highlightedHtml.value;
|
||||
localCodeNode!.innerHTML = highlightedHtml.value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user