Loop through all created fields and get the field type
Making sure you include use craft\db\Query; at the top of your Class, you can do something like this:

$fields = (new Query())
    -&gt;select(['id','handle','name','instructions','type'])
    -&gt;from(['{{%fields}}'])
    -&gt;all();

foreach ($fields as $field) {
    $output[(int) $field['id']] = array(
        'id'            =&gt; (int) $field['id'],
        'handle'        =&gt; $field['handle'],
        'name'          =&gt; $field['name'],
        'instructions'  =&gt; $field['instructions'],
        'type'          =&gt; $field['type']
    );
}