import { IKernel } from 'jupyter-js-services';
import { IMessageHandler, Message } from 'phosphor-messaging';
import { Widget } from 'phosphor-widget';
import { DocumentRegistry, IDocumentContext, IDocumentModel } from '../docregistry';
import { ContextManager } from './context';
/**
 * A class that maintains the lifecyle of file-backed widgets.
 */
export declare class DocumentWidgetManager {
    /**
     * Construct a new document widget manager.
     */
    constructor(options: DocumentWidgetManager.IOptions);
    /**
     * Dispose of the resources used by the widget manager.
     */
    dispose(): void;
    /**
     * Create a widget for a document and handle its lifecycle.
     */
    createWidget(name: string, id: string, kernel?: IKernel.IModel): Widget;
    /**
     * Install the message filter for the widget and add to list
     * of known widgets.
     */
    adoptWidget(id: string, widget: Widget): void;
    /**
     * See if a widget already exists for the given path and widget name.
     *
     * #### Notes
     * This can be used to use an existing widget instead of opening
     * a new widget.
     */
    findWidget(path: string, widgetName: string): Widget;
    /**
     * Get the document context for a widget.
     */
    contextForWidget(widget: Widget): IDocumentContext<IDocumentModel>;
    /**
     * Clone a widget.
     *
     * #### Notes
     * This will create a new widget with the same model and context
     * as this widget.
     */
    clone(widget: Widget): Widget;
    /**
     * Close the widgets associated with a given path.
     */
    closeFile(path: string): void;
    /**
     * Close all of the open documents.
     */
    closeAll(): void;
    /**
     * Filter a message sent to a message handler.
     *
     * @param handler - The target handler of the message.
     *
     * @param msg - The message dispatched to the handler.
     *
     * @returns `true` if the message should be filtered, of `false`
     *   if the message should be dispatched to the handler as normal.
     */
    filterMessage(handler: IMessageHandler, msg: Message): boolean;
    /**
     * Handle `'close-request'` messages.
     */
    protected onClose(widget: Widget): void;
    /**
     * Ask the user whether to close an unsaved file.
     */
    private _maybeClose(widget);
    private _closeGuard;
    private _contextManager;
    private _registry;
    private _widgets;
}
/**
 * A namespace for document widget manager statics.
 */
export declare namespace DocumentWidgetManager {
    /**
     * The options used to initialize a document widget manager.
     */
    interface IOptions {
        /**
         * A document registry instance.
         */
        registry: DocumentRegistry;
        /**
         * A context manager instance.
         */
        contextManager: ContextManager;
    }
}
