Creating a Schema for a Tagged Enum in Effect Typescript
Hi guys, I'm looking for a way to create a schema for a tagged enum, but I couldn't find any relevant information in the official documentation. Can anyone help me?
export type SubmitFailedReason = Data.TaggedEnum<{
AddressNotSet: {};
OrderAlreadyExists: {
orderId: string;
};
}>;
export const SubmitFailedReason = Data.taggedEnum<SubmitFailedReason>();
export const SubmitFailedReasonSchema = Schema.declare(
(input): input is SubmitFailedReason => {
// how to check if input is a SubmitFailedReason?
// or maybe I can use any other more elegant way to get the schema?
}
);