Plumb published track data to track frontend

Track data lives in globals.trackDataStore, which currently is simply
Map<string, {}>. Track frontends now must implement a consumeData
method, which receives the published data by track controller. The
type of the published and consumed data is up to the tracks to
determine, and the core code currently makes no attempt at typechecking
that.


Change-Id: I47b3162d82b1cdee4debde8923fb74be953bc58c
diff --git a/ui/src/frontend/track.ts b/ui/src/frontend/track.ts
index f67d23e..38b6fce 100644
--- a/ui/src/frontend/track.ts
+++ b/ui/src/frontend/track.ts
@@ -13,23 +13,22 @@
 // limitations under the License.
 
 import {TrackState} from '../common/state';
+
 import {TimeScale} from './time_scale';
 import {VirtualCanvasContext} from './virtual_canvas_context';
 
 /**
- * This interface forces track implementations to have two static properties:
- * kind and a create function.
- *
- * Kindscript does not have abstract static members, which is why this needs to
- * be in a seperate interface. We need the |create| method because the stored
- * value in the registry is an abstract class, and we cannot call 'new'
- * on an abstract class.
+ * This interface forces track implementations to have some static properties.
+ * Typescript does not have abstract static members, which is why this needs to
+ * be in a seperate interface.
  */
 export interface TrackCreator {
   // Store the kind explicitly as a string as opposed to using class.kind in
   // case we ever minify our code.
   readonly kind: string;
 
+  // We need the |create| method because the stored value in the registry is an
+  // abstract class, and we cannot call 'new' on an abstract class.
   create(TrackState: TrackState): Track;
 }
 
@@ -37,6 +36,12 @@
  * The abstract class that needs to be implemented by all tracks.
  */
 export abstract class Track {
+  // TODO: Typecheck that arg of consumeData and published data for a Track has
+  // the same type.
+  /**
+   * Receive data published by the TrackController of this track.
+   */
+  abstract consumeData(trackData: {}): void;
   constructor(protected trackState: TrackState) {}
   abstract renderCanvas(
       vCtx: VirtualCanvasContext, width: number, timeScale: TimeScale,