1
- // Generated by atdts from type definitions in 'trace.atd'.
2
- //
3
- // Type-safe translations from/to JSON
4
- //
5
- // For each type 'Foo', there is a pair of functions:
6
- // - 'writeFoo': convert a 'Foo' value into a JSON-compatible value.
7
- // - 'readFoo': convert a JSON-compatible value into a TypeScript value
8
- // of type 'Foo'.
1
+ /*
2
+ Generated by atdts from type definitions in 'trace.atd'.
9
3
4
+ Type-safe translations from/to JSON
5
+
6
+ For each type 'Foo', there is a pair of functions:
7
+ - 'writeFoo': convert a 'Foo' value into a JSON-compatible value.
8
+ - 'readFoo': convert a JSON-compatible value into a TypeScript value
9
+ of type 'Foo'.
10
+ */
11
+
12
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
13
+ // @ts -nocheck
14
+ /* tslint:disable */
15
+ /* eslint-disable */
10
16
11
17
export type Item = {
12
18
kind : Kind [ ] ;
13
- goal_id : Int ;
14
- runtime_id : Int ;
15
- step : Int ;
19
+ goal_id : number /*int*/ ;
20
+ runtime_id : number /*int*/ ;
21
+ step : number /*int*/ ;
16
22
name : string ;
17
23
payload : string [ ] ;
18
24
}
@@ -89,9 +95,9 @@ export type Location =
89
95
90
96
export type FileLocation = {
91
97
filename : string ;
92
- line : Int ;
93
- column : Int ;
94
- character : Int ;
98
+ line : number /*int*/ ;
99
+ column : number /*int*/ ;
100
+ character : number /*int*/ ;
95
101
}
96
102
97
103
export type Event =
@@ -124,11 +130,11 @@ export type Frame = {
124
130
runtime_id : RuntimeId ;
125
131
}
126
132
127
- export type GoalId = Int
133
+ export type GoalId = number /*int*/
128
134
129
- export type StepId = Int
135
+ export type StepId = number /*int*/
130
136
131
- export type RuntimeId = Int
137
+ export type RuntimeId = number /*int*/
132
138
133
139
export type GoalText = string
134
140
@@ -786,8 +792,6 @@ export function readChrText(x: any, context: any = x): ChrText {
786
792
// Runtime library
787
793
/////////////////////////////////////////////////////////////////////
788
794
789
- export type Int = number
790
-
791
795
export type Option < T > = null | { value : T }
792
796
793
797
function _atd_missing_json_field ( type_name : string , json_field_name : string ) {
@@ -820,7 +824,7 @@ function _atd_bad_ts(expected_type: string, ts_value: any, context: any) {
820
824
` Occurs in '${ JSON . stringify ( context ) } '.` )
821
825
}
822
826
823
- function _atd_check_json_tuple ( len : Int , x : any , context : any ) {
827
+ function _atd_check_json_tuple ( len : number /*int*/ , x : any , context : any ) {
824
828
if ( ! Array . isArray ( x ) || x . length !== len )
825
829
_atd_bad_json ( 'tuple of length ' + len , x , context ) ;
826
830
}
@@ -843,7 +847,7 @@ function _atd_read_bool(x: any, context: any): boolean {
843
847
}
844
848
}
845
849
846
- function _atd_read_int ( x : any , context : any ) : Int {
850
+ function _atd_read_int ( x : any , context : any ) : number /*int*/ {
847
851
if ( Number . isInteger ( x ) )
848
852
return x
849
853
else {
@@ -1024,7 +1028,7 @@ function _atd_write_bool(x: any, context: any): boolean {
1024
1028
}
1025
1029
}
1026
1030
1027
- function _atd_write_int ( x : any , context : any ) : Int {
1031
+ function _atd_write_int ( x : any , context : any ) : number /*int*/ {
1028
1032
if ( Number . isInteger ( x ) )
1029
1033
return x
1030
1034
else {
@@ -1133,7 +1137,7 @@ function _atd_write_required_field<T>(type_name: string,
1133
1137
}
1134
1138
1135
1139
function _atd_write_optional_field < T > ( write_elt : ( x : T , context : any ) => any ,
1136
- x : T ,
1140
+ x : T | undefined ,
1137
1141
context : any ) : any {
1138
1142
if ( x === undefined || x === null )
1139
1143
return x
0 commit comments