zowe / zowe-explorer-vscode

Visual Studio Code Extension for Zowe, which lets users interact with z/OS Data Sets, Unix System Services, and Jobs on a remote mainframe instance. Powered by Zowe SDKs.
Eclipse Public License 2.0
159 stars 89 forks source link

Add return types to all interface methods in Zowe Explorer API #2952

Open t1m0thyj opened 2 weeks ago

t1m0thyj commented 2 weeks ago

Zowe Explorer API defines many interfaces containing methods, some of which do not have return types defined.

For example, many of the methods on the IZoweTree interface are lacking return types: https://github.com/zowe/zowe-explorer-vscode/blob/next/packages/zowe-explorer-api/src/tree/IZoweTree.ts

Adding return types could be considered a breaking change but should improve the experience for developers/extenders. For example, when calling ZoweTreeProvider.addFavorite it'd be nice to have a return type Promise<void> displayed by IntelliSense instead of any 😋

github-actions[bot] commented 2 weeks ago

Thank you for raising this enhancement request. The community has 90 days to vote on it. If the enhancement receives at least 10 upvotes, it is added to our development backlog. If it receives fewer votes, the issue is closed.

traeok commented 1 week ago

Something to consider as part of adding return types: do we intend on supporting asynchronous types for some functions?

For example, the rename function could be typed as follows to allow both asynchronous and synchronous operations:

/**
 * Rename the node. Begins a dialog.
 * @param the node to be renamed
 */
rename(node: IZoweTreeNode): void | PromiseLike<void>;