Updated Exports Files (markdown)
@@ -10,7 +10,7 @@ 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 in dev mode (mode=RAW) – where `goog.require` statements are required – and with the `ol.js` build.
|
||||
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 single-arg 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. The `generate-exports --externs` generates Closure externs from the `@exportObjectLiteral` and `@exportObjectLiteralProperty` directives. The `build.py` script places these externs in the `build/src/external/externs/types.js` file, which is used as a regular externs file by the Closure compiler (see `build/ol.json`). The `generate-exports --typedef` command generate typedef's for the object literals declared with `@exportObjectLiteral` and `@exportObjectLiteralProperty`. The `build.py` script places the typedef's in the `build/src/external/src/types.js`, which, like `exports.js`, is used as an input file for the ol.js build (see `build/ol.json`). Externs define types for config objects created by lib users, while typedef's define types created internally by the lib.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user