@nextcloud/viewer
    Preparing search index...

    Interface ViewerProps

    List of props provided to your custom component. Use it like this:

    <script setup lang="ts">
    import type { ViewerProps } from '@nextcloud/viewer'

    const props = defineProps<ViewerProps>()
    interface ViewerProps {
        comparison?: ComparisonView;
        editing: boolean;
        embedded?: boolean;
        file: IFile;
        files: IFile[];
        isSidebarShown: boolean;
        localSource?: string;
        maxHeight: number;
        maxWidth: number;
        shown?: boolean;
        turns?: number;
    }
    Index
    comparison?: ComparisonView

    How the viewer compares files, or nothing when it is not comparing. Side by side, each of the two elements shows its own file; in differences, the only element shows what changed from the first file of files, the older one, to its file (see IHandler.canShowDifferences).

    editing: boolean

    Whether the viewer is in editing mode

    embedded?: boolean

    Whether the file is shown inline, outside the viewer, by a <nc-viewer-file> as the preview of a link to it. Start read-only and do not take over the page: no autoplay, no focus taken. A handler may offer its own way to switch to editing inline, as Text does; the full viewer, editing included, is one click away from the element's menu.

    file: IFile

    The file to be displayed

    files: IFile[]

    The list of files currently opened in the viewer. When comparing, the two files compared, the older one first (see comparison)

    isSidebarShown: boolean

    Whether the sidebar is shown

    localSource?: string

    Optional client-side source to display instead of fetching from the server (e.g. an object URL for a freshly edited image not yet reflected in the server preview). Handlers that support it should prefer this over file.

    maxHeight: number

    The max height of the viewer container

    maxWidth: number

    The max width of the viewer container

    shown?: boolean

    Whether the file has loaded and is on screen, so it can take the keyboard: a handler that wants its own content focused, an editor's text say, focuses it then. Before, the element is still hidden. When comparing, only the newer file's is.

    turns?: number

    Quarter turns anticlockwise the viewer is showing on top of the file's own orientation, while a rotation is being written. Handlers that can turn their content should honour it; the rest may ignore it.