Generated declaration files should at least be compilable with no errors (see issue #2268 for example). The simplest pragmatic way is to run compiler on a dummy TS file and a corresponding file.d.ts. If it doesn't crash, it's a pass.