diff --git a/docs/assets/search.js b/docs/assets/search.js index 874f037..bf9d1de 100644 --- a/docs/assets/search.js +++ b/docs/assets/search.js @@ -1 +1 @@ -window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA72b3W7jNhCF34W9FbLmDO04vtsfFF2g2wabYnshBIViMYlQW3Il2duFkXcvaFvW0Bzbokz3LrB0zozIj0OKYtaiLL5XYhKvxd9ZnoqJhHEk8mSuxUR8SfIsy551VYtILMuZmIjpLKkqXb1rL9281vOZiJorYiLEW9S4DSXs3aZFXtXlcloX5Tm7n+x7iXUkFkmp89rOrg0oB6D2EauFnmbP2TSpsyI/G/Pwbo+oMFBtq73o2txkbvmcno16eHeAqL8mT3rmE7gRBIj9sJzPk/KHT/RWEiD+t0x/z/KXT1mpp516/bQ2QEa/JatPSa19EmklYeLfz5KpbwKNJkAGX7OX17ryib9XhIiu/1lmpU4f6qTWc2PgkwgjDjFK6qT0yqMRBIjtE/ayiB+L2az7KLTuDhK1W/U9uD9I5M4V2JX0jZ/Vukxq3fTcxyRfJdWfOH2f50XdbQLsZHG9/O6Tl/NFqrNN0DxDJPl/ZXhpdtfL7EOR/njQ5SrrMBl5WV0/3/BpXyn7fhmGy+KP1+X8KU+y89XvhDBQLr8Uc73oMV6JLlAmH/Rrsso6vPcc1wXK5L4sVlmqvTMhukCZfNV5qsssf/FNhQoDt0pfYhh94MwetH4/q4q+ibXyQHl90XWSJnXimxDRBcqkZ8sEb5H7pKx/f/buoEYValQluT++jShQDs3b4886qZeldzauPOgMeWF2x0xC9t/nWs979eFOeGEuHu9tnCJY9M5vrKeUwbLp9k53VBauVTwrL6sMVnt7LYuDr333i8eeCTH6K2UWKMHgeV6W3pWz8n6rIbrAmVzWQFXwFrpoh+dKezsX7+r02895jESWp/pfMVmLlS4r80wTATd4cyci8ZzpWWo+dG2TjsS0mO82dNNiutz8+bi77Zs2H57Mzdu73w1EFA8iHN4MRqPHxyhuxJsLmx8aj/aXjVCKKJacUDpCaQlBRDFwQnCEYA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VVwmiCv+7MIpIPJnArdJtUDV64uIMEUe2F6qjtJytgr5UVS1sWz5UnKA/YqD4v9cRjSuIQL6MVF48p2HRk50GvkNO6V1snm5AMxJxUNelW0cnuEgLQxXQt2WwxyltnmizaxJY2MvRq5bI8PkQYgww16DTemVZGUU+xVTpkarYipusTUmjAVKZqqV9E8PqsoupDvNYIbb86c8KB68VC3Bw8JD4Re6EXv3pZLmtQf1av+HLpzQcgjqF6PcHQGVGS0qF6j5eTcp0ipU91K3Zz8p1prROalbtPSwb+AER4IDuedHiOxyBZ6luVaTOLHt7f/AL07bJRmNwAA"; \ No newline at end of file +window.searchData = "data:application/octet-stream;base64,H4sIAAAAAAAAA72b227jNhCG34W9FbLhzDgH3+0BRRfotsFmsXshBIViMYlQW3YlxdsgyLsXtC1raI5jSmZ6F9j8/xmTH4cixTyrav6zVuP0Wf1dlLkaa7hIVJnNjBqrL1lZFMWdqRuVqMdqqsZqMs3q2tTvuq9OHprZVCXtN2qs1EvSuo00bN0m87JuqsdJM68O2f3itmXWiVpklSkbN7suoD4F2kasF2ZS3BWTrCnm5cGYu617RIVT6nrt3jTX3Orb08IcDL5HdEQOtpFt8jkPCe60jhD19+zWTPsEbgURYl8/zmZZ9dQneieJEP97YX4W5f2nojKTIPJe10bI6I9s+Slrgij0JXHiX02zSd8EWk2EDL4W9w9N3Sf+VhEjuvnnsahMft1kjZlZgz6JCOIYs6TJql55tIIIsfuEPS7ix/l0Gj4LndZRooZV3532USIHV2BfMjR+0Zgqa0w7ch+zcpnVP3DyviznTdgiHGTxdvldZfeHi1SwTdQ8YyT5f2V4bHZvl9mHef50baplEbAY9bJ6+3zjp/1G2Q/LMF4W3x4eZ7dlVhyufq8II+Xy23xmFgPmK9NFyuSDeciWRcDea78uUiZX1XxZ5KZ3JkwXKZOvpsxNVZT3fVPhwsi9MpQYQR85s2tj3k/r+dDEOnmkvL6YJsuzJuubENNFymRgz0Tvkausav686z1ArSrWrMrK/vi2okg5tLvHX03WPFa9s/HlUV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SGxAOcTDFW+vNvSvmd8r8Tvv61etrS8wOmB30tmtvCnaGjOTeIC/X9/3y7r5f53ve+Z6H+jqXWJvVJdLOkE2UsHmyORORCwwyIDGMSM/PmzPExprCxtozlYoEMtoxDHffd3t2zfJlrFMY6xvfNsvb7fv1zhUYUhDG1I7rZHOngnmy0Ydew+96Zuy0jrmzcYNe47bP/XaeP9XtUSULxDocBnX4K4GkeKxaQFi1OBBv/XKe1SOGpu6FphuhrfF37ftARj/jCY/g6SdO5OHXrFbpsGJ1OIDXUazg6F4Fpw3ysL0bwQaYLdMQtk7vuEp1ARmmOAjT14aTpYyDUl5kVTO/czz54jCoPCy213NY5zIuYBAXras4dGzmwKCZ07rXxmSrmxisQ1hFw0EVrVpfaWCW7PESw54vJcti9Yad2bJOxkGdXHXXmVjvsukGg6ab1KusnOKgcirUaGKmdIyps2ASK5o0qGjuX1WIzWAaNINbb8mc8UCDeGi6i5CMB0YvDKJ3ayslzeoPDao/u+5SEL6/G/QT9q6AxGYLDZotr659xEodhZW6Gfvvvc6IVbWworbzb3GMB4bDYaebRC2KhZkWpVHj9Obl5T/Bs0YQejgAAA=="; \ No newline at end of file diff --git a/docs/classes/Maniiifest.html b/docs/classes/Maniiifest.html index 6fbfe3d..ac9c150 100644 --- a/docs/classes/Maniiifest.html +++ b/docs/classes/Maniiifest.html @@ -1,6 +1,6 @@ Maniiifest | maniiifest

Class Maniiifest

The Maniiifest class provides methods to parse and manipulate IIIF JSON manifests and collections. It ensures type safety and offers utility functions for working with IIIF data.

-

Constructors

Constructors

Properties

Methods

getCollection getCollectionId @@ -15,6 +15,7 @@ getManifestStart getManifestSummary getManifestViewingDirection +getSpecificationType iterateCollection iterateCollectionLabel iterateCollectionManifest @@ -52,130 +53,132 @@

This constructor attempts to read the specification from the provided data. If reading the specification fails, an error is logged to the console.

Parameters

  • data: any

    The data from which to read the specification.

    -

Returns Maniiifest

Properties

specification: any

Methods

  • Retrieves the collection from the manifest specification if it is of kind 'Collection'.

    +

Returns Maniiifest

Properties

specification: any

Methods

  • Retrieves the collection from the manifest specification if it is of kind 'Collection'.

    Returns CollectionT

    The collection if the specification is of kind 'Collection' and has a value, otherwise null.

    -
  • Retrieves the collection ID from the manifest specification if it is of kind 'Collection'.

    +
  • Retrieves the collection ID from the manifest specification if it is of kind 'Collection'.

    Returns string

    The collection ID if the specification is of kind 'Collection', otherwise null.

    -
  • Retrieves the collection label from the manifest specification if it is of kind 'Collection'.

    +
  • Retrieves the collection label from the manifest specification if it is of kind 'Collection'.

    Returns LabelT

    The collection label if the specification is of kind 'Collection', otherwise null.

    -
  • Retrieves the manifest from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the manifest from the manifest specification if it is of kind 'Manifest'.

    Returns ManifestT

    The manifest if the specification is of kind 'Manifest' and has a value, otherwise null.

    -
  • Retrieves the manifest ID if the specification kind is 'Manifest'.

    +
  • Retrieves the manifest ID if the specification kind is 'Manifest'.

    Returns string

    The manifest ID if the specification kind is 'Manifest', otherwise null.

    -
  • Retrieves the label from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the label from the manifest specification if it is of kind 'Manifest'.

    Returns LabelT

    The label if the specification is of kind 'Manifest' and has a label value, otherwise null.

    -
  • Retrieves the navigation date from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the navigation date from the manifest specification if it is of kind 'Manifest'.

    Returns string

    The navigation date if the specification is of kind 'Manifest' and has a navDate value, otherwise null.

    -
  • Retrieves the navigation place from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the navigation place from the manifest specification if it is of kind 'Manifest'.

    Returns NavPlaceT

    The navigation place if the specification is of kind 'Manifest' and has a navPlace value, otherwise null.

    -
  • Retrieves the required statement from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the required statement from the manifest specification if it is of kind 'Manifest'.

    Returns RequiredStatementT

    The required statement if the specification is of kind 'Manifest' and has a required statement value, otherwise null.

    -
  • Retrieves the rights statement from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the rights statement from the manifest specification if it is of kind 'Manifest'.

    Returns string

    The rights statement if the specification is of kind 'Manifest' and has a rights value, otherwise null.

    -
  • Retrieves the start element from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the start element from the manifest specification if it is of kind 'Manifest'.

    Returns ClassT

    The start element if the specification is of kind 'Manifest' and has a start value, otherwise null.

    -
  • Retrieves the summary from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the summary from the manifest specification if it is of kind 'Manifest'.

    Returns LngStringT

    The summary if the specification is of kind 'Manifest' and has a summary value, otherwise null.

    -
  • Retrieves the viewing direction from the manifest specification if it is of kind 'Manifest'.

    +
  • Retrieves the viewing direction from the manifest specification if it is of kind 'Manifest'.

    Returns string

    The viewing direction if the specification is of kind 'Manifest' and has a viewing direction value, otherwise null.

    -
  • Iterates over the collections in the specification.

    +
  • Retrieves the type of the manifest specification.

    +

    Returns string

    The type of the manifest specification.

    +
  • Iterates over the collections in the specification.

    This generator function yields collections from the specification and recursively from nested collections.

    Returns IterableIterator<CollectionT>

    The next collection item in the specification.

    -
  • Iterates over the labels in the collection.

    +
  • Iterates over the labels in the collection.

    This generator function yields labels from the collection's label and recursively from nested collections.

    Returns IterableIterator<LabelT>

    The next label item in the collection.

    -
  • Iterates over the manifests in the collection.

    +
  • Iterates over the manifests in the collection.

    This generator function yields manifests from the collection's manifest and recursively from nested collections.

    Returns IterableIterator<ManifestT>

    The next manifest item in the collection.

    -
  • Iterates over the metadata in the collection.

    +
  • Iterates over the metadata in the collection.

    This generator function yields metadata from the collection's metadata and recursively from nested collections.

    Returns IterableIterator<MetadataT>

    The next metadata item in the collection.

    -
  • Iterates over the behavior elements in the manifest.

    +
  • Iterates over the behavior elements in the manifest.

    This generator function yields behavior elements from the manifest.

    Returns IterableIterator<string>

    The next behavior element in the manifest.

    -
  • Iterates over the canvas elements in the manifest.

    +
  • Iterates over the canvas elements in the manifest.

    This generator function yields canvas elements from the manifest.

    Returns IterableIterator<CanvasT>

    The next canvas element in the manifest.

    -
  • Iterates over the annotation elements on the canvases in the manifest.

    +
  • Iterates over the annotation elements on the canvases in the manifest.

    This generator function yields annotation elements from the canvases in the manifest.

    Returns IterableIterator<AnnotationT>

    The next annotation element on the canvases in the manifest.

    -
  • Iterates over the service elements within the annotation bodies on the canvases in the manifest.

    +
  • Iterates over the service elements within the annotation bodies on the canvases in the manifest.

    This generator function yields service elements from the annotation bodies on the canvases in the manifest.

    Returns IterableIterator<ServiceT>

    The next service element within the annotation bodies on the canvases in the manifest.

    -
  • Iterates over the service elements within the services of the annotation bodies on the canvases in the manifest.

    +
  • Iterates over the service elements within the services of the annotation bodies on the canvases in the manifest.

    This generator function yields service elements from the services within the annotation bodies on the canvases in the manifest.

    Returns IterableIterator<ServiceT>

    The next service element within the services of the annotation bodies on the canvases in the manifest.

    -
  • Iterates over the annotation page elements on the canvases in the manifest.

    +
  • Iterates over the annotation page elements on the canvases in the manifest.

    This generator function yields annotation page elements from the canvases in the manifest.

    Returns IterableIterator<AnnotationPageT>

    The next annotation page element on the canvases in the manifest.

    -
  • Iterates over the navigation place features in the manifest's canvases.

    +
  • Iterates over the navigation place features in the manifest's canvases.

    This generator function yields features from the navigation places within the canvases of the manifest.

    Returns IterableIterator<FeatureT>

    The next feature in the navigation places of the manifest's canvases.

    -
  • Iterates over the W3C annotation elements on the canvases in the manifest.

    +
  • Iterates over the W3C annotation elements on the canvases in the manifest.

    This generator function yields W3C annotation elements from the canvases in the manifest.

    Returns IterableIterator<AnnotationT>

    The next W3C annotation element on the canvases in the manifest.

    -
  • Iterates over the W3C annotation page elements on the canvases in the manifest.

    +
  • Iterates over the W3C annotation page elements on the canvases in the manifest.

    This generator function yields W3C annotation page elements from the canvases in the manifest.

    Returns IterableIterator<AnnotationPageT>

    The next W3C annotation page element on the canvases in the manifest.

    -
  • Iterates over the homepage elements in the manifest.

    +
  • Iterates over the homepage elements in the manifest.

    This generator function yields homepage elements from the manifest.

    Returns IterableIterator<HomepageT>

    The next homepage element in the manifest.

    -
  • Iterates over the metadata elements in the manifest.

    +
  • Iterates over the metadata elements in the manifest.

    This generator function yields metadata elements from the manifest.

    Returns IterableIterator<MetadataT>

    The next metadata element in the manifest.

    -
  • Iterates over the navigation place features in the manifest.

    +
  • Iterates over the navigation place features in the manifest.

    This generator function yields features from the navigation places within the manifest.

    Returns IterableIterator<FeatureT>

    The next feature in the navigation places of the manifest.

    -
  • Iterates over the "partOf" elements in the manifest.

    +
  • Iterates over the "partOf" elements in the manifest.

    This generator function yields "partOf" elements from the manifest.

    Returns IterableIterator<ClassT>

    The next "partOf" element in the manifest.

    -
  • Iterates over the providers in the manifest.

    +
  • Iterates over the providers in the manifest.

    This generator function yields providers from the manifest.

    Returns IterableIterator<ProviderT>

    The next provider in the manifest.

    -
  • Iterates over the "homepage" elements in the providers of the manifest.

    +
  • Iterates over the "homepage" elements in the providers of the manifest.

    This generator function yields "homepage" elements from the providers within the manifest.

    Returns IterableIterator<HomepageT>

    The next "homepage" element in the providers of the manifest.

    -
  • Iterates over the "seeAlso" elements in the providers of the manifest.

    +
  • Iterates over the "seeAlso" elements in the providers of the manifest.

    This generator function yields "seeAlso" elements from the providers within the manifest.

    Returns IterableIterator<ExternalT>

    The next "seeAlso" element in the providers of the manifest.

    -
  • Iterates over the ranges in the manifest.

    +
  • Iterates over the ranges in the manifest.

    This generator function yields ranges from the structures within the manifest.

    Returns IterableIterator<RangeT>

    The next range in the manifest.

    -
  • Iterates over the range items in the manifest.

    +
  • Iterates over the range items in the manifest.

    This generator function yields range items from the structures within the manifest.

    Returns IterableIterator<RangeItemsT>

    The next range item in the manifest.

    -
  • Iterates over the "rendering" elements in the manifest.

    +
  • Iterates over the "rendering" elements in the manifest.

    This generator function yields "rendering" elements from the manifest.

    Returns IterableIterator<ExternalT>

    The next "rendering" element in the manifest.

    -
  • Iterates over the "seeAlso" elements in the manifest.

    +
  • Iterates over the "seeAlso" elements in the manifest.

    This generator function yields "seeAlso" elements from the manifest.

    Returns IterableIterator<ExternalT>

    The next "seeAlso" element in the manifest.

    -
  • Iterates over the services in the manifest.

    +
  • Iterates over the services in the manifest.

    This generator function yields services from the service pages within the manifest.

    Returns IterableIterator<ServiceT>

    The next service in the manifest.

    -
  • Iterates over the nested services in the manifest.

    +
  • Iterates over the nested services in the manifest.

    This generator function yields services from the nested service pages within the manifest.

    Returns IterableIterator<ServiceT>

    The next nested service in the manifest.

    -
  • Iterates over the services in the manifest.

    +
  • Iterates over the services in the manifest.

    This generator function yields services from the manifest's service pages.

    Returns IterableIterator<ServiceT>

    The next service in the manifest.

    -
  • Iterates over the services in the manifest.

    +
  • Iterates over the services in the manifest.

    This generator function yields services from the manifest's service pages.

    Returns IterableIterator<ServiceT>

    The next service in the manifest.

    -
  • Iterates over the thumbnail elements in the manifest.

    +
  • Iterates over the thumbnail elements in the manifest.

    This generator function yields thumbnail elements from the manifest.

    Returns IterableIterator<ResourceT>

    The next thumbnail element in the manifest.

    -
  • Iterates over the services within the thumbnail services in the manifest.

    +
  • Iterates over the services within the thumbnail services in the manifest.

    This generator function yields services from the service pages within the thumbnail services of the manifest.

    Returns IterableIterator<ServiceT>

    The next service within the thumbnail services in the manifest.

    -
  • Iterates over the nested services within the thumbnail services in the manifest.

    +
  • Iterates over the nested services within the thumbnail services in the manifest.

    This generator function yields services from the nested service pages within the thumbnail services of the manifest.

    Returns IterableIterator<ServiceT>

    The next nested service within the thumbnail services in the manifest.

    -
  • Iterates over the W3C annotations in the manifest.

    +
  • Iterates over the W3C annotations in the manifest.

    This generator function yields annotations from the manifest's annotation pages.

    Returns IterableIterator<AnnotationT>

    The next annotation in the manifest.

    -
  • Iterates over W3C Annotation Pages in a Manifest.

    +
  • Iterates over W3C Annotation Pages in a Manifest.

    This generator function iterates through each annotation page present in the manifest's annotations. It yields each annotation page transformed by F.writeAnnotationPageT for further processing.

    Returns IterableIterator<AnnotationPageT>

    An iterator that yields annotation pages as T.AnnotationPageT objects.

    -
+
diff --git a/package.json b/package.json index a543123..901bd8b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "maniiifest", - "version": "1.0.7", + "version": "1.0.8", "main": "dist/index.js", "types": "dist/index.d.ts", "files": [ diff --git a/src/Maniiifest.ts b/src/Maniiifest.ts index 28c90e7..1eb3c89 100644 --- a/src/Maniiifest.ts +++ b/src/Maniiifest.ts @@ -31,6 +31,15 @@ export class Maniiifest { } } + /** + * Retrieves the type of the manifest specification. + * + * @returns {string} The type of the manifest specification. + */ + getSpecificationType(): string { + return this.specification.kind; + } + /** * Retrieves the manifest ID if the specification kind is 'Manifest'. * diff --git a/test/Manifesty.test.ts b/test/Manifesty.test.ts index ec38e05..afcc827 100644 --- a/test/Manifesty.test.ts +++ b/test/Manifesty.test.ts @@ -35,6 +35,12 @@ describe('Collection functionality', () => { } ] + it('should return the correct specificaton type', () => { + const maniiifest = new Maniiifest(collection); + const result = maniiifest.getSpecificationType(); + expect(result).toEqual("Collection"); + }); + it('should return the correct collection id', () => { const maniiifest = new Maniiifest(collection); const result = maniiifest.getCollectionId(); @@ -95,6 +101,12 @@ describe('Manifest toplevel functionality', () => { "label": { "en": ["Book 1"] } } + it('should return the correct specificaton type', () => { + const maniiifest = new Maniiifest(manifest); + const result = maniiifest.getSpecificationType(); + expect(result).toEqual("Manifest"); + }); + it('should return the correct manifest id', () => { const maniiifest = new Maniiifest(manifest); const result = maniiifest.getManifestId();