Creating Optional Types in Schema

How do you do Schema optional types? I see some handy things like Schema.UndefinedOr, but it's not the same as a straight up optional type, so that the property can be omitted altogether

export class CanvasQuoteSettings extends Schema.Class<CanvasQuoteSettings>(
  "CanvasQuoteSettings",
)({
  canvas: Schema.UndefinedOr(Schema.instanceOf(HTMLCanvasElement)), // ???
  // ...
}) {}
Was this page helpful?