import { ISignal } from '@lumino/signaling'; import { ICompleterSelection, ICompletionContext, ICompletionProvider, ICompletionProviderManager, IInlineCompleterActions, IInlineCompleterFactory, IInlineCompletionProvider, IInlineCompletionProviderInfo } from './tokens'; /** * A manager for completion providers. */ export declare class CompletionProviderManager implements ICompletionProviderManager { /** * Construct a new completer manager. */ constructor(); /** * Signal emitted when active providers list is changed. */ get activeProvidersChanged(): ISignal; /** * Signal emitted when a selection is made from a completer menu. */ get selected(): ISignal; /** * Set provider timeout. * * @param {number} timeout - value of timeout in millisecond. */ setTimeout(timeout: number): void; /** * Enable/disable the document panel. */ setShowDocumentationPanel(showDoc: boolean): void; /** * Whether to suppress the tab completer when inline completions are presented. */ setSuppressIfInlineCompleterActive(suppress: boolean): void; /** * Enable/disable continuous hinting mode. */ setContinuousHinting(value: boolean): void; /** * Register a completer provider with the manager. * * @param {ICompletionProvider} provider - the provider to be registered. */ registerProvider(provider: ICompletionProvider): void; registerInlineProvider(provider: IInlineCompletionProvider): void; /** * * Return the map of providers. */ getProviders(): Map; /** * Activate the providers by id, the list of ids is populated from user setting. * The non-existing providers will be discarded. * * @param {Array} providerIds - Array of strings with ids of provider */ activateProvider(providerIds: Array): void; /** * Create or update completer handler of a widget with new context. * * @param newCompleterContext - The completion context. */ updateCompleter(newCompleterContext: ICompletionContext): Promise; /** * Invoke the completer in the widget with provided id. * * @param id - the id of notebook panel, console panel or code editor. */ invoke(id: string): void; /** * Activate `select` command in the widget with provided id. * * @param {string} id - the id of notebook panel, console panel or code editor. */ select(id: string): void; /** * Set inline completer factory. */ setInlineCompleterFactory(factory: IInlineCompleterFactory): void; /** * Inline completer actions. */ inline?: IInlineCompleterActions; /** * Inline providers information. */ get inlineProviders(): IInlineCompletionProviderInfo[]; /** * Helper function to generate a `ProviderReconciliator` with provided context. * The `isApplicable` method of provider is used to filter out the providers * which can not be used with provided context. * * @param {ICompletionContext} completerContext - the current completer context */ private generateReconciliator; /** * Helper to dispose the completer handler on widget disposed event. * * @param {string} id - id of the widget * @param {CompletionHandler} handler - the handler to be disposed. */ private disposeHandler; /** * Helper to generate a completer handler from provided context. */ private _generateHandler; /** * The completion provider map, the keys are id of provider */ private readonly _providers; /** * The inline completion provider map, the keys are id of provider */ private readonly _inlineProviders; /** * The completer handler map, the keys are id of widget and * values are the completer handler attached to this widget. */ private _panelHandlers; /** * The completer context map, the keys are id of widget and * values are the most recent context objects. */ private _mostRecentContext; /** * The set of activated providers */ private _activeProviders; /** * Timeout value for the completion provider. */ private _timeout; /** * Flag to show or hide the document panel. */ private _showDoc; /** * Flag to enable/disable continuous hinting. */ private _autoCompletion; private _activeProvidersChanged; private _selected; private _inlineCompleterFactory; private _inlineCompleterSettings; private _suppressIfInlineCompleterActive; }