Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate official TypeScript type definitions #8878

Merged
merged 38 commits into from
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
85c78ed
Generate official TypeScript type definitions
mramato May 27, 2020
d84166d
Don't hardcode ./node_modules/tsd-jsdoc
kring May 27, 2020
0b17c85
Use tsconfig.json to avoid errors in some environments.
kring May 27, 2020
08b6739
Add back a "Proxy" type.
mramato May 27, 2020
c90ac8f
Add missing `update` function to all DataSource implementations
mramato May 27, 2020
fbb66eb
JSDoc fixes to GregorianDate and TimeIntervalCollection
mramato May 27, 2020
0ad8cbd
Fix JSDoc for exportKml
mramato May 27, 2020
eb22bf3
Additional JSDoc/TypeScript fixes.
mramato May 27, 2020
5c346ed
Make IonImageryProvider actually implement all ImageryProvider proper…
mramato May 27, 2020
6185b18
More TypeScript fixes
mramato May 27, 2020
16924c3
Update CHANGES
mramato May 27, 2020
4d32df1
Number[] -> number[] in TS definition
mramato May 27, 2020
c231dc4
Fix Event.raiseEvent TS generation.
mramato May 27, 2020
60d4610
Add missing availability property to TerrainProvider classes.
mramato May 28, 2020
ce5b33e
Whoops
mramato May 28, 2020
e360dfc
More JSDoc fixes and TS improvements
mramato May 28, 2020
c2bd092
Don't abuse EllipsoidTerrainProvider.
mramato May 28, 2020
890aaae
Lots of small changes to improve the typescript definitions.
kring May 28, 2020
3172bc4
Give up on trying JSDoc tags for PropertyBag
thw0rted May 28, 2020
f30a9b0
Example of exporting ConstructorOptions interface
thw0rted May 28, 2020
6dd9e0c
Break out constructor options: Entity and Graphics
thw0rted May 28, 2020
ca986af
Various small type fixes
thw0rted May 28, 2020
9678a43
Selected/tracked entity can be undefined
thw0rted May 28, 2020
14c5ec1
First pass at generic Events
thw0rted May 28, 2020
2b91930
Constructor interfaces for ImageryProviders
thw0rted May 28, 2020
1b16c9a
Load-method option interfaces for some DataSources
thw0rted May 28, 2020
a89f7c9
Options interfaces for Viewer, Resource
thw0rted May 28, 2020
e18535f
Add CONTRIBUTORS entry
thw0rted May 29, 2020
d3cf0ac
Use function overloading for exportKml
thw0rted May 29, 2020
d734c83
Spell out docs for Resource.QueryParameter
thw0rted May 29, 2020
a38104e
Undo some changes
mramato May 29, 2020
dca5c58
Add ConstructorOptions to the rest of the ImageryProviders
mramato May 30, 2020
adc772c
Merge pull request #8884 from thw0rted/typescript-generics
mramato May 30, 2020
e7af041
Workaround CesiumMath -> Math documentation issue
mramato May 30, 2020
d95eea0
Fix doc links that include a hash.
mramato May 30, 2020
ac504a4
Merge remote-tracking branch 'origin/master' into typescript-definitions
mramato May 31, 2020
31571eb
Fix UrlTemplateImageryProvider
mramato May 31, 2020
4b6a4d1
More fixes found by Kevin.
mramato Jun 1, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Scene/ArcGisMapServerImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import ImageryProvider from "./ImageryProvider.js";
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified and used,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
* parameter is specified, the WGS84 ellipsoid is used.
* @property {Credit|String} credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
* @property {Credit|String} [credit] A credit for the data source, which is displayed on the canvas. This parameter is ignored when accessing a tiled server.
* @property {Number} [tileWidth=256] The width of each tile in pixels. This parameter is ignored when accessing a tiled server.
* @property {Number} [tileHeight=256] The height of each tile in pixels. This parameter is ignored when accessing a tiled server.
* @property {Number} [maximumLevel] The maximum tile level to request, or undefined if there is no maximum. This parameter is ignored when accessing
Expand Down
10 changes: 5 additions & 5 deletions Source/Scene/TileCoordinatesImageryProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import when from "../ThirdParty/when.js";
*
* Initialization options for the TileCoordinatesImageryProvider constructor
*
* @param {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.
* @param {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
* @property {TilingScheme} [tilingScheme=new GeographicTilingScheme()] The tiling scheme for which to draw tiles.
* @property {Ellipsoid} [ellipsoid] The ellipsoid. If the tilingScheme is specified,
* this parameter is ignored and the tiling scheme's ellipsoid is used instead. If neither
* parameter is specified, the WGS84 ellipsoid is used.
* @param {Color} [color=Color.YELLOW] The color to draw the tile box and label.
* @param {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.
* @param {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.
* @property {Color} [color=Color.YELLOW] The color to draw the tile box and label.
* @property {Number} [tileWidth=256] The width of the tile for level-of-detail selection purposes.
* @property {Number} [tileHeight=256] The height of the tile for level-of-detail selection purposes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dang it, I knew I was going to miss one of these :-/

*/

/**
Expand Down
2 changes: 1 addition & 1 deletion Tools/jsdoc/ts-conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"plugins": [
"./Tools/jsdoc/cesiumTags",
"./node_modules/tsd-jsdoc/dist/plugin"
"tsd-jsdoc/dist/plugin"
],
"templates": {
"cleverLinks": true,
Expand Down
7 changes: 4 additions & 3 deletions gulpfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1545,12 +1545,13 @@ function createTypeScriptDefinitions() {
//eslint-disable-next-line no-cond-assign
while ((matches = regex.exec(source))) {
const moduleName = matches[2].match(/([^\s|\(]+)/);
if (moduleName[1] === "CesiumMath") {
moduleName[1] = "Math";
}
publicModules.add(moduleName[1]);
}

// Math shows up as "Math" because of it's aliasing from CesiumMath and namespace collision with actual Math
// It fails the above regex so just add it directly here.
publicModules.add("Math");

// Fix up the output to match what we need
// declare => export since we are wrapping everything in a namespace
// CesiumMath => Math (because no CesiumJS build step would be complete without special logic for the Math class)
Expand Down