Hello,
The addTablesOfContent method allows to set a paragraph style and custom styles, or even import an existing TOC style from a file.
And using the headingLevel property you can a text as content to appear in the TOC. This text can be styled as needed.
Regards.