Context
The host supplies contexts to mount, activate and action handlers. Optional capabilities depend on declarations, placement and host support. Check availability before use. Register disposables with subscriptions; signal ends with the caller scope, not with a shared background connection.
Usage guide: views. API index.
Signatures, parameters and return types are generated from the SDK. Optional members are not available in every host and context.
Lifetime
Section titled “Lifetime”Lifetime.signal
Section titled “Lifetime.signal”readonly signal: AbortSignal;Lifetime.subscriptions
Section titled “Lifetime.subscriptions”readonly subscriptions: { add<T extends Disposable>(value: T): T;};Related types: Disposable.
CommonCapabilities
Section titled “CommonCapabilities”CommonCapabilities.background
Section titled “CommonCapabilities.background”readonly background?: PluginBackground;CommonCapabilities.fs
Section titled “CommonCapabilities.fs”readonly fs?: PluginFileSystem;CommonCapabilities.filemeta
Section titled “CommonCapabilities.filemeta”readonly filemeta?: PluginFileMeta;CommonCapabilities.storage
Section titled “CommonCapabilities.storage”readonly storage?: PluginStorage;CommonCapabilities.network
Section titled “CommonCapabilities.network”readonly network?: PluginNetwork;CommonCapabilities.settings
Section titled “CommonCapabilities.settings”readonly settings?: Pick<PluginSettings, "get">;CommonCapabilities.connections
Section titled “CommonCapabilities.connections”readonly connections?: PluginConnections;CommonCapabilities.ui
Section titled “CommonCapabilities.ui”readonly ui: HostUI;Related types: PluginBackground, PluginFileSystem, PluginFileMeta, PluginStorage, PluginNetwork, PluginSettings, PluginConnections, HostUI.
CommonContext
Section titled “CommonContext”interface CommonContext extends Lifetime { /* members below */ }CommonContext.i18n
Section titled “CommonContext.i18n”readonly i18n: PluginI18n;CommonContext.capabilities
Section titled “CommonContext.capabilities”readonly capabilities: CommonCapabilities;Related types: PluginI18n, CommonCapabilities, Lifetime.
PluginI18n
Section titled “PluginI18n”PluginI18n.locale
Section titled “PluginI18n.locale”readonly locale: string;PluginI18n.t
Section titled “PluginI18n.t”t(key: string, values?: Record<string, string | number>): string;| Parameter | Type | Required |
|---|---|---|
key |
string |
Yes |
values |
Record<string, string | number> |
No |
Returns: string.
PluginI18n.onDidChangeLocale
Section titled “PluginI18n.onDidChangeLocale”onDidChangeLocale(listener: (event: { locale: string;}) => void): Disposable;| Parameter | Type | Required |
|---|---|---|
listener |
(event: { locale: string; }) => void |
Yes |
Returns: Disposable.
Related types: Disposable.
ViewCapabilities
Section titled “ViewCapabilities”interface ViewCapabilities extends CommonCapabilities { /* members below */ }ViewCapabilities.explorer
Section titled “ViewCapabilities.explorer”readonly explorer?: ExplorerContext;ViewCapabilities.document
Section titled “ViewCapabilities.document”readonly document?: TextDocument;ViewCapabilities.eidos
Section titled “ViewCapabilities.eidos”readonly eidos?: EidosCapabilities;Related types: ExplorerContext, TextDocument, EidosCapabilities, CommonCapabilities.
ViewContext
Section titled “ViewContext”interface ViewContext extends CommonContext { /* members below */ }ViewContext.presentation
Section titled “ViewContext.presentation”readonly presentation?: { mode: "standalone" | "embedded";};ViewContext.binding
Section titled “ViewContext.binding”readonly binding: ViewBinding;ViewContext.capabilities
Section titled “ViewContext.capabilities”readonly capabilities: ViewCapabilities;Related types: ViewBinding, ViewCapabilities, CommonContext.
TextFileViewContext
Section titled “TextFileViewContext”export type TextFileViewContext = ViewContext & { readonly binding: Extract<ViewBinding, { kind: "file"; }>; readonly capabilities: ViewCapabilities & { readonly document: TextDocument; };};Related types: ViewContext, ViewBinding, ViewCapabilities, TextDocument.
TableFileViewContext
Section titled “TableFileViewContext”export type TableFileViewContext = ViewContext & { readonly binding: Extract<ViewBinding, { kind: "file"; }>; readonly capabilities: ViewCapabilities & { readonly eidos: EidosCapabilities & { readonly table: EidosTable; }; };};Related types: ViewContext, ViewBinding, ViewCapabilities, EidosCapabilities, EidosTable.
ActionContext
Section titled “ActionContext”interface ActionContext extends CommonContext { /* members below */ }ActionContext.binding
Section titled “ActionContext.binding”readonly binding: ActionBinding;ActionContext.capabilities
Section titled “ActionContext.capabilities”readonly capabilities: CommonCapabilities & { readonly document?: TextDocument; readonly settings: PluginSettings;};Related types: ActionBinding, CommonCapabilities, TextDocument, PluginSettings, CommonContext.
ExtensionContext
Section titled “ExtensionContext”interface ExtensionContext extends Lifetime { /* members below */ }ExtensionContext.i18n
Section titled “ExtensionContext.i18n”readonly i18n: PluginI18n;ExtensionContext.capabilities
Section titled “ExtensionContext.capabilities”readonly capabilities: { readonly hooks: { register(id: string, handler: FileHookHandler): Disposable; }; readonly formatters: { register(id: string, provider: FormatterProvider): Disposable; }; readonly actions: { registerTableProvider(id: string, provider: TableActionProvider): Disposable; register(id: string, handler: (ctx: ActionContext) => void | Promise<void>): Disposable; };};Related types: PluginI18n, FileHookHandler, Disposable, FormatterProvider, TableActionProvider, ActionContext, Lifetime.
TableActionContext
Section titled “TableActionContext”TableActionContext.i18n
Section titled “TableActionContext.i18n”readonly i18n: PluginI18n;TableActionContext.signal
Section titled “TableActionContext.signal”readonly signal: AbortSignal;TableActionContext.capabilities
Section titled “TableActionContext.capabilities”readonly capabilities: TableActionCapabilities;Related types: PluginI18n, TableActionCapabilities.
export type Mount = (ctx: ViewContext, root: HTMLElement) => void | Disposable | Promise<void | Disposable>;Related types: ViewContext, Disposable.
Activate
Section titled “Activate”export type Activate = (ctx: ExtensionContext) => void | Disposable | Promise<void | Disposable>;Related types: ExtensionContext, Disposable.