Implement as ts module and compile to js + d.ts file

To avoid the complications of separately implementing a JS module
and writing types for it and having consumers of the module do the
type definition assignement the module is now a typescript module which
compiles to javascript + a type definition file.

Signed-off-by: Snorre Magnus Davøen <snorre.davoen@nsd.uib.no>
1 job for master in 19 seconds (queued for 1 second)
Status Job ID Name Coverage
  Test
passed #8769
test

00:00:19