Commit 1e67c34e authored by Robert Knight's avatar Robert Knight

Make the link between Guest and the "Annotator" interface clearer

`Annotator` is not a great name for this interface, but at least make
the link between it and Guest clearer by improving its documentation and
marking Guest as explicitly implementing it.
parent 49e1f96a
...@@ -18,6 +18,7 @@ import { normalizeURI } from './util/url'; ...@@ -18,6 +18,7 @@ import { normalizeURI } from './util/url';
/** /**
* @typedef {import('../types/annotator').AnnotationData} AnnotationData * @typedef {import('../types/annotator').AnnotationData} AnnotationData
* @typedef {import('../types/annotator').Annotator} Annotator
* @typedef {import('../types/annotator').Anchor} Anchor * @typedef {import('../types/annotator').Anchor} Anchor
* @typedef {import('../types/annotator').Destroyable} Destroyable * @typedef {import('../types/annotator').Destroyable} Destroyable
* @typedef {import('../types/annotator').SidebarLayout} SidebarLayout * @typedef {import('../types/annotator').SidebarLayout} SidebarLayout
...@@ -101,7 +102,8 @@ function resolveAnchor(anchor) { ...@@ -101,7 +102,8 @@ function resolveAnchor(anchor) {
* The anchoring implementation defaults to a generic one for HTML documents and * The anchoring implementation defaults to a generic one for HTML documents and
* can be overridden to handle different document types. * can be overridden to handle different document types.
* *
* @implements Destroyable * @implements {Annotator}
* @implements {Destroyable}
*/ */
export default class Guest { export default class Guest {
/** /**
......
...@@ -65,12 +65,13 @@ ...@@ -65,12 +65,13 @@
*/ */
/** /**
* Subset of the annotator `Guest` instance that is exposed to other modules * Subset of the `Guest` class that is exposed to integrations.
* *
* @typedef Annotator * @typedef Annotator
* @prop {Anchor[]} anchors * @prop {Anchor[]} anchors
* @prop {(ann: AnnotationData) => Promise<Anchor[]>} anchor * @prop {(ann: AnnotationData) => Promise<Anchor[]>} anchor
* @prop {(frame: HTMLIFrameElement) => void} injectClient * @prop {(frame: HTMLIFrameElement) => void} injectClient - Inject the Hypothesis client
* into a same-origin iframe in guest mode.
*/ */
/** /**
......
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