mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 01:25:36 -05:00
Object Explorer API (#783)
See https://github.com/Microsoft/sqlopsstudio/wiki/Extensibility-API#object-explorer for usage details
This commit is contained in:
61
src/sql/sqlops.d.ts
vendored
61
src/sql/sqlops.d.ts
vendored
@@ -108,6 +108,67 @@ declare module 'sqlops' {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Namespace for interacting with Object Explorer
|
||||
*/
|
||||
export namespace objectexplorer {
|
||||
/**
|
||||
* Get an Object Explorer node corresponding to the given connection and path. If no path
|
||||
* is given, it returns the top-level node for the given connection. If there is no node at
|
||||
* the given path, it returns undefined.
|
||||
* @param {string} connectionId The id of the connection that the node exists on
|
||||
* @param {string?} nodePath The path of the node to get
|
||||
* @returns {ObjectExplorerNode} The node corresponding to the given connection and path,
|
||||
* or undefined if no such node exists.
|
||||
*/
|
||||
export function getNode(connectionId: string, nodePath?: string): Thenable<ObjectExplorerNode>;
|
||||
|
||||
/**
|
||||
* Get all active Object Explorer connection nodes
|
||||
* @returns {ObjectExplorerNode[]} The Object Explorer nodes for each saved connection
|
||||
*/
|
||||
export function getActiveConnectionNodes(): Thenable<ObjectExplorerNode[]>;
|
||||
|
||||
/**
|
||||
* Interface for representing and interacting with items in Object Explorer
|
||||
*/
|
||||
export interface ObjectExplorerNode extends NodeInfo {
|
||||
/**
|
||||
* The id of the connection that the node exists under
|
||||
*/
|
||||
connectionId: string;
|
||||
|
||||
/**
|
||||
* Whether the node is currently expanded in Object Explorer
|
||||
*/
|
||||
isExpanded(): Thenable<boolean>;
|
||||
|
||||
/**
|
||||
* Set whether the node is expanded or collapsed
|
||||
* @param expandedState The new state of the node. If 'None', the node will not be changed
|
||||
*/
|
||||
setExpandedState(expandedState: vscode.TreeItemCollapsibleState): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Set whether the node is selected
|
||||
* @param selected Whether the node should be selected
|
||||
* @param clearOtherSelections If true, clear any other selections. If false, leave any existing selections.
|
||||
* Defaults to true when selected is true and false when selected is false.
|
||||
*/
|
||||
setSelected(selected: boolean, clearOtherSelections?: boolean): Thenable<void>;
|
||||
|
||||
/**
|
||||
* Get all the child nodes. Returns an empty list if there are no children.
|
||||
*/
|
||||
getChildren(): Thenable<ObjectExplorerNode[]>;
|
||||
|
||||
/**
|
||||
* Get the parent node. Returns undefined if there is none.
|
||||
*/
|
||||
getParent(): Thenable<ObjectExplorerNode>;
|
||||
}
|
||||
}
|
||||
|
||||
// EXPORTED INTERFACES /////////////////////////////////////////////////
|
||||
export interface ConnectionInfo {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user