The extension manager model interface.

interface IExtensionManagerModel {
    actionError: null | string;
    canInstall: boolean;
    canManage: boolean;
    installedError: null | string;
    installPath: null | string;
    name: string;
    promptReload: boolean;
    searchError: null | string;
    serviceManager: ServiceManager.IManager;
    stateChanged: Signal<IExtensionManagerModel, void>;
    translator: ITranslator;
    get canFetch(): boolean;
    get canPerformActions(): boolean;
    get installed(): readonly IEntry[];
    get isDisclaimed(): boolean;
    set isDisclaimed(v: boolean): void;
    get isDisposed(): boolean;
    get isEnabled(): boolean;
    set isEnabled(v: boolean): void;
    get isLoadingInstalledExtensions(): boolean;
    get isSearching(): boolean;
    get lastPage(): number;
    get page(): number;
    set page(value: number): void;
    get pagination(): number;
    set pagination(value: number): void;
    get query(): string;
    set query(value: string): void;
    get searchResult(): readonly IEntry[];
    addPendingAction(pending: Promise<any>): void;
    disable(entry: IEntry): Promise<void>;
    dispose(): void;
    enable(entry: IEntry): Promise<void>;
    fetchInstalled(force: boolean): Promise<IEntry[]>;
    hasPendingActions(): boolean;
    install(entry: IEntry, options?: { useVersion?: string }): Promise<void>;
    performAction(
        action: string,
        entry: IEntry,
        actionOptions?: IActionOptions,
    ): Promise<IActionReply>;
    refresh(): Promise<void>;
    refreshInstalled(force?: boolean): Promise<void>;
    search(force?: boolean): Promise<void>;
    uninstall(entry: IEntry): Promise<void>;
    update(force?: boolean): Promise<void>;
}

Hierarchy (View Summary)

Properties

actionError: null | string = null
canInstall: boolean

Whether the extension manager supports installing extensions.

When false, extensions are listed read-only: there is no registry to search and no un-/installation. They can still be enabled or disabled when canManage is true.

canManage: boolean

Whether the extension manager supports enabling and disabling extensions.

It is independent of canInstall, so a read-only manager still exposes enable and disable actions by default. Set it to false for a pure listing with no actions at all.

installedError: null | string = null

Contains an error message if an error occurred when querying installed extensions.

installPath: null | string

Extensions installation path.

name: string

Extension manager name.

promptReload: boolean = false

Whether a reload should be considered due to actions taken.

searchError: null | string = null

Contains an error message if an error occurred when searching for extensions.

serviceManager: ServiceManager.IManager

The service manager to use for building.

stateChanged: Signal<IExtensionManagerModel, void>

A signal emitted when any model state changes.

translator: ITranslator

Accessors

  • get canFetch(): boolean
  • Whether the model may fetch data from external web services, such as extension author avatars.

    Fetching requires the user to have accepted the disclaimer (see isDisclaimed); this holds for a read-only manager too.

    Returns boolean

  • get canPerformActions(): boolean
  • Whether actions may currently be performed on installed extensions.

    Requires canManage. An installable manager additionally requires the disclaimer, as its actions may contact external services; a read-only manager only toggles extensions locally.

    Returns boolean

  • get isDisposed(): boolean
  • Test whether the model is disposed.

    Returns boolean

Methods