I am querying a system API (Linux' DBus API) that expects 3 strings:
servicepathname
So I could write the signature of the TypeScript methods that calls the interface like so:
getInterface(service: string, path: string, name: string): DBusInterface;
But I know , service, path and name each follow specific string patterns:
service=/^org\.bluez/path=/(\/[a-zA-Z]*)+/name=/([a-zA-Z]+\.)+/
(Regex not 100% correct, but here for comprehensibility)
I am wondering if it is possible to type guard the 3 parameters to match these patterns, like
type ServiceName: /^org\.bluez/