Global variables from getTemplateSrv

Current goal is to receive a dashboard’s selected time-range through the global variables __from and __to and extract their values programmatically (typescript). I’ve looked throughout the documentation, but the closest I could find was the function getTemplateSrv from the grafana/runtime. This function though, only returns dashboard variables.
Question is, is there a similar function that works for the global variables? Perhaps I’m missing something with getTemplateSrv that already does what I need?

Hello, try :