JsModule { bom_token: missing (optional), interpreter_token: missing (optional), directives: JsDirectiveList [], items: JsModuleItemList [ TsDeclareStatement { declare_token: DECLARE_KW@0..8 "declare" [] [Whitespace(" ")], declaration: JsClassDeclaration { decorators: JsDecoratorList [], abstract_token: missing (optional), class_token: CLASS_KW@8..14 "class" [] [Whitespace(" ")], id: JsIdentifierBinding { name_token: IDENT@14..16 "T" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), l_curly_token: L_CURLY@16..18 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsBogusMember { items: [ TsPropertySignatureModifierList [ TsReadonlyModifier { modifier_token: READONLY_KW@18..27 "readonly" [] [Whitespace(" ")], }, ], JsLiteralMemberName { value: IDENT@27..28 "b" [] [], }, TsTypeAnnotation { colon_token: COLON@28..30 ":" [] [Whitespace(" ")], ty: TsStringType { string_token: STRING_KW@30..37 "string" [] [Whitespace(" ")], }, }, JsInitializerClause { eq_token: EQ@37..39 "=" [] [Whitespace(" ")], expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@39..45 "\"test\"" [] [], }, }, SEMICOLON@45..47 ";" [] [Whitespace(" ")], ], }, ], r_curly_token: R_CURLY@47..48 "}" [] [], }, }, JsClassDeclaration { decorators: JsDecoratorList [], abstract_token: missing (optional), class_token: CLASS_KW@48..55 "class" [Newline("\n")] [Whitespace(" ")], id: JsIdentifierBinding { name_token: IDENT@55..57 "T" [] [Whitespace(" ")], }, type_parameters: missing (optional), extends_clause: missing (optional), implements_clause: missing (optional), l_curly_token: L_CURLY@57..59 "{" [] [Whitespace(" ")], members: JsClassMemberList [ JsBogusMember { items: [ TsPropertySignatureModifierList [ TsDeclareModifier { modifier_token: DECLARE_KW@59..67 "declare" [] [Whitespace(" ")], }, TsReadonlyModifier { modifier_token: READONLY_KW@67..76 "readonly" [] [Whitespace(" ")], }, ], JsLiteralMemberName { value: IDENT@76..77 "b" [] [], }, TsTypeAnnotation { colon_token: COLON@77..79 ":" [] [Whitespace(" ")], ty: TsStringType { string_token: STRING_KW@79..86 "string" [] [Whitespace(" ")], }, }, JsInitializerClause { eq_token: EQ@86..88 "=" [] [Whitespace(" ")], expression: JsStringLiteralExpression { value_token: JS_STRING_LITERAL@88..94 "\"test\"" [] [], }, }, SEMICOLON@94..96 ";" [] [Whitespace(" ")], ], }, ], r_curly_token: R_CURLY@96..97 "}" [] [], }, ], eof_token: EOF@97..98 "" [Newline("\n")] [], } 0: JS_MODULE@0..98 0: (empty) 1: (empty) 2: JS_DIRECTIVE_LIST@0..0 3: JS_MODULE_ITEM_LIST@0..97 0: TS_DECLARE_STATEMENT@0..48 0: DECLARE_KW@0..8 "declare" [] [Whitespace(" ")] 1: JS_CLASS_DECLARATION@8..48 0: JS_DECORATOR_LIST@8..8 1: (empty) 2: CLASS_KW@8..14 "class" [] [Whitespace(" ")] 3: JS_IDENTIFIER_BINDING@14..16 0: IDENT@14..16 "T" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: (empty) 7: L_CURLY@16..18 "{" [] [Whitespace(" ")] 8: JS_CLASS_MEMBER_LIST@18..47 0: JS_BOGUS_MEMBER@18..47 0: TS_PROPERTY_SIGNATURE_MODIFIER_LIST@18..27 0: TS_READONLY_MODIFIER@18..27 0: READONLY_KW@18..27 "readonly" [] [Whitespace(" ")] 1: JS_LITERAL_MEMBER_NAME@27..28 0: IDENT@27..28 "b" [] [] 2: TS_TYPE_ANNOTATION@28..37 0: COLON@28..30 ":" [] [Whitespace(" ")] 1: TS_STRING_TYPE@30..37 0: STRING_KW@30..37 "string" [] [Whitespace(" ")] 3: JS_INITIALIZER_CLAUSE@37..45 0: EQ@37..39 "=" [] [Whitespace(" ")] 1: JS_STRING_LITERAL_EXPRESSION@39..45 0: JS_STRING_LITERAL@39..45 "\"test\"" [] [] 4: SEMICOLON@45..47 ";" [] [Whitespace(" ")] 9: R_CURLY@47..48 "}" [] [] 1: JS_CLASS_DECLARATION@48..97 0: JS_DECORATOR_LIST@48..48 1: (empty) 2: CLASS_KW@48..55 "class" [Newline("\n")] [Whitespace(" ")] 3: JS_IDENTIFIER_BINDING@55..57 0: IDENT@55..57 "T" [] [Whitespace(" ")] 4: (empty) 5: (empty) 6: (empty) 7: L_CURLY@57..59 "{" [] [Whitespace(" ")] 8: JS_CLASS_MEMBER_LIST@59..96 0: JS_BOGUS_MEMBER@59..96 0: TS_PROPERTY_SIGNATURE_MODIFIER_LIST@59..76 0: TS_DECLARE_MODIFIER@59..67 0: DECLARE_KW@59..67 "declare" [] [Whitespace(" ")] 1: TS_READONLY_MODIFIER@67..76 0: READONLY_KW@67..76 "readonly" [] [Whitespace(" ")] 1: JS_LITERAL_MEMBER_NAME@76..77 0: IDENT@76..77 "b" [] [] 2: TS_TYPE_ANNOTATION@77..86 0: COLON@77..79 ":" [] [Whitespace(" ")] 1: TS_STRING_TYPE@79..86 0: STRING_KW@79..86 "string" [] [Whitespace(" ")] 3: JS_INITIALIZER_CLAUSE@86..94 0: EQ@86..88 "=" [] [Whitespace(" ")] 1: JS_STRING_LITERAL_EXPRESSION@88..94 0: JS_STRING_LITERAL@88..94 "\"test\"" [] [] 4: SEMICOLON@94..96 ";" [] [Whitespace(" ")] 9: R_CURLY@96..97 "}" [] [] 4: EOF@97..98 "" [Newline("\n")] [] -- ts_annotated_property_initializer_ambient_context.ts:1:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × In ambient contexts, properties cannot have both a type annotation and an initializer. > 1 │ declare class T { readonly b: string = "test"; } │ ^^^^^^^^ 2 │ class T { declare readonly b: string = "test"; } 3 │ i The type annotation is here: > 1 │ declare class T { readonly b: string = "test"; } │ ^^^^^^^^ 2 │ class T { declare readonly b: string = "test"; } 3 │ -- ts_annotated_property_initializer_ambient_context.ts:2:38 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ × In ambient contexts, properties cannot have both a type annotation and an initializer. 1 │ declare class T { readonly b: string = "test"; } > 2 │ class T { declare readonly b: string = "test"; } │ ^^^^^^^^ 3 │ i The type annotation is here: 1 │ declare class T { readonly b: string = "test"; } > 2 │ class T { declare readonly b: string = "test"; } │ ^^^^^^^^ 3 │ -- declare class T { readonly b: string = "test"; } class T { declare readonly b: string = "test"; }