ultimatedarktowerdisplay 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +44 -24
- package/dist/TowerDisplay.d.ts +6 -2
- package/dist/TowerSideView.d.ts +32 -0
- package/dist/TowerStateReadout.d.ts +2 -1
- package/dist/effectLabels.d.ts +1 -0
- package/dist/index.cjs.js +10710 -17
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.esm.js +10926 -68
- package/dist/index.esm.js.map +1 -1
- package/dist/types.d.ts +16 -1
- package/package.json +8 -8
package/dist/types.d.ts
CHANGED
|
@@ -1,13 +1,28 @@
|
|
|
1
|
-
import type { TowerState } from 'ultimatedarktower';
|
|
1
|
+
import type { TowerState, TowerSide, SealIdentifier } from 'ultimatedarktower';
|
|
2
|
+
export type { TowerSide, SealIdentifier };
|
|
3
|
+
/** Identifies which renderer implementation to use. */
|
|
4
|
+
export type RendererType = 'readout' | 'side-view';
|
|
2
5
|
/** Configuration options for TowerDisplay. */
|
|
3
6
|
export interface TowerDisplayOptions {
|
|
4
7
|
/** DOM element to render into. */
|
|
5
8
|
container: HTMLElement;
|
|
9
|
+
/** Which renderer(s) to show. Defaults to ['readout', 'side-view']. */
|
|
10
|
+
renderers?: RendererType | RendererType[];
|
|
11
|
+
/** Called when the user clicks a seal overlay in the side view. */
|
|
12
|
+
onSealClick?: (seal: SealIdentifier) => void;
|
|
13
|
+
/**
|
|
14
|
+
* When true (the default), clicking a seal toggles its visibility independently
|
|
15
|
+
* of game state. Set to false to disable the built-in toggle and rely solely on
|
|
16
|
+
* {@link ITowerDisplay.applySeals} for seal visibility.
|
|
17
|
+
*/
|
|
18
|
+
clickToToggleSeals?: boolean;
|
|
6
19
|
}
|
|
7
20
|
/** Public interface for all display implementations. */
|
|
8
21
|
export interface ITowerDisplay {
|
|
9
22
|
/** Update the display with a new decoded tower state. */
|
|
10
23
|
applyState(state: TowerState): void;
|
|
24
|
+
/** Update seal visibility — pass the current list of broken seals. */
|
|
25
|
+
applySeals(brokenSeals: SealIdentifier[]): void;
|
|
11
26
|
/** Reset the display to its idle/waiting state. */
|
|
12
27
|
showIdle(): void;
|
|
13
28
|
/** Remove all rendered DOM content and reset internal state. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ultimatedarktowerdisplay",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "DOM-based state readout for the Ultimate Dark Tower board game.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"ci": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"ultimatedarktower": "^2.
|
|
39
|
+
"ultimatedarktower": "^2.5.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/jest": "^29.5.0",
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
44
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
45
|
+
"eslint": "^8.57.0",
|
|
43
46
|
"jest": "^29.7.0",
|
|
44
47
|
"jest-environment-jsdom": "^29.7.0",
|
|
48
|
+
"prettier": "^3.2.0",
|
|
45
49
|
"ts-jest": "^29.1.0",
|
|
46
50
|
"typescript": "^5.4.0",
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"@typescript-eslint/parser": "^7.0.0",
|
|
50
|
-
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
51
|
-
"prettier": "^3.2.0",
|
|
52
|
-
"ultimatedarktower": "^2.1.0"
|
|
51
|
+
"ultimatedarktower": "^2.5.0",
|
|
52
|
+
"vite": "^5.4.0"
|
|
53
53
|
},
|
|
54
54
|
"keywords": [
|
|
55
55
|
"ReturnToDarkTower",
|