Plugin middleware setup in typescript

Documentation at Server API for plugins | Strapi Documentation says :

(in js)

'use strict';
module.exports = async (ctx, next) => {
  console.log("your custom logic")
  await next();
}

So I tried to update mine to :

export default async (ctx, next) => {
    console.log('Middleware');
    await next();
  };
};

But I get an error “middleware must be a function”