AnyMux

FS Document Viewer API reference

Exports of @anymux/fs-document-viewer. Back to the module

Classes

FileBrowserAdapter

class

Adapter that wraps a DocumentViewerStore.fileSystem to provide the IFileBrowserProvider interface This maintains compatibility with existing DocumentViewer while using the new FileBrowser component

class FileBrowserAdapter

id

property
id: "document-viewer-adapter"

name

property
name: "Document Viewer File System Adapter"

version

property
version: "1.0.0"

constructor

constructor
constructor(fileSystem: IFileSystem, enableLogging?: boolean): FileBrowserAdapter

loadItems

method
loadItems(path: string): Promise<FileBrowserItem[]>

normalizePath

method
normalizePath(path: string): string

getParentPath

method
getParentPath(path: string): string | null

resolvePath

method
resolvePath(basePath: string, relativePath: string): string

getItemIcon

method
getItemIcon(item: FileBrowserItem): IconDefinition

getItemDisplayName

method
getItemDisplayName(item: FileBrowserItem): string

getItemPreview

method
getItemPreview(item: FileBrowserItem): Promise<PreviewData | null>

canPerformAction

method
canPerformAction(action: string, items: FileBrowserItem[]): boolean

performAction

method
performAction(action: string, items: FileBrowserItem[]): Promise<any>

initialize

method
initialize(): Promise<void>

dispose

method
dispose(): void

loadItemDetails

method
loadItemDetails(item: FileBrowserItem): Promise<FileBrowserItemDetails>

refreshItems

method
refreshItems(path: string): Promise<FileBrowserItem[]>

getSupportedViewModes

method
getSupportedViewModes(): ViewModeDefinition[]

getToolbarActions

method
getToolbarActions(): ToolbarAction[]

getContextMenuActions

method
getContextMenuActions(item: FileBrowserItem): ContextAction[]

getDefaultViewMode

method
getDefaultViewMode(): string

getItemTooltip

method
getItemTooltip(item: FileBrowserItem): string

getAvailableFilters

method
getAvailableFilters(): FilterDefinition[]

getAvailableSortFields

method
getAvailableSortFields(): SortFieldDefinition[]

applyFilter

method
applyFilter(items: FileBrowserItem[], criteria: any): FileBrowserItem[]

applySort

method
applySort(items: FileBrowserItem[], field: string, direction: "asc" | "desc"): FileBrowserItem[]

onItemsChanged

method
onItemsChanged(callback: (changes: ItemChange[]) => void): () => void

onError

method
onError(callback: (error: Error) => void): () => void

getFileSystem

method
getFileSystem(): IFileSystem

setFileSystem

method
setFileSystem(fileSystem: IFileSystem): void

setLogging

method
setLogging(enabled: boolean): void

Constants

DocumentViewer

const
const DocumentViewer: (({ fileSystem, initialPath }: DocumentViewerProps) => import("/home/andrew/gits/github/AnyFileSystem/AnyFsMnoorepo-sf-phase3-npmf/node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/jsx-runtime").JSX.Element) & { displayName: string; }

DocumentViewerWithFileBrowser

const
const DocumentViewerWithFileBrowser: (({ fileSystem, initialPath, className, onFileSelect, onError }: DocumentViewerWithFileBrowserProps) => import("/home/andrew/gits/github/AnyFileSystem/AnyFsMnoorepo-sf-phase3-npmf/node_modules/.pnpm/@types+react@19.2.14/node_modules/@types/react/jsx-runtime").JSX.Element) & { displayName: string; }