# FS Document Viewer API reference

> Exports of @anymux/fs-document-viewer.

Source: https://anymux-docs.n.yatsyk.com/docs/fs-document-viewer/jsdoc

## Classes

### FileBrowserAdapter

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

```ts
class FileBrowserAdapter
```

- `id: "document-viewer-adapter"`
- `name: "Document Viewer File System Adapter"`
- `version: "1.0.0"`
- `constructor(fileSystem: IFileSystem, enableLogging?: boolean): FileBrowserAdapter`
- `loadItems(path: string): Promise<FileBrowserItem[]>`
- `normalizePath(path: string): string`
- `getParentPath(path: string): string | null`
- `resolvePath(basePath: string, relativePath: string): string`
- `getItemIcon(item: FileBrowserItem): IconDefinition`
- `getItemDisplayName(item: FileBrowserItem): string`
- `getItemPreview(item: FileBrowserItem): Promise<PreviewData | null>`
- `canPerformAction(action: string, items: FileBrowserItem[]): boolean`
- `performAction(action: string, items: FileBrowserItem[]): Promise<any>`
- `initialize(): Promise<void>`
- `dispose(): void`
- `loadItemDetails(item: FileBrowserItem): Promise<FileBrowserItemDetails>`
- `refreshItems(path: string): Promise<FileBrowserItem[]>`
- `getSupportedViewModes(): ViewModeDefinition[]`
- `getToolbarActions(): ToolbarAction[]`
- `getContextMenuActions(item: FileBrowserItem): ContextAction[]`
- `getDefaultViewMode(): string`
- `getItemTooltip(item: FileBrowserItem): string`
- `getAvailableFilters(): FilterDefinition[]`
- `getAvailableSortFields(): SortFieldDefinition[]`
- `applyFilter(items: FileBrowserItem[], criteria: any): FileBrowserItem[]`
- `applySort(items: FileBrowserItem[], field: string, direction: "asc" | "desc"): FileBrowserItem[]`
- `onItemsChanged(callback: (changes: ItemChange[]) => void): () => void`
- `onError(callback: (error: Error) => void): () => void`
- `getFileSystem(): IFileSystem`
- `setFileSystem(fileSystem: IFileSystem): void`
- `setLogging(enabled: boolean): void`

## Constants

### DocumentViewer

```ts
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

```ts
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; }
```
