Fix compile error, add d.ts for metricsWatcher.js