Skip to content

Commit d5fd19b

Browse files
committed
1.0 -> 1.1: all interfaces are now exported
1 parent 5cb169b commit d5fd19b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

readme.md renamed to README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,16 @@ This tool provides a CLI that does the conversion for you.
2525
Our output:
2626

2727
```typescript
28-
interface Book {
28+
export interface Book {
2929
pages: number;
3030
chapters: Chapter[];
3131
Authors: string[];
3232
}
33-
interface Chapter {
33+
export interface Chapter {
3434
title: string;
3535
content: string | Paragraph[];
3636
}
37-
interface Paragraph {
37+
export interface Paragraph {
3838
content: string;
3939
}
4040
```
@@ -86,7 +86,7 @@ For example if you use the below file as input, the first line `User = string` w
8686
output:
8787

8888
```typescript
89-
interface Book{
89+
export interface Book{
9090
owner: User
9191
price: int
9292
}

python_nodes.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66

77
import * as ts from "typescript"
8-
import {factory} from "typescript"
8+
import {factory, SyntaxKind} from "typescript"
99

1010

1111
type PrimitiveField = string | number | null
@@ -283,7 +283,7 @@ export class ClassDef extends Node {
283283
}
284284

285285
}
286-
return factory.createInterfaceDeclaration(undefined, undefined, factory.createIdentifier(this.name), undefined, undefined, members)
286+
return factory.createInterfaceDeclaration(undefined, [factory.createModifier(SyntaxKind.ExportKeyword)], factory.createIdentifier(this.name), undefined, undefined, members)
287287
}
288288

289289
return undefined

0 commit comments

Comments
 (0)