Commit Graph

15 Commits

Author SHA1 Message Date
Tim Schaub 4d71d2b1e8 Less greedy 2013-09-10 23:24:43 -06:00
Tim Schaub 15609f36ad Unused imports 2013-09-04 13:56:03 -06:00
Tim Schaub 2ac3d4d2cd Export namespaces instead of functions in generated code 2013-09-04 13:56:02 -06:00
Éric Lemoine a37f114e4b Add export annotation @exportFunction
This commit adds a new export annotation: @exportFunction. @exportFunction is to be used to declare functions that take an options object literal as their first arguments. @exportFunction is to regular functions as @exportClass is to constructors.

The usage of @exportFunction is as follows:

@exportFunction ol.control.defaults ol.control.DefaultsOptions ol.Collection

Note: the Function#export method uses a recursive function. This is to handle nested options.
2013-08-19 14:01:57 +02:00
Éric Lemoine 8d09be7134 No reference to internal types in externs file
Currently we have things like like in the generated externs file (types.js):

/**
 * @type {ol.control.AttributionOptions|undefined}
 */
olx.control.DefaultsOptionsExtern.prototype.attributionOptions;

It doesn't make sense to have external object properties whose types are
internal (ol.control.AttributionOptions in the above example).

With this commit, the generate-exports.py script generates this:

/**
 * @type {olx.control.AttributionOptionsExtern|undefined}
 */
olx.control.DefaultsOptionsExtern.prototype.attributionOptions;
2013-08-19 13:54:26 +02:00
Éric Lemoine e17d6aef70 Preserve unexpected items in options object passed to the constructor 2013-07-12 17:47:09 +02:00
Éric Lemoine ca332a3fef Minor fix to the generate-exports.py script
Now that we correctly export the ol.animation.*, ol.easing.* and ol.coordinate.* symbols we can make the generate-exports.py script work for more cases.
2013-05-09 22:46:08 +02:00
Tom Payne baf8cc49a1 Avoid generating long lines in exports 2013-04-23 15:29:17 +02:00
Tom Payne 1d5431226e Use objectliterals.jsdoc instead of objectliterals.exports 2013-04-07 18:00:11 +02:00
Tom Payne 4d1ec1ff90 Remove (mostly unused) logger 2013-04-06 17:32:41 +02:00
Éric Lemoine 0b403c767a Fix goog.provide for object literals 2013-03-20 18:43:02 +01:00
Éric Lemoine 02d8d9e0bc Support nested options objects
This commit extends the generated Export constructors to support nested options objects. For example, this is now supported:

@exportObjectLiteralProperty ol.MapOptions.view ol.View|ol.View2DOptions|undefined

This specifies that the "view" property in the map options can reference an ol.View instance, an ol.View2DOptions literal object, or undefined. If the "view" property references an ol.View2DOptions literal object the ol.MapExport constructor will create an ol.View2DExport instance, and pass it to the parent constructor, ol.Map. In this way, extern types never cross the external/internal boundary. In other words, translations from non-renamed to renamed objects remain confined to the generated Export constructors.
2013-03-20 18:43:02 +01:00
Éric Lemoine 1f641c5933 Make the generated Export classes accept undefined
We have constructors, like ol.View2D and ol.control.Attribution, whose "options" argument is optional (opt_options). But currently, we cannot do "new ol.View2D()" in uncompiled code that uses an ol3 build compiled in advanced mode. This commit fixes that by changing the generated Export constructors.
2013-03-15 18:01:53 +01:00
Tom Payne 3e420313a2 Only require things that start with a capital letter 2013-03-03 13:08:34 +01:00
Tom Payne bf4e7bcb70 Work around broken operating systems 2012-11-09 11:45:58 +01:00