forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
And fix study acpl chart cursor again by moving the pubsub.on('ply', ...) call into the chart initializer.
- Loading branch information
1 parent
4557bd6
commit d9503c9
Showing
9 changed files
with
349 additions
and
324 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,55 @@ | ||
import type Highcharts from 'highcharts'; | ||
|
||
export interface HighchartsHTMLElement extends HTMLElement { | ||
highcharts: Highcharts.ChartObject; | ||
} | ||
|
||
export interface PlyChart extends Highcharts.ChartObject { | ||
firstPly: number; | ||
selectPly(ply: number, isMainline: boolean): void; | ||
} | ||
|
||
export interface PlyChartHTMLElement extends HTMLElement { | ||
highcharts: PlyChart; | ||
export interface AcplChart extends PlyChart { | ||
updateData(d: AnalyseData, mainline: Tree.Node[]): void; | ||
} | ||
|
||
export interface Division { | ||
middle?: number; | ||
end?: number; | ||
} | ||
|
||
export interface Player { | ||
color: 'white' | 'black'; | ||
blurs?: { | ||
bits?: string; | ||
}; | ||
} | ||
|
||
export interface AnalyseData { | ||
player: Player; | ||
opponent: Player; | ||
treeParts: Tree.Node[]; | ||
game: { | ||
division?: Division; | ||
variant: { | ||
key: string; | ||
}; | ||
moveCentis?: number[]; | ||
status: { | ||
name: string; | ||
}; | ||
}; | ||
analysis?: { | ||
partial: boolean; | ||
}; | ||
clock?: { | ||
running: boolean; | ||
initial: number; | ||
increment: number; | ||
}; | ||
} | ||
|
||
declare global { | ||
interface Window { | ||
readonly LichessChartGame: { | ||
acpl(el: HTMLElement, data: AnalyseData, mainline: Tree.Node[], trans: Trans): Promise<AcplChart>; | ||
movetime(el: HTMLElement, data: AnalyseData, trans: Trans, hunter: boolean): Promise<PlyChart>; | ||
}; | ||
} | ||
} |
Oops, something went wrong.