import "core-js/features/array/flat"; import "core-js/features/array/flat-map"; declare global { interface Array { flat(this: ReadonlyArray[], depth?: 1): U[]; flatMap( callbackfn: (value: T, index: number, array: T[]) => ReadonlyArray | U, thisArg?: this ): U[]; } }