rhamt-vscode-extension
Version:
RHAMT VSCode extension
60 lines (53 loc) • 2.71 kB
TypeScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import { Uri } from "vscode";
import { RhamtConfiguration } from 'raas-core';
export declare class RhamtTreeDataProvider implements vscode.TreeDataProvider<IRhamtNode>, vscode.Disposable {
public static readonly subscriptionContextValue: string;
public onDidChangeTreeData: vscode.Event<IRhamtNode>;
public onNodeCreate: vscode.Event<IRhamtNode>;
constructor(resourceProvider: IChildProvider, loadMoreCommandId: string, rootTreeItems?: IRhamtParentTreeItem[]);
public getTreeItem(node: IRhamtNode): vscode.TreeItem;
public getChildren(node?: IRhamtParentNode): Promise<IRhamtNode[]>;
public refresh(node?: IRhamtNode, clearCache?: boolean): Promise<void>;
public loadMore(node: IRhamtNode): Promise<void>;
public findNode(id: string): Promise<IRhamtNode | undefined>;
public dispose(): void;
}
export interface IRhamtNode<T extends IRhamtTreeItem = IRhamtTreeItem> {
readonly id: string;
readonly treeItem: T;
readonly parent?: IRhamtParentNode;
readonly treeDataProvider: RhamtTreeDataProvider;
refresh(): Promise<void>;
deleteNode(): Promise<void>;
run(description: string, callback: () => Promise<void>): Promise<void>;
}
export interface IRhamtParentNode<T extends IRhamtTreeItem = IRhamtTreeItem> extends IRhamtNode<T> {
createChild(userOptions?: any): Promise<IRhamtNode>;
getCachedChildren(): Promise<IRhamtNode[]>;
}
export interface IRhamtTreeItem {
id?: string;
label: string;
description?: string;
iconPath?: string | Uri | { light: string | Uri; dark: string | Uri };
commandId?: string;
contextValue: string;
deleteTreeItem?(node: IRhamtNode): Promise<void>;
refreshLabel?(node: IRhamtNode): Promise<void>;
isAncestorOf?(contextValue: string): boolean;
}
export interface IChildProvider {
readonly childTypeLabel?: string;
loadMoreChildren(node: IRhamtNode, clearCache: boolean): Promise<IRhamtTreeItem[]>;
hasMoreChildren(): boolean;
createChild?(node: IRhamtNode, showCreatingNode: (label: string) => void, userOptions?: any): Promise<IRhamtTreeItem>;
compareChildren?(node1: IRhamtNode, node2: IRhamtNode): number;
}
export interface IRhamtParentTreeItem extends IRhamtTreeItem, IChildProvider {
pickTreeItem?(expectedContextValue: string): IRhamtTreeItem | undefined;
}