`import_type` replacement in IDA9+

Does anyone know how correctly implement replacement of import_type IDA-SDK-API was removed since IDA9?
There are a few approaches below, and no one works as intended.