:infer-externs

compiler optionsince v1.9.456Edit

A helpful facility for generating :externs whenever a . form is used on a type-hinted symbol ^js/Foo.Bar x. Enable *warn-on-infer* to be warned of failed inferences. Successful inferences are written to inferred_externs.js in :output-dir.

:infer-externs true

Details:

See Externs for more details.


Examples:

Given the following cljs code

(defn wrap-baz [^js/Foo.Bar x]
  (.baz x))

these externs will be created in inferred_externs.js:

var Foo = {};
Foo.Bar = function() {};
Foo.Bar.prototype.baz = function() {};

See Also: