Skip to content

Add Proper TypeScript Return Types for FintectureClient Functions #26

@hugoblanc

Description

@hugoblanc

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions