Fix compiler and type safety issues
Compiler was complaining about `branch` not being a known property of
dataset.
We are declaring the interface such that property renaming is prevented
during js compilation.
Change-Id: I52a032eb94f6c1315ab5d312c1d3fc91707e912f
diff --git a/web/automerger.ts b/web/automerger.ts
index f34f5d9..96bcab5 100644
--- a/web/automerger.ts
+++ b/web/automerger.ts
@@ -27,12 +27,12 @@
// export for testing only
export type ConfigMap = {[branch: string]: boolean};
-export interface UIActionInfo extends ActionInfo {
+export declare interface UIActionInfo extends ActionInfo {
__key: string;
__url?: string;
}
-interface PopupPluginApiExtended extends PopupPluginApi {
+export interface PopupPluginApiExtended extends PopupPluginApi {
// TODO: Remove this reference to a private method. This can break any time.
_getElement: () => HTMLElement;
}
@@ -131,7 +131,7 @@
document.querySelectorAll('[data-branch]').forEach(relChange => {
if (!(relChange instanceof HTMLElement)) return;
if (!this.change) return;
- const relatedBranch = relChange.dataset.branch;
+ const relatedBranch = relChange.dataset['branch'];
if (relatedBranch === this.change.branch) {
relChange.style.fontWeight = 'bold';
} else {