This wouldn’t work. Apart from it being very difficult to get people to sleep deeply enough for them to dream in machines like this, the brain state is very different whilst asleep compared with awake. Also the data generated from typing would be very different than thought since it’s likely picking up on broad electrical activity in the primary motor cortex.
Source: spouse works in a sleep lab studying dreams with MRI
what sleep lab does your spouse work at? i'm curious about studying dreams