Add a listener that will be called when the RenderableState changes or when "rendering completed" switches between false and true.
Creates a new overlay element that can be used to render for example annotations.
Destroys this instance, removing itself from the element it is currently rendered into and releasing any used resources. After this method is called, calling other methods are no-ops. getTargetState() and getCurrentState() will always return DESTROYED. Rendering completed change listeners will be called called with false, and all added listeners will thereafter be removed.
You should NOT call this method if this instance was retrieved from a IRenderablePageStream. Use IRenderablePageStream.unloadPage() instead.
Destroys an overlay element previously created with createOverlayElement()
Fetch rectangles that represents CSS coordinates within overlay elements. This method must be called only when isRenderingCompleted() returns true, otherwise an empty result will be returned.
Focus on the DOM element best matching the specified ContentLocation.
a Promise resolved if an element was focused(), rejected otherwise.
Get information about how this RenderableDocumentPage is related with the reader document in the context of the fragmentation process that generated it.
Returns null if this page was not a result of a document fragmentation process.
The page index within the content document, starting with 0.
Get the ContentLocation representing the range of the entire page content.
Get the reader document that this page was created from.
Get the intended PageSpread slot for this instance.
When the returned value is PageSpreadSlot.LEFT or PageSpreadSlot.RIGHT the isPartOfSyntheticSpread() will tell if this instance is part of a synthetic spread.
Get the ContentLocation pointing to the start of this page.
Get the target state of this IRenderable.
If this renderable has finished its rendering operation so that it can be displayed without any artifacts. You can use addRenderingCompletedChangeListener() to react when this value changes.
If rendering tasks in this renderable should be paused. Is initially false.
Removes this instance from the element it was previously rendered into. This will cancel any ongoing rendering process. isRenderingCompleted() will return false after this method has been called.
Removes a listener previously added with addStateChangeListener().
Render to the DOM by appending one or more nodes into the specified Element. If this instance is currently rendered into another Element, remove() will be called internally before rendering into the specified Element.
After this method returns, the getState() method will return ATTACHED_TO_DOM, even if the implementation has delegated the rendering to an async process.
When calling this method, the passed element should be position offscreen, have an overlay element that "hides" the Renderables content, or have its visibility set to "hidden". This is to avoid rendering glitches while the IRenderable is rendered to the DOM.
You should NOT use "display: none" as this may cause the rendering to fail as many DOM APIs related with measuring returns 0.
When rendering process is complete, isRenderingCompleted() will return true, and all listeners added with addRenderingCompletedChangeListener() will be called.
The element to render into. Must be an element attached to the DOM.
Called by the reading system if this renderable should try pause its rendering process. This method is typically called with true for offscreen pages, while visible pages are rendering.
Initially the renderable should have its renderingPaused state set to false.
Performs a transition between ATTACHED_TO_DOM and VISIBLE state. Calling this method if this instance is in none of those states is an error.
Generated using TypeDoc
WARNING: This interface is not stable yet and may be subject to change. It is only intended for internal use at this point.
The IRenderableDocumentPage interface used for presenting pages from a IReaderDocument. These are typically consumed by a Renderer using a IRenderableDocumentPageStream