import { z } from "zod";
import { WsSchema } from "./dist";
const schema = new WsSchema({
TEST: z.object({}),
MESSAGE: z.string(),
});
// Typescript should infer here that .data() should expect a string argument.
// Typescript is able to do so when the WsSchema class is imported from its source file, but it expects an argument of type 'unkown' when imported from the generated dist
// this should not be valid and typescript should complain here, but it does not when importing from the dist folder
schema.send("MESSAGE").data({})
import { z } from "zod";
import { WsSchema } from "./dist";
const schema = new WsSchema({
TEST: z.object({}),
MESSAGE: z.string(),
});
// Typescript should infer here that .data() should expect a string argument.
// Typescript is able to do so when the WsSchema class is imported from its source file, but it expects an argument of type 'unkown' when imported from the generated dist
// this should not be valid and typescript should complain here, but it does not when importing from the dist folder
schema.send("MESSAGE").data({})