Complete worked example
typescript
type ElementOf<T> = T extends readonly (infer U)[] ? U : never;
type Payload = Awaited<Promise<Promise<{ id: string }>>>;
const item: ElementOf<readonly string[]> = "QA";
const payload: Payload = { id: "a" };- Reasoning
- The readonly pattern preserves array compatibility while Awaited recursively models successful resolution.