import { ReactWidget } from '@jupyterlab/apputils'; import { ISettingRegistry, Settings } from '@jupyterlab/settingregistry'; import { ITranslator } from '@jupyterlab/translation'; import { IScore } from '@jupyterlab/ui-components'; import { Message } from '@lumino/messaging'; import { ISignal } from '@lumino/signaling'; import type { SettingsEditor } from './settingseditor'; /** * A list of plugins with editable settings. */ export declare class PluginList extends ReactWidget { /** * Create a new plugin list. */ constructor(options: PluginList.IOptions); /** * The setting registry. * @deprecated - it was not intended as a public property */ readonly registry: ISettingRegistry; private _registry; /** * A signal emitted when a list user interaction happens. */ get changed(): ISignal; /** * The selection value of the plugin list. */ get scrollTop(): number | undefined; get hasErrors(): boolean; get filter(): SettingsEditor.PluginSearchFilter; /** * The selection value of the plugin list. */ get selection(): string; set selection(selection: string); /** * Signal that fires when search filter is updated so that settings panel can filter results. */ get updateFilterSignal(): ISignal; get handleSelectSignal(): ISignal; /** * Handle `'update-request'` messages. */ protected onUpdateRequest(msg: Message): void; /** * Handle the `'mousedown'` event for the plugin list. * * @param event - The DOM event sent to the widget */ private _evtMousedown; /** * Check the plugin for a rendering hint's value. * * #### Notes * The order of priority for overridden hints is as follows, from most * important to least: * 1. Data set by the end user in a settings file. * 2. Data set by the plugin author as a schema default. * 3. Data set by the plugin author as a top-level key of the schema. */ getHint(key: string, registry: ISettingRegistry, plugin: ISettingRegistry.IPlugin): string; /** * Function to recursively filter properties that match search results. * @param filter - Function to filter based on search results * @param props - Schema properties being filtered * @param definitions - Definitions to use for filling in references in properties * @param ref - Reference to a definition * @returns - String array of properties that match the search results. */ getFilterString(filter: (item: string) => Partial | null, props: ISettingRegistry.IProperty, definitions?: any, ref?: string): string[]; /** * Updates the filter when the search bar value changes. * @param filter Filter function passed by search bar based on search value. */ setFilter(filter: ((item: string) => Partial | null) | null, query?: string): void; setError(id: string, error: boolean): void; mapPlugins(plugin: ISettingRegistry.IPlugin): JSX.Element; render(): JSX.Element; protected translator: ITranslator; private _changed; private _errors; private _filter; private _model; private _query; private _handleSelectSignal; private _updateFilterSignal; private _confirm?; private _scrollTop; private _selection; } /** * A namespace for `PluginList` statics. */ export declare namespace PluginList { /** * The instantiation options for a plugin list. */ interface IOptions { /** * A function that allows for asynchronously confirming a selection. * * #### Notes * If the promise returned by the function resolves, then the selection will * succeed and emit an event. If the promise rejects, the selection is not * made. */ confirm?: (id: string) => Promise; /** * Model for the plugin list. */ model?: PluginList.Model; /** * The setting registry for the plugin list. */ registry: ISettingRegistry; /** * List of plugins to skip. * @deprecated - pass a `model` with `toSkip` option instead */ toSkip?: string[]; /** * The setting registry for the plugin list. */ translator?: ITranslator; /** * An optional initial query so the plugin list can filter on start. */ query?: string; } /** * Sort a list of plugins by title and ID. * @deprecated - prior to 4.3 this function was used to reimplement * the same ordering between the plugin list and editor; it is no * longer needed as the order is now tracked by the model. */ function sortPlugins(registry: ISettingRegistry): ISettingRegistry.IPlugin[]; /** * Model for plugin list */ class Model { /** * Create a new plugin list model. */ constructor(options: PluginList.Model.IOptions); /** * A list of loaded plugins. */ get plugins(): ISettingRegistry.IPlugin[]; /** * A promise which resolves when an initial loading of plugins completed. * * Note: this does not guarantee that all `plugins` nor `settings` are available * as these can be also loaded later as plugins are added or transformed. */ get ready(): Promise; /** * Settings keyed by plugin name. * * Note: settings for plugins can be loaded later than the plugin * itself, which is the case for plugins using a `transform` step. */ get settings(): Record; /** * Signal emitted when list of plugins change. * * This signal will be emitted when new plugins are added to the registry, * when settings schema of an already present plugin changes, and when the * settings state changes from default to modified or vice versa. */ get changed(): ISignal; /** * Loads, sorts and filters plugins from the registry. */ private _loadPlugins; /** * Loads settings and stores them for easy access when displaying search results. */ private _loadSettings; private _sortPlugins; private _plugins; private _changed; private _ready; private _registry; private _settings; private _settingsModified; private _toSkip; } /** * A namespace for `PluginList.Model` statics. */ namespace Model { /** * The instantiation options for a plugin list model. */ interface IOptions { /** * The setting registry for the plugin list model. */ registry: ISettingRegistry; /** * List of plugins to skip. */ toSkip?: string[]; } } }