Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interfaces instead of declared classes #123

Open
dbaileychess opened this issue Sep 13, 2017 · 4 comments
Open

Interfaces instead of declared classes #123

dbaileychess opened this issue Sep 13, 2017 · 4 comments

Comments

@dbaileychess
Copy link

Wouldn't it make more sense to have the screeps.d.ts generated with 'Interfaces' instead of 'declare class'? This repo isn't providing any implementation, its more used as a type system.

See (https://stackoverflow.com/questions/14311675/typescript-declaration-files-contain-class-definitions-with-no-member-implementa/14323673#14323673 and
https://stackoverflow.com/questions/14345485/whats-the-difference-between-declare-class-and-interface-in-typescript)

@thaelina
Copy link
Contributor

Taking a look at the repo, the only instance of a declare class is for RoomVisual which can be an interface as well, I think.

@dbaileychess
Copy link
Author

The npm package (4.2.1) is outdated or pointing to the 'classes' branch then, most definitions are still 'classes' in the npm package.

@thaelina
Copy link
Contributor

thaelina commented Sep 15, 2017 via email

@Dessix
Copy link
Collaborator

Dessix commented Oct 1, 2017

Yes, interfaces allow extension, especially static extension using the duet declaration with a constructor interface, so this is the preference set by the Typescript standard library.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants