fix(codegen): add missing declare to PropertyDefinition (#4937)

I'm seeing a broken test for

```rust
    #[test]
    fn dts_class_decl_prop_test() {
        transform_dts_test(
            "export class Foo { declare a: string }",
            "export declare class Foo {
  a: string;
}",
        );
    }
```

can you double check @Dunqing ?
This commit is contained in:
Boshen 2024-08-17 14:26:24 +00:00
parent bea76f0f24
commit bbf9ec0774

View file

@ -2535,6 +2535,9 @@ impl<'a, const MINIFY: bool> Gen<MINIFY> for PropertyDefinition<'a> {
fn gen(&self, p: &mut Codegen<{ MINIFY }>, ctx: Context) {
p.add_source_mapping(self.span.start);
self.decorators.gen(p, ctx);
if self.declare {
p.print_str("declare ");
}
if let Some(accessibility) = &self.accessibility {
accessibility.gen(p, ctx);
}