Skip to content

Commit f93870c

Browse files
Merge pull request #277 from ahocevar/fix-types
Fix types and remove unnecessary async
2 parents 116354d + cd19c12 commit f93870c

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/geotiff.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ class GeoTIFFBase {
181181
* image is called and the result returned.
182182
* @see GeoTIFFImage.readRasters
183183
* @param {import('./geotiffimage').ReadRasterOptions} [options={}] optional parameters
184-
* @returns {Promise.<(TypedArray|TypedArray[])>} the decoded arrays as a promise
184+
* @returns {Promise<(TypedArray|TypedArray[])>} the decoded arrays as a promise
185185
*/
186186
async readRasters(options = {}) {
187187
const { window: imageWindow, width, height } = options;
@@ -326,7 +326,7 @@ class GeoTIFF extends GeoTIFFBase {
326326
* this function must be called with caution (e.g only using the IFD offsets from
327327
* the headers or other IFDs).
328328
* @param {number} offset the offset to parse the IFD at
329-
* @returns {ImageFileDirectory} the parsed IFD
329+
* @returns {Promise<ImageFileDirectory>} the parsed IFD
330330
*/
331331
async parseFileDirectoryAt(offset) {
332332
const entrySize = this.bigTiff ? 20 : 12;
@@ -455,7 +455,7 @@ class GeoTIFF extends GeoTIFFBase {
455455
/**
456456
* Returns the count of the internal subfiles.
457457
*
458-
* @returns {number} the number of internal subfile images
458+
* @returns {Promise<number>} the number of internal subfile images
459459
*/
460460
async getImageCount() {
461461
let index = 0;
@@ -479,7 +479,7 @@ class GeoTIFF extends GeoTIFFBase {
479479
/**
480480
* Get the values of the COG ghost area as a parsed map.
481481
* See https://gdal.org/drivers/raster/cog.html#header-ghost-area for reference
482-
* @returns {Object} the parsed ghost area or null, if no such area was found
482+
* @returns {Promise<Object>} the parsed ghost area or null, if no such area was found
483483
*/
484484
async getGhostValues() {
485485
const offset = this.bigTiff ? 16 : 8;
@@ -600,7 +600,7 @@ class MultiGeoTIFF extends GeoTIFFBase {
600600
* Get the n-th internal subfile of an image. By default, the first is returned.
601601
*
602602
* @param {number} [index=0] the index of the image to return.
603-
* @returns {GeoTIFFImage} the image at the given index
603+
* @returns {Promise<GeoTIFFImage>} the image at the given index
604604
*/
605605
async getImage(index = 0) {
606606
await this.getImageCount();
@@ -629,7 +629,7 @@ class MultiGeoTIFF extends GeoTIFFBase {
629629
/**
630630
* Returns the count of the internal subfiles.
631631
*
632-
* @returns {number} the number of internal subfile images
632+
* @returns {Promise<number>} the number of internal subfile images
633633
*/
634634
async getImageCount() {
635635
if (this.imageCount !== null) {
@@ -652,7 +652,7 @@ export { MultiGeoTIFF };
652652
* See {@link makeRemoteSource} for details.
653653
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
654654
* to be aborted
655-
* @returns {Promise.<GeoTIFF>} The resulting GeoTIFF file.
655+
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
656656
*/
657657
export async function fromUrl(url, options = {}, signal) {
658658
return GeoTIFF.fromSource(makeRemoteSource(url, options), signal);
@@ -680,7 +680,7 @@ export async function fromArrayBuffer(arrayBuffer, signal) {
680680
* @param {string} path The file path to read from.
681681
* @param {AbortSignal} [signal] An AbortSignal that may be signalled if the request is
682682
* to be aborted
683-
* @returns {Promise.<GeoTIFF>} The resulting GeoTIFF file.
683+
* @returns {Promise<GeoTIFF>} The resulting GeoTIFF file.
684684
*/
685685
export async function fromFile(path, signal) {
686686
return GeoTIFF.fromSource(makeFileSource(path), signal);
@@ -725,7 +725,7 @@ export async function fromUrls(mainUrl, overviewUrls = [], options = {}, signal)
725725
* @param {(Array)} array of pixel values
726726
* @returns {metadata} metadata
727727
*/
728-
export async function writeArrayBuffer(values, metadata) {
728+
export function writeArrayBuffer(values, metadata) {
729729
return writeGeotiff(values, metadata);
730730
}
731731

src/pool.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ class Pool {
6363
/**
6464
* Decode the given block of bytes with the set compression method.
6565
* @param {ArrayBuffer} buffer the array buffer of bytes to decode.
66-
* @returns {Promise.<ArrayBuffer>} the decoded result as a `Promise`
66+
* @returns {Promise<ArrayBuffer>} the decoded result as a `Promise`
6767
*/
6868
async decode(fileDirectory, buffer) {
6969
if (this._awaitingDecoder) {

0 commit comments

Comments
 (0)