The render interface for file browser listing options.

interface IRenderer {
    getCheckboxNode: (node: HTMLElement) => null | HTMLInputElement;
    createDragImage(
        node: HTMLElement,
        count: number,
        trans: IRenderMime.TranslationBundle,
        fileType?: DocumentRegistry.IFileType,
    ): HTMLElement;
    createItemNode(
        hiddenColumns?: Set<ToggleableColumn>,
        columnsSizes?: Record<
            "name"
            | "last_modified"
            | "is_selected"
            | "file_size",
            null | number,
        >,
    ): HTMLElement;
    createNode(): HTMLElement;
    getNameNode(node: HTMLElement): HTMLElement;
    handleHeaderClick(
        node: HTMLElement,
        event: MouseEvent,
    ): null | DirListing.ISortState;
    populateHeaderNode(
        node: HTMLElement,
        translator?: ITranslator,
        hiddenColumns?: Set<ToggleableColumn>,
        columnsSizes?: Record<
            "name"
            | "last_modified"
            | "is_selected"
            | "file_size",
            null | number,
        >,
    ): void;
    updateItemModified(
        modified: HTMLElement,
        modifiedDate: string,
        modifiedStyle: RelativeTimeFormatStyle,
    ): void;
    updateItemNode(
        node: HTMLElement,
        model: Contents.IModel,
        fileType?: DocumentRegistry.IFileType,
        translator?: ITranslator,
        hiddenColumns?: Set<ToggleableColumn>,
        selected?: boolean,
        modifiedStyle?: RelativeTimeFormatStyle,
        columnsSizes?: Record<
            "name"
            | "last_modified"
            | "is_selected"
            | "file_size",
            null | number,
        >,
    ): void;
    updateItemSize(
        node: HTMLElement,
        model: Contents.IModel,
        modifiedStyle?: RelativeTimeFormatStyle,
        columnsSizes?: Record<
            "name"
            | "last_modified"
            | "is_selected"
            | "file_size",
            null | number,
        >,
    ): void;
}

Implemented by

Properties

getCheckboxNode: (node: HTMLElement) => null | HTMLInputElement

Get the checkbox input element node.

Downstream interface implementations,such as jupyterlab-unfold, that don't support checkboxes should simply always return null for this function.

Type declaration

Methods

  • Create a new item node for a dir listing.

    Parameters

    • OptionalhiddenColumns: Set<ToggleableColumn>
    • OptionalcolumnsSizes: Record<"name" | "last_modified" | "is_selected" | "file_size", null | number>

    Returns HTMLElement

    A new DOM node to use as a content item.

  • Update an item's last modified date.

    Parameters

    • modified: HTMLElement

      Element containing the file's last modified date.

    • modifiedDate: string

      String representation of the last modified date.

    • modifiedStyle: RelativeTimeFormatStyle

      The date style for the modified column: narrow, short, or long

    Returns void

  • Update an item node to reflect the current state of a model.

    Parameters

    • node: HTMLElement

      A node created by [[createItemNode]].

    • model: Contents.IModel

      The model object to use for the item state.

    • OptionalfileType: DocumentRegistry.IFileType

      The file type of the item, if applicable.

    • Optionaltranslator: ITranslator
    • OptionalhiddenColumns: Set<ToggleableColumn>
    • Optionalselected: boolean
    • OptionalmodifiedStyle: RelativeTimeFormatStyle

      The date style for the modified column: narrow, short, or long

    • OptionalcolumnsSizes: Record<"name" | "last_modified" | "is_selected" | "file_size", null | number>

    Returns void

  • Update size of item nodes, assuming that model has not changed.

    Parameters

    • node: HTMLElement
    • model: Contents.IModel
    • OptionalmodifiedStyle: RelativeTimeFormatStyle
    • OptionalcolumnsSizes: Record<"name" | "last_modified" | "is_selected" | "file_size", null | number>

    Returns void