@nextcloud/viewer
    Preparing search index...

    Interface IHandler

    interface IHandler {
        canEdit?: boolean;
        displayName: string;
        enabled: (nodes: IFile[]) => boolean;
        group?: string;
        iconSvgInline?: string;
        id: string;
        preload?: (node: IFile) => Promise<void>;
        tagname: string;
        theme?: "dark" | "light" | "default";
    }
    Index
    canEdit?: boolean

    Whether 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).

    displayName: string

    The handler translated name

    enabled: (nodes: IFile[]) => boolean

    Is this enabled for the given mimes ?

    group?: string

    Identifier 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.

    iconSvgInline?: string

    Optional icon for the handler

    id: string

    Unique identifier for the handler

    preload?: (node: IFile) => Promise<void>

    Optional 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.

    Type Declaration

      • (node: IFile): Promise<void>
      • Parameters

        • node: IFile

          The node to preload data for

        Returns Promise<void>

        A promise that resolves when the data is preloaded

    tagname: string

    The custom element tag name to use for this handler.

    theme?: "dark" | "light" | "default"

    Viewer modal theme (one of 'dark', 'light', 'default')