Skip to content

Commit

Permalink
Merge branch 'master' of github.com:willb335/chessboardjsx
Browse files Browse the repository at this point in the history
  • Loading branch information
willb335 committed Sep 3, 2019
2 parents 6a7b2b8 + 8a5cb3c commit 54839f5
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 33 deletions.
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,15 @@
"code",
"doc"
]
},
{
"login": "altruisticsoftware",
"name": "Chris",
"avatar_url": "https://avatars3.githubusercontent.com/u/12105346?v=4",
"profile": "https://github.com/altruisticsoftware",
"contributions": [
"code"
]
}
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This project follows the [all-contributors](https://github.com/kentcdodds/all-co
<!-- prettier-ignore -->
| [<img src="https://avatars2.githubusercontent.com/u/10157307?v=4" width="100px;"/><br /><sub><b>Will</b></sub>](https://github.com/willb335)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=willb335 "Code") [📖](https://github.com/willb335/chessboardjsx/commits?author=willb335 "Documentation") [💡](#example-willb335 "Examples") [⚠️](https://github.com/willb335/chessboardjsx/commits?author=willb335 "Tests") | [<img src="https://avatars3.githubusercontent.com/u/146082?v=4" width="100px;"/><br /><sub><b>Andrew Bashelor</b></sub>](https://github.com/a-bash)<br />[📖](https://github.com/willb335/chessboardjsx/commits?author=a-bash "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/25490975?v=4" width="100px;"/><br /><sub><b>yougotgotyo</b></sub>](https://chadburg.com/)<br />[🤔](#ideas-yougotgotyo "Ideas, Planning, & Feedback") | [<img src="https://avatars0.githubusercontent.com/u/385366?v=4" width="100px;"/><br /><sub><b>Roger Knapp</b></sub>](http://csharptest.net)<br />[🤔](#ideas-csharptest "Ideas, Planning, & Feedback") | [<img src="https://avatars1.githubusercontent.com/u/37779?v=4" width="100px;"/><br /><sub><b>Tiago Serafim</b></sub>](https://github.com/slig)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=slig "Code") [📖](https://github.com/willb335/chessboardjsx/commits?author=slig "Documentation") | [<img src="https://avatars1.githubusercontent.com/u/536006?v=4" width="100px;"/><br /><sub><b>Kef Schecter</b></sub>](http://www.furrykef.com/)<br />[🐛](https://github.com/willb335/chessboardjsx/issues?q=author%3Afurrykef "Bug reports") | [<img src="https://avatars0.githubusercontent.com/u/42919?v=4" width="100px;"/><br /><sub><b>Nils-Helge Garli Hegvik</b></sub>](http://www.lånekalkulatoren.no)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=nilsga "Code") |
| :---: | :---: | :---: | :---: | :---: | :---: | :---: |
| [<img src="https://avatars1.githubusercontent.com/u/10798199?v=4" width="100px;"/><br /><sub><b>Levi Durfee</b></sub>](https://levi.lol/)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=levidurfee "Code") [📖](https://github.com/willb335/chessboardjsx/commits?author=levidurfee "Documentation") |
| [<img src="https://avatars1.githubusercontent.com/u/10798199?v=4" width="100px;"/><br /><sub><b>Levi Durfee</b></sub>](https://levi.lol/)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=levidurfee "Code") [📖](https://github.com/willb335/chessboardjsx/commits?author=levidurfee "Documentation") | [<img src="https://avatars3.githubusercontent.com/u/12105346?v=4" width="100px;"/><br /><sub><b>Chris</b></sub>](https://github.com/altruisticsoftware)<br />[💻](https://github.com/willb335/chessboardjsx/commits?author=altruisticsoftware "Code") |
<!-- ALL-CONTRIBUTORS-LIST:END -->

## LICENSE
Expand Down
30 changes: 10 additions & 20 deletions chessboard.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
import { Component, CSSProperties } from 'react';

type Square =
'a8' | 'b8' | 'c8' | 'd8' | 'e8' | 'f8' | 'g8' | 'h8' |
'a7' | 'b7' | 'c7' | 'd7' | 'e7' | 'f7' | 'g7' | 'h7' |
'a6' | 'b6' | 'c6' | 'd6' | 'e6' | 'f6' | 'g6' | 'h6' |
'a5' | 'b5' | 'c5' | 'd5' | 'e5' | 'f5' | 'g5' | 'h5' |
'a4' | 'b4' | 'c4' | 'd4' | 'e4' | 'f4' | 'g4' | 'h4' |
'a3' | 'b3' | 'c3' | 'd3' | 'e3' | 'f3' | 'g3' | 'h3' |
'a2' | 'b2' | 'c2' | 'd2' | 'e2' | 'f2' | 'g2' | 'h2' |
'a1' | 'b1' | 'c1' | 'd1' | 'e1' | 'f1' | 'g1' | 'h1'
;
import { Square } from "chess.js"

type Piece =
'wP' | 'wN' | 'wB' | 'wR' | 'wQ' | 'wK' |
Expand All @@ -21,11 +11,11 @@ type Position = {
}

type CustomPieces = {
[piece in Piece]?: (obj: {isDragging: boolean, squareWidth: number, droppedPiece: string, targetSquare: string, sourceSquare: string}) => JSX.Element
[piece in Piece]?: (obj: {isDragging: boolean, squareWidth: number, droppedPiece: Piece, targetSquare: Square, sourceSquare: Square}) => JSX.Element
}

interface Props {
allowDrag?: (obj: {piece: string, sourceSquare: string}) => boolean,
allowDrag?: (obj: {piece: Piece, sourceSquare: Square}) => boolean,
boardStyle?: CSSProperties,
calcWidth?: (obj: {screenWidth: number, screenHeight: number}) => number,
darkSquareStyle?: CSSProperties,
Expand All @@ -35,13 +25,13 @@ interface Props {
getPosition?: (currentPosition: Position) => void,
id?: string | number,
lightSquareStyle?: CSSProperties,
onDragOverSquare?: (square: string) => void,
onDrop?: (obj: {sourceSquare: string, targetSquare: string, piece: string}) => void,
onMouseOutSquare?: (square: string) => void,
onMouseOverSquare?: (square: string) => void,
onPieceClick?: (piece: string) => void,
onSquareClick?: (square: string) => void,
onSquareRightClick?: (square: string) => void,
onDragOverSquare?: (square: Square) => void,
onDrop?: (obj: {sourceSquare: Square, targetSquare: Square, piece: Piece}) => void,
onMouseOutSquare?: (square: Square) => void,
onMouseOverSquare?: (square: Square) => void,
onPieceClick?: (piece: Piece) => void,
onSquareClick?: (square: Square) => void,
onSquareRightClick?: (square: Square) => void,
orientation?: 'white' | 'black',
pieces?: CustomPieces,
position?: string | Position,
Expand Down
52 changes: 40 additions & 12 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"@babel/register": "7.0.0-beta.51",
"@commitlint/cli": "6.2.0",
"@commitlint/config-conventional": "6.1.3",
"@types/chess.js": "^0.10.0",
"all-contributors-cli": "5.2.0",
"babel-cli": "6.26.0",
"babel-core": "7.0.0-bridge.0",
Expand Down

0 comments on commit 54839f5

Please sign in to comment.