EDIT: The purpose is to be able to style the TOC in the same way that the main doc is styleable.
I’m not sure I understand. Do you mean that you just want to be able to style the toc like you would anything else, by adding classes that you can access with your css?
If so, this can already be done. You can use the toc however you want using page.toc or section.toc, and you’re free in the process to add your classes into your template. See the example be;ow from the docs;
Otherwise I might have misunderstood your question, sorry.