Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
466285bd
Commit
466285bd
authored
May 25, 2021
by
Eduardo Sanz García
Committed by
Eduardo
May 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge `Integration` and `Destroyable` interfaces
parent
cd2db0a7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
5 deletions
+3
-5
html.js
src/annotator/integrations/html.js
+0
-2
pdf.js
src/annotator/integrations/pdf.js
+0
-2
annotator.js
src/types/annotator.js
+3
-1
No files found.
src/annotator/integrations/html.js
View file @
466285bd
...
@@ -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
)
{
...
...
src/annotator/integrations/pdf.js
View file @
466285bd
...
@@ -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
{
/**
/**
...
...
src/types/annotator.js
View file @
466285bd
...
@@ -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 Integration
Base
* @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
*/
*/
/**
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment