1- import type {
2- CharacterRange ,
3- GeneralizedRange ,
4- LineRange ,
5- Message ,
6- SpyIDERecordedValues ,
7- } from ".." ;
1+ import type { CharacterRange , GeneralizedRange , LineRange } from ".." ;
82import { FlashStyle , isLineRange } from ".." ;
93import { Token } from "../types/Token" ;
104import { Selection } from "../types/Selection" ;
@@ -27,22 +21,16 @@ export type CharacterRangePlainObject = {
2721
2822export type GeneralizedRangePlainObject = CharacterRangePlainObject | LineRange ;
2923
30- interface PlainFlashDescriptor {
24+ export interface PlainFlashDescriptor {
3125 style : keyof typeof FlashStyle ;
3226 range : GeneralizedRangePlainObject ;
3327}
3428
35- interface PlainHighlight {
29+ export interface PlainHighlight {
3630 highlightId : string | undefined ;
3731 ranges : GeneralizedRangePlainObject [ ] ;
3832}
3933
40- export interface PlainSpyIDERecordedValues {
41- messages : Message [ ] | undefined ;
42- flashes : PlainFlashDescriptor [ ] | undefined ;
43- highlights : PlainHighlight [ ] | undefined ;
44- }
45-
4634export type SelectionPlainObject = {
4735 anchor : PositionPlainObject ;
4836 active : PositionPlainObject ;
@@ -148,21 +136,3 @@ export function characterRangeToPlainObject(
148136 end : positionToPlainObject ( range . end ) ,
149137 } ;
150138}
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