Type Alias RecursiveReplace<TShape, TFieldValue>

RecursiveReplace<TShape, TFieldValue>: {
    [P in keyof TShape]: TShape[P] extends (infer U)[]
        ? RecursiveReplace<U, TFieldValue>[]
        : TShape[P] extends
                | number
                | string
                | symbol
                | undefined
            ? TFieldValue
            : RecursiveReplace<TShape[P], TFieldValue>
}

Remaps TShape so each field has type TFieldValue. Recursive.

Type Parameters

  • TShape
  • TFieldValue