Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • Maniiifest

Index

Constructors

Properties

Methods

Constructors

  • new Maniiifest(data: any, type?: string): Maniiifest
  • Constructs a new instance of the Maniiifest class.

    This constructor initializes the specification based on the provided data and type. It supports the following types:

    • "AnnotationCollection": Reads the data as an AnnotationCollection specification.
    • "AnnotationPage": Reads the data as an AnnotationPage specification.
    • "Annotation": Reads the data as an Annotation specification.
    • undefined: Reads the data as a general specification.
    throws

    {Error} Throws an error if an unsupported type is provided.

    Parameters

    • data: any

      The data to be parsed into a specification.

    • Optional type: string

      The type of the specification. Can be "AnnotationCollection", "AnnotationPage", "Annotation", or undefined.

    Returns Maniiifest

Properties

specification: any

Methods

  • getAnnotation(): AnnotationT
  • Retrieves the annotation if the specification type is 'Annotation'.

    Returns AnnotationT

    The annotation if the specification type is 'Annotation', otherwise null.

  • getAnnotationBody(): BodyT
  • Retrieves the annotation body if the specification type is 'Annotation'.

    Returns BodyT

    The annotation body if the specification type is 'Annotation', otherwise null.

  • getAnnotationCollection(): AnnotationCollectionT
  • Retrieves the annotation collection if the specification type is 'AnnotationCollection'.

    Returns AnnotationCollectionT

    The annotation collection if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionContext(): ContextT
  • Retrieves the annotation collection context if the specification type is 'AnnotationCollection'.

    Returns ContextT

    The annotation collection context if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionFirst(): FirstT
  • Retrieves the first annotation in the collection if the specification type is 'AnnotationCollection'.

    Returns FirstT

    The first annotation in the collection if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionId(): string
  • Retrieves the annotation collection ID if the specification type is 'AnnotationCollection'.

    Returns string

    The annotation collection ID if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionLabel(): LabelT
  • Retrieves the annotation collection label if the specification type is 'AnnotationCollection'.

    Returns LabelT

    The annotation collection label if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionLast(): string
  • Retrieves the last annotation in the collection if the specification type is 'AnnotationCollection'.

    Returns string

    The last annotation in the collection if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionTotal(): number
  • Retrieves the total number of annotations in the collection if the specification type is 'AnnotationCollection'.

    Returns number

    The total number of annotations in the collection if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationCollectionType(): string
  • Retrieves the type of the annotation collection if the specification type is 'AnnotationCollection'.

    Returns string

    The type of the annotation collection if the specification type is 'AnnotationCollection', otherwise null.

  • getAnnotationContext(): ContextT
  • Retrieves the annotation context if the specification type is 'Annotation'.

    Returns ContextT

    The annotation context if the specification type is 'Annotation', otherwise null.

  • getAnnotationFeatureCollection(): FeatureCollectionT
  • Returns the feature collection if the specification kind is 'T6', otherwise returns null.

    Returns FeatureCollectionT

  • getAnnotationId(): string
  • Retrieves the annotation ID if the specification type is 'Annotation'.

    Returns string

    The annotation ID if the specification type is 'Annotation', otherwise null.

  • getAnnotationMotivation(): MotivationT
  • Retrieves the annotation motivation if the specification type is 'Annotation'.

    Returns MotivationT

    The annotation motivation if the specification type is 'Annotation', otherwise null.

  • getAnnotationPage(): AnnotationPageT
  • Retrieves the annotation page if the specification type is 'AnnotationPage'.

    Returns AnnotationPageT

    The annotation page if the specification type is 'AnnotationPage', otherwise null.

  • getAnnotationPageContext(): ContextT
  • Retrieves the annotation page context if the specification type is 'AnnotationPage'.

    Returns ContextT

    The annotation page context if the specification type is 'AnnotationPage', otherwise null.

  • getAnnotationPageId(): string
  • Retrieves the annotation page ID if the specification type is 'AnnotationPage'.

    Returns string

    The annotation page ID if the specification type is 'AnnotationPage', otherwise null.

  • getAnnotationPagePartOf(): PartOfT
  • Retrieves the 'partOf' property from the specification if the type is 'AnnotationPage'.

    Returns PartOfT

    The 'partOf' property if the specification type is 'AnnotationPage', otherwise null.

  • getAnnotationPageType(): string
  • Retrieves the type of the annotation page if the specification type is 'AnnotationPage'.

    Returns string

    The type of the annotation page if the specification type is 'AnnotationPage', otherwise null.

  • getAnnotationTarget(): TargetT
  • Retrieves the annotation target if the specification type is 'Annotation'.

    Returns TargetT

    The annotation target if the specification type is 'Annotation', otherwise null.

  • getAnnotationType(): string
  • Retrieves the annotation type if the specification type is 'Annotation'.

    Returns string

    The annotation type if the specification type is 'Annotation', otherwise null.

  • getCollection(): CollectionT
  • 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.

  • getCollectionContext(): ContextT
  • Retrieves the context from the manifest specification if it is of kind 'Collection'.

    Returns ContextT

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

  • getCollectionId(): string
  • 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.

  • getCollectionLabel(): LabelT
  • 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.

  • getCollectionLabelByLanguage(language: string): LngStringT
  • Retrieves the label from the collection specification by language if it is of kind 'Collection'.

    Parameters

    • language: string

      The language code to retrieve the label for.

    Returns LngStringT

    The label for the specified language if it exists, otherwise null.

  • getManifest(): ManifestT
  • 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.

  • getManifestContext(): ContextT
  • Retrieves the context from the manifest specification if it is of kind 'Manifest'.

    Returns ContextT

    The context if the specification is of kind 'Manifest', otherwise null.

  • getManifestId(): string
  • Retrieves the manifest ID if the specification kind is 'Manifest'.

    Returns string

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

  • getManifestLabel(): LabelT
  • 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.

  • getManifestLabelByLanguage(language: string): LngStringT
  • Retrieves the label from the manifest specification by language if it is of kind 'Manifest'.

    Parameters

    • language: string

      The language code to retrieve the label for.

    Returns LngStringT

    The label for the specified language if it exists, otherwise null.

  • getManifestNavDate(): string
  • 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.

  • getManifestNavPlace(): NavPlaceT
  • 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.

  • getManifestRequiredStatement(): RequiredStatementT
  • 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.

  • getManifestRights(): string
  • 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.

  • getManifestStart(): ClassT
  • 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.

  • getManifestSummary(): LngStringT
  • 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.

  • getManifestViewingDirection(): string
  • 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.

  • getSpecificationType(): string
  • Retrieves the type of the manifest specification.

    Returns string

    The type of the manifest specification.

  • iterateAnnotationFeature(): IterableIterator<FeatureT>
  • Generator function that yields each feature if the specification kind is 'T6'.

    Returns IterableIterator<FeatureT>

  • iterateAnnotationGeometryPointCoordinates(): IterableIterator<number>
  • Generator function that yields point coordinates for each feature with geometry kind 'T1' if the specification kind is 'T6'.

    Returns IterableIterator<number>

  • iterateAnnotationPageAnnotation(): IterableIterator<AnnotationT>
  • Iterates over the annotations in the specification if the type is 'AnnotationPage'.

    yields

    {T.AnnotationT} The annotations from the specification.

    Returns IterableIterator<AnnotationT>

  • iterateAnnotationPageAnnotationTextualBody(): IterableIterator<AnnotationBodyT4>
  • Iterates over the textual bodies of annotations in the annotation page.

    Returns IterableIterator<AnnotationBodyT4>

    An iterator over the textual bodies of annotations.

  • iterateCollection(): IterableIterator<CollectionT>
  • Iterates over the collections in the specification.

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

    yields

    {T.CollectionT} The next collection item in the specification.

    Returns IterableIterator<CollectionT>

  • iterateCollectionLabel(): IterableIterator<LabelT>
  • Iterates over the labels in the collection.

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

    yields

    {T.LabelT} The next label item in the collection.

    Returns IterableIterator<LabelT>

  • iterateCollectionManifest(): IterableIterator<ManifestT>
  • Iterates over the manifests in the collection.

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

    yields

    {T.ManifestT} The next manifest item in the collection.

    Returns IterableIterator<ManifestT>

  • iterateCollectionMetadata(): IterableIterator<MetadataT>
  • Iterates over the metadata in the collection.

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

    yields

    {T.MetadataT} The next metadata item in the collection.

    Returns IterableIterator<MetadataT>

  • iterateCollectionThumbnail(): IterableIterator<ResourceT>
  • Iterates over the thumbnails in the collection.

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

    yields

    {T.ThumbnailT} The next thumbnail item in the collection.

    Returns IterableIterator<ResourceT>

  • iterateManifestBehavior(): IterableIterator<string>
  • Iterates over the behavior elements in the manifest.

    This generator function yields behavior elements from the manifest.

    yields

    {T.BehaviorT} The next behavior element in the manifest.

    Returns IterableIterator<string>

  • iterateManifestCanvas(): IterableIterator<CanvasT>
  • Iterates over the canvas elements in the manifest.

    This generator function yields canvas elements from the manifest.

    yields

    {T.CanvasT} The next canvas element in the manifest.

    Returns IterableIterator<CanvasT>

  • iterateManifestCanvasAnnotation(): IterableIterator<AnnotationT>
  • Iterates over the annotation elements on the canvases in the manifest.

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

    yields

    {T.AnnotationT} The next annotation element on the canvases in the manifest.

    Returns IterableIterator<AnnotationT>

  • iterateManifestCanvasAnnotationPage(): IterableIterator<AnnotationPageT>
  • 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.

    yields

    {T.AnnotationPageT} The next annotation page element on the canvases in the manifest.

    Returns IterableIterator<AnnotationPageT>

  • iterateManifestCanvasNavPlaceFeature(): IterableIterator<FeatureT>
  • 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.

    yields

    {T.FeatureT} The next feature in the navigation places of the manifest's canvases.

    Returns IterableIterator<FeatureT>

  • iterateManifestCanvasW3cAnnotation(): IterableIterator<AnnotationT>
  • 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.

    yields

    {T.AnnotationT} The next W3C annotation element on the canvases in the manifest.

    Returns IterableIterator<AnnotationT>

  • iterateManifestCanvasW3cAnnotationPage(): IterableIterator<AnnotationPageT>
  • 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.

    yields

    {T.AnnotationPageT} The next W3C annotation page element on the canvases in the manifest.

    Returns IterableIterator<AnnotationPageT>

  • iterateManifestCanvasW3cAnnotationTextualBody(): IterableIterator<AnnotationBodyT4>
  • Iterates over the textual bodies of annotations in the manifest's canvases.

    Returns IterableIterator<AnnotationBodyT4>

    An iterator over the textual bodies of annotations.

  • iterateManifestHomepage(): IterableIterator<HomepageT>
  • Iterates over the homepage elements in the manifest.

    This generator function yields homepage elements from the manifest.

    yields

    {T.HomepageT} The next homepage element in the manifest.

    Returns IterableIterator<HomepageT>

  • iterateManifestMetadata(): IterableIterator<MetadataT>
  • Iterates over the metadata elements in the manifest.

    This generator function yields metadata elements from the manifest.

    yields

    {T.MetadataT} The next metadata element in the manifest.

    Returns IterableIterator<MetadataT>

  • iterateManifestNavPlaceFeature(): IterableIterator<FeatureT>
  • Iterates over the navigation place features in the manifest.

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

    yields

    {T.FeatureT} The next feature in the navigation places of the manifest.

    Returns IterableIterator<FeatureT>

  • iterateManifestPartOf(): IterableIterator<PartOfT>
  • Iterates over the "partOf" elements in the manifest.

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

    yields

    {T.PartOfT} The next "partOf" element in the manifest.

    Returns IterableIterator<PartOfT>

  • iterateManifestProvider(): IterableIterator<ProviderT>
  • Iterates over the providers in the manifest.

    This generator function yields providers from the manifest.

    yields

    {T.ProviderT} The next provider in the manifest.

    Returns IterableIterator<ProviderT>

  • iterateManifestProviderHomepage(): IterableIterator<HomepageT>
  • Iterates over the "homepage" elements in the providers of the manifest.

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

    yields

    {T.HomepageT} The next "homepage" element in the providers of the manifest.

    Returns IterableIterator<HomepageT>

  • iterateManifestProviderSeeAlso(): IterableIterator<ExternalT>
  • Iterates over the "seeAlso" elements in the providers of the manifest.

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

    yields

    {T.SeeAlsoT} The next "seeAlso" element in the providers of the manifest.

    Returns IterableIterator<ExternalT>

  • iterateManifestRange(): IterableIterator<RangeT>
  • Iterates over the ranges in the manifest.

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

    yields

    {T.RangeT} The next range in the manifest.

    Returns IterableIterator<RangeT>

  • iterateManifestRangeItem(): IterableIterator<RangeItemsT>
  • Iterates over the range items in the manifest.

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

    yields

    {T.RangeItemsT} The next range item in the manifest.

    Returns IterableIterator<RangeItemsT>

  • iterateManifestRendering(): IterableIterator<ExternalT>
  • Iterates over the "rendering" elements in the manifest.

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

    yields

    {T.RenderingT} The next "rendering" element in the manifest.

    Returns IterableIterator<ExternalT>

  • iterateManifestSeeAlso(): IterableIterator<ExternalT>
  • Iterates over the "seeAlso" elements in the manifest.

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

    yields

    {T.SeeAlsoT} The next "seeAlso" element in the manifest.

    Returns IterableIterator<ExternalT>

  • iterateManifestService(): IterableIterator<ServiceItemT>
  • Iterates over the services in the manifest.

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

    yields

    {T.ServiceT} The next service in the manifest.

    Returns IterableIterator<ServiceItemT>

  • iterateManifestServices(): IterableIterator<ServiceItemT>
  • Iterates over the services in the manifest.

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

    yields

    {T.ServiceT} The next service in the manifest.

    Returns IterableIterator<ServiceItemT>

  • iterateManifestThumbnail(): IterableIterator<ResourceT>
  • Iterates over the thumbnail elements in the manifest.

    This generator function yields thumbnail elements from the manifest.

    yields

    {T.ThumbnailT} The next thumbnail element in the manifest.

    Returns IterableIterator<ResourceT>

  • iterateManifestThumbnailService(): IterableIterator<ServiceItemT>
  • 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.

    yields

    {T.ServiceT} The next service within the thumbnail services in the manifest.

    Returns IterableIterator<ServiceItemT>

  • iterateManifestW3cAnnotation(): IterableIterator<AnnotationT>
  • Iterates over the W3C annotations in the manifest.

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

    yields

    {T.AnnotationT} The next annotation in the manifest.

    Returns IterableIterator<AnnotationT>

  • iterateManifestW3cAnnotationPage(): IterableIterator<AnnotationPageT>
  • 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.

    yields

    {IterableIterator<T.AnnotationPageT>} An iterator that yields annotation pages as T.AnnotationPageT objects.

    Returns IterableIterator<AnnotationPageT>

  • iterateManifestW3cAnnotationTextualBody(): IterableIterator<AnnotationBodyT4>
  • Iterates over the textual bodies of annotations in the manifest.

    Returns IterableIterator<AnnotationBodyT4>

    An iterator over the textual bodies of annotations.

Generated using TypeDoc