Skip to content

Client async functions return unknow ts type instead of the response types. #370

@Hyperkid123

Description

@Hyperkid123

Example: https://stackblitz.com/edit/vitejs-vite-mygi8omd?file=src%2Fmain.ts

All client function return type are unknown instead of the AxiosPromise<T> type.

const rbacApi = APIFactory('/', {
  getPrincipalAccess,
});

// This is unknown but should be GetPrincipalAccessReturnType
const resp = rbacApi.getPrincipalAccess({
  application: 'foo',
  limit: 123,
});

The resp is of type unknown which means TS will not let you access the Promise API. You have to type cast the return value or ignore the TS.

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