If you are writing a tailwind plugin in typescript tailwind file (tailwind.config.ts), you have to use the plugin() function. At time of writing, there seems to be a bug where if you try to use your IDEs auto import to get this function, it imports as the default export of the tailwindcss package:
import plugin from "tailwindcss";This is wrong, and if you try to write a plugin with this import you will get type errors, since you have not in fact plugin function. To fix this, you just need to import it from tailwindcss/plugin:
import plugin from "tailwindcss/plugin";