diff --git a/examples/chaos/bindings/UniqueType.ts b/examples/chaos/bindings/UniqueType.ts new file mode 100644 index 0000000..2da391f --- /dev/null +++ b/examples/chaos/bindings/UniqueType.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type UniqueType = { value: number, }; diff --git a/examples/chaos/bindings/index.ts b/examples/chaos/bindings/index.ts index 3e8f3f5..cd7d3e9 100644 --- a/examples/chaos/bindings/index.ts +++ b/examples/chaos/bindings/index.ts @@ -14,8 +14,9 @@ import type { Mutation } from "@qubit-rs/client"; import type { Subscription } from "@qubit-rs/client"; import type { NestedStruct } from "./NestedStruct.ts"; import type { MyEnum } from "./MyEnum.ts"; +import type { UniqueType } from "./UniqueType.ts"; import type { Metadata } from "./Metadata.ts"; import type { User } from "./User.ts"; import type { Test } from "./Test.ts"; -export type QubitServer = { version: Query<[], string>, count: Mutation<[], number>, countdown: Subscription<[min: number, max: number, ], number>, array: Query<[], Array>, enum_test: Query<[], MyEnum>, user: { someHandler: Query<[_id: string, ], User>, create: Mutation<[name: string, email: string, age: number, ], User>, list: Query<[], Array>, asdf: Query<[], null> } }; \ No newline at end of file +export type QubitServer = { version: Query<[], string>, count: Mutation<[], number>, countdown: Subscription<[min: number, max: number, ], number>, array: Query<[], Array>, enum_test: Query<[], MyEnum>, array_type: Query<[], Array>, user: { someHandler: Query<[_id: string, ], User>, create: Mutation<[name: string, email: string, age: number, ], User>, list: Query<[], Array>, asdf: Query<[], null> } }; \ No newline at end of file diff --git a/examples/chaos/src/main.rs b/examples/chaos/src/main.rs index 65c8342..eee909b 100644 --- a/examples/chaos/src/main.rs +++ b/examples/chaos/src/main.rs @@ -166,6 +166,16 @@ async fn array() -> Vec { vec!["a".to_string(), "b".to_string(), "c".to_string()] } +#[derive(Clone, Serialize, TS)] +struct UniqueType { + value: usize, +} + +#[handler(query)] +async fn array_type() -> Vec { + vec![] +} + #[derive(Clone, Serialize, TS)] struct NestedStruct { a: f32, @@ -194,6 +204,7 @@ async fn main() { .handler(countdown) .handler(array) .handler(enum_test) + .handler(array_type) .nest("user", user::create_router()); // Save the router's bindings