diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-30 09:50:40 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-30 09:50:40 +0100 |
| commit | 1ab92f34420bba4fa83da4ea518c862cab105273 (patch) | |
| tree | f7369f30207bf175eb2991a67bb431d168c3d8db /examples/01-struct | |
| parent | b27ce73f66a025ce16d7158c0283fff7b3bf7f1a (diff) | |
Generate fields for structs in typescript-types
Diffstat (limited to 'examples/01-struct')
| -rw-r--r-- | examples/01-struct/output/typescript/src/point.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/examples/01-struct/output/typescript/src/point.ts b/examples/01-struct/output/typescript/src/point.ts index abdbe25..81f1b83 100644 --- a/examples/01-struct/output/typescript/src/point.ts +++ b/examples/01-struct/output/typescript/src/point.ts @@ -4,10 +4,26 @@ * A straight line from one point to another. */ class Line { + start: Point; + + end: Point; + + constructor(start: Point, end: Point) { + this.start = start; + this.end = end; + } } /** * A 2D point. */ class Point { + x: number; + + y: number; + + constructor(x: number, y: number) { + this.x = x; + this.y = y; + } } |
