Making Props Private with `Schema.Class` in Effect Typescript

Hi! Is there a way to make the props private when using Schema.Class ?
Like here, I would like to make the name prop of Person not accessible, like is done with Person2. (see in playground)
import { Schema } from "effect"

class Person extends Schema.Class<Person>("Person")({
  name: Schema.NonEmptyString
}) {}
new Person({ name: "foo" }).name


class Person2 {
  private name: string
  constructor({name}:{name: string}) {
    this.name = name
  }
}

new Person2({ name: "foo" }).name // ts error: Property 'name' is private and only accessible within class 'Person2'
Was this page helpful?