It is possible to create a DeepReadonly
type like this:
type DeepReadonly = {
readonly [P in keyof T]: DeepReadonly;
};
You might want to use ts-essentials package for that:
import { DeepReadonly } from "ts-essentials";
const myDeepReadonlyObject: DeepReadonly = {
B: { C: 1 },
D: [ { E: 2 } ],
}