Suppress warning about duplicate global declaration.

We want to have separate declaration to keep the files in separate js
bundles.

Also fix the incorrect usage of params that has been renamed to prefs,
and descrepancy between prefs being optional or not.

Release-Notes: skip
Change-Id: I252b3bba30cb9318c41ae24acf4a37f4c389907d
diff --git a/web/element/codemirror-element.ts b/web/element/codemirror-element.ts
index ee7b9bc..98dd811 100644
--- a/web/element/codemirror-element.ts
+++ b/web/element/codemirror-element.ts
@@ -17,6 +17,8 @@
     'content-change': ValueChangedEvent;
   }
   interface HTMLElementTagNameMap {
+    // @ts-ignore TS2717: Subsequent property declarations must have the same
+    // type.
     'codemirror-element': CodeMirrorElement;
   }
 }
diff --git a/web/element/codemirror-element_test.ts b/web/element/codemirror-element_test.ts
index ca8383e..86f3f4d 100644
--- a/web/element/codemirror-element_test.ts
+++ b/web/element/codemirror-element_test.ts
@@ -15,8 +15,8 @@
       html`<codemirror-element></codemirror-element>`
     );
     element.lineNum = 123;
-    element.params = {
-      matchBrackets: true,
+    element.prefs = {
+      match_brackets: true,
     };
     await element.updateComplete;
   });
diff --git a/web/gr-editor.ts b/web/gr-editor.ts
index 05e5dbd..b211a99 100644
--- a/web/gr-editor.ts
+++ b/web/gr-editor.ts
@@ -16,7 +16,7 @@
  */
 interface CodeMirrorElement extends HTMLElement {
   lineNum?: number;
-  prefs: unknown;
+  prefs?: unknown;
   fileContent?: string;
   fileType?: string;
 }
@@ -24,6 +24,8 @@
 declare global {
   interface HTMLElementTagNameMap {
     'gr-editor': GrEditor;
+    // @ts-ignore TS2717: Subsequent property declarations must have the same
+    // type.
     'codemirror-element': CodeMirrorElement;
   }
 }
diff --git a/web/gr-editor_test.ts b/web/gr-editor_test.ts
index d44f66a..613daa4 100644
--- a/web/gr-editor_test.ts
+++ b/web/gr-editor_test.ts
@@ -51,6 +51,6 @@
       'codemirror-element'
     );
     assert.equal(cmElement.lineNum, 123);
-    assert.isTrue(cmElement.params?.matchBrackets);
+    assert.isTrue(cmElement.prefs?.match_brackets);
   });
 });