Support using native `TypeNode` to set type of a `Structure`
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
Currently, the `type` property of a `Structure` only support `string | WriterFunction`. If I want to set the value with a native `TypeNode`, I had to wrap it using `printNode()` like the example below.
```typescript
const project = new Project();
const common = project.createSourceFile("common.ts");
common.addTypeAlias(
{
name: "integer",
type: printNode(ts.createIntersectionTypeNode(...)),
});
```
**Describe the solution you'd like**
I hope I can use it without any wrapper.
```typescript
const project = new Project();
const common = project.createSourceFile("common.ts");
common.addTypeAlias(
{
name: "integer",
type: ts.createIntersectionTypeNode(...),
});
```
**Describe alternatives you've considered**
Contributor guide
Assessment
This issue has not been assessed yet.