Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Proper TypeScript Return Types for FintectureClient Functions #26

Open
hugoblanc opened this issue Aug 25, 2023 · 0 comments
Open

Comments

@hugoblanc
Copy link

Hello, team!

While using the FintectureClient class from the SDK, I noticed that most of the functions have generic Promise<object> return types. As TypeScript developers, having specific return types for each function can greatly improve our development experience. This allows us to take full advantage of TypeScript's static type checking and IntelliSense functionality.

Here's a breakdown of the current functions and their return types:

getAccessToken(authCode?: string, scopes?: string): Promise<object>;
refreshAccessToken(refreshToken: string): Promise<object>;
getProviders(search?: object): Promise<object>;
getApplication(): Promise<object>;
getTestAccounts(search?: object): Promise<object>;
// ... (more functions)

While some methods, like getPisConnect and getAisConnect, are correctly typed:

getPisConnect(accessToken: string, connectConfig: any): Promise<IPisConnect>;
getAisConnect(accessToken: string, connectConfig: any): Promise<IAisConnect>;

I'd like to propose that the other methods also have specific return types, rather than the generic Promise<object>. This way, developers can have a clearer understanding of the data structure that each function will return, which can help in reducing potential runtime errors and improving development efficiency.

If the exact return type structure is documented or known, it would be great to see them represented in the TypeScript definitions.

Thanks for considering this enhancement!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant