Understanding `PetsDecoded` and `PetsEncoded` Types in Effect Typescript Library

For this example:

enum Pets {
    CAT = 'cat',
    DOG = 'dog',
}

const PetsSchema = S.Enums(Pets);

type PetsDecoded = typeof PetsSchema.Type;
type PetsEncoded = typeof PetsSchema.Encoded;


What would you expect the two inferred types to be and why?

My intuition tells me that:

type PetsDecoded = Pets
type PetsEncoded = 'cat' | 'dog'


But this is not the case. In reality:

type PetsDecoded = Pets
type PetsEncoded = Pets


It's possible that I'm misunderstanding the purpose of Encoded. Any insight is greatly appreciated.
Was this page helpful?