interface Array { flatMap( fn: (this: R, x: T, index: number, array: this) => readonly U[], thisArg?: R, ): U[]; } interface ReadonlyArray { flatMap( fn: (this: R, x: T, index: number, array: this) => readonly U[], thisArg?: R, ): U[]; }