@@ -19,12 +19,15 @@ import {customElement} from 'lit/decorators.js';
19
19
import { makeObservable , observable } from 'mobx' ;
20
20
21
21
import { 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' ;
23
23
import { MultiSegmentAnnotations , TextSegment } from '../lib/lit_types' ;
24
24
import { styles as sharedStyles } from '../lib/shared_styles.css' ;
25
25
import { type IndexedInput , ModelInfoMap , Spec } from '../lib/types' ;
26
26
import { doesOutputSpecContain , filterToKeys , findSpecKeys } from '../lib/utils' ;
27
27
28
+ // This should be removed.
29
+ type AnyDuringMigration = any ;
30
+
28
31
/** LIT module for model output. */
29
32
@customElement ( 'annotated-text-gold-module' )
30
33
export class AnnotatedTextGoldModule extends LitModule {
@@ -53,13 +56,15 @@ export class AnnotatedTextGoldModule extends LitModule {
53
56
// Text segment fields
54
57
const segmentNames = findSpecKeys ( dataSpec , TextSegment ) ;
55
58
const segments : TextSegments = filterToKeys ( input . data , segmentNames ) ;
56
- const segmentSpec = filterToKeys ( dataSpec , segmentNames ) ;
59
+ const segmentSpec : SegmentSpec =
60
+ filterToKeys ( dataSpec , segmentNames ) as AnyDuringMigration ;
57
61
58
62
// Annotation fields
59
63
const annotationNames = findSpecKeys ( dataSpec , MultiSegmentAnnotations ) ;
60
64
const annotations : AnnotationGroups =
61
65
filterToKeys ( input . data , annotationNames ) ;
62
- const annotationSpec = filterToKeys ( dataSpec , annotationNames ) ;
66
+ const annotationSpec : AnnotationSpec =
67
+ filterToKeys ( dataSpec , annotationNames ) as AnyDuringMigration ;
63
68
64
69
// If more than one model is selected, AnnotatedTextModule will be offset
65
70
// vertically due to the model name header, while this one won't be.
@@ -149,12 +154,15 @@ export class AnnotatedTextModule extends LitModule {
149
154
findSpecKeys ( this . appState . currentDatasetSpec , TextSegment ) ;
150
155
const segments : TextSegments =
151
156
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 ;
154
160
155
161
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 ;
158
166
// clang-format off
159
167
return html `
160
168
< annotated-text-vis .segments =${ segments }
0 commit comments