Phials developer documentation
User guide
AI Notice: Most documentation right now was auto-generated by an LLM. Handwritten documentation will be implemented over time on the road to 1.0

ContextProvider

Context provider - contributes items to the right-click context menu.

Items are defined statically in the items array and filtered at runtime using the provider’s canHandle and each item’s canHandle.

Signature

interface ContextProvider {
    type: "context";
    id: string;
    name: string;
    priority?: number;
    selectionMode?: "single" | "multi";
    extensions?: string[];
    mimeTypes?: string[];
    categories?: FileCategory[];
    canHandle?: (ctx: ContextItemContext) => boolean;
    category?: ContextProviderCategory | null;
    items: ContextProviderItem[];
}

Members

NameTypeRequiredDescription
type"context"yes
idstringyes
namestringyes
prioritynumberno
selectionMode"single" | "multi"noSelection mode: ‘single’ (default) or ‘multi’
extensionsstring[]noOptional file-type filtering at provider level
mimeTypesstring[]no
categoriesFileCategory[]no
canHandle(ctx: ContextItemContext) => booleannoProvider-level visibility check. For single mode: receives the right-clicked entry. For multi mode: receives all selected entries.
categoryContextProviderCategory | nullnoSubmenu category (null = root level)
itemsContextProviderItem[]yesStatic array of menu items provided by this provider