import { TextDocument, WebviewPanel } from "vscode"; import { Disposable } from "@anz-bank/vscode-sysl-model"; /** * A Webview-based editor for a text document. * * This is a wrapper class that exposes an API for interacting with the contents of the editor as * you would a TextEditor. */ export declare class CustomEditor { readonly document: TextDocument; readonly webviewPanel: WebviewPanel; constructor(document: TextDocument, webviewPanel: WebviewPanel); render(data: any): Thenable; } /** * Stores a collection of WebviewPanels for retrieval by tests. * * Exported for testing only. Application code should use the singleton instance. */ export declare class CustomEditorManager { /** Array of WebviewPanels that have been created to find the active one. */ private editors; /** * Array of disposables for listeners to registered panel view state changes. * * Aligned with {@link editors} such that disposable i disposes of the listening for view * state changes in panel i. */ private viewStateChangeListenersDisposables; /** * Array of callbacks to invoke when the view state of any panel changes. */ private onDidChangeVisiblePanelsListeners; /** Returns the active CustomEditor if there is one, or undefined. */ get activeCustomEditor(): CustomEditor | undefined; /** Returns the visible WebviewPanels. */ get visibleCustomEditors(): CustomEditor[]; visibleEditorsForDoc(uri: string): CustomEditor[]; /** Adds a panel to the collection. */ addEditor(editor: CustomEditor): void; /** * Handles the disposal of a panel by removing it from the collection and disposing of its view * state change listener. */ disposeEditor(panel: CustomEditor): void; /** * Registers a listener that is invoked when the visibility of any managed panels changes. */ onDidChangeVisiblePanels(listener: (editor: CustomEditor) => any, thisArg?: any, disposables?: Disposable[]): Disposable; /** * Handles the change of the view state of a managed panel by invoking registered callbacks. * @param e The event emitted by the change. */ private handleViewStateChange; /** Returns the custom editor instance containing a panel, if it exists. */ private editorForWebviewPanel; } /** Singleton instance to work with in application code. */ export declare const customEditorManager: CustomEditorManager;