Fix up a bunch of typescript issues
These came to light with the typescript compiler upgrade that is
coming up soon with the bazel upgrade.
A lot of the changes in this patch arose from the changes in the
imports. For some reason we can no longer import modules the way we
used to. I'm not really sure how it ever worked. The upstream
documentation agrees with the changes we had to make here. It's
possible that the old version of typescript simply did things
differently when it comes to importing modules.
Change-Id: I054b5269c90cc94276e9f856d8cd79c8de2946f2
diff --git a/aos/network/www/config_handler.ts b/aos/network/www/config_handler.ts
index 8670c0a..a65d2fa 100644
--- a/aos/network/www/config_handler.ts
+++ b/aos/network/www/config_handler.ts
@@ -1,7 +1,13 @@
-import {aos.Configuration as Configuration, aos.Channel as Channel} from 'aos/configuration_generated';
-import {Connect} from 'aos/network/connect_generated';
+import * as configuration from 'org_frc971/aos/configuration_generated';
+import * as connect from 'org_frc971/aos/network/connect_generated';
+import * as flatbuffers_builder from 'org_frc971/external/com_github_google_flatbuffers/ts/builder';
+
import {Connection} from './proxy';
+import Configuration = configuration.aos.Configuration;
+import Channel = configuration.aos.Channel;
+import Connect = connect.aos.message_bridge.Connect;
+
export class ConfigHandler {
private readonly root_div = document.createElement('div');
private readonly tree_div;
@@ -54,7 +60,8 @@
handleChange() {
const toggles = this.root_div.getElementsByTagName('input');
- const builder = new flatbuffers.Builder(512);
+ const builder =
+ new flatbuffers_builder.Builder(512) as unknown as flatbuffers.Builder;
const channels: flatbuffers.Offset[] = [];
for (const toggle of toggles) {