From 04a28854c9e5544cccc05f1b0548b856a39a1472 Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Mon, 13 May 2019 10:49:38 +0200 Subject: [PATCH 1/5] Make IIIFInfo#Versions appear in doc For whatever reasons, the possible values of `Versions` did not appear in the built docs. --- src/ol/format/IIIFInfo.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js index 2d12a8073c..27fc18f415 100644 --- a/src/ol/format/IIIFInfo.js +++ b/src/ol/format/IIIFInfo.js @@ -97,9 +97,10 @@ import {assert} from '../asserts.js'; */ /** -* @enum {string} -*/ -export const Versions = { + * Enum representing the major IIIF Image API versions + * @enum {string} + */ +const Versions = { VERSION1: 'version1', VERSION2: 'version2', VERSION3: 'version3' @@ -424,3 +425,4 @@ class IIIFInfo { } export default IIIFInfo; +export {Versions}; From cdb36a3bf2882414f66e7ca637a67a9e2df48a3a Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Mon, 13 May 2019 11:04:28 +0200 Subject: [PATCH 2/5] Expose IIIFInfo methods for doc --- src/ol/format/IIIFInfo.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js index 27fc18f415..9222726011 100644 --- a/src/ol/format/IIIFInfo.js +++ b/src/ol/format/IIIFInfo.js @@ -286,6 +286,7 @@ class IIIFInfo { /** * @param {Object|string} imageInfo Deserialized image information JSON response * object or JSON response as string + * @api */ setImageInfo(imageInfo) { if (typeof imageInfo == 'string') { @@ -297,6 +298,7 @@ class IIIFInfo { /** * @returns {Versions} Major IIIF version. + * @api */ getImageApiVersion() { if (this.imageInfo === undefined) { @@ -395,6 +397,7 @@ class IIIFInfo { /** * @param {PreferredOptions} opt_preferredOptions Optional options for preferred format and quality. * @returns {import("../source/IIIF.js").Options} IIIF tile source ready constructor options. + * @api */ getTileSourceOptions(opt_preferredOptions) { const options = opt_preferredOptions || {}, From 80eb8b62ce8340e933fa4601f351addecb9bbc8a Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Mon, 13 May 2019 11:14:43 +0200 Subject: [PATCH 3/5] Display union types in IIIFInfo constructor doc --- src/ol/format/IIIFInfo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ol/format/IIIFInfo.js b/src/ol/format/IIIFInfo.js index 9222726011..73e1834fba 100644 --- a/src/ol/format/IIIFInfo.js +++ b/src/ol/format/IIIFInfo.js @@ -276,7 +276,7 @@ versionFunctions[Versions.VERSION3] = generateVersion3Options; class IIIFInfo { /** - * @param {ImageInformationResponse1_0|ImageInformationResponse1_1|ImageInformationResponse2|ImageInformationResponse3|string} imageInfo + * @param {string|ImageInformationResponse1_0|ImageInformationResponse1_1|ImageInformationResponse2|ImageInformationResponse3} imageInfo * Deserialized image information JSON response object or JSON response as string */ constructor(imageInfo) { @@ -284,8 +284,8 @@ class IIIFInfo { } /** - * @param {Object|string} imageInfo Deserialized image information JSON response - * object or JSON response as string + * @param {string|ImageInformationResponse1_0|ImageInformationResponse1_1|ImageInformationResponse2|ImageInformationResponse3} imageInfo + * Deserialized image information JSON response object or JSON response as string * @api */ setImageInfo(imageInfo) { From 5e288ebedfc2e332104e16289c88a6641a380f49 Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Mon, 13 May 2019 11:15:20 +0200 Subject: [PATCH 4/5] Improve IIIF tile source doc --- src/ol/source/IIIF.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ol/source/IIIF.js b/src/ol/source/IIIF.js index e165db78bb..1518da994d 100644 --- a/src/ol/source/IIIF.js +++ b/src/ol/source/IIIF.js @@ -56,6 +56,10 @@ function formatPercentage(percentage) { */ class IIIF extends TileImage { + /** + * @param {Options} opt_options + * @api + */ constructor(opt_options) { const options = opt_options || {}; From 1d08eb5752e19d22a5808660d813b6a935162a30 Mon Sep 17 00:00:00 2001 From: Lutz Helm Date: Mon, 13 May 2019 12:27:14 +0200 Subject: [PATCH 5/5] Give a hint on how to parse IIIF info.json --- src/ol/source/IIIF.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ol/source/IIIF.js b/src/ol/source/IIIF.js index 1518da994d..4152ed8bc8 100644 --- a/src/ol/source/IIIF.js +++ b/src/ol/source/IIIF.js @@ -57,7 +57,8 @@ function formatPercentage(percentage) { class IIIF extends TileImage { /** - * @param {Options} opt_options + * @param {Options} opt_options Tile source options. Use {@link import("../format/IIIFInfo.js").IIIFInfo} + * to parse Image API service information responses into constructor options. * @api */ constructor(opt_options) {