summaryrefslogtreecommitdiff
path: root/examples/17-transient-0/src
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2026-09-21 20:57:36 +0100
committerMichael Williamson <mike@zwobble.org>2026-09-21 20:57:36 +0100
commit2bf02785d9aef8b7b265d41cd45e2519a7e04bb4 (patch)
tree72765bd081280ca0a36ad5f820a0659b35ff66ee /examples/17-transient-0/src
parent8b601565c9e14aa673dca94bd79c84ad6f2f04f3 (diff)
Support Option in typescript-types
Diffstat (limited to 'examples/17-transient-0/src')
-rw-r--r--examples/17-transient-0/src/data.hob126
1 files changed, 126 insertions, 0 deletions
diff --git a/examples/17-transient-0/src/data.hob b/examples/17-transient-0/src/data.hob
new file mode 100644
index 0000000..25fb1be
--- /dev/null
+++ b/examples/17-transient-0/src/data.hob
@@ -0,0 +1,126 @@
+struct StructSingleton {
+ singleton;
+}
+
+struct StructWithBool {
+ field a: Bool;
+ field b: Bool;
+}
+
+struct StructWithFloat64 {
+ field a: Float64;
+ field b: Float64;
+}
+
+struct StructWithInt8 {
+ field a: Int8;
+ field b: Int8;
+}
+
+struct StructWithInt32 {
+ field a: Int32;
+ field b: Int32;
+}
+
+struct StructWithInt64 {
+ field a: Int64;
+ field b: Int64;
+}
+
+struct StructWithString {
+ field a: String;
+ field b: String;
+}
+
+struct StructWithStruct {
+ field inner: StructWithInt32;
+ field c: Int32;
+}
+
+struct GenericStruct[A, B] {
+ field a: A;
+ field b: B;
+}
+
+struct StructWithGenericStruct {
+ field a: GenericStruct[Int32, String];
+ field b: GenericStruct[Option[String], GenericStruct[Option[String], GenericStruct[String, String]]];
+}
+
+struct StructWithList {
+ field a: List[Int64];
+ field b: List[StructWithInt32];
+}
+
+struct StructWithOption {
+ field a: Option[Int64];
+ field b: Option[StructWithInt32];
+}
+
+enum EnumWithVariants {
+ variant zero;
+ variant one;
+ variant two;
+}
+
+struct StructWithEnum {
+ field inner: EnumWithVariants;
+ field c: Int32;
+}
+
+sum SumWithVariants {
+ variant VariantOne;
+ variant VariantTwo;
+}
+
+struct VariantOne {
+ field a: Int32;
+}
+
+struct VariantTwo {
+ field a: Int64;
+}
+
+sum SumWithBoxedVariants {
+ variant Box[VariantOne];
+ variant Box[VariantTwo];
+}
+
+struct StructWithSum {
+ field inner: SumWithVariants;
+ field b: Int32;
+}
+
+native Native {
+}
+
+struct StructWithNative {
+ field a: Native;
+}
+
+native GenericNative[A, B] {
+}
+
+struct StructWithGenericNative {
+ field a: GenericNative[Int32, String];
+ field b: GenericNative[Option[String], GenericNative[Option[String], GenericNative[String, String]]];
+}
+
+struct StructWithBox {
+ field inner: Box[StructWithInt32];
+}
+
+struct StructWithListOfShared {
+ field inner: List[Shared[StructWithInt32]];
+}
+
+struct StructWithDifferentSharedTypes {
+ field a: Shared[StructWithInt32];
+ field b: Shared[StructWithInt64];
+ field c: Shared[StructWithInt32];
+}
+
+struct StructWithSharedSumAndVariant {
+ field a: Shared[SumWithVariants];
+ field b: Shared[VariantOne];
+}