Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ListModel

Model for an extension list. ListModel statics.

Hierarchy

  • VDomModel
    • ListModel

Implements

  • IModel

Index

Constructors

constructor

  • new ListModel(serviceManager: ServiceManager): ListModel

Properties

Private _installed

_installed: IEntry[]

Private _page

_page: number = 0

Private _pagination

_pagination: number = 250

Private _pendingActions

_pendingActions: Promise<any>[] = []

Private _query

_query: string | null = null

Private _searchResult

_searchResult: IEntry[]

Private _totalEntries

_totalEntries: number = 0

initialized

initialized: boolean = false

Whether the model has finished async initialization.

installedError

installedError: string | null = null

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

isDisposed

isDisposed: boolean

Test whether the model is disposed.

promptBuild

promptBuild: boolean = false

Whether a fresh build should be considered due to actions taken.

searchError

searchError: string | null = null

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

Protected searcher

searcher: Searcher = new Searcher()

A helper for performing searches of jupyterlab extensions on the NPM repository.

serverConnectionError

serverConnectionError: string | null = null

Contains an error message if an error occurred when querying the server extension.

Protected serverConnectionSettings

serverConnectionSettings: ISettings

Settings for connecting to the notebook server.

serverRequirementsError

serverRequirementsError: string | null = null

Contains an error message if the server has unfulfilled requirements.

Protected serviceManager

serviceManager: ServiceManager

The service manager to use for building.

stateChanged

stateChanged: Signal<this, void>

A signal emitted when any model state changes.

Accessors

installed

  • get installed(): ReadonlyArray<IEntry>
  • A readonly array of the installed extensions.

    Returns ReadonlyArray<IEntry>

page

  • get page(): number
  • set page(value: number): void
  • The current NPM repository search page.

    The npm repository search is paginated by the pagination attribute. The page value selects which page is used.

    Setting its value triggers a new search.

    Returns number

  • The current NPM repository search page.

    The npm repository search is paginated by the pagination attribute. The page value selects which page is used.

    Setting its value triggers a new search.

    Parameters

    • value: number

    Returns void

pagination

  • get pagination(): number
  • set pagination(value: number): void
  • The NPM repository search pagination.

    The npm repository search is paginated by the pagination attribute. The page value selects which page is used.

    Setting its value triggers a new search.

    Returns number

  • The NPM repository search pagination.

    The npm repository search is paginated by the pagination attribute. The page value selects which page is used.

    Setting its value triggers a new search.

    Parameters

    • value: number

    Returns void

query

  • get query(): string | null
  • set query(value: string | null): void
  • The current NPM repository search query.

    Setting its value triggers a new search.

    Returns string | null

  • The current NPM repository search query.

    Setting its value triggers a new search.

    Parameters

    • value: string | null

    Returns void

searchResult

  • get searchResult(): ReadonlyArray<IEntry>
  • A readonly array containing the latest search result

    Returns ReadonlyArray<IEntry>

totalEntries

  • get totalEntries(): number
  • The total number of results in the current search.

    Returns number

Methods

Protected _addPendingAction

  • _addPendingAction(pending: Promise<any>): void
  • Add a pending action.

    Parameters

    • pending: Promise<any>

      A promise that resolves when the action is completed.

    Returns void

Protected _performAction

  • Send a request to the server to perform an action on an extension.

    Parameters

    • action: string

      A valid action to perform.

    • entry: IEntry

      The extension to perform the action on.

    Returns Promise<IActionReply>

checkCompanionPackages

  • checkCompanionPackages(entry: IEntry): Promise<boolean>
  • Check for companion packages in kernels or server.

    Parameters

    • entry: IEntry

      An entry indicating which extension to check.

    Returns Promise<boolean>

disable

  • disable(entry: IEntry): Promise<void>
  • Disable an extension.

    Parameters

    • entry: IEntry

      An entry indicating which extension to disable.

    Returns Promise<void>

dispose

  • dispose(): void
  • Dispose the model.

    Returns void

enable

  • enable(entry: IEntry): Promise<void>
  • Enable an extension.

    Parameters

    • entry: IEntry

      An entry indicating which extension to enable.

    Returns Promise<void>

Protected fetchInstalled

  • Make a request to the server for info about its installed extensions.

    Parameters

    • Default value refreshInstalled: boolean = false

    Returns Promise<IInstalledEntry[]>

hasPendingActions

  • hasPendingActions(): boolean
  • Whether there are currently any actions pending.

    Returns boolean

ignoreBuildRecommendation

  • ignoreBuildRecommendation(): void
  • Ignore a build recommendation

    Returns void

initialize

  • initialize(): Promise<void>
  • Initialize the model.

    Returns Promise<void>

install

  • install(entry: IEntry): Promise<void>
  • Install an extension.

    Parameters

    • entry: IEntry

      An entry indicating which extension to install.

    Returns Promise<void>

performBuild

  • performBuild(): void
  • Perform a build on the server

    Returns void

Protected performSearch

  • performSearch(): Promise<object>
  • Search with current query.

    Sets searchError and totalEntries as appropriate.

    Returns Promise<object>

    } The search result as a map of entries.

Protected queryInstalled

  • queryInstalled(refreshInstalled: boolean): Promise<object>
  • Query the installed extensions.

    Sets installedError as appropriate.

    Parameters

    • refreshInstalled: boolean

    Returns Promise<object>

    } A map of installed extensions.

refreshInstalled

  • refreshInstalled(): void
  • Ignore a build recommendation

    Returns void

Protected translateInstalled

  • Translate installed extensions information from the server into entries.

    Parameters

    Returns Promise<object>

Protected translateSearchResult

  • translateSearchResult(res: Promise<ISearchResult>): Promise<object>
  • Translate search results from an npm repository query into entries and remove entries with 'deprecated' in the keyword list

    Parameters

    Returns Promise<object>

triggerBuildCheck

  • triggerBuildCheck(): void
  • Trigger a build check to incorporate actions taken.

    Returns void

uninstall

  • uninstall(entry: IEntry): Promise<void>
  • Uninstall an extension.

    Parameters

    • entry: IEntry

      An entry indicating which extension to uninstall.

    Returns Promise<void>

Protected update

  • update(refreshInstalled?: boolean): Promise<void>
  • Update the current model.

    This will query the NPM repository, and the notebook server.

    Emits the stateChanged signal on successful completion.

    Parameters

    • Default value refreshInstalled: boolean = false

    Returns Promise<void>

Static entryHasUpdate

  • entryHasUpdate(entry: IEntry): boolean
  • Utility function to check whether an entry can be updated.

    Parameters

    • entry: IEntry

      The entry to check.

    Returns boolean

Generated using TypeDoc