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

Typescript Support #3

Merged
merged 9 commits into from May 26, 2020
Merged

Typescript Support #3

merged 9 commits into from May 26, 2020

Conversation

yujinlin0224
Copy link
Contributor

Add *.d.ts files to make this package supported Typescript.
Please check that all type derivation in *.d.ts files are right.

Copy link
Member

@yishn yishn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've added some comments.

src/GoBoard.d.ts Outdated Show resolved Hide resolved
src/GoBoard.d.ts Outdated Show resolved Hide resolved
src/GoBoard.d.ts Outdated
Comment on lines 18 to 20
private _players: [Sign, Sign]
private _captures: [number, number]
private _koInfo: {sign: Sign; vertex: Vertex}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are implementation details, so please remove them as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 9ce2874

src/GoBoard.d.ts Outdated Show resolved Hide resolved
src/GoBoard.d.ts Outdated Show resolved Hide resolved
src/GoBoard.d.ts Outdated Show resolved Hide resolved
@yujinlin0224
Copy link
Contributor Author

yujinlin0224 commented May 25, 2020

Some functions use [x, y] as argument but not vertex, for example board.get:
In readme: board.get(vertex), but in src/GoBoard.js: get([x, y])
Now I am using get([x, y]: Vertex): number | null in GoBoard.d.ts,
is it better to change to get(vertex: Vertex): number | null like readme?

@yishn
Copy link
Member

yishn commented May 26, 2020

Maybe it would be better, yeah. I don't think it makes a technical difference to TypeScript, though.

@yujinlin0224
Copy link
Contributor Author

yujinlin0224 commented May 26, 2020

Is it all fine? Is there any part still need to be changed?

@yishn
Copy link
Member

yishn commented May 26, 2020

Thanks a lot!

@yishn yishn merged commit 8450f49 into SabakiHQ:master May 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants