@@ -12,8 +12,6 @@ This declares that the `ol.Map` symbol, and that the `ol.Map.prototype.addLayer`
|
||||
|
||||
Exports files are processed by the `bin/generate-exports` script, using its `--exports` switch. This script receives a list of exports files as its input, and outputs `@exportSymbol` and `@exportProperty` statements. The output of `generate-exports --exports` goes into `build/src/external/src/exports.js`, which is then used as an input file for the `ol.js` build (see `build/ol.json`).
|
||||
|
||||
Note: the `src/google.exports` file just makes the `goog.require` function be exported as a null function. This is just to be able to execute the examples both with Plovr in raw mode (`?mode=RAW`) – where `goog.require` statements are required – and against the `ol.js` build.
|
||||
|
||||
The `src/objectliterals.exports` file is specific. This file declares the config objects and properties for the library's single-argument constructors. These declarations are done with the `@exportObjectLiteral` and `@exportObjectLiteralProperty` directives. This file is also processed with the `bin/generate-exports` script, but using the `--externs` and `--typedef` switches.
|
||||
|
||||
Note: config objects and properties are declared in a specific file because they may be shared by multiple constructors. For example the `ol.source.Vector` constructor currently takes an `ol.source.SourceOptions` config object, and `ol.source.SourceOptions` is a generic/base type that can used for other constructors.
|
||||
|
||||
Reference in New Issue
Block a user