How to write javascript plugin for JupyterLab 4?

I am working on an extension that can render graphviz fenced code and replace it with the graphviz image. I currently have some Javascript that can successfully pass the graphviz code to a runtime and return a graph, but this is all written in Javascript. Is it possible to write an JupyterLab 4 plugin in Javascript or somehow embed my code into a Typescript plugin?

For context, my current working code works by putting all the Javascript code into the style/index.js file which seems to be loaded and made available when I install the plugin. By removing the code from style/index.js and making the functionality into a plugin I hope it can be enabled and disabled and otherwise treated as a plugin instead of a forced-on functionality like it currently is.

I have some javascript that can capture fenced graphviz code and pass it to a graphviz runtime to produce a graph however this is all done in javascript and I would like to insert this functionality into a typescript JupyterLab 4 extension.