geotiff 3.0.0 → 3.0.1

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 (164) hide show
  1. package/dist-browser/geotiff.js +3 -2
  2. package/dist-browser/geotiff.js.map +1 -1
  3. package/dist-module/compression/basedecoder.d.ts +4 -0
  4. package/dist-module/compression/basedecoder.d.ts.map +1 -1
  5. package/dist-module/compression/basedecoder.js +6 -0
  6. package/dist-module/compression/index.d.ts +4 -4
  7. package/dist-module/compression/index.d.ts.map +1 -1
  8. package/dist-module/compression/index.js +4 -4
  9. package/dist-module/compression/jpeg.d.ts +6 -1
  10. package/dist-module/compression/jpeg.d.ts.map +1 -1
  11. package/dist-module/compression/jpeg.js +50 -5
  12. package/dist-module/compression/lzw.js +1 -1
  13. package/dist-module/compression/webimage.d.ts +1 -1
  14. package/dist-module/compression/webimage.d.ts.map +1 -1
  15. package/dist-module/compression/webimage.js +1 -1
  16. package/dist-module/dataslice.d.ts.map +1 -1
  17. package/dist-module/dataslice.js +2 -2
  18. package/dist-module/dataview64.d.ts +2 -2
  19. package/dist-module/dataview64.d.ts.map +1 -1
  20. package/dist-module/dataview64.js +4 -4
  21. package/dist-module/geotiff.d.ts +161 -45
  22. package/dist-module/geotiff.d.ts.map +1 -1
  23. package/dist-module/geotiff.js +111 -20
  24. package/dist-module/geotiffimage.d.ts +76 -110
  25. package/dist-module/geotiffimage.d.ts.map +1 -1
  26. package/dist-module/geotiffimage.js +98 -70
  27. package/dist-module/geotiffwriter.js +2 -2
  28. package/dist-module/globals.d.ts +48 -40
  29. package/dist-module/globals.d.ts.map +1 -1
  30. package/dist-module/globals.js +14 -10
  31. package/dist-module/imagefiledirectory.d.ts +2 -2
  32. package/dist-module/imagefiledirectory.d.ts.map +1 -1
  33. package/dist-module/imagefiledirectory.js +23 -12
  34. package/dist-module/logging.js +7 -7
  35. package/dist-module/pool.d.ts +2 -3
  36. package/dist-module/pool.d.ts.map +1 -1
  37. package/dist-module/pool.js +18 -16
  38. package/dist-module/predictor.js +1 -1
  39. package/dist-module/resample.d.ts +18 -18
  40. package/dist-module/resample.d.ts.map +1 -1
  41. package/dist-module/resample.js +12 -12
  42. package/dist-module/source/basesource.d.ts +7 -7
  43. package/dist-module/source/basesource.d.ts.map +1 -1
  44. package/dist-module/source/basesource.js +7 -7
  45. package/dist-module/source/blockedsource.d.ts +10 -10
  46. package/dist-module/source/blockedsource.d.ts.map +1 -1
  47. package/dist-module/source/blockedsource.js +12 -9
  48. package/dist-module/source/client/base.d.ts +8 -10
  49. package/dist-module/source/client/base.d.ts.map +1 -1
  50. package/dist-module/source/client/base.js +4 -3
  51. package/dist-module/source/client/fetch.d.ts +2 -7
  52. package/dist-module/source/client/fetch.d.ts.map +1 -1
  53. package/dist-module/source/client/fetch.js +7 -2
  54. package/dist-module/source/client/http.d.ts +4 -1
  55. package/dist-module/source/client/http.d.ts.map +1 -1
  56. package/dist-module/source/client/http.js +4 -4
  57. package/dist-module/source/client/xhr.d.ts +4 -1
  58. package/dist-module/source/client/xhr.d.ts.map +1 -1
  59. package/dist-module/source/client/xhr.js +1 -1
  60. package/dist-module/source/file.js +4 -4
  61. package/dist-module/source/filereader.js +1 -1
  62. package/dist-module/source/httputils.d.ts +14 -6
  63. package/dist-module/source/httputils.d.ts.map +1 -1
  64. package/dist-module/source/httputils.js +13 -12
  65. package/dist-module/source/remote.d.ts +31 -22
  66. package/dist-module/source/remote.d.ts.map +1 -1
  67. package/dist-module/source/remote.js +37 -13
  68. package/dist-module/utils.d.ts +7 -1
  69. package/dist-module/utils.d.ts.map +1 -1
  70. package/dist-module/utils.js +6 -0
  71. package/dist-module/worker/create.js +1 -1
  72. package/dist-node/compression/basedecoder.d.ts +4 -0
  73. package/dist-node/compression/basedecoder.d.ts.map +1 -1
  74. package/dist-node/compression/basedecoder.js +6 -0
  75. package/dist-node/compression/basedecoder.js.map +1 -1
  76. package/dist-node/compression/index.d.ts +4 -4
  77. package/dist-node/compression/index.d.ts.map +1 -1
  78. package/dist-node/compression/index.js +4 -4
  79. package/dist-node/compression/jpeg.d.ts +6 -1
  80. package/dist-node/compression/jpeg.d.ts.map +1 -1
  81. package/dist-node/compression/jpeg.js +50 -5
  82. package/dist-node/compression/jpeg.js.map +1 -1
  83. package/dist-node/compression/lzw.js +1 -1
  84. package/dist-node/compression/lzw.js.map +1 -1
  85. package/dist-node/compression/webimage.js +1 -1
  86. package/dist-node/compression/webimage.js.map +1 -1
  87. package/dist-node/dataslice.js +2 -2
  88. package/dist-node/dataslice.js.map +1 -1
  89. package/dist-node/dataview64.d.ts +2 -2
  90. package/dist-node/dataview64.d.ts.map +1 -1
  91. package/dist-node/dataview64.js +4 -4
  92. package/dist-node/dataview64.js.map +1 -1
  93. package/dist-node/geotiff.d.ts +161 -45
  94. package/dist-node/geotiff.d.ts.map +1 -1
  95. package/dist-node/geotiff.js +110 -20
  96. package/dist-node/geotiff.js.map +1 -1
  97. package/dist-node/geotiffimage.d.ts +77 -111
  98. package/dist-node/geotiffimage.d.ts.map +1 -1
  99. package/dist-node/geotiffimage.js +98 -70
  100. package/dist-node/geotiffimage.js.map +1 -1
  101. package/dist-node/geotiffwriter.js +2 -2
  102. package/dist-node/geotiffwriter.js.map +1 -1
  103. package/dist-node/globals.d.ts +48 -40
  104. package/dist-node/globals.d.ts.map +1 -1
  105. package/dist-node/globals.js +14 -10
  106. package/dist-node/globals.js.map +1 -1
  107. package/dist-node/imagefiledirectory.d.ts +2 -2
  108. package/dist-node/imagefiledirectory.d.ts.map +1 -1
  109. package/dist-node/imagefiledirectory.js +23 -12
  110. package/dist-node/imagefiledirectory.js.map +1 -1
  111. package/dist-node/logging.js +7 -7
  112. package/dist-node/logging.js.map +1 -1
  113. package/dist-node/pool.d.ts +2 -3
  114. package/dist-node/pool.d.ts.map +1 -1
  115. package/dist-node/pool.js +18 -16
  116. package/dist-node/pool.js.map +1 -1
  117. package/dist-node/predictor.js +1 -1
  118. package/dist-node/predictor.js.map +1 -1
  119. package/dist-node/resample.d.ts +18 -18
  120. package/dist-node/resample.d.ts.map +1 -1
  121. package/dist-node/resample.js +12 -12
  122. package/dist-node/source/basesource.d.ts +7 -7
  123. package/dist-node/source/basesource.d.ts.map +1 -1
  124. package/dist-node/source/basesource.js +7 -7
  125. package/dist-node/source/basesource.js.map +1 -1
  126. package/dist-node/source/blockedsource.d.ts +10 -10
  127. package/dist-node/source/blockedsource.d.ts.map +1 -1
  128. package/dist-node/source/blockedsource.js +12 -9
  129. package/dist-node/source/blockedsource.js.map +1 -1
  130. package/dist-node/source/client/base.d.ts +8 -10
  131. package/dist-node/source/client/base.d.ts.map +1 -1
  132. package/dist-node/source/client/base.js +4 -3
  133. package/dist-node/source/client/base.js.map +1 -1
  134. package/dist-node/source/client/fetch.d.ts +2 -6
  135. package/dist-node/source/client/fetch.d.ts.map +1 -1
  136. package/dist-node/source/client/fetch.js +7 -2
  137. package/dist-node/source/client/fetch.js.map +1 -1
  138. package/dist-node/source/client/http.d.ts +4 -1
  139. package/dist-node/source/client/http.d.ts.map +1 -1
  140. package/dist-node/source/client/http.js +4 -4
  141. package/dist-node/source/client/http.js.map +1 -1
  142. package/dist-node/source/client/xhr.d.ts +4 -1
  143. package/dist-node/source/client/xhr.d.ts.map +1 -1
  144. package/dist-node/source/client/xhr.js +1 -1
  145. package/dist-node/source/client/xhr.js.map +1 -1
  146. package/dist-node/source/file.js +4 -4
  147. package/dist-node/source/file.js.map +1 -1
  148. package/dist-node/source/filereader.js +1 -1
  149. package/dist-node/source/filereader.js.map +1 -1
  150. package/dist-node/source/httputils.d.ts +14 -6
  151. package/dist-node/source/httputils.d.ts.map +1 -1
  152. package/dist-node/source/httputils.js +13 -12
  153. package/dist-node/source/httputils.js.map +1 -1
  154. package/dist-node/source/remote.d.ts +31 -22
  155. package/dist-node/source/remote.d.ts.map +1 -1
  156. package/dist-node/source/remote.js +37 -13
  157. package/dist-node/source/remote.js.map +1 -1
  158. package/dist-node/utils.d.ts +7 -1
  159. package/dist-node/utils.d.ts.map +1 -1
  160. package/dist-node/utils.js +6 -0
  161. package/dist-node/utils.js.map +1 -1
  162. package/dist-node/worker/create.js +1 -1
  163. package/dist-node/worker/create.js.map +1 -1
  164. package/package.json +3 -54
@@ -2,13 +2,13 @@
2
2
  * A no-op logger
3
3
  */
4
4
  class DummyLogger {
5
- log() { }
6
- debug() { }
7
- info() { }
8
- warn() { }
9
- error() { }
10
- time() { }
11
- timeEnd() { }
5
+ log(..._args) { }
6
+ debug(..._args) { }
7
+ info(..._args) { }
8
+ warn(..._args) { }
9
+ error(..._args) { }
10
+ time(..._args) { }
11
+ timeEnd(..._args) { }
12
12
  }
13
13
  let LOGGER = new DummyLogger();
14
14
  /**
@@ -34,9 +34,8 @@ declare class Pool {
34
34
  */
35
35
  constructor(size?: number, createWorker?: () => Worker);
36
36
  workerWrappers: Promise<WorkerWrapper[]> | null;
37
- bindParameters(compression: any, decoderParameters: any): {
38
- decode: (buffer: any) => Promise<any>;
39
- };
37
+ bindParameters(compression: any, decoderParameters: any): this;
38
+ decode(_buffer: any): Promise<void>;
40
39
  destroy(): Promise<void>;
41
40
  }
42
41
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.js"],"names":[],"mappings":";AAiFA;;GAEG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,0CAxBW,MAAY,MAAM,EAsC5B;IAbC,gDAA0B;IAe5B;;MAgBC;IAED,yBAOC;CACF;AAvJD;;GAEG;AAEH;;GAEG;AACH;IACE;;OAEG;IACH,oBAFW,MAAM,EAOhB;IAJC,eAAoB;IAEpB,qBAAqB;IACrB,oBAAqB;IAGvB;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,sBAEC;IAED,+BAUC;IAED;;;;;OAKG;IACH,mBAJW,MAAM,kBACN,MAAM,EAAE,gBAgBlB;IAED,kBAEC;CACF"}
1
+ {"version":3,"file":"pool.d.ts","sourceRoot":"","sources":["../src/pool.js"],"names":[],"mappings":";AAiFA;;GAEG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,0CAxBW,MAAY,MAAM,EAsC5B;IAbC,gDAA0B;IAe5B,+DAeC;IAED,oCAEC;IAED,yBAOC;CACF;AA1JD;;GAEG;AAEH;;GAEG;AACH;IACE;;OAEG;IACH,oBAFW,MAAM,EAOhB;IAJC,eAAoB;IAEpB,qBAAqB;IACrB,oBAAqB;IAGvB;;;OAGG;IACH,mBAEC;IAED;;;OAGG;IACH,sBAEC;IAED,+BAUC;IAED;;;;;OAKG;IACH,mBAJW,MAAM,kBACN,MAAM,EAAE,gBAgBlB;IAED,kBAEC;CACF"}
@@ -57,7 +57,7 @@ class WorkerWrapper {
57
57
  reject = _reject;
58
58
  });
59
59
  this.jobs.set(jobId, { resolve, reject });
60
- this.worker.postMessage({ ...message, jobId }, transferables);
60
+ this.worker.postMessage({ ...message, jobId }, { transfer: transferables });
61
61
  return promise;
62
62
  }
63
63
  terminate() {
@@ -116,22 +116,24 @@ class Pool {
116
116
  }
117
117
  }
118
118
  bindParameters(compression, decoderParameters) {
119
- return {
120
- decode: async (buffer) => {
121
- if (preferWorker(compression) && this.workerWrappers) {
122
- // select the worker with the lowest jobCount
123
- const workerWrapper = (await this.workerWrappers).reduce((a, b) => {
124
- return a.getJobCount() < b.getJobCount() ? a : b;
125
- });
126
- const { decoded } = await workerWrapper.submitJob({ compression, decoderParameters, buffer }, [buffer]);
127
- return decoded;
128
- }
129
- else {
130
- const decoder = await getDecoder(compression, decoderParameters);
131
- return decoder.decode(buffer);
132
- }
133
- },
119
+ this.decode = async (buffer) => {
120
+ if (preferWorker(compression) && this.workerWrappers) {
121
+ // select the worker with the lowest jobCount
122
+ const workerWrapper = (await this.workerWrappers).reduce((a, b) => {
123
+ return a.getJobCount() < b.getJobCount() ? a : b;
124
+ });
125
+ const { decoded } = await workerWrapper.submitJob({ compression, decoderParameters, buffer }, [buffer]);
126
+ return decoded;
127
+ }
128
+ else {
129
+ const decoder = await getDecoder(compression, decoderParameters);
130
+ return decoder.decode(buffer);
131
+ }
134
132
  };
133
+ return this;
134
+ }
135
+ async decode(_buffer) {
136
+ throw new Error('Pool not initialized. Call `pool.bindParameters()` first.');
135
137
  }
136
138
  async destroy() {
137
139
  if (this.workerWrappers) {
@@ -61,7 +61,7 @@ export function applyPredictor(block, predictor, width, height, bitsPerSample, p
61
61
  default:
62
62
  throw new Error(`Predictor 2 not allowed with ${bitsPerSample[0]} bits per sample.`);
63
63
  }
64
- decodeRowAcc(row, stride, bytesPerSample);
64
+ decodeRowAcc(row, stride);
65
65
  }
66
66
  else if (predictor === 3) { // horizontal floating point
67
67
  row = new Uint8Array(block, i * stride * width * bytesPerSample, stride * width * bytesPerSample);
@@ -1,61 +1,61 @@
1
1
  /**
2
2
  * Resample the input arrays using nearest neighbor value selection.
3
- * @param {TypedArray[]} valueArrays The input arrays to resample
3
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
4
4
  * @param {number} inWidth The width of the input rasters
5
5
  * @param {number} inHeight The height of the input rasters
6
6
  * @param {number} outWidth The desired width of the output rasters
7
7
  * @param {number} outHeight The desired height of the output rasters
8
- * @returns {TypedArray[]} The resampled rasters
8
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
9
9
  */
10
- export function resampleNearest(valueArrays: TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number): TypedArray[];
10
+ export function resampleNearest(valueArrays: import("./geotiff").TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number): import("./geotiff").TypedArray[];
11
11
  /**
12
12
  * Resample the input arrays using bilinear interpolation.
13
- * @param {TypedArray[]} valueArrays The input arrays to resample
13
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
14
14
  * @param {number} inWidth The width of the input rasters
15
15
  * @param {number} inHeight The height of the input rasters
16
16
  * @param {number} outWidth The desired width of the output rasters
17
17
  * @param {number} outHeight The desired height of the output rasters
18
- * @returns {TypedArray[]} The resampled rasters
18
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
19
19
  */
20
- export function resampleBilinear(valueArrays: TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number): TypedArray[];
20
+ export function resampleBilinear(valueArrays: import("./geotiff").TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number): import("./geotiff").TypedArray[];
21
21
  /**
22
22
  * Resample the input arrays using the selected resampling method.
23
- * @param {TypedArray[]} valueArrays The input arrays to resample
23
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
24
24
  * @param {number} inWidth The width of the input rasters
25
25
  * @param {number} inHeight The height of the input rasters
26
26
  * @param {number} outWidth The desired width of the output rasters
27
27
  * @param {number} outHeight The desired height of the output rasters
28
28
  * @param {string} [method = 'nearest'] The desired resampling method
29
- * @returns {TypedArray[]} The resampled rasters
29
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
30
30
  */
31
- export function resample(valueArrays: TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number, method?: string): TypedArray[];
31
+ export function resample(valueArrays: import("./geotiff").TypedArray[], inWidth: number, inHeight: number, outWidth: number, outHeight: number, method?: string): import("./geotiff").TypedArray[];
32
32
  /**
33
33
  * Resample the pixel interleaved input array using nearest neighbor value selection.
34
- * @param {TypedArray} valueArrays The input arrays to resample
34
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
35
35
  * @param {number} inWidth The width of the input rasters
36
36
  * @param {number} inHeight The height of the input rasters
37
37
  * @param {number} outWidth The desired width of the output rasters
38
38
  * @param {number} outHeight The desired height of the output rasters
39
39
  * @param {number} samples The number of samples per pixel for pixel
40
40
  * interleaved data
41
- * @returns {TypedArray} The resampled raster
41
+ * @returns {import("./geotiff").TypedArray} The resampled raster
42
42
  */
43
- export function resampleNearestInterleaved(valueArray: any, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number): TypedArray;
43
+ export function resampleNearestInterleaved(valueArray: import("./geotiff").TypedArray, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number): import("./geotiff").TypedArray;
44
44
  /**
45
45
  * Resample the pixel interleaved input array using bilinear interpolation.
46
- * @param {TypedArray} valueArrays The input arrays to resample
46
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
47
47
  * @param {number} inWidth The width of the input rasters
48
48
  * @param {number} inHeight The height of the input rasters
49
49
  * @param {number} outWidth The desired width of the output rasters
50
50
  * @param {number} outHeight The desired height of the output rasters
51
51
  * @param {number} samples The number of samples per pixel for pixel
52
52
  * interleaved data
53
- * @returns {TypedArray} The resampled raster
53
+ * @returns {import("./geotiff").TypedArray} The resampled raster
54
54
  */
55
- export function resampleBilinearInterleaved(valueArray: any, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number): TypedArray;
55
+ export function resampleBilinearInterleaved(valueArray: import("./geotiff").TypedArray, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number): import("./geotiff").TypedArray;
56
56
  /**
57
57
  * Resample the pixel interleaved input array using the selected resampling method.
58
- * @param {TypedArray} valueArray The input array to resample
58
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
59
59
  * @param {number} inWidth The width of the input rasters
60
60
  * @param {number} inHeight The height of the input rasters
61
61
  * @param {number} outWidth The desired width of the output rasters
@@ -63,7 +63,7 @@ export function resampleBilinearInterleaved(valueArray: any, inWidth: number, in
63
63
  * @param {number} samples The number of samples per pixel for pixel
64
64
  * interleaved data
65
65
  * @param {string} [method = 'nearest'] The desired resampling method
66
- * @returns {TypedArray} The resampled rasters
66
+ * @returns {import("./geotiff").TypedArray} The resampled rasters
67
67
  */
68
- export function resampleInterleaved(valueArray: TypedArray, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number, method?: string): TypedArray;
68
+ export function resampleInterleaved(valueArray: import("./geotiff").TypedArray, inWidth: number, inHeight: number, outWidth: number, outHeight: number, samples: number, method?: string): import("./geotiff").TypedArray;
69
69
  //# sourceMappingURL=resample.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resample.d.ts","sourceRoot":"","sources":["../src/resample.js"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,6CAPW,UAAU,EAAE,WACZ,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,UAAU,EAAE,CAiBxB;AAQD;;;;;;;;GAQG;AACH,8CAPW,UAAU,EAAE,WACZ,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,UAAU,EAAE,CAoCxB;AAED;;;;;;;;;GASG;AACH,sCARW,UAAU,EAAE,WACZ,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GACJ,UAAU,EAAE,CAYxB;AAED;;;;;;;;;;GAUG;AACH,qEARW,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,UAAU,CAmBtB;AAED;;;;;;;;;;GAUG;AACH,sEARW,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,UAAU,CAoCtB;AAED;;;;;;;;;;;GAWG;AACH,gDAVW,UAAU,WACV,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,WAEN,MAAM,GACJ,UAAU,CAgBtB"}
1
+ {"version":3,"file":"resample.d.ts","sourceRoot":"","sources":["../src/resample.js"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,6CAPW,OAAO,WAAW,EAAE,UAAU,EAAE,WAChC,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,EAAE,CAiB5C;AAQD;;;;;;;;GAQG;AACH,8CAPW,OAAO,WAAW,EAAE,UAAU,EAAE,WAChC,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,EAAE,CAoC5C;AAED;;;;;;;;;GASG;AACH,sCARW,OAAO,WAAW,EAAE,UAAU,EAAE,WAChC,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,EAAE,CAY5C;AAED;;;;;;;;;;GAUG;AACH,uDATW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,OAAO,WAAW,EAAE,UAAU,CAmB1C;AAED;;;;;;;;;;GAUG;AACH,wDATW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,OAAO,WAAW,EAAE,UAAU,CAoC1C;AAED;;;;;;;;;;;GAWG;AACH,gDAVW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,WAEN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,CAgB1C"}
@@ -6,12 +6,12 @@ function copyNewSize(array, width, height, samplesPerPixel = 1) {
6
6
  }
7
7
  /**
8
8
  * Resample the input arrays using nearest neighbor value selection.
9
- * @param {TypedArray[]} valueArrays The input arrays to resample
9
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
10
10
  * @param {number} inWidth The width of the input rasters
11
11
  * @param {number} inHeight The height of the input rasters
12
12
  * @param {number} outWidth The desired width of the output rasters
13
13
  * @param {number} outHeight The desired height of the output rasters
14
- * @returns {TypedArray[]} The resampled rasters
14
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
15
15
  */
16
16
  export function resampleNearest(valueArrays, inWidth, inHeight, outWidth, outHeight) {
17
17
  const relX = inWidth / outWidth;
@@ -36,12 +36,12 @@ function lerp(v0, v1, t) {
36
36
  }
37
37
  /**
38
38
  * Resample the input arrays using bilinear interpolation.
39
- * @param {TypedArray[]} valueArrays The input arrays to resample
39
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
40
40
  * @param {number} inWidth The width of the input rasters
41
41
  * @param {number} inHeight The height of the input rasters
42
42
  * @param {number} outWidth The desired width of the output rasters
43
43
  * @param {number} outHeight The desired height of the output rasters
44
- * @returns {TypedArray[]} The resampled rasters
44
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
45
45
  */
46
46
  export function resampleBilinear(valueArrays, inWidth, inHeight, outWidth, outHeight) {
47
47
  const relX = inWidth / outWidth;
@@ -70,13 +70,13 @@ export function resampleBilinear(valueArrays, inWidth, inHeight, outWidth, outHe
70
70
  }
71
71
  /**
72
72
  * Resample the input arrays using the selected resampling method.
73
- * @param {TypedArray[]} valueArrays The input arrays to resample
73
+ * @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
74
74
  * @param {number} inWidth The width of the input rasters
75
75
  * @param {number} inHeight The height of the input rasters
76
76
  * @param {number} outWidth The desired width of the output rasters
77
77
  * @param {number} outHeight The desired height of the output rasters
78
78
  * @param {string} [method = 'nearest'] The desired resampling method
79
- * @returns {TypedArray[]} The resampled rasters
79
+ * @returns {import("./geotiff").TypedArray[]} The resampled rasters
80
80
  */
81
81
  export function resample(valueArrays, inWidth, inHeight, outWidth, outHeight, method = 'nearest') {
82
82
  switch (method.toLowerCase()) {
@@ -91,14 +91,14 @@ export function resample(valueArrays, inWidth, inHeight, outWidth, outHeight, me
91
91
  }
92
92
  /**
93
93
  * Resample the pixel interleaved input array using nearest neighbor value selection.
94
- * @param {TypedArray} valueArrays The input arrays to resample
94
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
95
95
  * @param {number} inWidth The width of the input rasters
96
96
  * @param {number} inHeight The height of the input rasters
97
97
  * @param {number} outWidth The desired width of the output rasters
98
98
  * @param {number} outHeight The desired height of the output rasters
99
99
  * @param {number} samples The number of samples per pixel for pixel
100
100
  * interleaved data
101
- * @returns {TypedArray} The resampled raster
101
+ * @returns {import("./geotiff").TypedArray} The resampled raster
102
102
  */
103
103
  export function resampleNearestInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples) {
104
104
  const relX = inWidth / outWidth;
@@ -118,14 +118,14 @@ export function resampleNearestInterleaved(valueArray, inWidth, inHeight, outWid
118
118
  }
119
119
  /**
120
120
  * Resample the pixel interleaved input array using bilinear interpolation.
121
- * @param {TypedArray} valueArrays The input arrays to resample
121
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
122
122
  * @param {number} inWidth The width of the input rasters
123
123
  * @param {number} inHeight The height of the input rasters
124
124
  * @param {number} outWidth The desired width of the output rasters
125
125
  * @param {number} outHeight The desired height of the output rasters
126
126
  * @param {number} samples The number of samples per pixel for pixel
127
127
  * interleaved data
128
- * @returns {TypedArray} The resampled raster
128
+ * @returns {import("./geotiff").TypedArray} The resampled raster
129
129
  */
130
130
  export function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples) {
131
131
  const relX = inWidth / outWidth;
@@ -154,7 +154,7 @@ export function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWi
154
154
  }
155
155
  /**
156
156
  * Resample the pixel interleaved input array using the selected resampling method.
157
- * @param {TypedArray} valueArray The input array to resample
157
+ * @param {import("./geotiff").TypedArray} valueArray The input array to resample
158
158
  * @param {number} inWidth The width of the input rasters
159
159
  * @param {number} inHeight The height of the input rasters
160
160
  * @param {number} outWidth The desired width of the output rasters
@@ -162,7 +162,7 @@ export function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWi
162
162
  * @param {number} samples The number of samples per pixel for pixel
163
163
  * interleaved data
164
164
  * @param {string} [method = 'nearest'] The desired resampling method
165
- * @returns {TypedArray} The resampled rasters
165
+ * @returns {import("./geotiff").TypedArray} The resampled rasters
166
166
  */
167
167
  export function resampleInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples, method = 'nearest') {
168
168
  switch (method.toLowerCase()) {
@@ -5,17 +5,17 @@
5
5
  */
6
6
  export class BaseSource {
7
7
  /**
8
- *
9
- * @param {Slice[]} slices
10
- * @returns {ArrayBuffer[]}
8
+ * @param {Array<Slice>} slices
9
+ * @param {AbortSignal} [signal]
10
+ * @returns {Promise<*[]>}
11
11
  */
12
- fetch(slices: Slice[], signal?: undefined): ArrayBuffer[];
12
+ fetch(slices: Array<Slice>, signal?: AbortSignal): Promise<any[]>;
13
13
  /**
14
- *
15
14
  * @param {Slice} slice
16
- * @returns {ArrayBuffer}
15
+ * @param {AbortSignal} [_signal]
16
+ * @returns {Promise<*>}
17
17
  */
18
- fetchSlice(slice: Slice): ArrayBuffer;
18
+ fetchSlice(slice: Slice, _signal?: AbortSignal): Promise<any>;
19
19
  /**
20
20
  * Returns the filesize if already determined and null otherwise
21
21
  */
@@ -1 +1 @@
1
- {"version":3,"file":"basesource.d.ts","sourceRoot":"","sources":["../../src/source/basesource.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;IACE;;;;OAIG;IACH,cAHW,KAAK,EAAE,uBACL,WAAW,EAAE,CAMzB;IAED;;;;OAIG;IACH,kBAHW,KAAK,GACH,WAAW,CAIvB;IAED;;OAEG;IACH,qBAEC;IAED,uBAEC;CACF;;YAnCa,MAAM;YACN,MAAM"}
1
+ {"version":3,"file":"basesource.d.ts","sourceRoot":"","sources":["../../src/source/basesource.js"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;IACE;;;;OAIG;IACH,cAJW,KAAK,CAAC,KAAK,CAAC,WACZ,WAAW,GACT,OAAO,CAAC,GAAC,EAAE,CAAC,CAMxB;IAED;;;;OAIG;IACH,kBAJW,KAAK,YACL,WAAW,GACT,OAAO,CAAC,GAAC,CAAC,CAItB;IAED;;OAEG;IACH,qBAEC;IAED,uBAEC;CACF;;YAnCa,MAAM;YACN,MAAM"}
@@ -5,19 +5,19 @@
5
5
  */
6
6
  export class BaseSource {
7
7
  /**
8
- *
9
- * @param {Slice[]} slices
10
- * @returns {ArrayBuffer[]}
8
+ * @param {Array<Slice>} slices
9
+ * @param {AbortSignal} [signal]
10
+ * @returns {Promise<*[]>}
11
11
  */
12
- async fetch(slices, signal = undefined) {
12
+ async fetch(slices, signal) {
13
13
  return Promise.all(slices.map((slice) => this.fetchSlice(slice, signal)));
14
14
  }
15
15
  /**
16
- *
17
16
  * @param {Slice} slice
18
- * @returns {ArrayBuffer}
17
+ * @param {AbortSignal} [_signal]
18
+ * @returns {Promise<*>}
19
19
  */
20
- async fetchSlice(slice) {
20
+ async fetchSlice(slice, _signal) {
21
21
  throw new Error(`fetching of slice ${slice} not possible, not implemented`);
22
22
  }
23
23
  /**
@@ -19,15 +19,15 @@ export class BlockedSource extends BaseSource {
19
19
  blockIdsToFetch: Set<any>;
20
20
  abortedBlockIds: Set<any>;
21
21
  /**
22
- *
23
22
  * @param {import("./basesource").Slice[]} slices
23
+ * @param {AbortSignal} [signal]
24
+ * @return {Promise<ArrayBuffer[]>}
24
25
  */
25
- fetch(slices: import("./basesource").Slice[], signal: any): Promise<ArrayBuffer[]>;
26
+ fetch(slices: import("./basesource").Slice[], signal?: AbortSignal): Promise<ArrayBuffer[]>;
26
27
  /**
27
- *
28
- * @param {AbortSignal} signal
28
+ * @param {AbortSignal} [signal]
29
29
  */
30
- fetchBlocks(signal: AbortSignal): void;
30
+ fetchBlocks(signal?: AbortSignal): void;
31
31
  /**
32
32
  *
33
33
  * @param {Set} blockIds
@@ -35,11 +35,11 @@ export class BlockedSource extends BaseSource {
35
35
  */
36
36
  groupBlocks(blockIds: Set<any>): BlockGroup[];
37
37
  /**
38
- *
39
38
  * @param {import("./basesource").Slice[]} slices
40
- * @param {Map} blocks
39
+ * @param {Map<number, Block>} blocks
40
+ * @returns {ArrayBuffer[]}
41
41
  */
42
- readSliceData(slices: import("./basesource").Slice[], blocks: Map<any, any>): ArrayBuffer[];
42
+ readSliceData(slices: import("./basesource").Slice[], blocks: Map<number, Block>): ArrayBuffer[];
43
43
  }
44
44
  import { BaseSource } from './basesource.js';
45
45
  import QuickLRU from 'quick-lru';
@@ -48,9 +48,9 @@ declare class Block {
48
48
  *
49
49
  * @param {number} offset
50
50
  * @param {number} length
51
- * @param {ArrayBuffer} [data]
51
+ * @param {ArrayBuffer} data
52
52
  */
53
- constructor(offset: number, length: number, data?: ArrayBuffer);
53
+ constructor(offset: number, length: number, data: ArrayBuffer);
54
54
  offset: number;
55
55
  length: number;
56
56
  data: ArrayBuffer;
@@ -1 +1 @@
1
- {"version":3,"file":"blockedsource.d.ts","sourceRoot":"","sources":["../../src/source/blockedsource.js"],"names":[],"mappings":"AAuCA;IACE;;;;;;OAMG;IACH,oBALW,UAAU,6BAElB;QAAyB,SAAS;QACT,SAAS;KAAC,EAwBrC;IApBC,mBAAoB;IACpB,kBAA0B;IAE1B,+BAKE;IAEF,iCAAiC;IACjC,eADW,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CACC;IAG9B,6BAA8B;IAG9B,0BAAgC;IAEhC,0BAAgC;IAOlC;;;OAGG;IACH,cAFW,OAAO,cAAc,EAAE,KAAK,EAAE,uCAmFxC;IAED;;;OAGG;IACH,oBAFW,WAAW,QAgDrB;IAED;;;;OAIG;IACH,iCAFa,UAAU,EAAE,CAiCxB;IAED;;;;OAIG;IACH,sBAHW,OAAO,cAAc,EAAE,KAAK,EAAE,wCAwCxC;CACF;2BArS0B,iBAAiB;qBAFvB,WAAW;AAIhC;IACE;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,SACN,WAAW,EAMrB;IAHC,eAAoB;IACpB,eAAoB;IACpB,kBAAgB;IAGlB;;OAEG;IACH,WAFa,MAAM,CAIlB;CACF;AAED;IACE;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,YACN,MAAM,EAAE,EAMlB;IAHC,eAAoB;IACpB,eAAoB;IACpB,mBAAwB;CAE3B"}
1
+ {"version":3,"file":"blockedsource.d.ts","sourceRoot":"","sources":["../../src/source/blockedsource.js"],"names":[],"mappings":"AAuCA;IACE;;;;;;OAMG;IACH,oBALW,UAAU,6BAElB;QAAyB,SAAS;QACT,SAAS;KAAC,EAwBrC;IApBC,mBAAoB;IACpB,kBAA0B;IAE1B,+BAKE;IAEF,iCAAiC;IACjC,eADW,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CACC;IAG9B,6BAA8B;IAG9B,0BAAgC;IAEhC,0BAAgC;IAOlC;;;;OAIG;IACH,cAJW,OAAO,cAAc,EAAE,KAAK,EAAE,WAC9B,WAAW,GACV,OAAO,CAAC,WAAW,EAAE,CAAC,CAmFjC;IAED;;OAEG;IACH,qBAFW,WAAW,QA+CrB;IAED;;;;OAIG;IACH,iCAFa,UAAU,EAAE,CAiCxB;IAED;;;;OAIG;IACH,sBAJW,OAAO,cAAc,EAAE,KAAK,EAAE,UAC9B,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAChB,WAAW,EAAE,CA0CzB;CACF;2BAvS0B,iBAAiB;qBAFvB,WAAW;AAIhC;IACE;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,QACN,WAAW,EAMrB;IAHC,eAAoB;IACpB,eAAoB;IACpB,kBAAgB;IAGlB;;OAEG;IACH,WAFa,MAAM,CAIlB;CACF;AAED;IACE;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,YACN,MAAM,EAAE,EAMlB;IAHC,eAAoB;IACpB,eAAoB;IACpB,mBAAwB;CAE3B"}
@@ -6,9 +6,9 @@ class Block {
6
6
  *
7
7
  * @param {number} offset
8
8
  * @param {number} length
9
- * @param {ArrayBuffer} [data]
9
+ * @param {ArrayBuffer} data
10
10
  */
11
- constructor(offset, length, data = null) {
11
+ constructor(offset, length, data) {
12
12
  this.offset = offset;
13
13
  this.length = length;
14
14
  this.data = data;
@@ -63,8 +63,9 @@ export class BlockedSource extends BaseSource {
63
63
  return this.source.fileSize;
64
64
  }
65
65
  /**
66
- *
67
66
  * @param {import("./basesource").Slice[]} slices
67
+ * @param {AbortSignal} [signal]
68
+ * @return {Promise<ArrayBuffer[]>}
68
69
  */
69
70
  async fetch(slices, signal) {
70
71
  const blockRequests = [];
@@ -112,7 +113,7 @@ export class BlockedSource extends BaseSource {
112
113
  abortedBlockIds.forEach((id) => this.blockIdsToFetch.add(id));
113
114
  // start the retry of some blocks if required
114
115
  if (abortedBlockIds.length > 0 && signal && !signal.aborted) {
115
- this.fetchBlocks(null);
116
+ this.fetchBlocks();
116
117
  for (const blockId of abortedBlockIds) {
117
118
  const block = this.blockRequests.get(blockId);
118
119
  if (!block) {
@@ -137,8 +138,7 @@ export class BlockedSource extends BaseSource {
137
138
  return this.readSliceData(slices, requiredBlocks);
138
139
  }
139
140
  /**
140
- *
141
- * @param {AbortSignal} signal
141
+ * @param {AbortSignal} [signal]
142
142
  */
143
143
  fetchBlocks(signal) {
144
144
  // check if we still need to
@@ -157,7 +157,7 @@ export class BlockedSource extends BaseSource {
157
157
  const o = blockOffset - response.offset;
158
158
  const t = Math.min(o + this.blockSize, response.data.byteLength);
159
159
  const data = response.data.slice(o, t);
160
- const block = new Block(blockOffset, data.byteLength, data, blockId);
160
+ const block = new Block(blockOffset, data.byteLength, data);
161
161
  this.blockCache.set(blockId, block);
162
162
  this.abortedBlockIds.delete(blockId);
163
163
  }
@@ -210,9 +210,9 @@ export class BlockedSource extends BaseSource {
210
210
  return groups;
211
211
  }
212
212
  /**
213
- *
214
213
  * @param {import("./basesource").Slice[]} slices
215
- * @param {Map} blocks
214
+ * @param {Map<number, Block>} blocks
215
+ * @returns {ArrayBuffer[]}
216
216
  */
217
217
  readSliceData(slices, blocks) {
218
218
  return slices.map((slice) => {
@@ -226,6 +226,9 @@ export class BlockedSource extends BaseSource {
226
226
  const sliceView = new Uint8Array(sliceData);
227
227
  for (let blockId = blockIdLow; blockId <= blockIdHigh; ++blockId) {
228
228
  const block = blocks.get(blockId);
229
+ if (!block) {
230
+ continue;
231
+ }
229
232
  const delta = block.offset - slice.offset;
230
233
  const topDelta = block.top - top;
231
234
  let blockInnerOffset = 0;
@@ -5,30 +5,28 @@ export class BaseResponse {
5
5
  get ok(): boolean;
6
6
  /**
7
7
  * Returns the status code of the response
8
+ * @returns {number} the status code
8
9
  */
9
- get status(): void;
10
+ get status(): number;
10
11
  /**
11
12
  * Returns the value of the specified header
12
13
  * @param {string} headerName the header name
13
- * @returns {string} the header value
14
+ * @returns {string|null} the header value
14
15
  */
15
- getHeader(headerName: string): string;
16
+ getHeader(headerName: string): string | null;
16
17
  /**
17
- * @returns {ArrayBuffer} the response data of the request
18
+ * @returns {Promise<ArrayBuffer>} the response data of the request
18
19
  */
19
- getData(): ArrayBuffer;
20
+ getData(): Promise<ArrayBuffer>;
20
21
  }
21
22
  export class BaseClient {
22
23
  constructor(url: any);
23
24
  url: any;
24
25
  /**
25
26
  * Send a request with the options
26
- * @param {{headers: HeadersInit, signal: AbortSignal}} [options={}]
27
+ * @param {RequestInit} [options={}]
27
28
  * @returns {Promise<BaseResponse>}
28
29
  */
29
- request({ headers, signal }?: {
30
- headers: HeadersInit;
31
- signal: AbortSignal;
32
- }): Promise<BaseResponse>;
30
+ request({ headers, signal }?: RequestInit): Promise<BaseResponse>;
33
31
  }
34
32
  //# sourceMappingURL=base.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/source/client/base.js"],"names":[],"mappings":"AAAA;IACE;;OAEG;IACH,kBAEC;IAED;;OAEG;IACH,mBAEC;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;OAEG;IACH,WAFa,WAAW,CAIvB;CACF;AAED;IACE,sBAEC;IADC,SAAc;IAGhB;;;;OAIG;IACH,8BAHW;QAAC,OAAO,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAC,GACzC,OAAO,CAAC,YAAY,CAAC,CAIjC;CACF"}
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../src/source/client/base.js"],"names":[],"mappings":"AAAA;IACE;;OAEG;IACH,kBAEC;IAED;;;OAGG;IACH,cAFa,MAAM,CAIlB;IAED;;;;OAIG;IACH,sBAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAIvB;IAED;;OAEG;IACH,WAFa,OAAO,CAAC,WAAW,CAAC,CAIhC;CACF;AAED;IACE,sBAEC;IADC,SAAc;IAGhB;;;;OAIG;IACH,8BAHW,WAAW,GACT,OAAO,CAAC,YAAY,CAAC,CAIjC;CACF"}
@@ -7,6 +7,7 @@ export class BaseResponse {
7
7
  }
8
8
  /**
9
9
  * Returns the status code of the response
10
+ * @returns {number} the status code
10
11
  */
11
12
  get status() {
12
13
  throw new Error('not implemented');
@@ -14,13 +15,13 @@ export class BaseResponse {
14
15
  /**
15
16
  * Returns the value of the specified header
16
17
  * @param {string} headerName the header name
17
- * @returns {string} the header value
18
+ * @returns {string|null} the header value
18
19
  */
19
20
  getHeader(headerName) {
20
21
  throw new Error('not implemented');
21
22
  }
22
23
  /**
23
- * @returns {ArrayBuffer} the response data of the request
24
+ * @returns {Promise<ArrayBuffer>} the response data of the request
24
25
  */
25
26
  async getData() {
26
27
  throw new Error('not implemented');
@@ -32,7 +33,7 @@ export class BaseClient {
32
33
  }
33
34
  /**
34
35
  * Send a request with the options
35
- * @param {{headers: HeadersInit, signal: AbortSignal}} [options={}]
36
+ * @param {RequestInit} [options={}]
36
37
  * @returns {Promise<BaseResponse>}
37
38
  */
38
39
  async request({ headers, signal } = {}) {
@@ -2,13 +2,10 @@ export class FetchClient extends BaseClient {
2
2
  constructor(url: any, credentials: any);
3
3
  credentials: any;
4
4
  /**
5
- * @param {{headers: HeadersInit, signal: AbortSignal}} [options={}]
5
+ * @param {RequestInit} [options={}]
6
6
  * @returns {Promise<FetchResponse>}
7
7
  */
8
- request({ headers, signal }?: {
9
- headers: HeadersInit;
10
- signal: AbortSignal;
11
- }): Promise<FetchResponse>;
8
+ request({ headers, signal }?: RequestInit): Promise<FetchResponse>;
12
9
  }
13
10
  import { BaseClient } from './base.js';
14
11
  declare class FetchResponse extends BaseResponse {
@@ -18,8 +15,6 @@ declare class FetchResponse extends BaseResponse {
18
15
  */
19
16
  constructor(response: Response);
20
17
  response: Response;
21
- get status(): number;
22
- getHeader(name: any): string | null;
23
18
  getData(): Promise<any>;
24
19
  }
25
20
  import { BaseResponse } from './base.js';
@@ -1 +1 @@
1
- {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/source/client/fetch.js"],"names":[],"mappings":"AA4BA;IACE,wCAGC;IADC,iBAA8B;IAGhC;;;OAGG;IACH,8BAHW;QAAC,OAAO,EAAE,WAAW,CAAC;QAAC,MAAM,EAAE,WAAW,CAAA;KAAC,GACzC,OAAO,CAAC,aAAa,CAAC,CAOlC;CACF;2BA5CwC,WAAW;AAEpD;IACE;;;OAGG;IACH,sBAFW,QAAQ,EAKlB;IADC,mBAAwB;IAG1B,qBAEC;IAED,oCAEC;IAED,wBAKC;CACF;6BA1BwC,WAAW"}
1
+ {"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../src/source/client/fetch.js"],"names":[],"mappings":"AAiCA;IACE,wCAGC;IADC,iBAA8B;IAGhC;;;OAGG;IACH,8BAHW,WAAW,GACT,OAAO,CAAC,aAAa,CAAC,CAOlC;CACF;2BAjDwC,WAAW;AAEpD;IACE;;;OAGG;IACH,sBAFW,QAAQ,EAKlB;IADC,mBAAwB;IAe1B,wBAMC;CACF;6BA/BwC,WAAW"}
@@ -11,13 +11,18 @@ class FetchResponse extends BaseResponse {
11
11
  get status() {
12
12
  return this.response.status;
13
13
  }
14
+ /**
15
+ * @param {string} name
16
+ * @returns {string|null}
17
+ */
14
18
  getHeader(name) {
15
19
  return this.response.headers.get(name);
16
20
  }
17
21
  async getData() {
18
22
  const data = this.response.arrayBuffer
19
23
  ? await this.response.arrayBuffer()
20
- : (await this.response.buffer()).buffer;
24
+ // FIXME Can this really have a buffer property?
25
+ : (await /** @type {*} */ (this.response).buffer()).buffer;
21
26
  return data;
22
27
  }
23
28
  }
@@ -27,7 +32,7 @@ export class FetchClient extends BaseClient {
27
32
  this.credentials = credentials;
28
33
  }
29
34
  /**
30
- * @param {{headers: HeadersInit, signal: AbortSignal}} [options={}]
35
+ * @param {RequestInit} [options={}]
31
36
  * @returns {Promise<FetchResponse>}
32
37
  */
33
38
  async request({ headers, signal } = {}) {
@@ -2,7 +2,10 @@ export class HttpClient extends BaseClient {
2
2
  parsedUrl: any;
3
3
  httpApi: any;
4
4
  constructRequest(headers: any, signal: any): Promise<any>;
5
- request({ headers, signal }?: {}): Promise<any>;
5
+ request({ headers, signal }?: {
6
+ headers?: undefined;
7
+ signal?: undefined;
8
+ }): Promise<any>;
6
9
  }
7
10
  import { BaseClient } from './base.js';
8
11
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/source/client/http.js"],"names":[],"mappings":"AAgCA;IAGI,eAAuC;IACvC,aAAmE;IAGrE,0DAmCC;IAED,gDAGC;CACF;2BA5EwC,WAAW"}
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../src/source/client/http.js"],"names":[],"mappings":"AAgCA;IAGI,eAAuC;IACvC,aAAmE;IAGrE,0DAmCC;IAED;;;qBAGC;CACF;2BA5EwC,WAAW"}