/** * Copyright 2019 EPAM Systems * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Message } from '@phosphor/messaging'; import { Widget } from '@phosphor/widgets'; export interface IWidgetOptions { defaultRenderHolder: string; renderer?: IRenderer; } /** * A renderer for use with a running sessions widget. */ export interface IRenderer { createNode(): HTMLElement; } /** * The default implementation of `IRenderer`. */ export declare class Renderer implements IRenderer { nodeName: string; constructor(nodeName: string); createNode(): HTMLElement; } /** * The default `Renderer` instance. */ /** * A class that exposes the plugin sessions. */ export declare class BaseLegionWidget extends Widget { component: any; /** * Construct a new running widget. */ constructor(options: IWidgetOptions); /** * Override widget's default show() to * refresh content every time widget is shown. */ show(): void; refresh(): void; /** * The renderer used by the running widget. */ readonly renderer: IRenderer; /** * Dispose of the resources used by the widget. */ dispose(): void; /** * Handle the DOM events for the widget. * * @param event - The DOM event sent to the widget. * * #### Notes * This method implements the DOM `EventListener` interface and is * called in response to events on the widget's DOM nodes. It should * not be called directly by user code. */ handleEvent(event: Event): void; /** * A message handler invoked on an `'after-attach'` message. */ protected onAfterAttach(msg: Message): void; /** * A message handler invoked on a `'before-detach'` message. */ protected onBeforeDetach(msg: Message): void; /** * Handle the `'click'` event for the widget. * * #### Notes * This listener is attached to the document node. */ private _evtChange; /** * Handle the `'click'` event for the widget. * * #### Notes * This listener is attached to the document node. */ private _evtClick; /** * Handle the `'dblclick'` event for the widget. */ private _evtDblClick; private _renderer; } export interface IWidgetRegistry { getOrConstruct(name: string): TargetWidget; } export declare type WidgetRegistryBuilder = (name: string) => TargetWidget; export declare class WidgetRegistry implements IWidgetRegistry { private _storage; private _builder; constructor(builder: WidgetRegistryBuilder); getOrConstruct(name: string): TargetWidget; }