-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(hub-common): add minimal definitions of ArcGIS types and drop ar…
…cgis-js-api (#1797)
- Loading branch information
Showing
15 changed files
with
112 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { ISpatialReferenceInstance } from "./ISpatialReferenceInstance.js"; | ||
|
||
// NOTE: we define our own interface for geometry b/c | ||
// adding @arcgis/core just to get the Geometry type causes problems, for example: | ||
// as of the 4.32 RC we see (non-fatal) TS errors when running karma tests | ||
/** | ||
* An instance of the [Geometry](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html) class | ||
* | ||
* NOTE: this interface only defines the properties needed by this package | ||
*/ | ||
export interface IGeometryInstance { | ||
/** | ||
* The spatial reference of the geometry. | ||
* | ||
* @default SpatialReference.WGS84 // wkid: 4326 | ||
* | ||
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#spatialReference) | ||
*/ | ||
spatialReference: ISpatialReferenceInstance; | ||
/** | ||
* The geometry type. | ||
* | ||
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-Geometry.html#type) | ||
*/ | ||
readonly type: | ||
| "point" | ||
| "multipoint" | ||
| "polyline" | ||
| "polygon" | ||
| "extent" | ||
| "mesh"; | ||
/** | ||
* Converts an instance of this class to its [ArcGIS portal JSON](https://developers.arcgis.com/documentation/common-data-types/geometry-objects.htm) representation. | ||
* | ||
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-core-JSONSupport.html#toJSON) | ||
*/ | ||
toJSON(): any; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
packages/common/src/core/types/ISpatialReferenceInstance.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* The properties of a spatial reference instance used by hub.js | ||
* | ||
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html) | ||
*/ | ||
export interface ISpatialReferenceInstance { | ||
/** | ||
* The well-known ID of a spatial reference. | ||
* | ||
* [Read more...](https://developers.arcgis.com/javascript/latest/api-reference/esri-geometry-SpatialReference.html#wkid) | ||
*/ | ||
wkid: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.