1
- import type {
2
- CharacterRange ,
3
- GeneralizedRange ,
4
- LineRange ,
5
- Message ,
6
- SpyIDERecordedValues ,
7
- } from ".." ;
1
+ import type { CharacterRange , GeneralizedRange , LineRange } from ".." ;
8
2
import { FlashStyle , isLineRange } from ".." ;
9
3
import { Token } from "../types/Token" ;
10
4
import { Selection } from "../types/Selection" ;
@@ -27,22 +21,16 @@ export type CharacterRangePlainObject = {
27
21
28
22
export type GeneralizedRangePlainObject = CharacterRangePlainObject | LineRange ;
29
23
30
- interface PlainFlashDescriptor {
24
+ export interface PlainFlashDescriptor {
31
25
style : keyof typeof FlashStyle ;
32
26
range : GeneralizedRangePlainObject ;
33
27
}
34
28
35
- interface PlainHighlight {
29
+ export interface PlainHighlight {
36
30
highlightId : string | undefined ;
37
31
ranges : GeneralizedRangePlainObject [ ] ;
38
32
}
39
33
40
- export interface PlainSpyIDERecordedValues {
41
- messages : Message [ ] | undefined ;
42
- flashes : PlainFlashDescriptor [ ] | undefined ;
43
- highlights : PlainHighlight [ ] | undefined ;
44
- }
45
-
46
34
export type SelectionPlainObject = {
47
35
anchor : PositionPlainObject ;
48
36
active : PositionPlainObject ;
@@ -148,21 +136,3 @@ export function characterRangeToPlainObject(
148
136
end : positionToPlainObject ( range . end ) ,
149
137
} ;
150
138
}
151
-
152
- export function spyIDERecordedValuesToPlainObject (
153
- input : SpyIDERecordedValues ,
154
- ) : PlainSpyIDERecordedValues {
155
- return {
156
- messages : input . messages ,
157
- flashes : input . flashes ?. map ( ( descriptor ) => ( {
158
- style : descriptor . style ,
159
- range : generalizedRangeToPlainObject ( descriptor . range ) ,
160
- } ) ) ,
161
- highlights : input . highlights ?. map ( ( highlight ) => ( {
162
- highlightId : highlight . highlightId ,
163
- ranges : highlight . ranges . map ( ( range ) =>
164
- generalizedRangeToPlainObject ( range ) ,
165
- ) ,
166
- } ) ) ,
167
- } ;
168
- }
0 commit comments