Ensure `mapArray` returns a precise type with generics

Using the following code, out has type Schema.Array$<Schema.Schema.AnyNoContext> when I would like it to be Schema.Array$<Schema.String> :
import { Schema } from 'effect';

const mapArray = <T extends { schema: Schema.Schema.AnyNoContext }>(value: T) =>
  Schema.Array(value.schema);

const out = mapArray({ schema: Schema.String });
How can I force mapArray` to return a more precise type?
Was this page helpful?