Mega 2560 WiFi - error: 'PinStatus' does not name a type

I think that you may be correct. I'm currently experimenting with the WifiEsp library.

For reference, this is the board that I have:

https://www.amazon.com/HiLetgo-MEGA2560-ATmega2560-ESP8266-Compatible/dp/B08KXLRG2B/ref=sr_1_3?dchild=1&keywords=arduino+mega+wifi+hiletgo&qid=1635778938&sr=8-3