From 4e78ff9fc404af63e03b4c4c9464f603eb54c8d3 Mon Sep 17 00:00:00 2001 From: zFernand0 <37381190+zFernand0@users.noreply.github.com> Date: Wed, 24 Jul 2024 07:57:19 -0400 Subject: [PATCH] fix: not everything can be converted from Promise to PromiseLike :cry: Signed-off-by: zFernand0 <37381190+zFernand0@users.noreply.github.com> --- .../zowe-explorer-api/src/tree/IZoweTree.ts | 132 ++++++------------ 1 file changed, 44 insertions(+), 88 deletions(-) diff --git a/packages/zowe-explorer-api/src/tree/IZoweTree.ts b/packages/zowe-explorer-api/src/tree/IZoweTree.ts index 808862faa5..ca996d96f6 100644 --- a/packages/zowe-explorer-api/src/tree/IZoweTree.ts +++ b/packages/zowe-explorer-api/src/tree/IZoweTree.ts @@ -29,12 +29,10 @@ export interface IZoweTree extends vscode.TreeDataProvider, Partial extends vscode.TreeDataProvider, Partial; + addSession(opts?: Types.AddSessionOpts): Promise; /** * Adds a single session to the tree * @param profile the profile to add to the tree */ - addSingleSession(profile: imperative.IProfileLoaded): void | PromiseLike; + addSingleSession(profile: imperative.IProfileLoaded): Promise; /** * Edit a session to the container * @param node This parameter identifies the node that needs to be called */ - editSession(node: IZoweTreeNode): void | PromiseLike; + editSession(node: IZoweTreeNode): Promise; /** * Get sessions from persistent object of provider @@ -85,176 +83,149 @@ export interface IZoweTree extends vscode.TreeDataProvider, Partial): void | PromiseLike; + createZoweSession(zoweFileProvider: IZoweTree): Promise; /** * Create a brand new Schema * @param zoweFileProvider The tree from which the schema will be created */ - createZoweSchema(zoweFileProvider: IZoweTree): void | PromiseLike; + createZoweSchema(zoweFileProvider: IZoweTree): Promise; /** * Adds a favorite node * @param favorite Adds a favorite node */ - checkCurrentProfile(node: IZoweTreeNode): void | PromiseLike; + checkCurrentProfile(node: IZoweTreeNode); /** * Log in to authentication service * @param node This parameter identifies the node that needs to be called */ - ssoLogin(node: IZoweTreeNode): void | PromiseLike; + ssoLogin(node: IZoweTreeNode): Promise; /** * Log out from authentication service * @param node This parameter identifies the node that needs to be called */ - ssoLogout(node: IZoweTreeNode): void | PromiseLike; + ssoLogout(node: IZoweTreeNode): Promise; /** * Adds a favorite node * @param favorite Adds a favorite node */ - addFavorite(favorite: IZoweTreeNode): void | PromiseLike; - + addFavorite(favorite: IZoweTreeNode): Promise; /** * Removes a favorite node * @param favorite Adds a favorite node */ - removeFavorite(node: IZoweTreeNode): void | PromiseLike; - + removeFavorite(node: IZoweTreeNode): Promise; /** * Removes profile node from Favorites section * @param profileName */ - removeFavProfile(profileName: string, userSelected: boolean): void | PromiseLike; - + removeFavProfile(profileName: string, userSelected: boolean): Promise; /** * Refreshes the tree */ - refresh(): void | PromiseLike; - + refresh(): void; /** * Refreshes an element of the tree * @param favorite Node to refresh */ - refreshElement(node: IZoweTreeNode): void | PromiseLike; - + refreshElement(node: IZoweTreeNode): void; /** * Signals that node data has changed in the tree view * @param element to pass to event listener callback */ - nodeDataChanged?(node: IZoweTreeNode): void | PromiseLike; - + nodeDataChanged?(node: IZoweTreeNode): void; /** * Event Emitters used to notify subscribers that the refresh event has fired */ - onDidChangeConfiguration(e: vscode.ConfigurationChangeEvent): void | PromiseLike; - + onDidChangeConfiguration(e: vscode.ConfigurationChangeEvent); /** * Change the state of an expandable node * @param element the node being flipped * @param isOpen the intended state of the the tree view provider, true or false */ - flipState(element: IZoweTreeNode, isOpen: boolean): void | PromiseLike; + flipState(element: IZoweTreeNode, isOpen: boolean); /** * Rename the node. Begins a dialog. * @param the node to be renamed */ - rename(node: IZoweTreeNode): void | PromiseLike; - + rename(node: IZoweTreeNode); /** * Opens the node. Begins a dialog. * @param node: the node to be opened * @param preview: open in preview of edit mode */ - open(node: IZoweTreeNode, preview: boolean): void | PromiseLike; - + open(node: IZoweTreeNode, preview: boolean); /** * Begins a copy operation on the node. * @param node: the node to be copied */ - copy(node: IZoweTreeNode): void | PromiseLike; - + copy(node: IZoweTreeNode); /** * Concludes a copy/paste operation on the node. * @param node: the node to be pasted */ - paste(node: IZoweTreeNode): void | PromiseLike; - + paste(node: IZoweTreeNode); /** * Deletes a node. * @param node: the node to be deleted */ - delete(node: IZoweTreeNode): void | PromiseLike; - + delete(node: IZoweTreeNode); /** * Reveals and selects a node within the tree. * @param treeView: the vscode tree container * @param node: the node to be selected */ - setItem(treeView: vscode.TreeView, node: IZoweTreeNode): void | PromiseLike; - + setItem(treeView: vscode.TreeView, node: IZoweTreeNode); /** * Saves the currently employed filter as a favorite. * @param node: A root node representing a session */ - saveSearch(node: IZoweTreeNode): void | PromiseLike; - + saveSearch(node: IZoweTreeNode); /** * Saves an edited file. * @param node: the node to be saved */ - saveFile(document: vscode.TextDocument): void | PromiseLike; + saveFile(document: vscode.TextDocument); - /** - * Refresh the given node with current mainframe data. - * @param node: the node to be refreshed - */ - refreshPS(node: IZoweTreeNode): void | PromiseLike; + refreshPS(node: IZoweTreeNode); - /** - * Confirmation dialog to upload/save the given node. - * @param node: the node to be uploaded/saved - */ - uploadDialog(node: IZoweTreeNode): void | PromiseLike; + uploadDialog(node: IZoweTreeNode); /** * Begins a filter/search operation on a node. * @param node: the root node to be searched from */ - filterPrompt(node: IZoweTreeNode): void | PromiseLike; + filterPrompt(node: IZoweTreeNode); /** * Adds a search history element to persisted settings. * @param node: the root node representing the operation */ - addSearchHistory(element: string): void | PromiseLike; - + addSearchHistory(element: string); /** * Retrieves search history elements from persisted settings. */ - getSearchHistory(): string[] | PromiseLike; - + getSearchHistory(); /** * Returns the type of the tree provider. * @returns {PersistenceSchemaEnum} the type of tree: Dataset, USS, or Job */ getTreeType(): PersistenceSchemaEnum; - /** * Deletes a root node from the tree. * @param node: A root node representing a session * @param hideFromAllTrees: whether to hide from all trees or just the single tree */ - deleteSession(node: IZoweTreeNode, hideFromAllTrees?: boolean): void | PromiseLike; - + deleteSession(node: IZoweTreeNode, hideFromAllTrees?: boolean); /** * Lets the user open a dataset by filtering the currently-loaded list */ - getAllLoadedItems?(): IZoweTreeNode[] | Promise; - + getAllLoadedItems?(): Promise; /** * Retrieves the vscode tree container */ @@ -266,106 +237,91 @@ export interface IZoweTree extends vscode.TreeDataProvider, Partial; - + updateFavorites(); /** * Renames a node from the favorites list * * @param {IZoweTreeNode} node */ - renameFavorite(node: IZoweTreeNode, newLabel: string): void | PromiseLike; - + renameFavorite(node: IZoweTreeNode, newLabel: string); /** * Renames a node based on the profile and it's label * * @param {string} criteria the member name to add */ - addFileHistory?(criteria: string): void | PromiseLike; - + addFileHistory?(criteria: string); /** * Returns the array of recently-opened member names * * @returns {string[]} the array of recently-opened member names */ - getFileHistory?(): string[] | PromiseLike; - + getFileHistory?(); /** * Removes a member name from the recently-opened members array * * @param {string} name the member to remove */ - removeFileHistory?(name: string): void | PromiseLike; - + removeFileHistory?(name: string); /** * Removes session from the session array * @param {string} name the sessions to remove */ - removeSession?(name: string): void | PromiseLike; - + removeSession?(name: string): void; /** * Returns a new dataset filter string, from an old filter and a new string * * @param {string} newFilter the new filter to add * @param {IZoweTreeNode} node the node with the old filter */ - createFilterString?(newFilter: string, node: IZoweTreeNode): string | PromiseLike; - + createFilterString?(newFilter: string, node: IZoweTreeNode); /** * @param {string} profileLabel * @param {string} beforeLabel * @param {string} afterLabel */ - renameNode(profile: string, beforeDataSetName: string, afterDataSetName: string): void | PromiseLike; - + renameNode(profile: string, beforeDataSetName: string, afterDataSetName: string); /** * Opens an item & reveals it in the tree * * @param {string} path the path of the item * @param {IZoweTreeNode} sessionNode the session to use */ - openItemFromPath?(path: string, sessionNode: IZoweTreeNode): void | PromiseLike; - + openItemFromPath?(path: string, sessionNode: IZoweTreeNode); /** * Adds template for data set creation attributes * * @param {any} criteria the member name to add */ - addDsTemplate?(criteria: Types.DataSetAllocTemplate): void | PromiseLike; - + addDsTemplate?(criteria: Types.DataSetAllocTemplate): Promise; /** * Returns the array of saved templates for data set creation attributes * * @returns {DataSetAllocTemplate[]} the array of recently-opened member names */ - getDsTemplates?(): Types.DataSetAllocTemplate[] | PromiseLike; - + getDsTemplates?(): Types.DataSetAllocTemplate[]; /* Initializes polling (refresh w/ configurable interval) for the provided node. * * @param {IZoweTreeNode} node the node to poll data for */ - pollData?(node: IZoweTreeNode): void | PromiseLike; - + pollData?(node: IZoweTreeNode): any; /** * Opens resource for the provided node using encoding specified by user. * @param {IZoweTreeNode} node * @param {ZosEncoding} encoding File encoding, user will be prompted if undefined */ - openWithEncoding?(node: IZoweTreeNode, encoding?: ZosEncoding): void | PromiseLike; + openWithEncoding?(node: IZoweTreeNode, encoding?: ZosEncoding): Promise; }