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.
- package/dist-browser/geotiff.js +3 -2
- package/dist-browser/geotiff.js.map +1 -1
- package/dist-module/compression/basedecoder.d.ts +4 -0
- package/dist-module/compression/basedecoder.d.ts.map +1 -1
- package/dist-module/compression/basedecoder.js +6 -0
- package/dist-module/compression/index.d.ts +4 -4
- package/dist-module/compression/index.d.ts.map +1 -1
- package/dist-module/compression/index.js +4 -4
- package/dist-module/compression/jpeg.d.ts +6 -1
- package/dist-module/compression/jpeg.d.ts.map +1 -1
- package/dist-module/compression/jpeg.js +50 -5
- package/dist-module/compression/lzw.js +1 -1
- package/dist-module/compression/webimage.d.ts +1 -1
- package/dist-module/compression/webimage.d.ts.map +1 -1
- package/dist-module/compression/webimage.js +1 -1
- package/dist-module/dataslice.d.ts.map +1 -1
- package/dist-module/dataslice.js +2 -2
- package/dist-module/dataview64.d.ts +2 -2
- package/dist-module/dataview64.d.ts.map +1 -1
- package/dist-module/dataview64.js +4 -4
- package/dist-module/geotiff.d.ts +161 -45
- package/dist-module/geotiff.d.ts.map +1 -1
- package/dist-module/geotiff.js +111 -20
- package/dist-module/geotiffimage.d.ts +76 -110
- package/dist-module/geotiffimage.d.ts.map +1 -1
- package/dist-module/geotiffimage.js +98 -70
- package/dist-module/geotiffwriter.js +2 -2
- package/dist-module/globals.d.ts +48 -40
- package/dist-module/globals.d.ts.map +1 -1
- package/dist-module/globals.js +14 -10
- package/dist-module/imagefiledirectory.d.ts +2 -2
- package/dist-module/imagefiledirectory.d.ts.map +1 -1
- package/dist-module/imagefiledirectory.js +23 -12
- package/dist-module/logging.js +7 -7
- package/dist-module/pool.d.ts +2 -3
- package/dist-module/pool.d.ts.map +1 -1
- package/dist-module/pool.js +18 -16
- package/dist-module/predictor.js +1 -1
- package/dist-module/resample.d.ts +18 -18
- package/dist-module/resample.d.ts.map +1 -1
- package/dist-module/resample.js +12 -12
- package/dist-module/source/basesource.d.ts +7 -7
- package/dist-module/source/basesource.d.ts.map +1 -1
- package/dist-module/source/basesource.js +7 -7
- package/dist-module/source/blockedsource.d.ts +10 -10
- package/dist-module/source/blockedsource.d.ts.map +1 -1
- package/dist-module/source/blockedsource.js +12 -9
- package/dist-module/source/client/base.d.ts +8 -10
- package/dist-module/source/client/base.d.ts.map +1 -1
- package/dist-module/source/client/base.js +4 -3
- package/dist-module/source/client/fetch.d.ts +2 -7
- package/dist-module/source/client/fetch.d.ts.map +1 -1
- package/dist-module/source/client/fetch.js +7 -2
- package/dist-module/source/client/http.d.ts +4 -1
- package/dist-module/source/client/http.d.ts.map +1 -1
- package/dist-module/source/client/http.js +4 -4
- package/dist-module/source/client/xhr.d.ts +4 -1
- package/dist-module/source/client/xhr.d.ts.map +1 -1
- package/dist-module/source/client/xhr.js +1 -1
- package/dist-module/source/file.js +4 -4
- package/dist-module/source/filereader.js +1 -1
- package/dist-module/source/httputils.d.ts +14 -6
- package/dist-module/source/httputils.d.ts.map +1 -1
- package/dist-module/source/httputils.js +13 -12
- package/dist-module/source/remote.d.ts +31 -22
- package/dist-module/source/remote.d.ts.map +1 -1
- package/dist-module/source/remote.js +37 -13
- package/dist-module/utils.d.ts +7 -1
- package/dist-module/utils.d.ts.map +1 -1
- package/dist-module/utils.js +6 -0
- package/dist-module/worker/create.js +1 -1
- package/dist-node/compression/basedecoder.d.ts +4 -0
- package/dist-node/compression/basedecoder.d.ts.map +1 -1
- package/dist-node/compression/basedecoder.js +6 -0
- package/dist-node/compression/basedecoder.js.map +1 -1
- package/dist-node/compression/index.d.ts +4 -4
- package/dist-node/compression/index.d.ts.map +1 -1
- package/dist-node/compression/index.js +4 -4
- package/dist-node/compression/jpeg.d.ts +6 -1
- package/dist-node/compression/jpeg.d.ts.map +1 -1
- package/dist-node/compression/jpeg.js +50 -5
- package/dist-node/compression/jpeg.js.map +1 -1
- package/dist-node/compression/lzw.js +1 -1
- package/dist-node/compression/lzw.js.map +1 -1
- package/dist-node/compression/webimage.js +1 -1
- package/dist-node/compression/webimage.js.map +1 -1
- package/dist-node/dataslice.js +2 -2
- package/dist-node/dataslice.js.map +1 -1
- package/dist-node/dataview64.d.ts +2 -2
- package/dist-node/dataview64.d.ts.map +1 -1
- package/dist-node/dataview64.js +4 -4
- package/dist-node/dataview64.js.map +1 -1
- package/dist-node/geotiff.d.ts +161 -45
- package/dist-node/geotiff.d.ts.map +1 -1
- package/dist-node/geotiff.js +110 -20
- package/dist-node/geotiff.js.map +1 -1
- package/dist-node/geotiffimage.d.ts +77 -111
- package/dist-node/geotiffimage.d.ts.map +1 -1
- package/dist-node/geotiffimage.js +98 -70
- package/dist-node/geotiffimage.js.map +1 -1
- package/dist-node/geotiffwriter.js +2 -2
- package/dist-node/geotiffwriter.js.map +1 -1
- package/dist-node/globals.d.ts +48 -40
- package/dist-node/globals.d.ts.map +1 -1
- package/dist-node/globals.js +14 -10
- package/dist-node/globals.js.map +1 -1
- package/dist-node/imagefiledirectory.d.ts +2 -2
- package/dist-node/imagefiledirectory.d.ts.map +1 -1
- package/dist-node/imagefiledirectory.js +23 -12
- package/dist-node/imagefiledirectory.js.map +1 -1
- package/dist-node/logging.js +7 -7
- package/dist-node/logging.js.map +1 -1
- package/dist-node/pool.d.ts +2 -3
- package/dist-node/pool.d.ts.map +1 -1
- package/dist-node/pool.js +18 -16
- package/dist-node/pool.js.map +1 -1
- package/dist-node/predictor.js +1 -1
- package/dist-node/predictor.js.map +1 -1
- package/dist-node/resample.d.ts +18 -18
- package/dist-node/resample.d.ts.map +1 -1
- package/dist-node/resample.js +12 -12
- package/dist-node/source/basesource.d.ts +7 -7
- package/dist-node/source/basesource.d.ts.map +1 -1
- package/dist-node/source/basesource.js +7 -7
- package/dist-node/source/basesource.js.map +1 -1
- package/dist-node/source/blockedsource.d.ts +10 -10
- package/dist-node/source/blockedsource.d.ts.map +1 -1
- package/dist-node/source/blockedsource.js +12 -9
- package/dist-node/source/blockedsource.js.map +1 -1
- package/dist-node/source/client/base.d.ts +8 -10
- package/dist-node/source/client/base.d.ts.map +1 -1
- package/dist-node/source/client/base.js +4 -3
- package/dist-node/source/client/base.js.map +1 -1
- package/dist-node/source/client/fetch.d.ts +2 -6
- package/dist-node/source/client/fetch.d.ts.map +1 -1
- package/dist-node/source/client/fetch.js +7 -2
- package/dist-node/source/client/fetch.js.map +1 -1
- package/dist-node/source/client/http.d.ts +4 -1
- package/dist-node/source/client/http.d.ts.map +1 -1
- package/dist-node/source/client/http.js +4 -4
- package/dist-node/source/client/http.js.map +1 -1
- package/dist-node/source/client/xhr.d.ts +4 -1
- package/dist-node/source/client/xhr.d.ts.map +1 -1
- package/dist-node/source/client/xhr.js +1 -1
- package/dist-node/source/client/xhr.js.map +1 -1
- package/dist-node/source/file.js +4 -4
- package/dist-node/source/file.js.map +1 -1
- package/dist-node/source/filereader.js +1 -1
- package/dist-node/source/filereader.js.map +1 -1
- package/dist-node/source/httputils.d.ts +14 -6
- package/dist-node/source/httputils.d.ts.map +1 -1
- package/dist-node/source/httputils.js +13 -12
- package/dist-node/source/httputils.js.map +1 -1
- package/dist-node/source/remote.d.ts +31 -22
- package/dist-node/source/remote.d.ts.map +1 -1
- package/dist-node/source/remote.js +37 -13
- package/dist-node/source/remote.js.map +1 -1
- package/dist-node/utils.d.ts +7 -1
- package/dist-node/utils.d.ts.map +1 -1
- package/dist-node/utils.js +6 -0
- package/dist-node/utils.js.map +1 -1
- package/dist-node/worker/create.js +1 -1
- package/dist-node/worker/create.js.map +1 -1
- package/package.json +3 -54
package/dist-node/resample.d.ts
CHANGED
|
@@ -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}
|
|
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:
|
|
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}
|
|
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:
|
|
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":["../dist-module/resample.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,6CAPW,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"resample.d.ts","sourceRoot":"","sources":["../dist-module/resample.js"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,6CAPW,OAAO,WAAW,EAAE,UAAU,EAAE,WAChC,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,EAAE,CAiB5C;AAMD;;;;;;;;GAQG;AACH,8CAPW,OAAO,WAAW,EAAE,UAAU,EAAE,WAChC,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,EAAE,CA0B5C;AACD;;;;;;;;;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;AACD;;;;;;;;;;GAUG;AACH,uDATW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,OAAO,WAAW,EAAE,UAAU,CAiB1C;AACD;;;;;;;;;;GAUG;AACH,wDATW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,GAEJ,OAAO,WAAW,EAAE,UAAU,CA0B1C;AACD;;;;;;;;;;;GAWG;AACH,gDAVW,OAAO,WAAW,EAAE,UAAU,WAC9B,MAAM,YACN,MAAM,YACN,MAAM,aACN,MAAM,WACN,MAAM,WAEN,MAAM,GACJ,OAAO,WAAW,EAAE,UAAU,CAY1C"}
|
package/dist-node/resample.js
CHANGED
|
@@ -14,12 +14,12 @@ function copyNewSize(array, width, height, samplesPerPixel = 1) {
|
|
|
14
14
|
}
|
|
15
15
|
/**
|
|
16
16
|
* Resample the input arrays using nearest neighbor value selection.
|
|
17
|
-
* @param {TypedArray[]} valueArrays The input arrays to resample
|
|
17
|
+
* @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
|
|
18
18
|
* @param {number} inWidth The width of the input rasters
|
|
19
19
|
* @param {number} inHeight The height of the input rasters
|
|
20
20
|
* @param {number} outWidth The desired width of the output rasters
|
|
21
21
|
* @param {number} outHeight The desired height of the output rasters
|
|
22
|
-
* @returns {TypedArray[]} The resampled rasters
|
|
22
|
+
* @returns {import("./geotiff").TypedArray[]} The resampled rasters
|
|
23
23
|
*/
|
|
24
24
|
function resampleNearest(valueArrays, inWidth, inHeight, outWidth, outHeight) {
|
|
25
25
|
const relX = inWidth / outWidth;
|
|
@@ -44,12 +44,12 @@ function lerp(v0, v1, t) {
|
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
46
|
* Resample the input arrays using bilinear interpolation.
|
|
47
|
-
* @param {TypedArray[]} valueArrays The input arrays to resample
|
|
47
|
+
* @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
|
|
48
48
|
* @param {number} inWidth The width of the input rasters
|
|
49
49
|
* @param {number} inHeight The height of the input rasters
|
|
50
50
|
* @param {number} outWidth The desired width of the output rasters
|
|
51
51
|
* @param {number} outHeight The desired height of the output rasters
|
|
52
|
-
* @returns {TypedArray[]} The resampled rasters
|
|
52
|
+
* @returns {import("./geotiff").TypedArray[]} The resampled rasters
|
|
53
53
|
*/
|
|
54
54
|
function resampleBilinear(valueArrays, inWidth, inHeight, outWidth, outHeight) {
|
|
55
55
|
const relX = inWidth / outWidth;
|
|
@@ -78,13 +78,13 @@ function resampleBilinear(valueArrays, inWidth, inHeight, outWidth, outHeight) {
|
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Resample the input arrays using the selected resampling method.
|
|
81
|
-
* @param {TypedArray[]} valueArrays The input arrays to resample
|
|
81
|
+
* @param {import("./geotiff").TypedArray[]} valueArrays The input arrays to resample
|
|
82
82
|
* @param {number} inWidth The width of the input rasters
|
|
83
83
|
* @param {number} inHeight The height of the input rasters
|
|
84
84
|
* @param {number} outWidth The desired width of the output rasters
|
|
85
85
|
* @param {number} outHeight The desired height of the output rasters
|
|
86
86
|
* @param {string} [method = 'nearest'] The desired resampling method
|
|
87
|
-
* @returns {TypedArray[]} The resampled rasters
|
|
87
|
+
* @returns {import("./geotiff").TypedArray[]} The resampled rasters
|
|
88
88
|
*/
|
|
89
89
|
function resample(valueArrays, inWidth, inHeight, outWidth, outHeight, method = 'nearest') {
|
|
90
90
|
switch (method.toLowerCase()) {
|
|
@@ -99,14 +99,14 @@ function resample(valueArrays, inWidth, inHeight, outWidth, outHeight, method =
|
|
|
99
99
|
}
|
|
100
100
|
/**
|
|
101
101
|
* Resample the pixel interleaved input array using nearest neighbor value selection.
|
|
102
|
-
* @param {TypedArray}
|
|
102
|
+
* @param {import("./geotiff").TypedArray} valueArray The input array to resample
|
|
103
103
|
* @param {number} inWidth The width of the input rasters
|
|
104
104
|
* @param {number} inHeight The height of the input rasters
|
|
105
105
|
* @param {number} outWidth The desired width of the output rasters
|
|
106
106
|
* @param {number} outHeight The desired height of the output rasters
|
|
107
107
|
* @param {number} samples The number of samples per pixel for pixel
|
|
108
108
|
* interleaved data
|
|
109
|
-
* @returns {TypedArray} The resampled raster
|
|
109
|
+
* @returns {import("./geotiff").TypedArray} The resampled raster
|
|
110
110
|
*/
|
|
111
111
|
function resampleNearestInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples) {
|
|
112
112
|
const relX = inWidth / outWidth;
|
|
@@ -126,14 +126,14 @@ function resampleNearestInterleaved(valueArray, inWidth, inHeight, outWidth, out
|
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
128
128
|
* Resample the pixel interleaved input array using bilinear interpolation.
|
|
129
|
-
* @param {TypedArray}
|
|
129
|
+
* @param {import("./geotiff").TypedArray} valueArray The input array to resample
|
|
130
130
|
* @param {number} inWidth The width of the input rasters
|
|
131
131
|
* @param {number} inHeight The height of the input rasters
|
|
132
132
|
* @param {number} outWidth The desired width of the output rasters
|
|
133
133
|
* @param {number} outHeight The desired height of the output rasters
|
|
134
134
|
* @param {number} samples The number of samples per pixel for pixel
|
|
135
135
|
* interleaved data
|
|
136
|
-
* @returns {TypedArray} The resampled raster
|
|
136
|
+
* @returns {import("./geotiff").TypedArray} The resampled raster
|
|
137
137
|
*/
|
|
138
138
|
function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples) {
|
|
139
139
|
const relX = inWidth / outWidth;
|
|
@@ -162,7 +162,7 @@ function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWidth, ou
|
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
164
164
|
* Resample the pixel interleaved input array using the selected resampling method.
|
|
165
|
-
* @param {TypedArray} valueArray The input array to resample
|
|
165
|
+
* @param {import("./geotiff").TypedArray} valueArray The input array to resample
|
|
166
166
|
* @param {number} inWidth The width of the input rasters
|
|
167
167
|
* @param {number} inHeight The height of the input rasters
|
|
168
168
|
* @param {number} outWidth The desired width of the output rasters
|
|
@@ -170,7 +170,7 @@ function resampleBilinearInterleaved(valueArray, inWidth, inHeight, outWidth, ou
|
|
|
170
170
|
* @param {number} samples The number of samples per pixel for pixel
|
|
171
171
|
* interleaved data
|
|
172
172
|
* @param {string} [method = 'nearest'] The desired resampling method
|
|
173
|
-
* @returns {TypedArray} The resampled rasters
|
|
173
|
+
* @returns {import("./geotiff").TypedArray} The resampled rasters
|
|
174
174
|
*/
|
|
175
175
|
function resampleInterleaved(valueArray, inWidth, inHeight, outWidth, outHeight, samples, method = 'nearest') {
|
|
176
176
|
switch (method.toLowerCase()) {
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export class BaseSource {
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
* @param {
|
|
10
|
-
* @returns {
|
|
8
|
+
* @param {Array<Slice>} slices
|
|
9
|
+
* @param {AbortSignal} [signal]
|
|
10
|
+
* @returns {Promise<*[]>}
|
|
11
11
|
*/
|
|
12
|
-
fetch(slices: Slice
|
|
12
|
+
fetch(slices: Array<Slice>, signal?: AbortSignal): Promise<any[]>;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
15
14
|
* @param {Slice} slice
|
|
16
|
-
* @
|
|
15
|
+
* @param {AbortSignal} [_signal]
|
|
16
|
+
* @returns {Promise<*>}
|
|
17
17
|
*/
|
|
18
|
-
fetchSlice(slice: Slice):
|
|
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":["../../dist-module/source/basesource.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IACI;;;;OAIG;IACH,
|
|
1
|
+
{"version":3,"file":"basesource.d.ts","sourceRoot":"","sources":["../../dist-module/source/basesource.js"],"names":[],"mappings":"AAAA;;;;GAIG;AACH;IACI;;;;OAIG;IACH,cAJW,KAAK,CAAC,KAAK,CAAC,WACZ,WAAW,GACT,OAAO,CAAC,GAAC,EAAE,CAAC,CAIxB;IACD;;;;OAIG;IACH,kBAJW,KAAK,YACL,WAAW,GACT,OAAO,CAAC,GAAC,CAAC,CAItB;IACD;;OAEG;IACH,qBAEC;IACD,uBAEC;CACJ;;YA7Ba,MAAM;YACN,MAAM"}
|
|
@@ -8,19 +8,19 @@ exports.BaseSource = void 0;
|
|
|
8
8
|
*/
|
|
9
9
|
class BaseSource {
|
|
10
10
|
/**
|
|
11
|
-
*
|
|
12
|
-
* @param {
|
|
13
|
-
* @returns {
|
|
11
|
+
* @param {Array<Slice>} slices
|
|
12
|
+
* @param {AbortSignal} [signal]
|
|
13
|
+
* @returns {Promise<*[]>}
|
|
14
14
|
*/
|
|
15
|
-
async fetch(slices, signal
|
|
15
|
+
async fetch(slices, signal) {
|
|
16
16
|
return Promise.all(slices.map((slice) => this.fetchSlice(slice, signal)));
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
20
19
|
* @param {Slice} slice
|
|
21
|
-
* @
|
|
20
|
+
* @param {AbortSignal} [_signal]
|
|
21
|
+
* @returns {Promise<*>}
|
|
22
22
|
*/
|
|
23
|
-
async fetchSlice(slice) {
|
|
23
|
+
async fetchSlice(slice, _signal) {
|
|
24
24
|
throw new Error(`fetching of slice ${slice} not possible, not implemented`);
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basesource.js","sourceRoot":"","sources":["../../dist-module/source/basesource.js"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,UAAU;IACnB;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM
|
|
1
|
+
{"version":3,"file":"basesource.js","sourceRoot":"","sources":["../../dist-module/source/basesource.js"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,MAAa,UAAU;IACnB;;;;OAIG;IACH,KAAK,CAAC,KAAK,CAAC,MAAM,EAAE,MAAM;QACtB,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IACD;;;;OAIG;IACH,KAAK,CAAC,UAAU,CAAC,KAAK,EAAE,OAAO;QAC3B,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,gCAAgC,CAAC,CAAC;IAChF,CAAC;IACD;;OAEG;IACH,IAAI,QAAQ;QACR,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,KAAK,CAAC,KAAK;QACP,mBAAmB;IACvB,CAAC;CACJ;AA1BD,gCA0BC"}
|
|
@@ -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
|
|
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
|
|
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<
|
|
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}
|
|
51
|
+
* @param {ArrayBuffer} data
|
|
52
52
|
*/
|
|
53
|
-
constructor(offset: number, length: number, data
|
|
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":["../../dist-module/source/blockedsource.js"],"names":[],"mappings":"AAmCA;IACI;;;;;;OAMG;IACH,oBALW,UAAU,6BAElB;QAAyB,SAAS;QACT,SAAS;KAAC,EAmBrC;IAfG,mBAAoB;IACpB,kBAA0B;IAC1B,+BAKE;IACF,iCAAiC;IACjC,eADW,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CACC;IAE9B,6BAA8B;IAE9B,0BAAgC;IAChC,0BAAgC;IAKpC
|
|
1
|
+
{"version":3,"file":"blockedsource.d.ts","sourceRoot":"","sources":["../../dist-module/source/blockedsource.js"],"names":[],"mappings":"AAmCA;IACI;;;;;;OAMG;IACH,oBALW,UAAU,6BAElB;QAAyB,SAAS;QACT,SAAS;KAAC,EAmBrC;IAfG,mBAAoB;IACpB,kBAA0B;IAC1B,+BAKE;IACF,iCAAiC;IACjC,eADW,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CACC;IAE9B,6BAA8B;IAE9B,0BAAgC;IAChC,0BAAgC;IAKpC;;;;OAIG;IACH,cAJW,OAAO,cAAc,EAAE,KAAK,EAAE,WAC9B,WAAW,GACV,OAAO,CAAC,WAAW,EAAE,CAAC,CAuEjC;IACD;;OAEG;IACH,qBAFW,WAAW,QA2CrB;IACD;;;;OAIG;IACH,iCAFa,UAAU,EAAE,CAuBxB;IACD;;;;OAIG;IACH,sBAJW,OAAO,cAAc,EAAE,KAAK,EAAE,UAC9B,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,GAChB,WAAW,EAAE,CAuCzB;CACJ;2BA5P0B,iBAAiB;qBAFvB,WAAW;AAGhC;IACI;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,QACN,WAAW,EAMrB;IAHG,eAAoB;IACpB,eAAoB;IACpB,kBAAgB;IAEpB;;OAEG;IACH,WAFa,MAAM,CAIlB;CACJ;AACD;IACI;;;;;OAKG;IACH,oBAJW,MAAM,UACN,MAAM,YACN,MAAM,EAAE,EAMlB;IAHG,eAAoB;IACpB,eAAoB;IACpB,mBAAwB;CAE/B"}
|
|
@@ -12,9 +12,9 @@ class Block {
|
|
|
12
12
|
*
|
|
13
13
|
* @param {number} offset
|
|
14
14
|
* @param {number} length
|
|
15
|
-
* @param {ArrayBuffer}
|
|
15
|
+
* @param {ArrayBuffer} data
|
|
16
16
|
*/
|
|
17
|
-
constructor(offset, length, data
|
|
17
|
+
constructor(offset, length, data) {
|
|
18
18
|
this.offset = offset;
|
|
19
19
|
this.length = length;
|
|
20
20
|
this.data = data;
|
|
@@ -69,8 +69,9 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
69
69
|
return this.source.fileSize;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
*
|
|
73
72
|
* @param {import("./basesource").Slice[]} slices
|
|
73
|
+
* @param {AbortSignal} [signal]
|
|
74
|
+
* @return {Promise<ArrayBuffer[]>}
|
|
74
75
|
*/
|
|
75
76
|
async fetch(slices, signal) {
|
|
76
77
|
const blockRequests = [];
|
|
@@ -118,7 +119,7 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
118
119
|
abortedBlockIds.forEach((id) => this.blockIdsToFetch.add(id));
|
|
119
120
|
// start the retry of some blocks if required
|
|
120
121
|
if (abortedBlockIds.length > 0 && signal && !signal.aborted) {
|
|
121
|
-
this.fetchBlocks(
|
|
122
|
+
this.fetchBlocks();
|
|
122
123
|
for (const blockId of abortedBlockIds) {
|
|
123
124
|
const block = this.blockRequests.get(blockId);
|
|
124
125
|
if (!block) {
|
|
@@ -143,8 +144,7 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
143
144
|
return this.readSliceData(slices, requiredBlocks);
|
|
144
145
|
}
|
|
145
146
|
/**
|
|
146
|
-
*
|
|
147
|
-
* @param {AbortSignal} signal
|
|
147
|
+
* @param {AbortSignal} [signal]
|
|
148
148
|
*/
|
|
149
149
|
fetchBlocks(signal) {
|
|
150
150
|
// check if we still need to
|
|
@@ -163,7 +163,7 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
163
163
|
const o = blockOffset - response.offset;
|
|
164
164
|
const t = Math.min(o + this.blockSize, response.data.byteLength);
|
|
165
165
|
const data = response.data.slice(o, t);
|
|
166
|
-
const block = new Block(blockOffset, data.byteLength, data
|
|
166
|
+
const block = new Block(blockOffset, data.byteLength, data);
|
|
167
167
|
this.blockCache.set(blockId, block);
|
|
168
168
|
this.abortedBlockIds.delete(blockId);
|
|
169
169
|
}
|
|
@@ -216,9 +216,9 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
216
216
|
return groups;
|
|
217
217
|
}
|
|
218
218
|
/**
|
|
219
|
-
*
|
|
220
219
|
* @param {import("./basesource").Slice[]} slices
|
|
221
|
-
* @param {Map} blocks
|
|
220
|
+
* @param {Map<number, Block>} blocks
|
|
221
|
+
* @returns {ArrayBuffer[]}
|
|
222
222
|
*/
|
|
223
223
|
readSliceData(slices, blocks) {
|
|
224
224
|
return slices.map((slice) => {
|
|
@@ -232,6 +232,9 @@ class BlockedSource extends basesource_js_1.BaseSource {
|
|
|
232
232
|
const sliceView = new Uint8Array(sliceData);
|
|
233
233
|
for (let blockId = blockIdLow; blockId <= blockIdHigh; ++blockId) {
|
|
234
234
|
const block = blocks.get(blockId);
|
|
235
|
+
if (!block) {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
235
238
|
const delta = block.offset - slice.offset;
|
|
236
239
|
const topDelta = block.top - top;
|
|
237
240
|
let blockInnerOffset = 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blockedsource.js","sourceRoot":"","sources":["../../dist-module/source/blockedsource.js"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AACjC,0CAAoE;AACpE,mDAA6C;AAC7C,MAAM,KAAK;IACP;;;;;OAKG;IACH,YAAY,MAAM,EAAE,MAAM,EAAE,IAAI
|
|
1
|
+
{"version":3,"file":"blockedsource.js","sourceRoot":"","sources":["../../dist-module/source/blockedsource.js"],"names":[],"mappings":";;;;;;AAAA,0DAAiC;AACjC,0CAAoE;AACpE,mDAA6C;AAC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IAAI,WAAW,EAAE,EAAE,OAAO,EAAE,CAAC;gBAC/D,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;gBAClC,IAAI,CAAC,KAAK,EAAE,CAAC;oBACT,SAAS;gBACb,CAAC;gBACD,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;gBAC1C,MAAM,QAAQ,GAAG,KAAK,CAAC,GAAG,GAAG,GAAG,CAAC;gBACjC,IAAI,gBAAgB,GAAG,CAAC,CAAC;gBACzB,IAAI,gBAAgB,GAAG,CAAC,CAAC;gBACzB,IAAI,eAAe,CAAC;gBACpB,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;oBACZ,gBAAgB,GAAG,CAAC,KAAK,CAAC;gBAC9B,CAAC;qBACI,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;oBACjB,gBAAgB,GAAG,KAAK,CAAC;gBAC7B,CAAC;gBACD,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;oBACf,eAAe,GAAG,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBACtD,CAAC;qBACI,CAAC;oBACF,eAAe,GAAG,GAAG,GAAG,KAAK,CAAC,MAAM,GAAG,gBAAgB,CAAC;gBAC5D,CAAC;gBACD,MAAM,SAAS,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,EAAE,eAAe,CAAC,CAAC;gBAChF,SAAS,CAAC,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;YAC/C,CAAC;YACD,OAAO,SAAS,CAAC;QACrB,CAAC,CAAC,CAAC;IACP,CAAC;CACJ;AA3ND,sCA2NC"}
|
|
@@ -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():
|
|
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 {
|
|
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":["../../../dist-module/source/client/base.js"],"names":[],"mappings":"AAAA;IACI;;OAEG;IACH,kBAEC;IACD
|
|
1
|
+
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../../dist-module/source/client/base.js"],"names":[],"mappings":"AAAA;IACI;;OAEG;IACH,kBAEC;IACD;;;OAGG;IACH,cAFa,MAAM,CAIlB;IACD;;;;OAIG;IACH,sBAHW,MAAM,GACJ,MAAM,GAAC,IAAI,CAIvB;IACD;;OAEG;IACH,WAFa,OAAO,CAAC,WAAW,CAAC,CAIhC;CACJ;AACD;IACI,sBAEC;IADG,SAAc;IAElB;;;;OAIG;IACH,8BAHW,WAAW,GACT,OAAO,CAAC,YAAY,CAAC,CAIjC;CACJ"}
|
|
@@ -10,6 +10,7 @@ class BaseResponse {
|
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
12
|
* Returns the status code of the response
|
|
13
|
+
* @returns {number} the status code
|
|
13
14
|
*/
|
|
14
15
|
get status() {
|
|
15
16
|
throw new Error('not implemented');
|
|
@@ -17,13 +18,13 @@ class BaseResponse {
|
|
|
17
18
|
/**
|
|
18
19
|
* Returns the value of the specified header
|
|
19
20
|
* @param {string} headerName the header name
|
|
20
|
-
* @returns {string} the header value
|
|
21
|
+
* @returns {string|null} the header value
|
|
21
22
|
*/
|
|
22
23
|
getHeader(headerName) {
|
|
23
24
|
throw new Error('not implemented');
|
|
24
25
|
}
|
|
25
26
|
/**
|
|
26
|
-
* @returns {ArrayBuffer} the response data of the request
|
|
27
|
+
* @returns {Promise<ArrayBuffer>} the response data of the request
|
|
27
28
|
*/
|
|
28
29
|
async getData() {
|
|
29
30
|
throw new Error('not implemented');
|
|
@@ -36,7 +37,7 @@ class BaseClient {
|
|
|
36
37
|
}
|
|
37
38
|
/**
|
|
38
39
|
* Send a request with the options
|
|
39
|
-
* @param {
|
|
40
|
+
* @param {RequestInit} [options={}]
|
|
40
41
|
* @returns {Promise<BaseResponse>}
|
|
41
42
|
*/
|
|
42
43
|
async request({ headers, signal } = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../dist-module/source/client/base.js"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;IACrB;;OAEG;IACH,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC;IACpD,CAAC;IACD
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../../dist-module/source/client/base.js"],"names":[],"mappings":";;;AAAA,MAAa,YAAY;IACrB;;OAEG;IACH,IAAI,EAAE;QACF,OAAO,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC;IACpD,CAAC;IACD;;;OAGG;IACH,IAAI,MAAM;QACN,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IACD;;;;OAIG;IACH,SAAS,CAAC,UAAU;QAChB,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;IACD;;OAEG;IACH,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,CAAC;CACJ;AA5BD,oCA4BC;AACD,MAAa,UAAU;IACnB,YAAY,GAAG;QACX,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;IACnB,CAAC;IACD;;;;OAIG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE;QAClC,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;CACJ;AAZD,gCAYC"}
|
|
@@ -2,13 +2,10 @@ export class FetchClient extends BaseClient {
|
|
|
2
2
|
constructor(url: any, credentials: any);
|
|
3
3
|
credentials: any;
|
|
4
4
|
/**
|
|
5
|
-
* @param {
|
|
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 {
|
|
@@ -19,7 +16,6 @@ declare class FetchResponse extends BaseResponse {
|
|
|
19
16
|
constructor(response: Response);
|
|
20
17
|
response: Response;
|
|
21
18
|
get status(): any;
|
|
22
|
-
getHeader(name: any): any;
|
|
23
19
|
getData(): Promise<any>;
|
|
24
20
|
}
|
|
25
21
|
import { BaseResponse } from './base.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../dist-module/source/client/fetch.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../dist-module/source/client/fetch.js"],"names":[],"mappings":"AA4BA;IACI,wCAGC;IADG,iBAA8B;IAElC;;;OAGG;IACH,8BAHW,WAAW,GACT,OAAO,CAAC,aAAa,CAAC,CAOlC;CACJ;2BA3CwC,WAAW;AACpD;IACI;;;OAGG;IACH,sBAFW,QAAQ,EAKlB;IADG,mBAAwB;IAE5B,kBAEC;IAQD,wBAMC;CACJ;6BA3BwC,WAAW"}
|
|
@@ -14,13 +14,18 @@ class FetchResponse extends base_js_1.BaseResponse {
|
|
|
14
14
|
get status() {
|
|
15
15
|
return this.response.status;
|
|
16
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* @param {string} name
|
|
19
|
+
* @returns {string|null}
|
|
20
|
+
*/
|
|
17
21
|
getHeader(name) {
|
|
18
22
|
return this.response.headers.get(name);
|
|
19
23
|
}
|
|
20
24
|
async getData() {
|
|
21
25
|
const data = this.response.arrayBuffer
|
|
22
26
|
? await this.response.arrayBuffer()
|
|
23
|
-
|
|
27
|
+
// FIXME Can this really have a buffer property?
|
|
28
|
+
: (await /** @type {*} */ (this.response).buffer()).buffer;
|
|
24
29
|
return data;
|
|
25
30
|
}
|
|
26
31
|
}
|
|
@@ -30,7 +35,7 @@ class FetchClient extends base_js_1.BaseClient {
|
|
|
30
35
|
this.credentials = credentials;
|
|
31
36
|
}
|
|
32
37
|
/**
|
|
33
|
-
* @param {
|
|
38
|
+
* @param {RequestInit} [options={}]
|
|
34
39
|
* @returns {Promise<FetchResponse>}
|
|
35
40
|
*/
|
|
36
41
|
async request({ headers, signal } = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../dist-module/source/client/fetch.js"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,MAAM,aAAc,SAAQ,sBAAY;IACpC;;;OAGG;IACH,YAAY,QAAQ;QAChB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChC,CAAC;IACD,SAAS,CAAC,IAAI;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW;YAClC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YACnC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.js","sourceRoot":"","sources":["../../../dist-module/source/client/fetch.js"],"names":[],"mappings":";;;AAAA,uCAAqD;AACrD,MAAM,aAAc,SAAQ,sBAAY;IACpC;;;OAGG;IACH,YAAY,QAAQ;QAChB,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC7B,CAAC;IACD,IAAI,MAAM;QACN,OAAO,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC;IAChC,CAAC;IACD;;;OAGG;IACH,SAAS,CAAC,IAAI;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC3C,CAAC;IACD,KAAK,CAAC,OAAO;QACT,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,CAAC,WAAW;YAClC,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE;YACnC,gDAAgD;YAChD,CAAC,CAAC,CAAC,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QAC/D,OAAO,IAAI,CAAC;IAChB,CAAC;CACJ;AACD,MAAa,WAAY,SAAQ,oBAAU;IACvC,YAAY,GAAG,EAAE,WAAW;QACxB,KAAK,CAAC,GAAG,CAAC,CAAC;QACX,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACnC,CAAC;IACD;;;OAGG;IACH,KAAK,CAAC,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE;QAClC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE;YACnC,OAAO,EAAE,WAAW,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM;SACjD,CAAC,CAAC;QACH,OAAO,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC;IACvC,CAAC;CACJ;AAfD,kCAeC"}
|
|
@@ -3,7 +3,10 @@ export class HttpClient extends BaseClient {
|
|
|
3
3
|
parsedUrl: urlMod.UrlWithStringQuery;
|
|
4
4
|
httpApi: typeof http | typeof https;
|
|
5
5
|
constructRequest(headers: any, signal: any): Promise<any>;
|
|
6
|
-
request({ headers, signal }?: {
|
|
6
|
+
request({ headers, signal }?: {
|
|
7
|
+
headers?: undefined;
|
|
8
|
+
signal?: undefined;
|
|
9
|
+
}): Promise<any>;
|
|
7
10
|
}
|
|
8
11
|
import { BaseClient } from './base.js';
|
|
9
12
|
import urlMod from 'url';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../dist-module/source/client/http.js"],"names":[],"mappings":"AA0BA;IACI,sBAIC;IAFG,qCAAuC;IACvC,oCAAmE;IAEvE,0DA6BC;IACD
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../../dist-module/source/client/http.js"],"names":[],"mappings":"AA0BA;IACI,sBAIC;IAFG,qCAAuC;IACvC,oCAAmE;IAEvE,0DA6BC;IACD;;;qBAGC;CACJ;2BA/DwC,WAAW;mBADjC,KAAK;iBAFP,MAAM;kBACL,OAAO"}
|
|
@@ -12,7 +12,7 @@ const utils_js_1 = require("../../utils.js");
|
|
|
12
12
|
class HttpResponse extends base_js_1.BaseResponse {
|
|
13
13
|
/**
|
|
14
14
|
* BaseResponse facade for node HTTP/HTTPS API Response
|
|
15
|
-
* @param {http.
|
|
15
|
+
* @param {import('http').IncomingMessage} response
|
|
16
16
|
*/
|
|
17
17
|
constructor(response, dataPromise) {
|
|
18
18
|
super();
|
|
@@ -20,10 +20,10 @@ class HttpResponse extends base_js_1.BaseResponse {
|
|
|
20
20
|
this.dataPromise = dataPromise;
|
|
21
21
|
}
|
|
22
22
|
get status() {
|
|
23
|
-
return this.response.statusCode;
|
|
23
|
+
return /** @type {number} */ (this.response.statusCode);
|
|
24
24
|
}
|
|
25
25
|
getHeader(name) {
|
|
26
|
-
return this.response.headers[name];
|
|
26
|
+
return /** @type {string|null} */ (this.response.headers[name]);
|
|
27
27
|
}
|
|
28
28
|
async getData() {
|
|
29
29
|
const data = await this.dataPromise;
|
|
@@ -66,7 +66,7 @@ class HttpClient extends base_js_1.BaseClient {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
|
-
async request({ headers, signal } = {}) {
|
|
69
|
+
async request({ headers = undefined, signal = undefined } = {}) {
|
|
70
70
|
const response = await this.constructRequest(headers, signal);
|
|
71
71
|
return response;
|
|
72
72
|
}
|