OptionalcanOptionalcanWhether this handler supports editing the current file in place.
When true the viewer shows an "Edit" action that toggles the handler's
editing prop (e.g. the image editor).
OptionalcanWhether it can show the differences between these two of its files in a
single view, as an image slider or a list of changes does. Called with
the files compared, the older first. When it says so, the viewer offers
that view next to side by side, and renders one element with
comparison: 'differences'.
OptionalcanWhether the viewer offers a slideshow through the other files it can open next to this one. Defaults to true.
The handler translated name
Is this enabled for the given mimes ?
OptionalgroupIdentifier to group handlers by. When opening a folder we'll check against all handlers that are enabled for the given group AND matches the group property.
OptionaliconOptional icon for the handler
Unique identifier for the handler
OptionalonCalled the first time the viewer needs the element, to define it
(customElements.define() with tagName).
The viewer waits for the returned promise and for the element to be
defined (customElements.whenDefined()) before rendering it, so the
view and everything it imports stay out of the registration script
that runs on every page. Leave it out when the element is already
defined by the time the viewer opens.
OptionalpreloadOptional function to preload data for the given node. This will be called for the previous and next nodes on opening a file to allow the handler to be faster when navigating.
The node to preload data for
Optionalspace: { height: number; width: number }
The space the viewer shows files in, in CSS pixels, for a handler whose request depends on it, like a preview's size
Its height
Its width
A promise that resolves when the data is preloaded
OptionalsupportsWhether this handler works with end-to-end encrypted files.
End-to-end encrypted files are decrypted when fetched from their WebDAV endpoint. A handler that fetches the file from a different endpoint gets ciphertext. Set the property to true if the handler reads the file from its dav source.
The tag name of the custom element that shows the file.
The element must be defined under this name with
CustomElementRegistry.define(), either when the handler is registered
or within the onInit callback (preferred, as it keeps the view out of
the script that runs on every page). With onInit, the viewer waits for
the element to be defined (customElements.whenDefined()) before
rendering it.
Custom elements share one registry for the whole page, so to avoid name
clashes the name has to start with your app id (e.g. your_app). In
addition to the custom element naming rules (lowercase, with a hyphen),
a good name would be your_app-viewer-handler.
OptionalthemeViewer modal theme: 'dark' (the default), 'light', or 'default' to follow the user's theme
Whether comparing versions of these files is worth offering, like
enabled()says whether it opens them. It is a hint for callers deciding whether to offer it at all (seecanCompare()):getViewer().compare()shows any pair either way.