oxc/crates/oxc_ast
Dunqing b22b59ae12 feat(transformer-dts): transform namespace support (#3683)
This PR implements namespace transform:

Look at this example

```ts
let internal = 0;
export namespace ns {
    namespace internal {
        export class Foo {}
    }
    export namespace nested {
        export import inner = internal;
    }
}

// to

export declare namespace ns {
    namespace internal {
        class Foo {
        }
    }
    export namespace nested {
        export import inner = internal;
    }
    export {};
}

```

The `let internal = 0` is unexported, and is unreferenced in other types. So we need to remove it.

I refactored `scope` because the previous implementation could not correctly remove unexported and unreferenced declarations.

For example, in this case
```ts
type T = string;
export function foo<T>(): T {
}
// to
type T = string;
export declare function foo<T>(): T;
```
The `type T = string` should be deleted, Because the `T` is not used in the function return type.
2024-06-15 09:45:58 +00:00
..
src feat(transformer-dts): transform namespace support (#3683) 2024-06-15 09:45:58 +00:00
Cargo.toml chore: change all usages of static_assertions to dev-dependencies (#3654) 2024-06-13 13:18:53 +08:00
CHANGELOG.md Release crates v0.14.0 (#3643) 2024-06-12 17:52:41 +08:00