There have been commercial attempts to manufacture battery transgormer type adapters to turn cordless tools into corded tools.
Generally, they haven’t been very successful, and were usually only used for tools like drills that didn’t pull much amperage.
The other method was a transformer that was separate from the tool, but which plugged into the battery attachment.
The main issue is that the low voltage of most cordless tools, means the tools need to draw higher amperage yhan a corded tool, which then produces extra heat, and requires thicker wire.
Cordless tools like circular saws and reciprocating saws tended to have way shorter run times than tools like drills, because the motors required extra amperage and amperage spikes.
Because of this you would need a larger transformer, and/or very thick wire for an adapter.
Festool does manufacture hybrid cordless/corded sanders, so it is possible for low amperage draw tools that don’t need huge amperage spikes, but Festool hasn’t tried to do the same with their drills.