@wodzik/cubecore 0.1.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.
Files changed (279) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +118 -0
  3. package/analyze/client.d.ts +18 -0
  4. package/analyze/client.js +42 -0
  5. package/analyze/index.d.ts +114 -0
  6. package/analyze/index.js +151 -0
  7. package/analyze/rotations.d.ts +3 -0
  8. package/analyze/rotations.js +15 -0
  9. package/analyze/roux.d.ts +67 -0
  10. package/analyze/roux.js +95 -0
  11. package/analyze/worker.d.ts +6 -0
  12. package/analyze/worker.js +31 -0
  13. package/analyze/zz.d.ts +47 -0
  14. package/analyze/zz.js +102 -0
  15. package/bld/index.d.ts +14 -0
  16. package/bld/index.js +14 -0
  17. package/bld/memo.d.ts +66 -0
  18. package/bld/memo.js +139 -0
  19. package/bld/scheme.d.ts +30 -0
  20. package/bld/scheme.js +35 -0
  21. package/bld/skin.d.ts +26 -0
  22. package/bld/skin.js +46 -0
  23. package/bld/tracker.d.ts +68 -0
  24. package/bld/tracker.js +145 -0
  25. package/bluetooth/clock.d.ts +22 -0
  26. package/bluetooth/clock.js +37 -0
  27. package/bluetooth/cubeSkins.d.ts +31 -0
  28. package/bluetooth/cubeSkins.js +32 -0
  29. package/bluetooth/gyro.d.ts +31 -0
  30. package/bluetooth/gyro.js +46 -0
  31. package/bluetooth/index.d.ts +5 -0
  32. package/bluetooth/index.js +5 -0
  33. package/bluetooth/session.d.ts +140 -0
  34. package/bluetooth/session.js +201 -0
  35. package/bluetooth/simulated.d.ts +52 -0
  36. package/bluetooth/simulated.js +80 -0
  37. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-definitions.d.ts +38 -0
  38. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-definitions.js +51 -0
  39. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-encrypter.d.ts +35 -0
  40. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-encrypter.js +70 -0
  41. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-protocol.d.ts +273 -0
  42. package/bluetooth/vendor/smartcube-web-bluetooth/gan-cube-protocol.js +846 -0
  43. package/bluetooth/vendor/smartcube-web-bluetooth/gan-gen1.d.ts +38 -0
  44. package/bluetooth/vendor/smartcube-web-bluetooth/gan-gen1.js +340 -0
  45. package/bluetooth/vendor/smartcube-web-bluetooth/gan-gen234-packet-validate.d.ts +11 -0
  46. package/bluetooth/vendor/smartcube-web-bluetooth/gan-gen234-packet-validate.js +118 -0
  47. package/bluetooth/vendor/smartcube-web-bluetooth/gan-mac-salt.d.ts +2 -0
  48. package/bluetooth/vendor/smartcube-web-bluetooth/gan-mac-salt.js +15 -0
  49. package/bluetooth/vendor/smartcube-web-bluetooth/gan-smart-cube.d.ts +18 -0
  50. package/bluetooth/vendor/smartcube-web-bluetooth/gan-smart-cube.js +152 -0
  51. package/bluetooth/vendor/smartcube-web-bluetooth/gan-smart-timer.d.ts +74 -0
  52. package/bluetooth/vendor/smartcube-web-bluetooth/gan-smart-timer.js +161 -0
  53. package/bluetooth/vendor/smartcube-web-bluetooth/gan-write-queue.d.ts +7 -0
  54. package/bluetooth/vendor/smartcube-web-bluetooth/gan-write-queue.js +11 -0
  55. package/bluetooth/vendor/smartcube-web-bluetooth/gatt-characteristic-write.d.ts +2 -0
  56. package/bluetooth/vendor/smartcube-web-bluetooth/gatt-characteristic-write.js +36 -0
  57. package/bluetooth/vendor/smartcube-web-bluetooth/index.d.ts +4 -0
  58. package/bluetooth/vendor/smartcube-web-bluetooth/index.js +4 -0
  59. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/address-hints.d.ts +12 -0
  60. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/address-hints.js +122 -0
  61. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/build-picker-options.d.ts +11 -0
  62. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/build-picker-options.js +55 -0
  63. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/default-optional-services.d.ts +21 -0
  64. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/default-optional-services.js +47 -0
  65. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/device-name-scan-filters.d.ts +6 -0
  66. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/device-name-scan-filters.js +24 -0
  67. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/gatt-snapshot.d.ts +6 -0
  68. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/gatt-snapshot.js +57 -0
  69. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-candidates.d.ts +11 -0
  70. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-candidates.js +67 -0
  71. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-probe-moyu32.d.ts +8 -0
  72. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-probe-moyu32.js +98 -0
  73. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-probe-qiyi.d.ts +8 -0
  74. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/mac-probe-qiyi.js +128 -0
  75. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/moyu32-session-crypto.d.ts +5 -0
  76. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/moyu32-session-crypto.js +60 -0
  77. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/normalize-uuid.d.ts +2 -0
  78. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/normalize-uuid.js +8 -0
  79. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/packet-sanity.d.ts +7 -0
  80. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/packet-sanity.js +142 -0
  81. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/profile-rank.d.ts +6 -0
  82. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/profile-rank.js +21 -0
  83. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/types.d.ts +32 -0
  84. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/attachment/types.js +1 -0
  85. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/ble-utils.d.ts +6 -0
  86. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/ble-utils.js +68 -0
  87. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/connect.d.ts +3 -0
  88. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/connect.js +178 -0
  89. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/cubie-cube.d.ts +16 -0
  90. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/cubie-cube.js +141 -0
  91. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/index.d.ts +11 -0
  92. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/index.js +10 -0
  93. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocol.d.ts +26 -0
  94. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocol.js +8 -0
  95. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/gan.d.ts +3 -0
  96. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/gan.js +265 -0
  97. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/giiker.d.ts +3 -0
  98. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/giiker.js +345 -0
  99. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/gocube.d.ts +15 -0
  100. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/gocube.js +382 -0
  101. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu-mhc.d.ts +3 -0
  102. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu-mhc.js +352 -0
  103. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu-v1.d.ts +57 -0
  104. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu-v1.js +243 -0
  105. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu32.d.ts +3 -0
  106. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/moyu32.js +454 -0
  107. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/qiyi.d.ts +3 -0
  108. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/protocols/qiyi.js +424 -0
  109. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/types.d.ts +78 -0
  110. package/bluetooth/vendor/smartcube-web-bluetooth/smartcube/types.js +1 -0
  111. package/bluetooth/vendor/smartcube-web-bluetooth/utils.d.ts +45 -0
  112. package/bluetooth/vendor/smartcube-web-bluetooth/utils.js +150 -0
  113. package/cfop/caseData.d.ts +16 -0
  114. package/cfop/caseData.js +88 -0
  115. package/cfop/cases.d.ts +42 -0
  116. package/cfop/cases.js +116 -0
  117. package/cfop/f2l.d.ts +28 -0
  118. package/cfop/f2l.js +88 -0
  119. package/cfop/f2lData.d.ts +15 -0
  120. package/cfop/f2lData.js +49 -0
  121. package/cfop/index.d.ts +41 -0
  122. package/cfop/index.js +110 -0
  123. package/cfop/slots.d.ts +2 -0
  124. package/cfop/slots.js +1 -0
  125. package/core/arrows.d.ts +24 -0
  126. package/core/arrows.js +22 -0
  127. package/core/bytes.d.ts +27 -0
  128. package/core/bytes.js +145 -0
  129. package/core/centers.d.ts +32 -0
  130. package/core/centers.js +83 -0
  131. package/core/checks.d.ts +53 -0
  132. package/core/checks.js +85 -0
  133. package/core/cubies.d.ts +45 -0
  134. package/core/cubies.js +169 -0
  135. package/core/frames.d.ts +61 -0
  136. package/core/frames.js +126 -0
  137. package/core/geometry.d.ts +58 -0
  138. package/core/geometry.js +132 -0
  139. package/core/index.d.ts +19 -0
  140. package/core/index.js +19 -0
  141. package/core/masks.d.ts +32 -0
  142. package/core/masks.js +39 -0
  143. package/core/method.d.ts +35 -0
  144. package/core/method.js +30 -0
  145. package/core/moves.d.ts +48 -0
  146. package/core/moves.js +88 -0
  147. package/core/notation.d.ts +48 -0
  148. package/core/notation.js +226 -0
  149. package/core/physical.d.ts +53 -0
  150. package/core/physical.js +99 -0
  151. package/core/practice.d.ts +62 -0
  152. package/core/practice.js +87 -0
  153. package/core/sequence.d.ts +90 -0
  154. package/core/sequence.js +157 -0
  155. package/core/stages.d.ts +90 -0
  156. package/core/stages.js +21 -0
  157. package/core/state.d.ts +55 -0
  158. package/core/state.js +140 -0
  159. package/core/stateCodec.d.ts +12 -0
  160. package/core/stateCodec.js +51 -0
  161. package/core/stream.d.ts +45 -0
  162. package/core/stream.js +75 -0
  163. package/core/tracker.d.ts +62 -0
  164. package/core/tracker.js +121 -0
  165. package/element/alg.d.ts +45 -0
  166. package/element/alg.js +150 -0
  167. package/element/base.d.ts +2 -0
  168. package/element/base.js +3 -0
  169. package/element/bld.d.ts +82 -0
  170. package/element/bld.js +222 -0
  171. package/element/index.d.ts +8 -0
  172. package/element/index.js +21 -0
  173. package/element/model.d.ts +36 -0
  174. package/element/model.js +64 -0
  175. package/element/player.d.ts +196 -0
  176. package/element/player.js +680 -0
  177. package/element/practice.d.ts +75 -0
  178. package/element/practice.js +150 -0
  179. package/element/scramble.d.ts +50 -0
  180. package/element/scramble.js +107 -0
  181. package/element/sequence.d.ts +126 -0
  182. package/element/sequence.js +254 -0
  183. package/element/styles.d.ts +32 -0
  184. package/element/styles.js +196 -0
  185. package/image/cache.d.ts +21 -0
  186. package/image/cache.js +66 -0
  187. package/image/index.d.ts +2 -0
  188. package/image/index.js +2 -0
  189. package/image/png-node.d.ts +6 -0
  190. package/image/png-node.js +10 -0
  191. package/image/svg.d.ts +36 -0
  192. package/image/svg.js +215 -0
  193. package/lbl/index.d.ts +10 -0
  194. package/lbl/index.js +31 -0
  195. package/methods/index.d.ts +20 -0
  196. package/methods/index.js +33 -0
  197. package/package.json +133 -0
  198. package/petrus/index.d.ts +11 -0
  199. package/petrus/index.js +27 -0
  200. package/react/index.d.ts +176 -0
  201. package/react/index.js +228 -0
  202. package/render/arrows.d.ts +68 -0
  203. package/render/arrows.js +190 -0
  204. package/render/build/attachments.d.ts +35 -0
  205. package/render/build/attachments.js +94 -0
  206. package/render/build/models.d.ts +9 -0
  207. package/render/build/models.js +27 -0
  208. package/render/build/tiles.d.ts +48 -0
  209. package/render/build/tiles.js +194 -0
  210. package/render/gltf.d.ts +10 -0
  211. package/render/gltf.js +106 -0
  212. package/render/index.d.ts +12 -0
  213. package/render/index.js +12 -0
  214. package/render/layers.d.ts +21 -0
  215. package/render/layers.js +24 -0
  216. package/render/pictures.d.ts +46 -0
  217. package/render/pictures.js +80 -0
  218. package/render/pieceModels.d.ts +38 -0
  219. package/render/pieceModels.js +43 -0
  220. package/render/renderer.d.ts +165 -0
  221. package/render/renderer.js +647 -0
  222. package/render/tile.d.ts +114 -0
  223. package/render/tile.js +390 -0
  224. package/render/viewports.d.ts +25 -0
  225. package/render/viewports.js +26 -0
  226. package/roux/cmll.d.ts +35 -0
  227. package/roux/cmll.js +121 -0
  228. package/roux/cmllData.d.ts +12 -0
  229. package/roux/cmllData.js +49 -0
  230. package/roux/index.d.ts +52 -0
  231. package/roux/index.js +175 -0
  232. package/skin/attachments.d.ts +82 -0
  233. package/skin/attachments.js +110 -0
  234. package/skin/index.d.ts +3 -0
  235. package/skin/index.js +3 -0
  236. package/skin/shapes.d.ts +112 -0
  237. package/skin/shapes.js +147 -0
  238. package/skin/skin.d.ts +911 -0
  239. package/skin/skin.js +412 -0
  240. package/solve/client.d.ts +58 -0
  241. package/solve/client.js +56 -0
  242. package/solve/handle.d.ts +6 -0
  243. package/solve/handle.js +38 -0
  244. package/solve/index.d.ts +8 -0
  245. package/solve/index.js +7 -0
  246. package/solve/lse.d.ts +42 -0
  247. package/solve/lse.js +151 -0
  248. package/solve/pieces.d.ts +18 -0
  249. package/solve/pieces.js +24 -0
  250. package/solve/protocol.d.ts +70 -0
  251. package/solve/protocol.js +16 -0
  252. package/solve/scramble.d.ts +76 -0
  253. package/solve/scramble.js +187 -0
  254. package/solve/stage.d.ts +108 -0
  255. package/solve/stage.js +532 -0
  256. package/solve/twophase.d.ts +36 -0
  257. package/solve/twophase.js +229 -0
  258. package/solve/worker.d.ts +6 -0
  259. package/solve/worker.js +15 -0
  260. package/timeline/codec.d.ts +23 -0
  261. package/timeline/codec.js +84 -0
  262. package/timeline/index.d.ts +7 -0
  263. package/timeline/index.js +7 -0
  264. package/timeline/recording.d.ts +19 -0
  265. package/timeline/recording.js +20 -0
  266. package/timeline/replay.d.ts +68 -0
  267. package/timeline/replay.js +145 -0
  268. package/timeline/segments.d.ts +31 -0
  269. package/timeline/segments.js +39 -0
  270. package/timeline/share.d.ts +30 -0
  271. package/timeline/share.js +62 -0
  272. package/timeline/stats.d.ts +34 -0
  273. package/timeline/stats.js +56 -0
  274. package/timeline/timings.d.ts +30 -0
  275. package/timeline/timings.js +54 -0
  276. package/zz/index.d.ts +29 -0
  277. package/zz/index.js +68 -0
  278. package/zz/seeds.d.ts +9 -0
  279. package/zz/seeds.js +29 -0
@@ -0,0 +1,196 @@
1
+ /**
2
+ * <cube-player> — a cube that plays an algorithm or a recorded solve, with
3
+ * optional controls and progress bar. Three levels of customisation:
4
+ *
5
+ * 1. use it as is: <cube-player alg="R U R' U'" progress></cube-player>
6
+ * 2. restyle it: CSS variables (--cc-accent…) and ::part(button-play)… — see styles.ts
7
+ * 3. bring your own controls: <cube-player controls="none"> or a child with slot="controls",
8
+ * driven by play() / pause() / seek() / stepForward()… and events.
9
+ *
10
+ * Attributes: alg, setup, anchor ("start": play the algorithm from the
11
+ * (set-up) cube — default; "end": the algorithm SOLVES it, so the cube
12
+ * starts at setup + inverse of the algorithm), tempo (moves per second,
13
+ * default 2), skin (preset name), theme ("light" | "dark" | "auto" — the
14
+ * skin's adjustments for the page; auto follows the system), back-view, visualization ("3d" | "net" |
15
+ * "top" — the 2D views are SVG pictures from @cubecore/image), controls
16
+ * ("default" | "none"), max-pause (ms: recorded pauses longer than this are
17
+ * shortened in the replay), progress (show the bar), markers (ticks at section
18
+ * ends), segment-labels (section names under the bar — click one to jump to
19
+ * it), tooltips ("off" to hide the section popup).
20
+ *
21
+ * Sections: `segments` (any [{ start, end, label, id?, detail?, split?,
22
+ * moves?, color? }] — see @cubecore/timeline Segment), or `method`, which
23
+ * computes them from the recording (stageSegments: any Method, colour
24
+ * neutral). The bar colours each section (palette --cc-segment-1…8 or the
25
+ * segment's colour), hatches the recognition part (before `split`), and
26
+ * shows a popup over the section under the pointer / at the playhead
27
+ * (`formatSegment` for your own text). PageUp / PageDown jump between sections.
28
+ * Properties: recording (a timed solve — plays in real time), alg, setup,
29
+ * skin, mask, method (sections from it), segments, formatSegment, markers, speeds, rate,
30
+ * currentTime, duration, playing, renderer.
31
+ * Events: timeupdate {time, duration, applied}, play, pause, ended,
32
+ * error {message} (e.g. an algorithm that doesn't parse — the cube then shows the setup),
33
+ * segmentchange {index, segment} (the playhead entered another section),
34
+ * load (what plays changed — alg, setup, recording…).
35
+ *
36
+ * Live: `attach(session)` follows a smart cube (a @cubecore/bluetooth
37
+ * SmartCubeSession, or anything with the same events) — its moves animate,
38
+ * resyncs jump, the gyro turns the cube; replay controls hide (`live`
39
+ * attribute). `detach()` goes back to playback.
40
+ */
41
+ /** What `attach` needs — SmartCubeSession fits; so does anything shaped like it. */
42
+ export interface LiveSource {
43
+ readonly state: State;
44
+ /** A skin for this cube (SmartCubeSession has one); used with attach(…, { autoSkin: true }). */
45
+ readonly suggestedSkin?: Skin;
46
+ on(type: "move", listener: (e: {
47
+ move: Move;
48
+ }) => void): () => void;
49
+ on(type: "state", listener: (e: {
50
+ state: State;
51
+ reason: string;
52
+ }) => void): () => void;
53
+ on(type: "orientation", listener: (q: {
54
+ x: number;
55
+ y: number;
56
+ z: number;
57
+ w: number;
58
+ }) => void): () => void;
59
+ }
60
+ import { type Mask, type Method, type Move, type State, type TurnArrow } from "../core/index.js";
61
+ import { type ArrowStyle, CubeRenderer } from "../render/index.js";
62
+ import { type Skin } from "../skin/index.js";
63
+ import { type Recording, type Segment } from "../timeline/index.js";
64
+ import { type Marker } from "./model.js";
65
+ import { ElementBase } from "./base.js";
66
+ export declare class CubePlayer extends ElementBase {
67
+ static observedAttributes: string[];
68
+ private readonly darkQuery;
69
+ private readonly onScheme;
70
+ private readonly root;
71
+ private _renderer;
72
+ private connected;
73
+ /** The smart cube followed (attach), if any. */
74
+ private liveSource;
75
+ private turnArrows;
76
+ private clock;
77
+ private unsubscribe;
78
+ private rec;
79
+ private start;
80
+ private startMoves;
81
+ private _recording;
82
+ private _skin;
83
+ private _mask;
84
+ private _method;
85
+ private _markers;
86
+ private _segments;
87
+ private segs;
88
+ private currentSegment;
89
+ private tooltipHide;
90
+ /** Tooltip text of a section (default: label · detail · time (recognition · execution) · moves). */
91
+ formatSegment: (s: Segment) => string;
92
+ private _speeds;
93
+ private _rate;
94
+ private _setupState;
95
+ private liveOff;
96
+ constructor();
97
+ connectedCallback(): void;
98
+ disconnectedCallback(): void;
99
+ /**
100
+ * The WebGL renderer exists only while the 3D view is shown: a page with
101
+ * many 2D pictures (case lists) must not use up the browser's WebGL
102
+ * contexts (~16 — past that the oldest canvas goes blank).
103
+ */
104
+ private syncRenderer;
105
+ attributeChangedCallback(name: string): void;
106
+ /** A timed solve: plays in real time (pauses stay pauses). Takes precedence over `alg`. */
107
+ get recording(): Recording | null;
108
+ set recording(r: Recording | null);
109
+ get alg(): string;
110
+ set alg(v: string);
111
+ /** Moves (or a state) that set the cube up before it plays. */
112
+ get setup(): string;
113
+ set setup(v: string | State);
114
+ get skin(): Skin;
115
+ set skin(s: Skin | string);
116
+ get mask(): Mask | null;
117
+ set mask(m: Mask | null);
118
+ /** Sections come from this method's analysis of the recording (colour neutral), unless `segments` are given. */
119
+ get method(): Method | null;
120
+ set method(m: Method | null);
121
+ /** Explicit sections of the bar (override `method`). */
122
+ get segments(): Segment[];
123
+ set segments(s: Segment[] | null);
124
+ /** Explicit tick marks (default: the ends of the sections). */
125
+ get markers(): Marker[] | null;
126
+ set markers(m: Marker[] | null);
127
+ /** Speeds the speed button cycles through. */
128
+ get speeds(): number[];
129
+ set speeds(v: number[]);
130
+ /** The underlying renderer, for anything the element doesn't expose. */
131
+ get renderer(): CubeRenderer | null;
132
+ get playing(): boolean;
133
+ get currentTime(): number;
134
+ get duration(): number;
135
+ get rate(): number;
136
+ set rate(r: number);
137
+ play(): void;
138
+ pause(): void;
139
+ toggle(): void;
140
+ seek(ms: number): void;
141
+ /** Jump to the moment `k` moves are done (0 = the start). */
142
+ seekToMove(k: number): void;
143
+ /** Moves done at the current time. */
144
+ get applied(): number;
145
+ /** The moves being played (the algorithm, or the recording's moves). */
146
+ get moves(): Move[];
147
+ stepForward(): void;
148
+ stepBack(): void;
149
+ toStart(): void;
150
+ toEnd(): void;
151
+ /** Follow a smart cube: its moves animate, resyncs jump, its gyro turns the cube. Returns detach. */
152
+ attach(source: LiveSource, options?: {
153
+ gyro?: boolean;
154
+ gyroSmoothing?: number;
155
+ autoSkin?: boolean;
156
+ }): () => void;
157
+ /** Stop following a live cube and go back to playback. */
158
+ detach(): void;
159
+ /**
160
+ * Arrows for the next turn on the 3D cube (a tracker's `nextTurn().arrows`).
161
+ * `owner` (e.g. the <cube-scramble> setting them): clearing with null only
162
+ * works for the one that set them last, so two elements can share a player.
163
+ */
164
+ showTurnArrows(arrows: readonly TurnArrow[] | null, style?: ArrowStyle, owner?: unknown): void;
165
+ /** Animate one move now (live input without a session). */
166
+ pushMove(move: Move | string): void;
167
+ private $;
168
+ private resolveSkin;
169
+ private load;
170
+ private lastPos;
171
+ /** Play / pause icon currently shown (null: not drawn yet). */
172
+ private shownPlaying;
173
+ private onTime;
174
+ /** "light" / "dark" from the theme attribute; "auto" (default) follows the system setting. */
175
+ private resolvedTheme;
176
+ private applyTheme;
177
+ /** 2D visualizations: an SVG of the position (moves applied so far) with the same skin and mask. */
178
+ private redraw;
179
+ private updateUi;
180
+ private renderSections;
181
+ private updateSections;
182
+ /** Show the popup of section `index` (−1 hides it). */
183
+ private showTooltip;
184
+ /** Start of the next (+1) / this-or-previous (−1) section. */
185
+ private jumpSection;
186
+ private onClick;
187
+ private onKey;
188
+ private wireProgress;
189
+ }
190
+ /** Register the element (idempotent). */
191
+ export declare function defineCubePlayer(tag?: string): void;
192
+ declare global {
193
+ interface HTMLElementTagNameMap {
194
+ "cube-player": CubePlayer;
195
+ }
196
+ }