Import libraries in external components

Hello everyone.
I’m trying to create an external component to communicate with an (Aurora) inverter. The idea is to use an existing library (which I’m using successfully with arduino ide - link to github) in the component.
Said library requires HardwareSerial to be initialized, like so:

HardwareSerial mySerial(2);
Aurora inverter = Aurora(2, &mySerial, 5);

But I could not get HardwareSerial to work. Here is what I get when using it:

src/esphome/components/empty_sensor/empty_sensor.cpp:13:1: error: 'HardwareSerial' does not name a type
   13 | HardwareSerial mySerial = HardwareSerial(2);
      | ^~~~~~~~~~~~~~

Importing like the following doesn’t help as well:

#import "HardwareSerial.h"; //Same using <HardwareSerial.h>

I get:

src/esphome/components/empty_sensor/empty_sensor.cpp:7:10: fatal error: HardwareSerial.h: No such file or directory

In other topics it seems to work without even importing (like here), is maybe imported with a yaml directive?

Thanks in advance

P.s. I’m also open to other solutions to work with Aurora inverters. I found a repo on github (michelsciortino/esphome-aurora-inverter - apparently I cannot link it, as I’m a new user) but it uses a custom component, which is not supported anymore.

I found this discussion, I don’t know if you saw it, I’m also looking for a solution to have my power one on home assistant via esphome, but I haven’t succeeded yet:

Has the magic to include libraries.

HardwareSerial is its name.