TypeScript Type for Schema Without Context

hi, i have this type, i want to accept any value of extend or Struct but without context
/**
 * Any schema type that is extended or is a struct.
 */
export type AnyExtendedOrStructSchema = Schema.Struct<any> | Schema.extend<any, any>


right now it is allowing schema with context
schema: Schema.Struct({
  foo: Schema.String,
  bar: Schema.Number,
  baz: Schema.transformOrFail(
    Schema.String,
    Schema.Number,
    {
      strict: true,
      decode: () => Effect.gen(function* () {
        const r = yield* TypedEffectService
        return yield* ParseResult.succeed(1)
      }),
      encode: () => Effect.gen(function* () {
        return yield* ParseResult.succeed('1')
      }),
    },
  ),
}),

this is valid as per current type
Was this page helpful?