Closure Compiler - 错误的类型注释。未知类型(带外部)

Closure Compiler - Bad Type Annotation. Unknown type (with externs)

从基础开始。我正在使用 JavaScript Closure Compiler 并得到错误 Bad Type Annotation. Unknown type VRPose I was trying to have a function return a {VRPose}。即

/**
 * @returns {VRPose}
 */
VRDisplay.prototype.getPose = function() {};

我做了显而易见的事情并尝试定义 VRPose 如下:

function VRPose() {};

不幸的是,这没有用;我有同样的错误。我应该如何在 Closure 中定义一个 type/class?

起初,我试过

goog.forwardDeclare('VRPose');

这实际上工作得很好。也许这是定义外部人员的正确行为。但这似乎有点回避问题。

我仔细查看了一下,发现缺少 @constructor 标记。所以这就是我现在拥有的:

/** @constructor */
function VRPose() {};

我不太确定这两者之间的区别是什么,所以如果有人愿意回答这个问题并提供更好的解释,我很乐意接受!