AI Disclosure: This page was generated by an LLM and may contain inaccuracies. Hand-crafted documentation will be implemented over time on the road to 1.0
PreviewProvider
Since Plugin API: 1.0.0
Preview provider - renders file previews, thumbnails, and fullscreen views
Signature
interface PreviewProvider {
type: "preview";
id: string;
name: string;
priority?: number;
extensions?: string[];
mimeTypes?: string[];
categories?: FileCategory[];
canHandle?: (file: FileEntry, api: FileMatchAPI) => boolean;
thumbnail?: import("svelte").Component<ThumbnailProviderProps>;
surface?: import("svelte").Component<PreviewSurfaceProps>;
createSession?: (props: PreviewSessionFactoryProps) => PreviewSession | Promise<PreviewSession>;
toolbar?: import("svelte").Component<PreviewToolbarContributionProps>;
destinations?: PreviewDestinationCapabilities;
overridesDoubleClick?: boolean;
isEditable?: (file: FileEntry, metadata?: FileMetadata) => boolean;
}Members
| Name | Type | Required | Description |
|---|---|---|---|
type | "preview" | yes | - |
id | string | yes | - |
name | string | yes | - |
priority | number | no | - |
extensions | string[] | no | File matching criteria |
mimeTypes | string[] | no | - |
categories | FileCategory[] | no | - |
canHandle | (file:FileEntry, api:FileMatchAPI) => boolean | no | - |
thumbnail | import("svelte").Component<ThumbnailProviderProps> | no | Components |
surface | import("svelte").Component<PreviewSurfaceProps> | no | Responsive file-specific viewer/editor used by every host destination. |
createSession | (props:PreviewSessionFactoryProps) =>PreviewSession| Promise<PreviewSession> | no | - |
toolbar | import("svelte").Component<PreviewToolbarContributionProps> | no | Single reactive provider control group mounted at the host toolbar’s trailing edge. |
destinations | PreviewDestinationCapabilities | no | - |
overridesDoubleClick | boolean | no | Behavior |
isEditable | (file:FileEntry, metadata?:FileMetadata) => boolean | no | Preview can modify file contents; the host exposes editor chrome only when this returns true. |