microsoft / microsoft/TypeScript
[Compiler API] function which check if a class implements an interface
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.4k
- Merge medio
- 1g 19h
- PR unite (30g)
- 117
Descrizione
Search Terms
Compiler API, InterfaceDeclaration, ClassDeclaration, Checker
Suggestion
A function to check whether a ClassDeclaration implements an InterfaceDeclaration
Use Cases
Hello, I wanted to check whether a ClassDeclaration of a.ts file implements an InterfaceDeclaration from b.ts file using Compiler API.
But I couldn't find a method or a function for it.
Examples
function isClassImplementInterface(
ts.ClassDeclaration: classDeclaration,
ts.InterfaceDeclaration: interfaceDeclaration
): boolean {
// return true if classDeclaration implements interfaceDeclaration correctly
}
Checklist
My suggestion meets these guidelines:
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript's Design Goals.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia leggendo la Compiler API relativa a InterfaceDeclaration, ClassDeclaration e al Checker. Determina come vengono rappresentate le relazioni tra classi e interfacce tra file diversi e quale forma di API richiede la richiesta. Il lavoro è completo quando è stata concordata e documentata una funzione supportata, con test per verificare se una classe implementa un'interfaccia.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- compilers
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100