@nextcloud/viewer
    Preparing search index...

    Type Alias ViewerOptions

    Options for opening the viewer

    type ViewerOptions = {
        canLoop?: boolean;
        editing?: boolean;
        enableSidebar?: boolean;
        folder?: IFolder;
        loadMore?: () => Promise<IFile[]>;
        onClose?: () => void;
        onEditingChange?: (editing: boolean) => void;
        onNext?: (file: IFile) => void;
        onPrev?: (file: IFile) => void;
        startSlideshow?: boolean;
        view?: IView;
    }
    Index
    canLoop?: boolean

    Whether the viewer can loop from last to first item and vice versa. Defaults to true.

    editing?: boolean

    Whether to open straight into editing mode (e.g. from an editing=true URL). Ignored for handlers that do not support editing.

    enableSidebar?: boolean

    Whether to offer the Files sidebar for the open file. Defaults to true. Turn it off for a file the sidebar cannot resolve, such as an old version of a file, which is served from its own dav endpoint.

    folder?: IFolder

    The folder the opened files live in. Forwarded to those file actions.

    loadMore?: () => Promise<IFile[]>

    Will be called to append more files when reaching the end of the current list

    onClose?: () => void

    Called once when the viewer is closed.

    Opening over a viewer that is still open does not drop it: every onClose passed since the viewer opened is called when it closes, each once, so a handler passing its file to another one with open() still lets the first opener clean up.

    onEditingChange?: (editing: boolean) => void

    Called when the editing state changes, so the opener can reflect it (e.g. in the URL).

    onNext?: (file: IFile) => void

    Called when navigating to the next item, with the file navigated to.

    onPrev?: (file: IFile) => void

    Called when navigating to the previous item, with the file navigated to.

    startSlideshow?: boolean

    Whether to start the slideshow as soon as the viewer opens. Ignored for a single file, as there is nothing to move on to.

    view?: IView

    The files view the viewer was opened from. Forwarded to the file actions rendered inside the viewer (download, delete, details, …) so they can run with the same context as in the files list.