Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

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

Aperta
#370 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
api

Direzione di ricerca

Start with the StackBlitz example and trace the APIFactory call for getPrincipalAccess. Inspect how the client function's return type is inferred, then verify that the response exposes the expected AxiosPromise API instead of unknown. Done means the example type-checks without a cast and preserves the response type.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
TypeScript
Stelle
7
Fork
37
Merge medio
2g 2h
PR unite (30g)
43

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RedHatInsights/javascript-clients

Tutte le issue di RedHatInsights/javascript-clients

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.