Strict types for WebGL and WebGL2
Les mainteneurs répondent en général sous 1 jour
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 25/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- À l'abandon
- Stack technique
- typescript
- Domaine
- tooling
Piste de recherche
Commencez par examiner les types proposés dans TypeScript PR #21902 et ses fichiers modifiés, puis inspectez comment les typings générés automatiquement alimentent dom.generated.d.ts. Déterminez si les déclarations WebGL/WebGL2 doivent constituer des entrées supplémentaires ou une option lib distincte, et évaluez les problèmes liés aux overloads et au supertype partagé décrits dans l’issue. Le travail est terminé lorsqu’une approche d’intégration est convenue et que des typings stricts appropriés sont définis.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Opening a new issue, as requested. See also https://github.com/Microsoft/TypeScript/pull/21902.
I wrote some strict types for WebGL/WebGL2, which would fix https://github.com/Microsoft/TypeScript/issues/5855 among others. See https://github.com/Microsoft/TypeScript/pull/21902/files.
The auto-generated typings would need to be excluded. Maybe this should be added as a separate option for the lib compiler option as it's not exactly lightweight.
I might have made some of the types too strict, for example for texImage2D I added overloads which exactly match the internalFormat/format/type combinations allowed by the WebGL spec. When calling the function with immediate values, this is fine, but calling it with values in variables is going to require as any casts. (Which could be fine, as at that point you're responsible for the correct types anyway).
Also the following would fail, because TS doesn't currently generate a common supertype (?).
declare const randomParameter: GL['ACTIVE_TEXTURE'] | GL['ALIASED_LINE_WIDTH_RANGE']
const x = gl.getParameter(randomParameter)
// no matching overload, but a return type of GL.TextureUnits | Float32Array would make sense.
Is adding the .d.ts files as additional inputFiles which are concatenated to the dom.generated.d.ts (or a separate webgl lib file) an option? I added a number of subtypes which are only implicitly in the spec: all constants are typed as a generic GLenum in spec, although there are many different subgroups which I typed explicitly. It is highly unlikely that those will be added to the IDL.
- Langage dominant
- TypeScript
- Étoiles
- 740
- Forks
- 474
- Merge moyen
- 3 j 7 h
- PR mergées (30 j)
- 14
Préparer son environnement
Nous n'avons pas encore vérifié les fichiers d'installation de ce projet. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de microsoft/TypeScript-DOM-lib-generator
-
Difficulté 2/5 1-3 heures Accessibilité débutants 74/100
microsoft/TypeScript-DOM-lib-generator#2554 · 6 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
lib.d.ts bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
microsoft/TypeScript-DOM-lib-generator#2485 ·
Les mainteneurs répondent en général sous 1 jour
-
lib.d.ts bug
Difficulté 1/5 Moins d'une heure Accessibilité débutants 68/100
microsoft/TypeScript-DOM-lib-generator#2154 · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
-
lib.d.ts bug
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
microsoft/TypeScript-DOM-lib-generator#2107 · 5 commentaires ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
microsoft/TypeScript-DOM-lib-generator#1675 · 2 commentaires · 1 réaction ·
Les mainteneurs répondent en général sous 1 jour
Toutes les issues de microsoft/TypeScript-DOM-lib-generator
Issues similaires
-
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
openedx/frontend-app-authoring#3274 ·
Les mainteneurs répondent en général sous 1 jour
-
🎙️ task - fix(deployer): deploy --env prep runs deploy:dev where the repo declares deploy:prepOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 88/100
-
area/documentation status/need-triage
Difficulté 1/5 Moins d'une heure Accessibilité débutants 95/100
google-gemini/gemini-cli#29548 ·
Les mainteneurs répondent en général sous 1 jour
-
sdk-typescript vector-store
Difficulté 2/5 Une demi-journée Accessibilité débutants 82/100
mem0ai/mem0#7495 · 1 commentaire ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 82/100
Les mainteneurs répondent en général sous 1 jour