@@ -19,12 +19,15 @@ import {customElement} from 'lit/decorators.js';
1919import { makeObservable , observable } from 'mobx' ;
2020
2121import { LitModule } from '../core/lit_module' ;
22- import { type AnnotationGroups , TextSegments } from '../elements/annotated_text_vis' ;
22+ import { type AnnotationGroups , type AnnotationSpec , type SegmentSpec , TextSegments } from '../elements/annotated_text_vis' ;
2323import { MultiSegmentAnnotations , TextSegment } from '../lib/lit_types' ;
2424import { styles as sharedStyles } from '../lib/shared_styles.css' ;
2525import { type IndexedInput , ModelInfoMap , Spec } from '../lib/types' ;
2626import { doesOutputSpecContain , filterToKeys , findSpecKeys } from '../lib/utils' ;
2727
28+ // This should be removed.
29+ type AnyDuringMigration = any ;
30+
2831/** LIT module for model output. */
2932@customElement ( 'annotated-text-gold-module' )
3033export class AnnotatedTextGoldModule extends LitModule {
@@ -53,13 +56,15 @@ export class AnnotatedTextGoldModule extends LitModule {
5356 // Text segment fields
5457 const segmentNames = findSpecKeys ( dataSpec , TextSegment ) ;
5558 const segments : TextSegments = filterToKeys ( input . data , segmentNames ) ;
56- const segmentSpec = filterToKeys ( dataSpec , segmentNames ) ;
59+ const segmentSpec : SegmentSpec =
60+ filterToKeys ( dataSpec , segmentNames ) as AnyDuringMigration ;
5761
5862 // Annotation fields
5963 const annotationNames = findSpecKeys ( dataSpec , MultiSegmentAnnotations ) ;
6064 const annotations : AnnotationGroups =
6165 filterToKeys ( input . data , annotationNames ) ;
62- const annotationSpec = filterToKeys ( dataSpec , annotationNames ) ;
66+ const annotationSpec : AnnotationSpec =
67+ filterToKeys ( dataSpec , annotationNames ) as AnyDuringMigration ;
6368
6469 // If more than one model is selected, AnnotatedTextModule will be offset
6570 // vertically due to the model name header, while this one won't be.
@@ -149,12 +154,15 @@ export class AnnotatedTextModule extends LitModule {
149154 findSpecKeys ( this . appState . currentDatasetSpec , TextSegment ) ;
150155 const segments : TextSegments =
151156 filterToKeys ( this . currentData . data , segmentNames ) ;
152- const segmentSpec =
153- filterToKeys ( this . appState . currentDatasetSpec , segmentNames ) ;
157+ const segmentSpec : SegmentSpec =
158+ filterToKeys ( this . appState . currentDatasetSpec , segmentNames ) as
159+ AnyDuringMigration ;
154160
155161 const outputSpec = this . appState . getModelSpec ( this . model ) . output ;
156- const annotationSpec = filterToKeys (
157- outputSpec , findSpecKeys ( outputSpec , MultiSegmentAnnotations ) ) ;
162+ const annotationSpec : AnnotationSpec =
163+ filterToKeys (
164+ outputSpec , findSpecKeys ( outputSpec , MultiSegmentAnnotations ) ) as
165+ AnyDuringMigration ;
158166 // clang-format off
159167 return html `
160168 < annotated-text-vis .segments =${ segments }
0 commit comments