godotjs / godotjs/javascript

generate strong types for engine signals and connections

Aperta
#30 4 commenti 0 reazioni 0 assegnatari Vedi su GitHub
enhancement
Lingua principale
C++
Stelle
1.1k
Fork
80
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

is there any interest in generating strong types for connections such as:

(this is probably a poor example, I'd need to dig in and make a PR to do it correctly)

```ts
declare module godot {
interface SceneTree implements MainLoop {
//overload 1 for network_peer_connected signal
function connect(
signal: "network_peer_connected",
target: T,
method: Extract | (...args: Parameters) => void, //could use e.g. MethodOf,
binds: Tail>,
flags: number = 0,
): number;
// more overloads, one per signal for discriminating union
}
}
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.