Keep your typescript version synchronized with a patched version that exposes internal definitions and some private methods for type checking.