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 "A" [] [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: [
ASYNC_KW@18..24 "async" [] [Whitespace(" ")],
JsLiteralMemberName {
value: IDENT@24..30 "method" [] [],
},
JsParameters {
l_paren_token: L_PAREN@30..31 "(" [] [],
items: JsParameterList [],
r_paren_token: R_PAREN@31..32 ")" [] [],
},
SEMICOLON@32..34 ";" [] [Whitespace(" ")],
],
},
],
r_curly_token: R_CURLY@34..35 "}" [] [],
},
},
],
eof_token: EOF@35..36 "" [Newline("\n")] [],
}
0: JS_MODULE@0..36
0: (empty)
1: (empty)
2: JS_DIRECTIVE_LIST@0..0
3: JS_MODULE_ITEM_LIST@0..35
0: TS_DECLARE_STATEMENT@0..35
0: DECLARE_KW@0..8 "declare" [] [Whitespace(" ")]
1: JS_CLASS_DECLARATION@8..35
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 "A" [] [Whitespace(" ")]
4: (empty)
5: (empty)
6: (empty)
7: L_CURLY@16..18 "{" [] [Whitespace(" ")]
8: JS_CLASS_MEMBER_LIST@18..34
0: JS_BOGUS_MEMBER@18..34
0: ASYNC_KW@18..24 "async" [] [Whitespace(" ")]
1: JS_LITERAL_MEMBER_NAME@24..30
0: IDENT@24..30 "method" [] []
2: JS_PARAMETERS@30..32
0: L_PAREN@30..31 "(" [] []
1: JS_PARAMETER_LIST@31..31
2: R_PAREN@31..32 ")" [] []
3: SEMICOLON@32..34 ";" [] [Whitespace(" ")]
9: R_CURLY@34..35 "}" [] []
4: EOF@35..36 "" [Newline("\n")] []
--
ts_ambient_async_method.ts:1:19 parse ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
× 'async' modifier cannot be used in an ambient context.
> 1 │ declare class A { async method(); }
│ ^^^^^^^^^^^^^^^
2 │
--
declare class A { async method(); }