Commit 466285bd authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Merge `Integration` and `Destroyable` interfaces

parent cd2db0a7
...@@ -6,7 +6,6 @@ import { HTMLMetadata } from './html-metadata'; ...@@ -6,7 +6,6 @@ import { HTMLMetadata } from './html-metadata';
/** /**
* @typedef {import('../../types/annotator').Anchor} Anchor * @typedef {import('../../types/annotator').Anchor} Anchor
* @typedef {import('../../types/annotator').Destroyable} Destroyable
* @typedef {import('../../types/annotator').Integration} Integration * @typedef {import('../../types/annotator').Integration} Integration
*/ */
...@@ -17,7 +16,6 @@ import { HTMLMetadata } from './html-metadata'; ...@@ -17,7 +16,6 @@ import { HTMLMetadata } from './html-metadata';
* by a more specific integration (eg. for PDFs). * by a more specific integration (eg. for PDFs).
* *
* @implements {Integration} * @implements {Integration}
* @implements {Destroyable}
*/ */
export class HTMLIntegration { export class HTMLIntegration {
constructor(container = document.body) { constructor(container = document.body) {
......
...@@ -19,7 +19,6 @@ import { PDFMetadata } from './pdf-metadata'; ...@@ -19,7 +19,6 @@ import { PDFMetadata } from './pdf-metadata';
* @typedef {import('../../types/annotator').Anchor} Anchor * @typedef {import('../../types/annotator').Anchor} Anchor
* @typedef {import('../../types/annotator').AnnotationData} AnnotationData * @typedef {import('../../types/annotator').AnnotationData} AnnotationData
* @typedef {import('../../types/annotator').Annotator} Annotator * @typedef {import('../../types/annotator').Annotator} Annotator
* @typedef {import('../../types/annotator').Destroyable} Destroyable
* @typedef {import('../../types/annotator').HypothesisWindow} HypothesisWindow * @typedef {import('../../types/annotator').HypothesisWindow} HypothesisWindow
* @typedef {import('../../types/annotator').Integration} Integration * @typedef {import('../../types/annotator').Integration} Integration
* @typedef {import('../../types/annotator').SidebarLayout} SidebarLayout * @typedef {import('../../types/annotator').SidebarLayout} SidebarLayout
...@@ -50,7 +49,6 @@ function delay(ms) { ...@@ -50,7 +49,6 @@ function delay(ms) {
/** /**
* Integration that works with PDF.js * Integration that works with PDF.js
* @implements {Integration} * @implements {Integration}
* @implements {Destroyable}
*/ */
export class PDFIntegration { export class PDFIntegration {
/** /**
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
* Interface for document type/viewer integrations that handle all the details * Interface for document type/viewer integrations that handle all the details
* of supporting a specific document type (web page, PDF, ebook, etc.). * of supporting a specific document type (web page, PDF, ebook, etc.).
* *
* @typedef Integration * @typedef IntegrationBase
* @prop {(root: HTMLElement, selectors: Selector[]) => Promise<Range>} anchor - * @prop {(root: HTMLElement, selectors: Selector[]) => Promise<Range>} anchor -
* Attempt to resolve a set of serialized selectors to the corresponding content in the * Attempt to resolve a set of serialized selectors to the corresponding content in the
* current document. * current document.
...@@ -110,6 +110,8 @@ ...@@ -110,6 +110,8 @@
* @prop {(a: Anchor) => Promise<void>} scrollToAnchor - Scroll to an anchor. * @prop {(a: Anchor) => Promise<void>} scrollToAnchor - Scroll to an anchor.
* This will only be called if the anchor has at least one highlight (ie. * This will only be called if the anchor has at least one highlight (ie.
* `anchor.highlights` is a non-empty array) * `anchor.highlights` is a non-empty array)
*
* @typedef {Destroyable & IntegrationBase} Integration
*/ */
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment