diff options
| author | Michael Williamson <mike@zwobble.org> | 2026-08-30 14:17:09 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2026-08-30 14:17:09 +0100 |
| commit | 5a15eaebcad9fe95772d7391bb2cc5b1b2a8c0d2 (patch) | |
| tree | 5cc435408a4039156245b65c9d00ef82df1a5666 /examples/01-struct | |
| parent | f6bdaa0381cfe762a0723085d666dce8eaf4434a (diff) | |
Mark fields as readonly in typescript-types
Diffstat (limited to 'examples/01-struct')
| -rw-r--r-- | examples/01-struct/output/typescript/src/point.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/01-struct/output/typescript/src/point.ts b/examples/01-struct/output/typescript/src/point.ts index 5dc76ee..fccae01 100644 --- a/examples/01-struct/output/typescript/src/point.ts +++ b/examples/01-struct/output/typescript/src/point.ts @@ -4,9 +4,9 @@ * A straight line from one point to another. */ class Line { - public start: Point; + public readonly start: Point; - public end: Point; + public readonly end: Point; public constructor(start: Point, end: Point) { this.start = start; @@ -20,9 +20,9 @@ export {Line}; * A 2D point. */ class Point { - public x: number; + public readonly x: number; - public y: number; + public readonly y: number; public constructor(x: number, y: number) { this.x = x; |
