ol 9.2.5-dev.1716917419876 → 9.2.5-dev.1717182609649

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/VectorRenderTile.d.ts +3 -3
  2. package/VectorRenderTile.d.ts.map +1 -1
  3. package/VectorTile.d.ts +19 -16
  4. package/VectorTile.d.ts.map +1 -1
  5. package/VectorTile.js +12 -9
  6. package/dist/ol.js +2 -2
  7. package/dist/ol.js.map +1 -1
  8. package/expr/expression.js +2 -2
  9. package/featureloader.d.ts +8 -8
  10. package/featureloader.d.ts.map +1 -1
  11. package/featureloader.js +5 -5
  12. package/format/EsriJSON.d.ts +0 -7
  13. package/format/EsriJSON.d.ts.map +1 -1
  14. package/format/Feature.d.ts +10 -10
  15. package/format/Feature.d.ts.map +1 -1
  16. package/format/Feature.js +6 -6
  17. package/format/GeoJSON.d.ts +9 -9
  18. package/format/GeoJSON.d.ts.map +1 -1
  19. package/format/GeoJSON.js +22 -17
  20. package/format/JSONFeature.d.ts +7 -27
  21. package/format/JSONFeature.d.ts.map +1 -1
  22. package/format/JSONFeature.js +10 -12
  23. package/format/MVT.d.ts +12 -12
  24. package/format/MVT.d.ts.map +1 -1
  25. package/format/MVT.js +16 -18
  26. package/format/TextFeature.d.ts +0 -9
  27. package/format/TextFeature.d.ts.map +1 -1
  28. package/format/TopoJSON.d.ts +0 -7
  29. package/format/TopoJSON.d.ts.map +1 -1
  30. package/format/XMLFeature.d.ts +0 -9
  31. package/format/XMLFeature.d.ts.map +1 -1
  32. package/interaction/Draw.d.ts +1 -1
  33. package/interaction/Draw.d.ts.map +1 -1
  34. package/interaction/Modify.d.ts +3 -3
  35. package/interaction/Modify.d.ts.map +1 -1
  36. package/interaction/Select.d.ts +1 -2
  37. package/interaction/Select.d.ts.map +1 -1
  38. package/layer/BaseVector.d.ts +7 -6
  39. package/layer/BaseVector.d.ts.map +1 -1
  40. package/layer/BaseVector.js +6 -4
  41. package/layer/Graticule.d.ts +3 -2
  42. package/layer/Graticule.d.ts.map +1 -1
  43. package/layer/Graticule.js +1 -1
  44. package/layer/Heatmap.d.ts +8 -7
  45. package/layer/Heatmap.d.ts.map +1 -1
  46. package/layer/Heatmap.js +7 -5
  47. package/layer/Tile.d.ts +2 -2
  48. package/layer/Tile.js +1 -1
  49. package/layer/Vector.d.ts +11 -9
  50. package/layer/Vector.d.ts.map +1 -1
  51. package/layer/Vector.js +7 -5
  52. package/layer/VectorImage.d.ts +9 -7
  53. package/layer/VectorImage.d.ts.map +1 -1
  54. package/layer/VectorImage.js +6 -4
  55. package/layer/VectorTile.d.ts +11 -9
  56. package/layer/VectorTile.d.ts.map +1 -1
  57. package/layer/VectorTile.js +11 -9
  58. package/package.json +1 -1
  59. package/renderer/canvas/TileLayer.d.ts +2 -2
  60. package/renderer/canvas/TileLayer.js +1 -1
  61. package/renderer/canvas/VectorImageLayer.d.ts +1 -1
  62. package/renderer/canvas/VectorImageLayer.d.ts.map +1 -1
  63. package/renderer/canvas/VectorLayer.d.ts +1 -1
  64. package/renderer/canvas/VectorLayer.d.ts.map +1 -1
  65. package/renderer/canvas/VectorTileLayer.d.ts +3 -3
  66. package/renderer/canvas/VectorTileLayer.d.ts.map +1 -1
  67. package/renderer/canvas/VectorTileLayer.js +1 -1
  68. package/source/OGCVectorTile.d.ts +7 -7
  69. package/source/OGCVectorTile.d.ts.map +1 -1
  70. package/source/OGCVectorTile.js +3 -3
  71. package/source/Vector.d.ts +14 -14
  72. package/source/Vector.d.ts.map +1 -1
  73. package/source/Vector.js +10 -10
  74. package/source/VectorTile.d.ts +8 -7
  75. package/source/VectorTile.d.ts.map +1 -1
  76. package/source/VectorTile.js +3 -2
  77. package/util.js +1 -1
@@ -834,7 +834,7 @@ function parseMatchArgs(encoded, context, parsedArgs, typeHint) {
834
834
 
835
835
  const input = parse(encoded[1], context);
836
836
  let inputType = input.type;
837
- const fallback = parse(encoded[encoded.length - 1], context);
837
+ const fallback = parse(encoded[encoded.length - 1], context, typeHint);
838
838
  let outputType =
839
839
  typeHint !== undefined ? typeHint & fallback.type : fallback.type;
840
840
 
@@ -842,7 +842,7 @@ function parseMatchArgs(encoded, context, parsedArgs, typeHint) {
842
842
  const args = new Array(argsCount - 2);
843
843
  for (let i = 0; i < argsCount - 2; i += 2) {
844
844
  const match = parse(encoded[i + 2], context);
845
- const output = parse(encoded[i + 3], context);
845
+ const output = parse(encoded[i + 3], context, typeHint);
846
846
  inputType &= match.type;
847
847
  outputType &= output.type;
848
848
  args[i] = match;
@@ -14,7 +14,7 @@
14
14
  * source.
15
15
  *
16
16
  * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
17
- * @typedef {function(this:(import("./source/Vector").default|import("./VectorTile.js").default),
17
+ * @typedef {function(this:(import("./source/Vector").default<FeatureType>|import("./VectorTile.js").default),
18
18
  * import("./extent.js").Extent,
19
19
  * number,
20
20
  * import("./proj/Projection.js").default,
@@ -34,9 +34,9 @@
34
34
  * @api
35
35
  */
36
36
  /**
37
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
37
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
38
38
  * @param {string|FeatureUrlFunction} url Feature URL service.
39
- * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
39
+ * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
40
40
  * @param {import("./extent.js").Extent} extent Extent.
41
41
  * @param {number} resolution Resolution.
42
42
  * @param {import("./proj/Projection.js").default} projection Projection.
@@ -45,18 +45,18 @@
45
45
  * @param {function(): void} failure Failure
46
46
  * Function called when loading failed.
47
47
  */
48
- export function loadFeaturesXhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>, extent: import("./extent.js").Extent, resolution: number, projection: import("./proj/Projection.js").default, success: (arg0: FeatureType[], arg1: import("./proj/Projection.js").default) => void, failure: () => void): void;
48
+ export function loadFeaturesXhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>, extent: import("./extent.js").Extent, resolution: number, projection: import("./proj/Projection.js").default, success: (arg0: FeatureType[], arg1: import("./proj/Projection.js").default) => void, failure: () => void): void;
49
49
  /**
50
50
  * Create an XHR feature loader for a `url` and `format`. The feature loader
51
51
  * loads features (with XHR), parses the features, and adds them to the
52
52
  * vector source.
53
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
53
+ * @template {import("./Feature.js").FeatureLike} FeatureType
54
54
  * @param {string|FeatureUrlFunction} url Feature URL service.
55
- * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
55
+ * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
56
56
  * @return {FeatureLoader<FeatureType>} The feature loader.
57
57
  * @api
58
58
  */
59
- export function xhr<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>): FeatureLoader<FeatureType>;
59
+ export function xhr<FeatureType extends import("./Feature.js").FeatureLike>(url: string | FeatureUrlFunction, format: import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>): FeatureLoader<FeatureType>;
60
60
  /**
61
61
  * Setter for the withCredentials configuration for the XHR.
62
62
  *
@@ -80,7 +80,7 @@ export function setWithCredentials(xhrWithCredentials: boolean): void;
80
80
  * The function is responsible for loading the features and adding them to the
81
81
  * source.
82
82
  */
83
- export type FeatureLoader<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>> = (this: (import("./source/Vector").default | import("./VectorTile.js").default), arg1: import("./extent.js").Extent, arg2: number, arg3: import("./proj/Projection.js").default, arg4: ((arg0: Array<FeatureType>) => void) | undefined, arg5: (() => void) | undefined) => void;
83
+ export type FeatureLoader<FeatureType extends import("./Feature.js").FeatureLike = import("./Feature.js").default<import("./geom.js").Geometry>> = (this: (import("./source/Vector").default<FeatureType> | import("./VectorTile.js").default<any>), arg1: import("./extent.js").Extent, arg2: number, arg3: import("./proj/Projection.js").default, arg4: ((arg0: Array<FeatureType>) => void) | undefined, arg5: (() => void) | undefined) => void;
84
84
  /**
85
85
  * {@link module :ol/source/Vector~VectorSource} sources use a function of this type to
86
86
  * get the url to load features from.
@@ -1 +1 @@
1
- {"version":3,"file":"featureloader.d.ts","sourceRoot":"","sources":["featureloader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;GAWG;AACH,kIAVW,MAAM,GAAC,kBAAkB,2HAEzB,OAAO,aAAa,EAAE,MAAM,cAC5B,MAAM,cACN,OAAO,sBAAsB,EAAE,OAAO,uCACT,OAAO,sBAAsB,EAAE,OAAO,KAAG,IAAI,iBAE9D,IAAI,QAkE1B;AAED;;;;;;;;;GASG;AACH,sHALW,MAAM,GAAC,kBAAkB,+IAsCnC;AAED;;;;;;GAMG;AACH,uDAJW,OAAO,QAMjB;;;;;;;;;;;;;;;;0JAxJ0B,CAAC,OAAO,iBAAiB,EAAE,OAAO,GAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,QAC/F,OAAmB,aAAa,EAAE,MAAM,QACxC,MAAkB,QAClB,OAAmB,sBAAsB,EAAE,OAAO,gBAC7B,MAAM,WAAW,CAAC,KAAG,IAAI,4BACtB,IAAI,kBAAI,IAAI;;;;;;;;;;wCAYf,OAAO,aAAa,EAAE,MAAM,QAAE,MAAM,QAAE,OAAO,sBAAsB,EAAE,OAAO,KAAG,MAAM"}
1
+ {"version":3,"file":"featureloader.d.ts","sourceRoot":"","sources":["featureloader.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;GAUG;AAEH;;;;;;;;;;;GAWG;AACH,4JAVW,MAAM,GAAC,kBAAkB,2HAEzB,OAAO,aAAa,EAAE,MAAM,cAC5B,MAAM,cACN,OAAO,sBAAsB,EAAE,OAAO,uCACT,OAAO,sBAAsB,EAAE,OAAO,KAAG,IAAI,iBAE9D,IAAI,QAkE1B;AAED;;;;;;;;;GASG;AACH,iFALW,MAAM,GAAC,kBAAkB,+IAsCnC;AAED;;;;;;GAMG;AACH,uDAJW,OAAO,QAMjB;;;;;;;;;;;;;;;;0JAxJ0B,CAAC,OAAO,iBAAiB,EAAE,OAAO,CAAC,WAAW,CAAC,yCAAkC,CAAC,QAC5G,OAAmB,aAAa,EAAE,MAAM,QACxC,MAAkB,QAClB,OAAmB,sBAAsB,EAAE,OAAO,gBAC7B,MAAM,WAAW,CAAC,KAAG,IAAI,4BACtB,IAAI,kBAAI,IAAI;;;;;;;;;;wCAYf,OAAO,aAAa,EAAE,MAAM,QAAE,MAAM,QAAE,OAAO,sBAAsB,EAAE,OAAO,KAAG,MAAM"}
package/featureloader.js CHANGED
@@ -26,7 +26,7 @@ let withCredentials = false;
26
26
  * source.
27
27
  *
28
28
  * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
29
- * @typedef {function(this:(import("./source/Vector").default|import("./VectorTile.js").default),
29
+ * @typedef {function(this:(import("./source/Vector").default<FeatureType>|import("./VectorTile.js").default),
30
30
  * import("./extent.js").Extent,
31
31
  * number,
32
32
  * import("./proj/Projection.js").default,
@@ -48,9 +48,9 @@ let withCredentials = false;
48
48
  */
49
49
 
50
50
  /**
51
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
51
+ * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").default]
52
52
  * @param {string|FeatureUrlFunction} url Feature URL service.
53
- * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
53
+ * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
54
54
  * @param {import("./extent.js").Extent} extent Extent.
55
55
  * @param {number} resolution Resolution.
56
56
  * @param {import("./proj/Projection.js").default} projection Projection.
@@ -128,9 +128,9 @@ export function loadFeaturesXhr(
128
128
  * Create an XHR feature loader for a `url` and `format`. The feature loader
129
129
  * loads features (with XHR), parses the features, and adds them to the
130
130
  * vector source.
131
- * @template {import("./Feature.js").FeatureLike} [FeatureType=import("./Feature.js").FeatureLike]
131
+ * @template {import("./Feature.js").FeatureLike} FeatureType
132
132
  * @param {string|FeatureUrlFunction} url Feature URL service.
133
- * @param {import("./format/Feature.js").default<import('./format/Feature.js').FeatureToFeatureClass<FeatureType>>} format Feature format.
133
+ * @param {import("./format/Feature.js").default<import("./format/Feature.js").FeatureToFeatureClass<FeatureType>>} format Feature format.
134
134
  * @return {FeatureLoader<FeatureType>} The feature loader.
135
135
  * @api
136
136
  */
@@ -62,13 +62,6 @@ declare class EsriJSON extends JSONFeature<typeof Feature> {
62
62
  * @return {import("../Feature.js").default} Feature.
63
63
  */
64
64
  protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined, idField?: string | undefined): import("../Feature.js").default;
65
- /**
66
- * @param {Object} object Object.
67
- * @param {import("./Feature.js").ReadOptions} [options] Read options.
68
- * @protected
69
- * @return {Array<Feature>} Features.
70
- */
71
- protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<Feature>;
72
65
  /**
73
66
  * @param {EsriJSONGeometry} object Object.
74
67
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
@@ -1 +1 @@
1
- {"version":3,"file":"EsriJSON.d.ts","sourceRoot":"","sources":["EsriJSON.js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AO,iBAAiB,EAAE,UAAU;4BACpC,OAAO,iBAAiB,EAAE,KAAK;+BAC/B,OAAO,iBAAiB,EAAE,QAAQ;2CAClC,OAAO,iBAAiB,EAAE,oBAAoB;;;;;WAK7C,MAAM,MAAM,MAAM,MAAM,MAAM,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;AAgChD;;;GAGG;AAEH;;;;;GAKG;AACH;IACE;;OAEG;IACH,2CAWC;IANC;;;;OAIG;IACH,sBAAyC;IAG3C;;;;;;OAMG;IACH,sIAFY,OAAO,eAAe,EAAE,OAAO,CAkB1C;IA6BD;;;;;OAKG;IACH,yCALW,gBAAgB,6DAGf,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAqBD;;;;;;;OAOG;IACH,8BALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,gBAAgB,CAK3B;IAuCD;;;;;;;OAOG;IACH,8BALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,kBAAkB,CAY7B;CACF;oBA/OmB,eAAe;wBACX,kBAAkB"}
@@ -123,7 +123,7 @@ export type FeatureObject = {
123
123
  /**
124
124
  * *
125
125
  */
126
- export type FeatureToFeatureClass<T extends Feature<import("../geom.js").Geometry> | RenderFeature> = T extends RenderFeature ? typeof RenderFeature : typeof Feature;
126
+ export type FeatureToFeatureClass<T extends import("../Feature.js").FeatureLike> = T extends RenderFeature ? typeof RenderFeature : typeof Feature;
127
127
  /**
128
128
  * *
129
129
  */
@@ -191,7 +191,7 @@ import RenderFeature from '../render/Feature.js';
191
191
  * @property {Object<string, *>} [properties] Properties.
192
192
  */
193
193
  /***
194
- * @template {Feature|RenderFeature} T
194
+ * @template {import('../Feature.js').FeatureLike} T
195
195
  * @typedef {T extends RenderFeature ? typeof RenderFeature : typeof Feature} FeatureToFeatureClass
196
196
  */
197
197
  /***
@@ -207,11 +207,11 @@ import RenderFeature from '../render/Feature.js';
207
207
  * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
208
208
  * file formats. See the documentation for each format for more details.
209
209
  *
210
- * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
210
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
211
211
  * @abstract
212
212
  * @api
213
213
  */
214
- declare class FeatureFormat<T extends import("../Feature.js").FeatureClass = typeof Feature> {
214
+ declare class FeatureFormat<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> {
215
215
  /**
216
216
  * @protected
217
217
  * @type {import("../proj/Projection.js").default|undefined}
@@ -224,9 +224,9 @@ declare class FeatureFormat<T extends import("../Feature.js").FeatureClass = typ
224
224
  protected defaultFeatureProjection: import("../proj/Projection.js").default | undefined;
225
225
  /**
226
226
  * @protected
227
- * @type {T}
227
+ * @type {FeatureClassType}
228
228
  */
229
- protected featureClass: T;
229
+ protected featureClass: FeatureClassType;
230
230
  /**
231
231
  * A list media types supported by the format in descending order of preference.
232
232
  * @type {Array<string>}
@@ -261,18 +261,18 @@ declare class FeatureFormat<T extends import("../Feature.js").FeatureClass = typ
261
261
  * @abstract
262
262
  * @param {Document|Element|Object|string} source Source.
263
263
  * @param {ReadOptions} [options] Read options.
264
- * @return {import("../Feature.js").FeatureLike|Array<import("../render/Feature.js").default>} Feature.
264
+ * @return {FeatureClassToFeature<FeatureClassType>|Array<FeatureClassToFeature<FeatureClassType>>} Feature.
265
265
  */
266
- readFeature(source: Document | Element | any | string, options?: ReadOptions | undefined): import("../Feature.js").FeatureLike | Array<import("../render/Feature.js").default>;
266
+ readFeature(source: Document | Element | any | string, options?: ReadOptions | undefined): FeatureClassToFeature<FeatureClassType> | Array<FeatureClassToFeature<FeatureClassType>>;
267
267
  /**
268
268
  * Read all features from a source.
269
269
  *
270
270
  * @abstract
271
271
  * @param {Document|Element|ArrayBuffer|Object|string} source Source.
272
272
  * @param {ReadOptions} [options] Read options.
273
- * @return {Array<import('../Feature.js').FeatureLike|FeatureClassToFeature<T>>} Features.
273
+ * @return {Array<FeatureClassToFeature<FeatureClassType>>} Features.
274
274
  */
275
- readFeatures(source: Document | Element | ArrayBuffer | any | string, options?: ReadOptions | undefined): Array<import('../Feature.js').FeatureLike | FeatureClassToFeature<T>>;
275
+ readFeatures(source: Document | Element | ArrayBuffer | any | string, options?: ReadOptions | undefined): Array<FeatureClassToFeature<FeatureClassType>>;
276
276
  /**
277
277
  * Read a single geometry from a source.
278
278
  *
@@ -1 +1 @@
1
- {"version":3,"file":"Feature.d.ts","sourceRoot":"","sources":["Feature.js"],"names":[],"mappings":"AAgSA;;;;;;GAMG;AACH,0HAJW,OAAO,uDAkDjB;AAED;;;;GAIG;AACH,mDAJW,OAAO,cAAc,EAAE,MAAM,sCAE5B,OAAO,cAAc,EAAE,MAAM,CAgBxC;AA2BD;;;;GAIG;AACH,4CAJW,aAAa,qDAEZ,aAAa,GAAC,MAAM,aAAa,CAAC,CAkC7C;AAED;;;;GAIG;AACH,uCAJW,cAAc,GAAC,IAAI,qDAElB,OAAO,qBAAqB,EAAE,OAAO,CAkBhD;;;;;;;;;;qBAnaa,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;wBASnC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;qBAOnC,OAAO,YAAY,EAAE,cAAc;;;;;;wBAInC,OAAO,YAAY,EAAE,cAAc;;;;;;;;;;;;;;;;;;;;;;mBAoBpC,aAAa,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK;;;;;UAKtC,OAAO,qBAAqB,EAAE,IAAI;;;;qBAClC,MAAM,MAAM,CAAC;;;;;;;;;;uCAMd,MAAM,cAAc,CAAC;6BAIrB,oBAAoB,mBAAyB;;;;;;;;;;;;;;;;;;;;sGAY7C,CAAC,SAAS,aAAa,GAAG,oBAAoB,GAAG,cAAc;;;;oFAK/D,CAAC,CAAC,MAAM,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,GAAG,OAAO;0BAnG7C,sBAAsB;AAwBhD;;;;;;;;;;;;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,wBAJW,OAAO,qBAAqB,EAAE,OAAO,uCAEpC,MAAM,GAAC,WAAW,CAI7B;CACF;oBAzRmB,eAAe"}
package/format/Feature.js CHANGED
@@ -95,7 +95,7 @@ import {
95
95
  */
96
96
 
97
97
  /***
98
- * @template {Feature|RenderFeature} T
98
+ * @template {import('../Feature.js').FeatureLike} T
99
99
  * @typedef {T extends RenderFeature ? typeof RenderFeature : typeof Feature} FeatureToFeatureClass
100
100
  */
101
101
 
@@ -113,7 +113,7 @@ import {
113
113
  * {@link module:ol/Feature~Feature} objects from a variety of commonly used geospatial
114
114
  * file formats. See the documentation for each format for more details.
115
115
  *
116
- * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
116
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
117
117
  * @abstract
118
118
  * @api
119
119
  */
@@ -133,9 +133,9 @@ class FeatureFormat {
133
133
 
134
134
  /**
135
135
  * @protected
136
- * @type {T}
136
+ * @type {FeatureClassType}
137
137
  */
138
- this.featureClass = /** @type {T} */ (Feature);
138
+ this.featureClass = /** @type {FeatureClassType} */ (Feature);
139
139
 
140
140
  /**
141
141
  * A list media types supported by the format in descending order of preference.
@@ -206,7 +206,7 @@ class FeatureFormat {
206
206
  * @abstract
207
207
  * @param {Document|Element|Object|string} source Source.
208
208
  * @param {ReadOptions} [options] Read options.
209
- * @return {import("../Feature.js").FeatureLike|Array<import("../render/Feature.js").default>} Feature.
209
+ * @return {FeatureClassToFeature<FeatureClassType>|Array<FeatureClassToFeature<FeatureClassType>>} Feature.
210
210
  */
211
211
  readFeature(source, options) {
212
212
  return abstract();
@@ -218,7 +218,7 @@ class FeatureFormat {
218
218
  * @abstract
219
219
  * @param {Document|Element|ArrayBuffer|Object|string} source Source.
220
220
  * @param {ReadOptions} [options] Read options.
221
- * @return {Array<import('../Feature.js').FeatureLike|FeatureClassToFeature<T>>} Features.
221
+ * @return {Array<FeatureClassToFeature<FeatureClassType>>} Features.
222
222
  */
223
223
  readFeatures(source, options) {
224
224
  return abstract();
@@ -10,7 +10,7 @@ export type GeoJSONMultiPoint = import("geojson").MultiPoint;
10
10
  export type GeoJSONMultiLineString = import("geojson").MultiLineString;
11
11
  export type GeoJSONMultiPolygon = import("geojson").MultiPolygon;
12
12
  export type GeoJSONGeometryCollection = import("geojson").GeometryCollection;
13
- export type Options<FeatureClassToFeature extends import("../Feature.js").FeatureClass> = {
13
+ export type Options<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> = {
14
14
  /**
15
15
  * Default data projection.
16
16
  */
@@ -37,7 +37,7 @@ export type Options<FeatureClassToFeature extends import("../Feature.js").Featur
37
37
  * the primary concern, and features are not going to be modified or round-tripped through the format,
38
38
  * consider using {@link module :ol/render/Feature~RenderFeature}
39
39
  */
40
- featureClass?: FeatureClassToFeature | undefined;
40
+ featureClass?: FeatureClassType | undefined;
41
41
  };
42
42
  /**
43
43
  * @typedef {import("geojson").GeoJSON} GeoJSONObject
@@ -53,7 +53,7 @@ export type Options<FeatureClassToFeature extends import("../Feature.js").Featur
53
53
  * @typedef {import("geojson").GeometryCollection} GeoJSONGeometryCollection
54
54
  */
55
55
  /**
56
- * @template {import("../Feature.js").FeatureClass} FeatureClassToFeature
56
+ * @template {import("../Feature.js").FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
57
57
  * @typedef {Object} Options
58
58
  *
59
59
  * @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
@@ -64,7 +64,7 @@ export type Options<FeatureClassToFeature extends import("../Feature.js").Featur
64
64
  * the geometry_name field in the feature GeoJSON. If set to `true` the GeoJSON reader
65
65
  * will look for that field to set the geometry name. If both this field is set to `true`
66
66
  * and a `geometryName` is provided, the `geometryName` will take precedence.
67
- * @property {FeatureClassToFeature} [featureClass] Feature class
67
+ * @property {FeatureClassType} [featureClass] Feature class
68
68
  * to be used when reading features. The default is {@link module:ol/Feature~Feature}. If performance is
69
69
  * the primary concern, and features are not going to be modified or round-tripped through the format,
70
70
  * consider using {@link module:ol/render/Feature~RenderFeature}
@@ -73,15 +73,15 @@ export type Options<FeatureClassToFeature extends import("../Feature.js").Featur
73
73
  * @classdesc
74
74
  * Feature format for reading and writing data in the GeoJSON format.
75
75
  *
76
- * @template {import('../Feature.js').FeatureClass} [T=typeof Feature]
77
- * @extends {JSONFeature<T>}
76
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
77
+ * @extends {JSONFeature<FeatureClassType>}
78
78
  * @api
79
79
  */
80
- declare class GeoJSON<T extends import("../Feature.js").FeatureClass = typeof Feature> extends JSONFeature<T> {
80
+ declare class GeoJSON<FeatureClassType extends import("../Feature.js").FeatureClass = typeof Feature> extends JSONFeature<FeatureClassType> {
81
81
  /**
82
- * @param {Options<T>} [options] Options.
82
+ * @param {Options<FeatureClassType>} [options] Options.
83
83
  */
84
- constructor(options?: Options<T> | undefined);
84
+ constructor(options?: Options<FeatureClassType> | undefined);
85
85
  /**
86
86
  * Name of the geometry attribute for features.
87
87
  * @type {string|undefined}
@@ -1 +1 @@
1
- {"version":3,"file":"GeoJSON.d.ts","sourceRoot":"","sources":["GeoJSON.js"],"names":[],"mappings":";4BAqBa,OAAO,SAAS,EAAE,OAAO;6BACzB,OAAO,SAAS,EAAE,OAAO;uCACzB,OAAO,SAAS,EAAE,iBAAiB;8BACnC,OAAO,SAAS,EAAE,QAAQ;2BAC1B,OAAO,SAAS,EAAE,KAAK;gCACvB,OAAO,SAAS,EAAE,UAAU;6BAC5B,OAAO,SAAS,EAAE,OAAO;gCACzB,OAAO,SAAS,EAAE,UAAU;qCAC5B,OAAO,SAAS,EAAE,eAAe;kCACjC,OAAO,SAAS,EAAE,YAAY;wCAC9B,OAAO,SAAS,EAAE,kBAAkB;;;;;qBAOnC,OAAO,YAAY,EAAE,cAAc;;;;;wBACnC,OAAO,YAAY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AAyC;IAEzC;;;;OAIG;IACH,6BAAuD;IAgGzD;;;;;OAKG;IACH,yCALW,eAAe,6DAGd,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAwBD;;;;;;;OAOG;IACH,4BALW,OAAO,eAAe,EAAE,OAAO,8DAE9B,cAAc,CAmCzB;IAED;;;;;;;OAOG;IACH,8BALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,wBAAwB,CAanC;IAED;;;;;;;OAOG;IACH,8BALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,eAAe,GAAC,yBAAyB,CAKpD;CACF;oBAxSmB,eAAe;wBACX,kBAAkB"}
package/format/GeoJSON.js CHANGED
@@ -33,7 +33,7 @@ import {isEmpty} from '../obj.js';
33
33
  */
34
34
 
35
35
  /**
36
- * @template {import("../Feature.js").FeatureClass} FeatureClassToFeature
36
+ * @template {import("../Feature.js").FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
37
37
  * @typedef {Object} Options
38
38
  *
39
39
  * @property {import("../proj.js").ProjectionLike} [dataProjection='EPSG:4326'] Default data projection.
@@ -44,7 +44,7 @@ import {isEmpty} from '../obj.js';
44
44
  * the geometry_name field in the feature GeoJSON. If set to `true` the GeoJSON reader
45
45
  * will look for that field to set the geometry name. If both this field is set to `true`
46
46
  * and a `geometryName` is provided, the `geometryName` will take precedence.
47
- * @property {FeatureClassToFeature} [featureClass] Feature class
47
+ * @property {FeatureClassType} [featureClass] Feature class
48
48
  * to be used when reading features. The default is {@link module:ol/Feature~Feature}. If performance is
49
49
  * the primary concern, and features are not going to be modified or round-tripped through the format,
50
50
  * consider using {@link module:ol/render/Feature~RenderFeature}
@@ -54,13 +54,13 @@ import {isEmpty} from '../obj.js';
54
54
  * @classdesc
55
55
  * Feature format for reading and writing data in the GeoJSON format.
56
56
  *
57
- * @template {import('../Feature.js').FeatureClass} [T=typeof Feature]
58
- * @extends {JSONFeature<T>}
57
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
58
+ * @extends {JSONFeature<FeatureClassType>}
59
59
  * @api
60
60
  */
61
61
  class GeoJSON extends JSONFeature {
62
62
  /**
63
- * @param {Options<T>} [options] Options.
63
+ * @param {Options<FeatureClassType>} [options] Options.
64
64
  */
65
65
  constructor(options) {
66
66
  options = options ? options : {};
@@ -109,7 +109,7 @@ class GeoJSON extends JSONFeature {
109
109
  * @param {Object} object Object.
110
110
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
111
111
  * @protected
112
- * @return {Feature|RenderFeature|Array<RenderFeature>}.default} Feature.
112
+ * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
113
113
  */
114
114
  readFeatureFromObject(object, options) {
115
115
  /**
@@ -128,13 +128,15 @@ class GeoJSON extends JSONFeature {
128
128
 
129
129
  const geometry = readGeometryInternal(geoJSONFeature['geometry'], options);
130
130
  if (this.featureClass === RenderFeature) {
131
- return createRenderFeature(
132
- {
133
- geometry,
134
- id: geoJSONFeature['id'],
135
- properties: geoJSONFeature['properties'],
136
- },
137
- options,
131
+ return /** @type {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
132
+ createRenderFeature(
133
+ {
134
+ geometry,
135
+ id: geoJSONFeature['id'],
136
+ properties: geoJSONFeature['properties'],
137
+ },
138
+ options,
139
+ )
138
140
  );
139
141
  }
140
142
 
@@ -153,18 +155,19 @@ class GeoJSON extends JSONFeature {
153
155
  if (geoJSONFeature['properties']) {
154
156
  feature.setProperties(geoJSONFeature['properties'], true);
155
157
  }
156
- return feature;
158
+ return /** @type {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
159
+ feature
160
+ );
157
161
  }
158
162
 
159
163
  /**
160
164
  * @param {Object} object Object.
161
165
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
162
166
  * @protected
163
- * @return {Array<Feature|RenderFeature>} Features.
167
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
164
168
  */
165
169
  readFeaturesFromObject(object, options) {
166
170
  const geoJSONObject = /** @type {GeoJSONObject} */ (object);
167
- /** @type {Array<Feature|RenderFeature|Array<RenderFeature>>} */
168
171
  let features = null;
169
172
  if (geoJSONObject['type'] === 'FeatureCollection') {
170
173
  const geoJSONFeatureCollection = /** @type {GeoJSONFeatureCollection} */ (
@@ -185,7 +188,9 @@ class GeoJSON extends JSONFeature {
185
188
  } else {
186
189
  features = [this.readFeatureFromObject(object, options)];
187
190
  }
188
- return features.flat();
191
+ return /** @type {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
192
+ features.flat()
193
+ );
189
194
  }
190
195
 
191
196
  /**
@@ -5,47 +5,27 @@ export default JSONFeature;
5
5
  * instantiated in apps.
6
6
  * Base class for JSON feature formats.
7
7
  *
8
- * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
9
- * @extends {FeatureFormat<T>}
8
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
9
+ * @extends {FeatureFormat<FeatureClassType>}
10
10
  * @abstract
11
11
  */
12
- declare class JSONFeature<T extends import("../Feature.js").FeatureClass = typeof import("../Feature.js").default> extends FeatureFormat<T> {
13
- /**
14
- * Read a feature. Only works for a single feature. Use `readFeatures` to
15
- * read a feature collection.
16
- *
17
- * @param {ArrayBuffer|Document|Element|Object|string} source Source.
18
- * @param {import("./Feature.js").ReadOptions} [options] Read options.
19
- * @return {import('./Feature.js').FeatureClassToFeature<T>} Feature.
20
- * @api
21
- */
22
- readFeature(source: ArrayBuffer | Document | Element | any | string, options?: import("./Feature.js").ReadOptions | undefined): import('./Feature.js').FeatureClassToFeature<T>;
23
- /**
24
- * Read all features. Works with both a single feature and a feature
25
- * collection.
26
- *
27
- * @param {ArrayBuffer|Document|Element|Object|string} source Source.
28
- * @param {import("./Feature.js").ReadOptions} [options] Read options.
29
- * @return {Array<import('./Feature.js').FeatureClassToFeature<T>>} Features.
30
- * @api
31
- */
32
- readFeatures(source: ArrayBuffer | Document | Element | any | string, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<T>>;
12
+ declare class JSONFeature<FeatureClassType extends import("../Feature.js").FeatureClass = typeof import("../Feature.js").default> extends FeatureFormat<FeatureClassType> {
33
13
  /**
34
14
  * @abstract
35
15
  * @param {Object} object Object.
36
16
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
37
17
  * @protected
38
- * @return {import("../Feature.js").default|import("../render/Feature.js").default|Array<import("../render/Feature.js").default>} Feature.
18
+ * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
39
19
  */
40
- protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): import("../Feature.js").default | import("../render/Feature.js").default | Array<import("../render/Feature.js").default>;
20
+ protected readFeatureFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): import('./Feature.js').FeatureClassToFeature<FeatureClassType> | Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>;
41
21
  /**
42
22
  * @abstract
43
23
  * @param {Object} object Object.
44
24
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
45
25
  * @protected
46
- * @return {Array<import("../Feature.js").default|import("../render/Feature.js").default>} Features.
26
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
47
27
  */
48
- protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<import("../Feature.js").default | import("../render/Feature.js").default>;
28
+ protected readFeaturesFromObject(object: any, options?: import("./Feature.js").ReadOptions | undefined): Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>;
49
29
  /**
50
30
  * @abstract
51
31
  * @param {Object} object Object.
@@ -1 +1 @@
1
- {"version":3,"file":"JSONFeature.d.ts","sourceRoot":"","sources":["JSONFeature.js"],"names":[],"mappings":";AAMA;;;;;;;;;GASG;AACH;IAYE;;;;;;;;OAQG;IACH,oBALW,WAAW,GAAC,QAAQ,GAAC,OAAO,SAAQ,MAAM,6DAEzC,OAAO,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAU1D;IAED;;;;;;;;OAQG;IACH,qBALW,WAAW,GAAC,QAAQ,GAAC,OAAO,SAAQ,MAAM,6DAEzC,MAAM,OAAO,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAUjE;IAED;;;;;;OAMG;IACH,wGAFY,OAAO,eAAe,EAAE,OAAO,GAAC,OAAO,sBAAsB,EAAE,OAAO,GAAC,MAAM,OAAO,sBAAsB,EAAE,OAAO,CAAC,CAI/H;IAED;;;;;;OAMG;IACH,yGAFY,MAAM,OAAO,eAAe,EAAE,OAAO,GAAC,OAAO,sBAAsB,EAAE,OAAO,CAAC,CAIxF;IAiBD;;;;;;OAMG;IACH,yGAFY,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAED;;;;;;OAMG;IACH,uBAJW,WAAW,GAAC,QAAQ,GAAC,OAAO,SAAQ,MAAM,GACzC,OAAO,uBAAuB,EAAE,OAAO,CAKlD;IAED;;;;;OAKG;IACH,iDAFY,OAAO,uBAAuB,EAAE,OAAO,CAIlD;IAED;;;;;;;OAOG;IACH,sBALW,OAAO,eAAe,EAAE,OAAO,8DAE9B,MAAM,CAKjB;IAED;;;;;OAKG;IACH,4BAJW,OAAO,eAAe,EAAE,OAAO,kEAMzC;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,kEAMhD;IAED;;;;;;;OAOG;IACH,wBALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,OAAO,qBAAqB,EAAE,OAAO,kEAM/C;CACF;0BAnMyB,cAAc"}
1
+ {"version":3,"file":"JSONFeature.d.ts","sourceRoot":"","sources":["JSONFeature.js"],"names":[],"mappings":";AAMA;;;;;;;;;GASG;AACH;IA8CE;;;;;;OAMG;IACH,wGAFY,OAAO,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,GAAC,MAAM,OAAO,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAI/I;IAED;;;;;;OAMG;IACH,yGAFY,MAAM,OAAO,cAAc,EAAE,qBAAqB,CAAC,gBAAgB,CAAC,CAAC,CAIhF;IAiBD;;;;;;OAMG;IACH,yGAFY,OAAO,qBAAqB,EAAE,OAAO,CAIhD;IAED;;;;;;OAMG;IACH,uBAJW,WAAW,GAAC,QAAQ,GAAC,OAAO,SAAQ,MAAM,GACzC,OAAO,uBAAuB,EAAE,OAAO,CAKlD;IAED;;;;;OAKG;IACH,iDAFY,OAAO,uBAAuB,EAAE,OAAO,CAIlD;IAED;;;;;;;OAOG;IACH,sBALW,OAAO,eAAe,EAAE,OAAO,8DAE9B,MAAM,CAKjB;IAED;;;;;OAKG;IACH,4BAJW,OAAO,eAAe,EAAE,OAAO,kEAMzC;IAED;;;;;;;OAOG;IACH,wBALW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,8DAErC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,MAAM,OAAO,eAAe,EAAE,OAAO,CAAC,kEAMhD;IAED;;;;;;;OAOG;IACH,wBALW,OAAO,qBAAqB,EAAE,OAAO,8DAEpC,MAAM,CAKjB;IAED;;;;;OAKG;IACH,8BAJW,OAAO,qBAAqB,EAAE,OAAO,kEAM/C;CACF;0BAjMyB,cAAc"}
@@ -10,8 +10,8 @@ import {abstract} from '../util.js';
10
10
  * instantiated in apps.
11
11
  * Base class for JSON feature formats.
12
12
  *
13
- * @template {import('../Feature.js').FeatureClass} [T=typeof import('../Feature.js').default]
14
- * @extends {FeatureFormat<T>}
13
+ * @template {import('../Feature.js').FeatureClass} [FeatureClassType=import('./Feature.js').FeatureToFeatureClass<import("../Feature.js").default>]
14
+ * @extends {FeatureFormat<FeatureClassType>}
15
15
  * @abstract
16
16
  */
17
17
  class JSONFeature extends FeatureFormat {
@@ -32,15 +32,13 @@ class JSONFeature extends FeatureFormat {
32
32
  *
33
33
  * @param {ArrayBuffer|Document|Element|Object|string} source Source.
34
34
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
35
- * @return {import('./Feature.js').FeatureClassToFeature<T>} Feature.
35
+ * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
36
36
  * @api
37
37
  */
38
38
  readFeature(source, options) {
39
- return /** @type {import('./Feature.js').FeatureClassToFeature<T>} */ (
40
- this.readFeatureFromObject(
41
- getObject(source),
42
- this.getReadOptions(source, options),
43
- )
39
+ return this.readFeatureFromObject(
40
+ getObject(source),
41
+ this.getReadOptions(source, options),
44
42
  );
45
43
  }
46
44
 
@@ -50,11 +48,11 @@ class JSONFeature extends FeatureFormat {
50
48
  *
51
49
  * @param {ArrayBuffer|Document|Element|Object|string} source Source.
52
50
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
53
- * @return {Array<import('./Feature.js').FeatureClassToFeature<T>>} Features.
51
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
54
52
  * @api
55
53
  */
56
54
  readFeatures(source, options) {
57
- return /** @type {Array<import('./Feature.js').FeatureClassToFeature<T>>} */ (
55
+ return /** @type {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} */ (
58
56
  this.readFeaturesFromObject(
59
57
  getObject(source),
60
58
  this.getReadOptions(source, options),
@@ -67,7 +65,7 @@ class JSONFeature extends FeatureFormat {
67
65
  * @param {Object} object Object.
68
66
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
69
67
  * @protected
70
- * @return {import("../Feature.js").default|import("../render/Feature.js").default|Array<import("../render/Feature.js").default>} Feature.
68
+ * @return {import('./Feature.js').FeatureClassToFeature<FeatureClassType>|Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Feature.
71
69
  */
72
70
  readFeatureFromObject(object, options) {
73
71
  return abstract();
@@ -78,7 +76,7 @@ class JSONFeature extends FeatureFormat {
78
76
  * @param {Object} object Object.
79
77
  * @param {import("./Feature.js").ReadOptions} [options] Read options.
80
78
  * @protected
81
- * @return {Array<import("../Feature.js").default|import("../render/Feature.js").default>} Features.
79
+ * @return {Array<import('./Feature.js').FeatureClassToFeature<FeatureClassType>>} Features.
82
80
  */
83
81
  readFeaturesFromObject(object, options) {
84
82
  return abstract();