cubing 0.63.3 → 0.63.5

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 (153) hide show
  1. package/README.md +15 -1
  2. package/alg/index.d.ts +1 -1
  3. package/bluetooth/index.d.ts +1 -1
  4. package/dist/bin/chunks/{chunk-OI3YIXMQ.js → chunk-22VWCGBC.js} +2 -2
  5. package/dist/bin/order.js +8 -4
  6. package/dist/bin/order.js.map +2 -2
  7. package/dist/bin/puzzle-geometry-bin.js +8 -4
  8. package/dist/bin/puzzle-geometry-bin.js.map +2 -2
  9. package/dist/bin/scramble.js +8 -4
  10. package/dist/bin/scramble.js.map +2 -2
  11. package/dist/bin/svg.js +56 -0
  12. package/dist/bin/svg.js.map +7 -0
  13. package/dist/lib/cubing/alg/index.d.ts +2 -84
  14. package/dist/lib/cubing/alg/index.js +1 -1
  15. package/dist/lib/cubing/bluetooth/index.d.ts +147 -134
  16. package/dist/lib/cubing/bluetooth/index.js +29 -5
  17. package/dist/lib/cubing/bluetooth/index.js.map +2 -2
  18. package/dist/lib/cubing/chunks/{big-puzzle-orientation-ZVZQJEF5.js → big-puzzle-orientation-ADWIOX6S.js} +2 -2
  19. package/dist/lib/cubing/chunks/{chunk-RINY3U6G.js → chunk-5ONX3JVC.js} +7 -2
  20. package/dist/lib/cubing/chunks/{chunk-RINY3U6G.js.map → chunk-5ONX3JVC.js.map} +1 -1
  21. package/dist/lib/cubing/chunks/{chunk-ROB5TROI.js → chunk-7LXHWXCO.js} +2 -2
  22. package/dist/lib/cubing/chunks/{chunk-FUHYAW74.js → chunk-A7FK4XKU.js} +49 -63
  23. package/dist/lib/cubing/chunks/chunk-A7FK4XKU.js.map +7 -0
  24. package/dist/lib/cubing/chunks/{chunk-FLK6AZKB.js → chunk-FUAADKXE.js} +7 -7
  25. package/dist/lib/cubing/chunks/{chunk-FLK6AZKB.js.map → chunk-FUAADKXE.js.map} +2 -2
  26. package/dist/lib/cubing/chunks/{chunk-E3YLQC45.js → chunk-GHFBZYSV.js} +2 -2
  27. package/dist/lib/cubing/chunks/chunk-GHFBZYSV.js.map +7 -0
  28. package/dist/lib/cubing/chunks/{chunk-FTE3QI5X.js → chunk-H5KMIDAF.js} +42 -47
  29. package/dist/lib/cubing/chunks/chunk-H5KMIDAF.js.map +7 -0
  30. package/dist/lib/cubing/chunks/{chunk-NGW52SHR.js → chunk-MQSQDKWH.js} +3 -3
  31. package/dist/lib/cubing/chunks/{chunk-O6HEZXGY.js → chunk-N5FJ5YIA.js} +4 -3
  32. package/dist/lib/cubing/chunks/{chunk-O6HEZXGY.js.map → chunk-N5FJ5YIA.js.map} +1 -1
  33. package/dist/lib/cubing/chunks/{chunk-ZU7PSGX4.js → chunk-UEUJSZTX.js} +4 -3
  34. package/dist/lib/cubing/chunks/{chunk-ZU7PSGX4.js.map → chunk-UEUJSZTX.js.map} +1 -1
  35. package/dist/lib/cubing/chunks/{chunk-44CFF24P.js → chunk-WMKAKGVZ.js} +46 -17
  36. package/dist/lib/cubing/chunks/chunk-WMKAKGVZ.js.map +7 -0
  37. package/dist/lib/cubing/chunks/{chunk-DQGYYYHZ.js → chunk-YR72E7KZ.js} +28 -13
  38. package/dist/lib/cubing/chunks/chunk-YR72E7KZ.js.map +7 -0
  39. package/dist/lib/cubing/chunks/{inside-L2JI2BEY.js → inside-LSPIPZY2.js} +53 -25
  40. package/dist/lib/cubing/chunks/inside-LSPIPZY2.js.map +7 -0
  41. package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js +132 -0
  42. package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-AIGABOAR.js.map +7 -0
  43. package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-XFECDWOF.js → search-dynamic-sgs-side-events-WORUZVF5.js} +6 -5
  44. package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-CM33KT7L.js → search-dynamic-sgs-unofficial-5JQKPNG2.js} +6 -5
  45. package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-NANDMURR.js → search-dynamic-solve-4x4x4-KIH4YATU.js} +7 -6
  46. package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-UZMNOI6U.js → search-dynamic-solve-fto-I5ID5LXD.js} +2 -2
  47. package/dist/lib/cubing/chunks/search-dynamic-solve-kilominx-Y2D3C74Y.js +771 -0
  48. package/dist/lib/cubing/chunks/search-dynamic-solve-kilominx-Y2D3C74Y.js.map +7 -0
  49. package/dist/lib/cubing/chunks/search-worker-entry.js +7 -6
  50. package/dist/lib/cubing/chunks/search-worker-entry.js.map +2 -2
  51. package/dist/lib/cubing/chunks/{twips-YHXBF55O.js → twips-ZNMKGC5U.js} +4 -4
  52. package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-AP2O4LGG.js +10 -0
  53. package/dist/lib/cubing/chunks/twips_wasm_bg-TJNYGA2C-AP2O4LGG.js.map +7 -0
  54. package/dist/lib/cubing/chunks/{twisty-dynamic-3d-VGZIQ64W.js → twisty-dynamic-3d-4BEQ76PB.js} +22 -7
  55. package/dist/lib/cubing/chunks/{twisty-dynamic-3d-VGZIQ64W.js.map → twisty-dynamic-3d-4BEQ76PB.js.map} +2 -2
  56. package/dist/lib/cubing/index-BXHm_6gm.d.ts +2626 -0
  57. package/dist/lib/cubing/index-Cvk652Bd.d.ts +76 -0
  58. package/dist/lib/cubing/kpuzzle/index.d.ts +2 -3
  59. package/dist/lib/cubing/kpuzzle/index.js +2 -2
  60. package/dist/lib/cubing/notation/index.d.ts +18 -17
  61. package/dist/lib/cubing/notation/index.js +4 -4
  62. package/dist/lib/cubing/outside-C2ODxIX_.d.ts +39 -0
  63. package/dist/lib/cubing/protocol/index.d.ts +14 -14
  64. package/dist/lib/cubing/protocol/index.js +4 -4
  65. package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -8
  66. package/dist/lib/cubing/puzzle-geometry/index.js +33 -1
  67. package/dist/lib/cubing/puzzle-geometry/index.js.map +1 -1
  68. package/dist/lib/cubing/puzzles/index.d.ts +2 -45
  69. package/dist/lib/cubing/puzzles/index.js +4 -4
  70. package/dist/lib/cubing/scramble/index.d.ts +2 -4
  71. package/dist/lib/cubing/scramble/index.js +6 -6
  72. package/dist/lib/cubing/search/index.d.ts +4 -9
  73. package/dist/lib/cubing/search/index.js +6 -6
  74. package/dist/lib/cubing/stream/index.d.ts +2 -45
  75. package/dist/lib/cubing/stream/index.js +1 -1
  76. package/dist/lib/cubing/twisty/index.d.ts +2 -60
  77. package/dist/lib/cubing/twisty/index.js +66 -18
  78. package/dist/lib/cubing/twisty/index.js.map +2 -2
  79. package/experimental-json-schema/kpuzzle/KPatternData.schema.json +27 -29
  80. package/experimental-json-schema/kpuzzle/KPuzzleDefinition.schema.json +82 -78
  81. package/experimental-json-schema/kpuzzle/KTransformationData.schema.json +21 -22
  82. package/kpuzzle/index.d.ts +1 -1
  83. package/notation/index.d.ts +1 -1
  84. package/package.json +25 -21
  85. package/protocol/index.d.ts +1 -1
  86. package/puzzle-geometry/index.d.ts +1 -1
  87. package/puzzles/index.d.ts +1 -1
  88. package/scramble/index.d.ts +1 -1
  89. package/search/index.d.ts +1 -1
  90. package/stream/index.d.ts +1 -1
  91. package/twisty/index.d.ts +1 -1
  92. package/dist/lib/cubing/PuzzleLoader-Bp8zngUn.d.ts +0 -2362
  93. package/dist/lib/cubing/chunks/chunk-44CFF24P.js.map +0 -7
  94. package/dist/lib/cubing/chunks/chunk-DQGYYYHZ.js.map +0 -7
  95. package/dist/lib/cubing/chunks/chunk-E3YLQC45.js.map +0 -7
  96. package/dist/lib/cubing/chunks/chunk-FTE3QI5X.js.map +0 -7
  97. package/dist/lib/cubing/chunks/chunk-FUHYAW74.js.map +0 -7
  98. package/dist/lib/cubing/chunks/chunk-FZBKZ5ZB.js +0 -265
  99. package/dist/lib/cubing/chunks/chunk-LWCBAAHO.js +0 -1180
  100. package/dist/lib/cubing/chunks/chunk-LWCBAAHO.js.map +0 -7
  101. package/dist/lib/cubing/chunks/chunk-M7YKTETT.js +0 -239
  102. package/dist/lib/cubing/chunks/chunk-M7YKTETT.js.map +0 -7
  103. package/dist/lib/cubing/chunks/chunk-NGW52SHR.js.map +0 -7
  104. package/dist/lib/cubing/chunks/chunk-OUM32GEA.js +0 -239
  105. package/dist/lib/cubing/chunks/chunk-OUM32GEA.js.map +0 -7
  106. package/dist/lib/cubing/chunks/chunk-SGJ5WPE4.js +0 -1074
  107. package/dist/lib/cubing/chunks/chunk-SGJ5WPE4.js.map +0 -7
  108. package/dist/lib/cubing/chunks/chunk-TAVR35KU.js +0 -265
  109. package/dist/lib/cubing/chunks/chunk-TAVR35KU.js.map +0 -7
  110. package/dist/lib/cubing/chunks/chunk-V27EM5TJ.js +0 -1074
  111. package/dist/lib/cubing/chunks/chunk-V27EM5TJ.js.map +0 -7
  112. package/dist/lib/cubing/chunks/chunk-VRTKWZPL.js +0 -10084
  113. package/dist/lib/cubing/chunks/chunk-VRTKWZPL.js.map +0 -7
  114. package/dist/lib/cubing/chunks/chunk-VSMFYTG6.js +0 -10086
  115. package/dist/lib/cubing/chunks/chunk-VSMFYTG6.js.map +0 -7
  116. package/dist/lib/cubing/chunks/inside-IHWQVDVU.js +0 -564
  117. package/dist/lib/cubing/chunks/inside-IHWQVDVU.js.map +0 -7
  118. package/dist/lib/cubing/chunks/inside-L2JI2BEY.js.map +0 -7
  119. package/dist/lib/cubing/chunks/inside-Q56GLXG4.js +0 -556
  120. package/dist/lib/cubing/chunks/inside-Q56GLXG4.js.map +0 -7
  121. package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-REUXFQJ4.js +0 -124
  122. package/dist/lib/cubing/chunks/puzzles-dynamic-4x4x4-REUXFQJ4.js.map +0 -7
  123. package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-GB4WAJ7I.js +0 -1891
  124. package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-MXHP7O4R.js +0 -1890
  125. package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-MXHP7O4R.js.map +0 -7
  126. package/dist/lib/cubing/chunks/search-dynamic-sgs-side-events-XFECDWOF.js.map +0 -7
  127. package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-2CECFBP3.js +0 -1268
  128. package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-CM33KT7L.js.map +0 -7
  129. package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-Q4LLHL2O.js +0 -1267
  130. package/dist/lib/cubing/chunks/search-dynamic-sgs-unofficial-Q4LLHL2O.js.map +0 -7
  131. package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-COSEVJBV.js +0 -2922
  132. package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-COSEVJBV.js.map +0 -7
  133. package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-E576AITS.js +0 -2923
  134. package/dist/lib/cubing/chunks/search-dynamic-solve-4x4x4-NANDMURR.js.map +0 -7
  135. package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js +0 -10
  136. package/dist/lib/cubing/chunks/twips_wasm_bg-RWVQBVBA-5YCKA6O5.js.map +0 -7
  137. package/dist/lib/cubing/chunks/twisty-dynamic-3d-5NZRNZ7C.js +0 -1881
  138. package/dist/lib/cubing/chunks/twisty-dynamic-3d-5NZRNZ7C.js.map +0 -7
  139. package/dist/lib/cubing/chunks/twisty-dynamic-3d-IKE4BUQG.js +0 -1883
  140. package/dist/lib/cubing/chunks/twisty-dynamic-3d-IKE4BUQG.js.map +0 -7
  141. package/dist/lib/cubing/chunks/twisty-dynamic-3d-XLUOPCLN.js +0 -1881
  142. package/dist/lib/cubing/chunks/twisty-dynamic-3d-XLUOPCLN.js.map +0 -7
  143. package/dist/lib/cubing/events-CewDA1aS.d.ts +0 -35
  144. package/dist/lib/cubing/index-DabjED-w.d.ts +0 -33
  145. /package/dist/bin/chunks/{chunk-OI3YIXMQ.js.map → chunk-22VWCGBC.js.map} +0 -0
  146. /package/dist/lib/cubing/chunks/{big-puzzle-orientation-ZVZQJEF5.js.map → big-puzzle-orientation-ADWIOX6S.js.map} +0 -0
  147. /package/dist/lib/cubing/chunks/{chunk-ROB5TROI.js.map → chunk-7LXHWXCO.js.map} +0 -0
  148. /package/dist/lib/cubing/chunks/{chunk-FZBKZ5ZB.js.map → chunk-MQSQDKWH.js.map} +0 -0
  149. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-side-events-GB4WAJ7I.js.map → search-dynamic-sgs-side-events-WORUZVF5.js.map} +0 -0
  150. /package/dist/lib/cubing/chunks/{search-dynamic-sgs-unofficial-2CECFBP3.js.map → search-dynamic-sgs-unofficial-5JQKPNG2.js.map} +0 -0
  151. /package/dist/lib/cubing/chunks/{search-dynamic-solve-4x4x4-E576AITS.js.map → search-dynamic-solve-4x4x4-KIH4YATU.js.map} +0 -0
  152. /package/dist/lib/cubing/chunks/{search-dynamic-solve-fto-UZMNOI6U.js.map → search-dynamic-solve-fto-I5ID5LXD.js.map} +0 -0
  153. /package/dist/lib/cubing/chunks/{twips-YHXBF55O.js.map → twips-ZNMKGC5U.js.map} +0 -0
@@ -1,2362 +0,0 @@
1
- import { Tagged } from 'type-fest';
2
- import { Texture, Object3D, Raycaster, PerspectiveCamera, Scene, WebGLRenderer } from 'three/src/Three.js';
3
-
4
- declare enum IterationDirection {
5
- Forwards = 1,
6
- Backwards = -1
7
- }
8
-
9
- type ExperimentalNotationType = "auto" | "LGN";
10
- interface ExperimentalSerializationOptions {
11
- notation?: ExperimentalNotationType;
12
- }
13
-
14
- declare abstract class Comparable {
15
- is(c: any): boolean;
16
- as<T>(c: new (...args: any) => T): T | null;
17
- abstract isIdentical(other: Comparable): boolean;
18
- }
19
- interface Repeatable extends Comparable {
20
- experimentalExpand(iterDir?: IterationDirection, depth?: number): Generator<AlgLeaf>;
21
- }
22
- declare abstract class AlgCommon<T extends Alg | AlgNode> extends Comparable implements Repeatable {
23
- constructor();
24
- get log(): (message?: any) => void;
25
- abstract toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
26
- abstract invert(): T;
27
- abstract experimentalExpand(iterDir: IterationDirection): Generator<AlgLeaf>;
28
- }
29
-
30
- /** @category Alg Nodes */
31
- declare class Commutator extends AlgCommon<Commutator> {
32
- #private;
33
- constructor(aSource: FlexibleAlgSource, bSource: FlexibleAlgSource);
34
- get A(): Alg;
35
- get B(): Alg;
36
- isIdentical(other: Comparable): boolean;
37
- invert(): Commutator;
38
- experimentalExpand(iterDir?: IterationDirection, depth?: number): Generator<AlgLeaf>;
39
- toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
40
- }
41
-
42
- /** @category Alg Nodes */
43
- declare class Conjugate extends AlgCommon<Conjugate> {
44
- #private;
45
- constructor(aSource: FlexibleAlgSource, bSource: FlexibleAlgSource);
46
- get A(): Alg;
47
- get B(): Alg;
48
- isIdentical(other: Comparable): boolean;
49
- invert(): Conjugate;
50
- experimentalExpand(iterDir: IterationDirection, depth?: number): Generator<AlgLeaf>;
51
- toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
52
- }
53
-
54
- interface QuantumMoveModifications {
55
- outerLayer?: number;
56
- innerLayer?: number;
57
- family?: string;
58
- }
59
- declare class QuantumMove extends Comparable {
60
- #private;
61
- constructor(family: string, innerLayer?: number | null, outerLayer?: number | null);
62
- static fromString(s: string): QuantumMove;
63
- modified(modifications: QuantumMoveModifications): QuantumMove;
64
- isIdentical(other: QuantumMove): boolean;
65
- /** @deprecated */
66
- get family(): string;
67
- /** @deprecated */
68
- get outerLayer(): number | null;
69
- /** @deprecated */
70
- get innerLayer(): number | null;
71
- experimentalExpand(): Generator<AlgLeaf>;
72
- toString(_experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
73
- }
74
- interface MoveModifications {
75
- outerLayer?: number;
76
- innerLayer?: number;
77
- family?: string;
78
- amount?: number;
79
- }
80
- /** @category Alg Nodes */
81
- declare class Move extends AlgCommon<Move> {
82
- #private;
83
- constructor(...args: [QuantumMove] | [QuantumMove, number] | [string] | [string, number]);
84
- isIdentical(other: Comparable): boolean;
85
- invert(): Move;
86
- experimentalExpand(iterDir?: IterationDirection): Generator<AlgLeaf>;
87
- get quantum(): QuantumMove;
88
- modified(modifications: MoveModifications): Move;
89
- static fromString(s: string): Move;
90
- get amount(): number;
91
- /** @deprecated */
92
- get type(): string;
93
- /** @deprecated */
94
- get family(): string;
95
- /** @deprecated */
96
- get outerLayer(): number | undefined;
97
- /** @deprecated */
98
- get innerLayer(): number | undefined;
99
- toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
100
- }
101
-
102
- /** @category Alg Nodes */
103
- declare class Pause extends AlgCommon<Pause> {
104
- experimentalNISSGrouping?: Grouping;
105
- toString(_experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
106
- isIdentical(other: Comparable): boolean;
107
- invert(): Pause;
108
- experimentalExpand(_iterDir?: IterationDirection, _depth?: number): Generator<AlgLeaf>;
109
- }
110
-
111
- interface GroupingModifications {
112
- alg?: Alg;
113
- amount?: number;
114
- }
115
- /** @category Alg Nodes */
116
- declare class Grouping extends AlgCommon<Grouping> {
117
- #private;
118
- experimentalNISSPlaceholder?: Pause;
119
- constructor(algSource: FlexibleAlgSource, amount?: number);
120
- isIdentical(other: Comparable): boolean;
121
- get alg(): Alg;
122
- get amount(): number;
123
- modified(modifications: GroupingModifications): Grouping;
124
- /** @deprecated */
125
- get experimentalRepetitionSuffix(): string;
126
- invert(): Grouping;
127
- experimentalExpand(iterDir?: IterationDirection, depth?: number): Generator<AlgLeaf>;
128
- static fromString(): Grouping;
129
- toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
130
- experimentalAsSquare1Tuple(): [moveU: Move, moveD: Move] | null;
131
- }
132
-
133
- /** @category Alg Nodes */
134
- declare class LineComment extends AlgCommon<LineComment> {
135
- #private;
136
- constructor(commentText: string);
137
- get text(): string;
138
- isIdentical(other: Comparable): boolean;
139
- invert(): LineComment;
140
- experimentalExpand(_iterDir?: IterationDirection, _depth?: number): Generator<AlgLeaf>;
141
- toString(_experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
142
- }
143
-
144
- /** @category Alg Nodes */
145
- declare class Newline extends AlgCommon<Newline> {
146
- toString(_experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
147
- isIdentical(other: Comparable): boolean;
148
- invert(): Newline;
149
- experimentalExpand(_iterDir?: IterationDirection, _depth?: number): Generator<AlgLeaf>;
150
- }
151
-
152
- /** @category Alg Nodes */
153
- type AlgLeaf = Move | LineComment | Newline | Pause;
154
- /** @category Alg Nodes */
155
- type AlgBranch = Grouping | Conjugate | Commutator;
156
- /** @category Alg Nodes */
157
- type AlgNode = AlgLeaf | AlgBranch;
158
-
159
- declare const DEFAULT_DIRECTIONAL = "any-direction";
160
- type QuantumDirectionalCancellation = typeof DEFAULT_DIRECTIONAL | "same-direction" | "none";
161
- type ModWrap = "none" | "gravity" | "canonical-centered" | "canonical-positive" | "preserve-sign";
162
- interface AppendCancelOptions {
163
- directional?: QuantumDirectionalCancellation;
164
- puzzleSpecificModWrap?: ModWrap;
165
- }
166
- interface AppendOptions {
167
- cancel?: boolean | AppendCancelOptions;
168
- puzzleLoader?: {
169
- puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;
170
- };
171
- puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;
172
- }
173
- interface SimplifyOptions extends AppendOptions {
174
- depth?: number | null;
175
- }
176
- interface PuzzleSpecificAxisSimplifyInfo {
177
- areQuantumMovesSameAxis: (quantumMove1: QuantumMove, quantumMove2: QuantumMove) => boolean;
178
- simplifySameAxisMoves: (moves: Move[], quantumMod: boolean) => Move[];
179
- }
180
- interface PuzzleSpecificSimplifyOptions {
181
- quantumMoveOrder?: (quantumMove: QuantumMove) => number;
182
- axis?: PuzzleSpecificAxisSimplifyInfo;
183
- }
184
-
185
- type FlexibleAlgSource = string | Iterable<AlgNode> | Alg;
186
- /**
187
- * `Alg` is a class that encapsulates a structured alg. To create an `Alg` from a string, use:
188
- *
189
- * new Alg("R U R'"); // Convenient
190
- * Alg.fromString(dynamicString); // Recommended when the string input is user-provided.
191
- *
192
- * Once you have an `Alg`, you can call methods to transform it:
193
- *
194
- * new Alg("[[R: U], R U R2']").expand().experimentalSimplify({cancel: true}).invert().log()
195
- *
196
- * To convert an `Alg` to a string, use .toString():
197
- *
198
- * new Alg("R U F").invert().toString();
199
- *
200
- * If you need to debug, you may also find it convenient to use .log():
201
- *
202
- * if (alg.isIdentical(alg.invert())) {
203
- * alg.log("A self-inverse!")
204
- * }
205
- *
206
- * For more information, see: {@link https://js.cubing.net/cubing/alg/}
207
- *
208
- * @category Alg
209
- */
210
- declare class Alg extends AlgCommon<Alg> {
211
- #private;
212
- constructor(alg?: FlexibleAlgSource);
213
- /**
214
- * Checks whether this Alg is structurally identical to another Alg. This
215
- * essentially means that they are written identically apart from whitespace.
216
- *
217
- * const alg1 = new Alg("R U L'");
218
- * const alg2 = new Alg("L U' R'").invert();
219
- * // true
220
- * alg1.isIdentical(alg2);
221
- *
222
- * // false
223
- * new Alg("[R, U]").isIdentical(new Alg("R U R' U'"));
224
- * // true
225
- * new Alg("[R, U]").expand().isIdentical(new Alg("R U R' U'"));
226
- *
227
- * Note that .isIdentical() efficiently compares algorithms, but mainly exists
228
- * to help optimize code when the structure of an algorithm hasn't changed.
229
- * There are many ways to write the "same" alg on most puzzles, but is
230
- * *highly* recommended to avoid expanding two Alg instances to compare them,
231
- * since that can easily slow your program to a crawl if someone inputs an alg
232
- * containing a large repetition. In general, you should use `cubing/kpuzzle`
233
- * to compare if two algs have the same effect on a puzzle.
234
- *
235
- * Also note that parser annotations are not taken into account while comparing
236
- * algs:
237
- *
238
- * const alg = new Alg([new Move("R"), new Move("U2")]);
239
- * // true, even though one of the algs has parser annotations
240
- * alg.isIdentical(new Alg("R U2"))
241
- *
242
- */
243
- isIdentical(other: Comparable): boolean;
244
- /**
245
- * Returns the inverse of the given alg.
246
- *
247
- * Note that that this does not make any assumptions about what puzzle the alg
248
- * is for. For example, U2 is its own inverse on a cube, but U2' has the same
249
- * effect U3 (and not U2) on Megaminx:
250
- *
251
- * // Outputs: R U2' L'
252
- * new Alg("L U2 R'").invert().log();
253
- */
254
- invert(): Alg;
255
- /** @deprecated Use {@link Alg.expand} instead. */
256
- experimentalExpand(iterDir?: IterationDirection, depth?: number): Generator<AlgLeaf>;
257
- /**
258
- * Expands all Grouping, Commutator, and Conjugate parts nested inside the
259
- * alg.
260
- *
261
- * // F R U R' U' F'
262
- * new Alg("[F: [R, U]]").expand().log();
263
- *
264
- * // F [R, U] F'
265
- * new Alg("[F: [R, U]]").expand(({ depth: 1 }).log();
266
- *
267
- * Avoid calling this on a user-provided alg unless the user explicitly asks
268
- * to see the expanded alg. Otherwise, it's easy to make your program freeze
269
- * when someone passes in an alg like: (R U)10000000
270
- *
271
- * Generally, if you want to perform an operation on an entire alg, you'll
272
- * want to use something based on the `Traversal` mechanism, like countMoves()
273
- * from `cubing/notation`.
274
- */
275
- expand(options?: {
276
- depth?: number;
277
- }): Alg;
278
- /** @deprecated */
279
- experimentalLeafMoves(): Generator<Move>;
280
- concat(input: FlexibleAlgSource): Alg;
281
- /** @deprecated */
282
- experimentalIsEmpty(): boolean;
283
- static fromString(s: string): Alg;
284
- /** @deprecated */
285
- units(): Generator<AlgNode>;
286
- childAlgNodes(): Generator<AlgNode>;
287
- /** @deprecated */
288
- experimentalNumUnits(): number;
289
- experimentalNumChildAlgNodes(): number;
290
- /** @deprecated */
291
- get type(): string;
292
- /**
293
- * Converts the Alg to a string:
294
- *
295
- * const alg = new Alg([new Move("R"), new Move("U2"), new Move("L")])
296
- * // R U2 L
297
- * console.log(alg.toString())
298
- */
299
- toString(experimentalSerializationOptions?: ExperimentalSerializationOptions): string;
300
- /**
301
- * `experimentalSimplify` can perform several mostly-syntactic simplifications on an alg:
302
- *
303
- * // Logs: R' U3
304
- * import { Alg } from "cubing/alg";
305
- * new Alg("R R2' U U2").experimentalSimplify({ cancel: true }).log()
306
- *
307
- * You can pass in a `PuzzleLoader` (currently only for 3x3x3) for puzzle-specific simplifications:
308
- *
309
- * // Logs: R' U'
310
- * import { Alg } from "cubing/alg";
311
- * import { cube3x3x3 } from "cubing/puzzles";
312
- * new Alg("R R2' U U2").experimentalSimplify({ cancel: true, puzzleLoader: cube3x3x3 }).log()
313
- *
314
- * You can also cancel only moves that are in the same direction:
315
- *
316
- * // Logs: R R2' U'
317
- * import { Alg } from "cubing/alg";
318
- * import { cube3x3x3 } from "cubing/puzzles";
319
- * new Alg("R R2' U U2").experimentalSimplify({
320
- * cancel: { directional: "same-direction" },
321
- * puzzleLoader: cube3x3x3
322
- * }).log()
323
- *
324
- * Additionally, you can specify how moves are "wrapped":
325
- *
326
- * import { Alg } from "cubing/alg";
327
- * import { cube3x3x3 } from "cubing/puzzles";
328
- *
329
- * function example(puzzleSpecificModWrap) {
330
- * alg.experimentalSimplify({
331
- * cancel: { puzzleSpecificModWrap },
332
- * puzzleLoader: cube3x3x3
333
- * }).log()
334
- * }
335
- *
336
- * const alg = new Alg("R7' . R6' . R5' . R6")
337
- * example("none") // R7' . R6' . R5' . R6
338
- * example("gravity") // R . R2' . R' . R2
339
- * example("canonical-centered") // R . R2 . R' . R2
340
- * example("canonical-positive") // R . R2 . R3 . R2
341
- * example("preserve-sign") // R3' . R2' . R' . R2
342
- *
343
- * Same-axis and simultaneous move canonicalization is not implemented yet:
344
- *
345
- * // Logs: R L R
346
- * import { Alg } from "cubing/alg";
347
- * import { cube3x3x3 } from "cubing/puzzles";
348
- * new Alg("R L R").experimentalSimplify({ cancel: true, puzzleLoader: cube3x3x3 }).log()
349
- */
350
- experimentalSimplify(options?: SimplifyOptions): Alg;
351
- /** @deprecated See {@link experimentalSimplify} */
352
- simplify(options?: SimplifyOptions): Alg;
353
- }
354
-
355
- interface NotationMapper {
356
- notationToInternal(move: Move): Move | null;
357
- notationToExternal(move: Move): Move | null;
358
- }
359
-
360
- type FaceName = string;
361
- type OrientationDirection = [number, number, number];
362
- type FaceBasedOrientationDescription = [
363
- [
364
- FaceName,
365
- OrientationDirection
366
- ],
367
- [
368
- FaceName,
369
- OrientationDirection
370
- ]
371
- ];
372
- type BaseFaceCount = 4 | 6 | 8 | 12 | 20;
373
- type FaceBasedOrientationDescriptionLookup = Record<BaseFaceCount, FaceBasedOrientationDescription>;
374
- declare class PuzzleGeometryFullOptions {
375
- verbosity: number;
376
- allMoves: boolean;
377
- outerBlockMoves: boolean;
378
- vertexMoves: boolean;
379
- addRotations: boolean;
380
- moveList: (string | Move)[] | null;
381
- fixedOrientation: boolean;
382
- fixedPieceType: null | "e" | "v" | "f";
383
- orientCenters: boolean;
384
- includeCornerOrbits: boolean;
385
- includeCenterOrbits: boolean;
386
- includeEdgeOrbits: boolean;
387
- excludeOrbits: string[];
388
- optimizeOrbits: boolean;
389
- grayCorners: boolean;
390
- grayCenters: boolean;
391
- grayEdges: boolean;
392
- puzzleOrientation: FaceBasedOrientationDescription | null;
393
- puzzleOrientations: FaceBasedOrientationDescriptionLookup | null;
394
- scrambleAmount: number;
395
- constructor(options?: PuzzleGeometryOptions);
396
- }
397
- type PuzzleGeometryOptions = Partial<PuzzleGeometryFullOptions>;
398
-
399
- declare class Perm {
400
- n: number;
401
- p: number[];
402
- constructor(a: number[]);
403
- toString(): string;
404
- mul(p2: Perm): Perm;
405
- rmul(p2: Perm): Perm;
406
- inv(): Perm;
407
- compareTo(p2: Perm): number;
408
- toGap(): string;
409
- toMathematica(): string;
410
- order(): number;
411
- }
412
-
413
- declare class PGOrbitDef {
414
- size: number;
415
- mod: number;
416
- constructor(size: number, mod: number);
417
- reassemblySize(): bigint;
418
- }
419
- declare class PGOrbitsDef {
420
- orbitnames: string[];
421
- private orbitdefs;
422
- solved: VisibleState;
423
- movenames: string[];
424
- moveops: PGTransform[];
425
- isRotation: boolean[];
426
- forcenames: boolean[];
427
- constructor(orbitnames: string[], orbitdefs: PGOrbitDef[], solved: VisibleState, movenames: string[], moveops: PGTransform[], isRotation: boolean[], forcenames: boolean[]);
428
- toKTransformationData(t: PGTransform): KTransformationData;
429
- toKPatternData(t: PGTransform): KPatternData;
430
- static transformToKTransformationData(orbitnames: string[], t: PGTransform): KTransformationData;
431
- private describeSet;
432
- toKsolve(name: string, mapper?: NotationMapper): string[];
433
- toKPuzzleDefinition(includemoves: boolean): KPuzzleDefinition;
434
- optimize(): PGOrbitsDef;
435
- scramble(n: number): void;
436
- getScrambleTransformation(n: number): PGTransform;
437
- reassemblySize(): bigint;
438
- }
439
- declare class PGOrbit {
440
- perm: number[];
441
- ori: number[];
442
- orimod: number;
443
- private static ktransformationCache;
444
- static e(n: number, mod: number): PGOrbit;
445
- constructor(perm: number[], ori: number[], orimod: number);
446
- mul(b: PGOrbit): PGOrbit;
447
- inv(): PGOrbit;
448
- equal(b: PGOrbit): boolean;
449
- killOri(): this;
450
- toPerm(): Perm;
451
- identicalPieces(): number[][];
452
- order(): number;
453
- isIdentity(): boolean;
454
- private zeroOris;
455
- remap(no: number[], on: number[], nv: number): PGOrbit;
456
- remapVS(no: number[], nv: number): PGOrbit;
457
- appendDefinition(result: string[], name: string, useVS: boolean, concise?: boolean): void;
458
- toKTransformationOrbitData(): KTransformationOrbitData;
459
- toKPatternOrbitData(): KPatternOrbitData;
460
- }
461
- declare class PGTransformBase {
462
- orbits: PGOrbit[];
463
- constructor(orbits: PGOrbit[]);
464
- internalMul(b: PGTransformBase): PGOrbit[];
465
- protected internalInv(): PGOrbit[];
466
- equal(b: PGTransformBase): boolean;
467
- protected killOri(): this;
468
- toPerm(): Perm;
469
- identicalPieces(): number[][];
470
- order(): number;
471
- }
472
- declare class PGTransform extends PGTransformBase {
473
- mul(b: PGTransform): PGTransform;
474
- mulScalar(n: number): PGTransform;
475
- inv(): PGTransform;
476
- e(): PGTransform;
477
- }
478
- declare class VisibleState extends PGTransformBase {
479
- mul(b: PGTransform): VisibleState;
480
- }
481
-
482
- type PuzzleDescriptionString = string;
483
- declare const pgPuzzle: {
484
- [name: string]: PuzzleDescriptionString;
485
- };
486
- type PuzzleName = keyof typeof pgPuzzle;
487
-
488
- declare class Quat {
489
- a: number;
490
- b: number;
491
- c: number;
492
- d: number;
493
- constructor(a: number, b: number, c: number, d: number);
494
- mul(q: Quat): Quat;
495
- toString(): string;
496
- dist(q: Quat): number;
497
- len(): number;
498
- cross(q: Quat): Quat;
499
- dot(q: Quat): number;
500
- normalize(): Quat;
501
- makenormal(): Quat;
502
- normalizeplane(): Quat;
503
- smul(m: number): Quat;
504
- sum(q: Quat): Quat;
505
- sub(q: Quat): Quat;
506
- angle(): number;
507
- invrot(): Quat;
508
- det3x3(a00: number, a01: number, a02: number, a10: number, a11: number, a12: number, a20: number, a21: number, a22: number): number;
509
- rotateplane(q: Quat): Quat;
510
- orthogonal(): Quat;
511
- pointrotation(b: Quat): Quat;
512
- unproject(b: Quat): Quat;
513
- rotatepoint(q: Quat): Quat;
514
- rotateface(face: Quat[]): Quat[];
515
- intersect3(p2: Quat, p3: Quat): Quat | false;
516
- side(x: number): number;
517
- /**
518
- * Cuts a face by this plane, or returns null if there
519
- * is no intersection.
520
- * @param face The face to cut.
521
- */
522
- cutface(face: Quat[]): Quat[][] | null;
523
- cutfaces(faces: Quat[][]): Quat[][];
524
- faceside(face: Quat[]): number;
525
- sameplane(p: Quat): boolean;
526
- makecut(r: number): Quat;
527
- }
528
-
529
- interface TextureMapper {
530
- getuv(fn: number, threed: number[]): number[];
531
- }
532
- interface StickerDatSticker {
533
- coords: number[];
534
- color: string;
535
- orbit: string;
536
- ord: number;
537
- ori: number;
538
- face: number;
539
- isDup?: boolean;
540
- }
541
- interface StickerDatFace {
542
- coords: number[];
543
- name: string;
544
- }
545
- type StickerDatAxis = {
546
- coordinates: number[];
547
- quantumMove: Move;
548
- order: number;
549
- };
550
- interface StickerDat {
551
- stickers: StickerDatSticker[];
552
- faces: StickerDatFace[];
553
- axis: StickerDatAxis[];
554
- unswizzle(mv: Move): Move | null;
555
- notationMapper: NotationMapper;
556
- textureMapper: TextureMapper;
557
- }
558
- declare function getPG3DNamedPuzzles(): {
559
- [s: string]: PuzzleDescriptionString;
560
- };
561
- declare function getPuzzleDescriptionString(puzzleName: PuzzleName): PuzzleDescriptionString;
562
- declare const PUZZLE_BASE_SHAPES: readonly ["c", "t", "o", "d", "i"];
563
- type PuzzleBaseShape = (typeof PUZZLE_BASE_SHAPES)[number];
564
- declare const PUZZLE_CUT_TYPES: readonly ["f", "v", "e"];
565
- type PuzzleCutType = (typeof PUZZLE_CUT_TYPES)[number];
566
- type PuzzleCutDescription = {
567
- cutType: PuzzleCutType;
568
- distance: number;
569
- };
570
- type PuzzleDescription = {
571
- shape: PuzzleBaseShape;
572
- cuts: PuzzleCutDescription[];
573
- };
574
- declare function parsePuzzleDescription(s: PuzzleDescriptionString): PuzzleDescription | null;
575
- declare function getPuzzleGeometryByDesc(desc: string, options?: PuzzleGeometryOptions): PuzzleGeometry;
576
- declare function getPuzzleGeometryByName(puzzleName: PuzzleName, options?: PuzzleGeometryOptions): PuzzleGeometry;
577
- type MoveSetGeo = [string, string, string, string, number];
578
- /** @category PuzzleGeometry */
579
- declare class PuzzleGeometry {
580
- puzzleDescription: PuzzleDescription;
581
- private rotations;
582
- basePlaneRotations: Quat[];
583
- private basePlanes;
584
- private faceNames;
585
- private facePlanes;
586
- private edgeNames;
587
- private vertexNames;
588
- private geometryNormals;
589
- private movePlanes;
590
- private movePlanesFiltered;
591
- movePlaneSets?: Quat[][];
592
- private movePlaneNormals?;
593
- movesetorders?: number[];
594
- movesetgeos?: MoveSetGeo[];
595
- private baseFaces;
596
- private faces;
597
- private faceCenterMass?;
598
- private baseFaceCount;
599
- stickersPerFace: number;
600
- shortestEdge: number;
601
- private markedFaceLookup;
602
- cubies: number[][];
603
- private vertexDistance;
604
- private edgeDistance;
605
- private faceToCubie?;
606
- private faceToCubieOrd?;
607
- private moveRotations?;
608
- private faceListHash?;
609
- private cubieSetNames?;
610
- private cubieOrbitSizes?;
611
- private cubieSetNums?;
612
- private cubieOrdNums?;
613
- private orbitOrientations?;
614
- private cubieValueMap?;
615
- private cubieSetCubies?;
616
- cmovesBySlice: number[][][];
617
- parsedMoveList?: [
618
- string | undefined,
619
- number,
620
- number,
621
- number,
622
- boolean,
623
- number
624
- ][];
625
- private duplicatedFaces;
626
- private duplicatedCubies;
627
- private fixedCubie;
628
- private net;
629
- private colors;
630
- private swizzler;
631
- notationMapper: NotationMapper;
632
- private addNotationMapper;
633
- private setReidOrSpeffzOrder;
634
- private options;
635
- constructor(puzzleDescription: PuzzleDescription, options: PuzzleGeometryOptions);
636
- private keyface;
637
- private keyface2;
638
- private keyface3;
639
- private findface;
640
- private project2d;
641
- private upperStringToBitSet;
642
- allstickers(): void;
643
- unswizzle(mv: Move): Move | null;
644
- private stringToBlockMove;
645
- parseMove(move: Move): [string | undefined, number, number, number, boolean, number];
646
- private parsemove;
647
- genperms(): void;
648
- private getboundarygeometry;
649
- private getmovesets;
650
- private graybyori;
651
- private skipbyori;
652
- private skipcubie;
653
- private header;
654
- writegap(): string;
655
- writemathematica(): string;
656
- writeksolve(name?: string): string;
657
- getKPuzzleDefinition(fortwisty?: boolean, includemoves?: boolean): KPuzzleDefinition;
658
- getMoveFromBits(moverange: number[], amount: number, inverted: boolean, axiscmoves: number[][], setmoves: number[] | undefined, movesetorder: number): PGTransform;
659
- private omitSet;
660
- private diffmvsets;
661
- getOrbitsDef(fortwisty: boolean, includemoves?: boolean): PGOrbitsDef;
662
- getScramble(n?: number): KTransformationData;
663
- getMovesAsPerms(): Perm[];
664
- showcanon(disp: (s: string) => void): void;
665
- getsolved(): Perm;
666
- private getOrientationRotation;
667
- private getInitial3DRotation;
668
- private generate2dmapping;
669
- generatesvg(w?: number, h?: number, trim?: number, threed?: boolean): string;
670
- get3d(options?: {
671
- stickerColors?: string[];
672
- darkIgnoredOrbits?: boolean;
673
- }): StickerDat;
674
- getGeoNormal(geoname: string): number[] | undefined;
675
- private getfaceindex;
676
- textForTwizzleExplorer(): string;
677
- writeSchreierSims(tw: (s: string) => void): void;
678
- }
679
- declare class PGNotation {
680
- private pg;
681
- private orbitNames;
682
- constructor(pg: PuzzleGeometry, od: PGOrbitsDef);
683
- lookupMove(move: Move): KTransformationData | null;
684
- remapKPuzzleDefinition(kpuzzleDefinition: KPuzzleDefinition): KPuzzleDefinition;
685
- }
686
-
687
- type KPatternData = {
688
- [orbitName: string]: KPatternOrbitData;
689
- };
690
- interface KPatternOrbitData {
691
- pieces: number[];
692
- orientation: number[];
693
- /** Each piece may have an "orientation mod" that means "the orientation of
694
- * this piece is known mod [value]".
695
- *
696
- * Suppose `.numOrientations` for this orbit has a value of N. This is
697
- * considered the default value for the orientation mod of each piece in the
698
- * orbit.
699
- *
700
- * - Each entry must be one of the following:
701
- * - A proper divisor of N.
702
- * - For example: if N is 12, then one of: 1, 2, 3, 6
703
- * - The special value 0, indicating the default value (N).
704
- * - This indicates that the orientation of a piece is fully known, i.e.
705
- * that its "orientation mod" is the default value (N). However, such a
706
- * value is recorded as 0 instead of N, in order to make it simpler to
707
- * implement and debug pattern logic involving the default value.
708
- * - If `.orientationMod[i]` is a proper divisor of N (i.e. not 0), then
709
- * `.orientation[i]` must be less than `.orientationMod[i]`. That is, the
710
- * orientation values must be individually "normalized" for each piece.
711
- * - If the `orientationMod` field is not present, then every piece is
712
- * considered to have the default value for its "orientation mod".
713
- *
714
- * For a "real-world" example of this concept, consider a traditional analog
715
- * 12-hour clock dial, like one that might hang on the wall in a school room.
716
- * Although there are 24 hours in a day, A.M. and P.M. times are not
717
- * distinguishable on such a clock. Since 3:00 (AM) and 15:00 are not
718
- * distinguishable, we would read either of those times as 3:00 with an
719
- * implicit "orientation mod" of 12.
720
- *
721
- * For most puzzles, however, we care about "visual" indistinguishability
722
- * rather than "temporal" indistinguishability. To adapt the previous example,
723
- * imagine a 24-hour clock with 24 hour marks around the dial, but where the
724
- * hour hand is symmetric and points equally at the current hour as well as
725
- * its diametic opposite (like a compass needle but painted all in one color).
726
- * This has the same set of "valid patterns" as a normal 12-hour clock. Such a
727
- * clock also has an "orientation mod" of 12, but where the multiples of the
728
- * modulus have been "unfolded" to show their full symmetry instead of being
729
- * implicit.
730
- *
731
- * For a non-trivial puzzle example, consider Eitan's FisherTwist, a shape mod
732
- * of the 3x3x3 cube:
733
- * https://www.hknowstore.com/locale/en-US/item.aspx?corpname=nowstore&itemid=97eb4e89-367e-4d02-b7f0-34e5e7f3cd12
734
- *
735
- * - The 4 equatorial centers have C₂ symmetry — it is possible to rotate any
736
- * of these centers 180° without a visible change to the state. This means
737
- * that the possible orientations "loop" after incrementing the orientation
738
- * by 2 (two turns clockwise), and therefore the "orientation mod" of a
739
- * given piece is only 2.
740
- * - If we apply a counter-clockwise rotation to one of these centers, the
741
- * transformation applies an orientation of 3. But the net orientation is
742
- * recorded as a normalized value of 1 instead, because 3 (mod 2) ≡ 1 (mod
743
- * 2).
744
- * - The 2 polar centers (U and D) have no distinguishable rotations. This
745
- * means that their orientation is "known mod 1" — any transformation of one
746
- * of these centers is indistinguishable from another transformation of the
747
- * same center, and all of them are mapped to a value of 0 (the only
748
- * possible value that exists mod 1).
749
- *
750
- * For 3x3x3:
751
- *
752
- * - When solving a normal 3x3x3, center orientations are conventionally
753
- * ignored. This is similar to the polar center case for Eitan's
754
- * FisherTwist, and the "orientation mod" of each piece is 1. This is also
755
- * the core motivating use case.
756
- * - For a supercube
757
- * (https://experiments.cubing.net/cubing.js/twisty/supercube.html) or the
758
- * general case of a "picture cube", all four center orientations are
759
- * distinguishable for every center. This means all centers have the default
760
- * orientation mod of 4. As documented above, this can be recorded with a
761
- * `.orientationMod` of `[0, 0, 0, 0, 0, 0]`, or equivalently by omitting
762
- * the `.orientationMod` field.
763
- * - When modeling a real 3x3x3 speedcube, it is common to have a logo on a
764
- * single sticker. If you want to model the exact visually distinguishable
765
- * states of such a puzzles, it is possible to use an `.orientationMod` such
766
- * as `[0, 1, 1, 1, 1, 1]`. For example, this can make it easy to find an
767
- * alg for a given case "while keeping the logo the same", without placing
768
- * more restrictions on other centers (which could make the search slower or
769
- * produce longer solutions).
770
- *
771
- * For those with a mathematical background, you may notice a relationship to
772
- * the concept of a coset (https://en.wikipedia.org/wiki/Coset). For example,
773
- * consider the group of patterns of a `KPuzzle` (without indistinguishable
774
- * pieces) generated by a set of transformations. We can assign each set of
775
- * piece orbits an orientation mod value (which must be identical for all
776
- * constituent pieces of the same orbit). Each such choice generates a set of
777
- * valid `KPattern`s that forms a subgroup, and each set of valid `.orientation`
778
- * values defines one coset of this set. However, note that the set of valid
779
- * `KPattern`s does *not* form a group when there are any pieces with different
780
- * `.orientationMod` values that share an orbit.
781
- *
782
- * --------
783
- *
784
- * Note that the concept of "orientation mod" exclusively applies to `KPattern`,
785
- * not `KTransformation`. If we tried to apply the orientation mod
786
- * calculations to the *transformations* of Eitan's FisherTwist, then `SWAP =
787
- * [U, M' E2 M]` would be indistinguishable from the identity. This would mean
788
- * that if we calculated `SWAP` and then used this calculation for `S SWAP
789
- * S'`, then we would conclude that it has no net effect. However, `S SWAP S'`
790
- * does *not* have the same effect as doing nothing — it visibly rotates the L
791
- * and R centers! (In mathematical terms: the set of `KTransformation`s would
792
- * not form a valid set of semigroup actions, due to broken associativity.)
793
- *
794
- * Although there are times that we could theoretically save some time/space
795
- * by ignoring some information when it's not needed for working with certain
796
- * `KTransformation`s (e.g. ignoring all center orientations for 3x3x3), it is
797
- * more practical for each `KTransformation` to always track the full range
798
- * for each piece's `.orientation`. For example:
799
- *
800
- * - This is simpler, both conceptually and in code.
801
- * - This allows changing the set of moves for a puzzle, without recalculating
802
- * cached transformations or certain lookup tables (useful for alg
803
- * searches).
804
- * - This allows swapping out a normal 3x3x3 in a `<twisty-player>` for a
805
- * picture cube, without re-calculating the center orientations of the
806
- * current alg.
807
- *
808
- * These use cases may not be strictly "necessary", but the opposite behaviour
809
- * might be surprising or frustrating if someone does not expect it. So we
810
- * implement it this way.
811
- *
812
- * Informally, the `KTransformation` has the full responsibility for tracking
813
- * "what really happens" — even if the effect is invisible in some cases,
814
- * while the `KPattern` tracks both what "is" and what "isn't" known.
815
- **/
816
- orientationMod?: number[];
817
- }
818
- type KTransformationData = {
819
- [orbitName: string]: KTransformationOrbitData;
820
- };
821
- interface KTransformationOrbitData {
822
- permutation: number[];
823
- orientationDelta: number[];
824
- }
825
- interface KPuzzleOrbitDefinition {
826
- orbitName: string;
827
- numPieces: number;
828
- numOrientations: number;
829
- }
830
- interface KPuzzleDefinitionJSON {
831
- name: string;
832
- orbits: KPuzzleOrbitDefinition[];
833
- defaultPattern: KPatternData;
834
- moves: {
835
- [orbitName: string]: KTransformationData;
836
- };
837
- derivedMoves?: {
838
- [derivedMove: string]: string;
839
- };
840
- }
841
-
842
- interface KPuzzleDefinition extends KPuzzleDefinitionJSON {
843
- experimentalIsPatternSolved?: (kpattern: KPattern, options: {
844
- ignorePuzzleOrientation: boolean;
845
- ignoreCenterOrientation: boolean;
846
- }) => boolean;
847
- }
848
-
849
- declare class KTransformation {
850
- #private;
851
- readonly kpuzzle: KPuzzle;
852
- readonly transformationData: KTransformationData;
853
- constructor(kpuzzle: KPuzzle, transformationData: KTransformationData);
854
- toJSON(): any;
855
- invert(): KTransformation;
856
- isIdentityTransformation(): boolean;
857
- /** @deprecated */
858
- static experimentalConstructIdentity(kpuzzle: KPuzzle): KTransformation;
859
- isIdentical(t2: KTransformation): boolean;
860
- /** @deprecated */
861
- apply(source: KTransformationSource): KTransformation;
862
- applyTransformation(t2: KTransformation): KTransformation;
863
- applyMove(move: Move | string): KTransformation;
864
- applyAlg(alg: Alg | string): KTransformation;
865
- toKPattern(): KPattern;
866
- repetitionOrder(): number;
867
- selfMultiply(amount: number): KTransformation;
868
- }
869
-
870
- type KTransformationSource = Alg | Move | string | KTransformation;
871
- declare class KPuzzle {
872
- #private;
873
- readonly definition: KPuzzleDefinition;
874
- private experimentalPGNotation;
875
- constructor(definition: KPuzzleDefinition, options?: {
876
- experimentalPGNotation?: PGNotation;
877
- });
878
- lookupOrbitDefinition(orbitName: string): KPuzzleOrbitDefinition;
879
- name(): string;
880
- identityTransformation(): KTransformation;
881
- moveToTransformation(move: Move | string): KTransformation;
882
- algToTransformation(alg: Alg | string): KTransformation;
883
- /** @deprecated */
884
- toTransformation(source: KTransformationSource): KTransformation;
885
- defaultPattern(): KPattern;
886
- canConvertDefaultPatternToUniqueTransformation(): boolean;
887
- }
888
-
889
- declare class KPattern {
890
- readonly kpuzzle: KPuzzle;
891
- readonly patternData: KPatternData;
892
- constructor(kpuzzle: KPuzzle, patternData: KPatternData);
893
- toJSON(): any;
894
- static fromTransformation(transformation: KTransformation): KPattern;
895
- /** @deprecated */
896
- apply(source: KTransformationSource): KPattern;
897
- applyTransformation(transformation: KTransformation): KPattern;
898
- applyMove(move: Move | string): KPattern;
899
- applyAlg(alg: Alg | string): KPattern;
900
- isIdentical(other: KPattern): boolean;
901
- /** @deprecated */
902
- experimentalToTransformation(): KTransformation | null;
903
- experimentalIsSolved(options: {
904
- ignorePuzzleOrientation: boolean;
905
- ignoreCenterOrientation: boolean;
906
- }): boolean;
907
- }
908
-
909
- type MillisecondTimestamp = Tagged<DOMHighResTimeStamp, "MillisecondTimestamp">;
910
- type MillisecondDuration = Tagged<number, "MillisecondDuration">;
911
- declare enum Direction {
912
- Forwards = 1,
913
- Paused = 0,
914
- Backwards = -1
915
- }
916
- interface MoveInProgress {
917
- move: Move;
918
- direction: Direction;
919
- fraction: number;
920
- }
921
- type PuzzlePosition = {
922
- pattern: KPattern;
923
- movesInProgress: MoveInProgress[];
924
- };
925
- declare enum BoundaryType {
926
- Move = "move",
927
- EntireTimeline = "entire-timeline"
928
- }
929
- interface TimeRange {
930
- start: MillisecondTimestamp;
931
- end: MillisecondTimestamp;
932
- }
933
-
934
- interface UserVisibleError {
935
- errors: string[];
936
- }
937
- declare class UserVisibleErrorTracker extends SimpleTwistyPropSource<UserVisibleError> {
938
- getDefaultValue(): UserVisibleError;
939
- reset(): void;
940
- protected canReuseValue(_v1: UserVisibleError, _v2: UserVisibleError): boolean;
941
- }
942
-
943
- type InputRecord = Record<string, any>;
944
- type InputProps<T extends InputRecord> = {
945
- [s in keyof T]: TwistyPropParent<T[s]>;
946
- };
947
- type Generation = Tagged<number, "Generation">;
948
- interface SourceEventDetail<OutputType> {
949
- sourceProp: TwistyPropSource<OutputType, any>;
950
- value: Promise<OutputType>;
951
- generation: Generation;
952
- }
953
- type SourceEvent<T> = CustomEvent<SourceEventDetail<T>>;
954
- type PromiseOrValue<T> = T | Promise<T>;
955
- declare abstract class TwistyPropParent<T> {
956
- #private;
957
- abstract get(): Promise<T>;
958
- canReuse(v1: T, v2: T): boolean;
959
- protected canReuseValue(_v1: T, _v2: T): boolean;
960
- debugGetChildren(): TwistyPropDerived<any, any>[];
961
- protected addChild(child: TwistyPropDerived<any, any>): void;
962
- protected removeChild(child: TwistyPropDerived<any, any>): void;
963
- protected lastSourceGeneration: number;
964
- protected markStale(sourceEvent: SourceEvent<any>): void;
965
- /** @deprecated */
966
- addRawListener(listener: () => void, options?: {
967
- initial: boolean;
968
- }): void;
969
- /** @deprecated */
970
- removeRawListener(listener: () => void): void;
971
- addFreshListener(listener: (value: T) => void): void;
972
- removeFreshListener(listener: (value: T) => void): void;
973
- }
974
- declare abstract class TwistyPropSource<OutputType, InputType = OutputType> extends TwistyPropParent<OutputType> {
975
- #private;
976
- abstract getDefaultValue(): PromiseOrValue<OutputType>;
977
- constructor(initialValue?: PromiseOrValue<InputType>);
978
- set(input: PromiseOrValue<InputType>): void;
979
- get(): Promise<OutputType>;
980
- protected deriveFromPromiseOrValue(input: PromiseOrValue<InputType>, oldValuePromise: Promise<OutputType>): Promise<OutputType>;
981
- protected abstract derive(input: InputType, oldValuePromise: Promise<OutputType>): PromiseOrValue<OutputType>;
982
- }
983
- declare abstract class SimpleTwistyPropSource<SimpleType> extends TwistyPropSource<SimpleType> {
984
- protected derive(input: SimpleType): PromiseOrValue<SimpleType>;
985
- }
986
- declare const NO_VALUE: unique symbol;
987
- type NoValueType = typeof NO_VALUE;
988
- declare abstract class TwistyPropDerived<InputTypes extends InputRecord, OutputType> extends TwistyPropParent<OutputType> {
989
- #private;
990
- protected userVisibleErrorTracker?: UserVisibleErrorTracker | undefined;
991
- constructor(parents: InputProps<InputTypes>, userVisibleErrorTracker?: UserVisibleErrorTracker | undefined);
992
- get(): Promise<OutputType>;
993
- protected abstract derive(input: InputTypes): PromiseOrValue<OutputType>;
994
- }
995
-
996
- interface AnimationTimelineLeaf {
997
- animLeaf: AlgLeaf;
998
- start: MillisecondTimestamp;
999
- end: MillisecondTimestamp;
1000
- }
1001
- type AnimationTimelineLeaves = AnimationTimelineLeaf[];
1002
- declare class AnimationTimelineLeavesRequestProp extends SimpleTwistyPropSource<AnimationTimelineLeaf[] | null> {
1003
- getDefaultValue(): AnimationTimelineLeaf[] | null;
1004
- }
1005
-
1006
- type AnimatedLeafAlgNode = Move | Pause;
1007
-
1008
- interface CurrentMove {
1009
- move: Move;
1010
- direction: Direction;
1011
- fraction: number;
1012
- startTimestamp: MillisecondTimestamp;
1013
- endTimestamp: MillisecondTimestamp;
1014
- }
1015
- interface CurrentMoveInfo {
1016
- patternIndex: number;
1017
- currentMoves: CurrentMove[];
1018
- movesFinishing: CurrentMove[];
1019
- movesFinished: CurrentMove[];
1020
- movesStarting: CurrentMove[];
1021
- latestStart: number;
1022
- earliestEnd: number;
1023
- }
1024
- type LeafIndex = Tagged<number, "LeafIndex">;
1025
- type LeafCount = Tagged<number, "LeafCount">;
1026
- interface AlgIndexer {
1027
- getAnimLeaf(index: LeafIndex): AnimatedLeafAlgNode | null;
1028
- indexToMoveStartTimestamp(index: LeafIndex): MillisecondTimestamp;
1029
- patternAtIndex(index: LeafIndex, startPattern?: KPattern): KPattern;
1030
- transformationAtIndex(index: LeafIndex): KTransformation;
1031
- numAnimatedLeaves(): LeafCount;
1032
- timestampToIndex(timestamp: MillisecondTimestamp): LeafIndex;
1033
- algDuration(): MillisecondDuration;
1034
- moveDuration(index: LeafIndex): MillisecondDuration;
1035
- timestampToPosition?: (timestamp: MillisecondTimestamp, startPattern?: KPattern) => PuzzlePosition;
1036
- currentMoveInfo?: (timestamp: MillisecondTimestamp) => CurrentMoveInfo;
1037
- }
1038
-
1039
- type FaceletMeshStickeringMask = "regular" | "dim" | "oriented" | "experimentalOriented2" | "ignored" | "invisible" | "mystery";
1040
- type FaceletStickeringMask = {
1041
- mask: FaceletMeshStickeringMask;
1042
- hintMask?: FaceletMeshStickeringMask;
1043
- };
1044
- type PieceStickeringMask = {
1045
- facelets: (FaceletMeshStickeringMask | FaceletStickeringMask | null)[];
1046
- };
1047
- type OrbitStickeringMask = {
1048
- pieces: (PieceStickeringMask | null)[];
1049
- };
1050
- type StickeringMask = {
1051
- specialBehaviour?: "picture";
1052
- name?: string;
1053
- orbits: Record<string, OrbitStickeringMask>;
1054
- };
1055
-
1056
- declare const experimentalStickerings: Record<string, {
1057
- groups?: Partial<Record<PuzzleID, string>>;
1058
- }>;
1059
-
1060
- declare const puzzleIDs: {
1061
- "3x3x3": boolean;
1062
- custom: boolean;
1063
- "2x2x2": boolean;
1064
- "4x4x4": boolean;
1065
- "5x5x5": boolean;
1066
- "6x6x6": boolean;
1067
- "7x7x7": boolean;
1068
- "40x40x40": boolean;
1069
- megaminx: boolean;
1070
- pyraminx: boolean;
1071
- square1: boolean;
1072
- clock: boolean;
1073
- skewb: boolean;
1074
- fto: boolean;
1075
- gigaminx: boolean;
1076
- master_tetraminx: boolean;
1077
- kilominx: boolean;
1078
- redi_cube: boolean;
1079
- baby_fto: boolean;
1080
- melindas2x2x2x2: boolean;
1081
- tri_quad: boolean;
1082
- loopover: boolean;
1083
- };
1084
- type PuzzleID = keyof typeof puzzleIDs;
1085
- declare class PuzzleIDRequestProp extends SimpleTwistyPropSource<PuzzleID | NoValueType> {
1086
- getDefaultValue(): PuzzleID | NoValueType;
1087
- }
1088
-
1089
- type ExperimentalStickering = keyof typeof experimentalStickerings;
1090
- declare class StickeringRequestProp extends SimpleTwistyPropSource<ExperimentalStickering | null> {
1091
- getDefaultValue(): ExperimentalStickering | null;
1092
- }
1093
-
1094
- declare const backViewLayouts: {
1095
- none: boolean;
1096
- "side-by-side": boolean;
1097
- "top-right": boolean;
1098
- };
1099
- type BackViewLayout = keyof typeof backViewLayouts;
1100
- type BackViewLayoutWithAuto = BackViewLayout | "auto";
1101
- declare class BackViewProp extends SimpleTwistyPropSource<BackViewLayoutWithAuto> {
1102
- getDefaultValue(): BackViewLayoutWithAuto;
1103
- }
1104
-
1105
- declare const visualizationFormats: {
1106
- readonly "3D": true;
1107
- readonly "2D": true;
1108
- readonly "experimental-2D-LL": true;
1109
- readonly "experimental-2D-LL-face": true;
1110
- readonly PG3D: true;
1111
- };
1112
- type VisualizationFormat = keyof typeof visualizationFormats;
1113
- type VisualizationFormatWithAuto = VisualizationFormat | "auto";
1114
- declare class VisualizationFormatProp extends SimpleTwistyPropSource<VisualizationFormatWithAuto> {
1115
- getDefaultValue(): VisualizationFormatWithAuto;
1116
- }
1117
-
1118
- declare let HTMLElementShim: typeof HTMLElement;
1119
-
1120
- declare class ManagedCustomElement extends HTMLElementShim {
1121
- readonly shadow: ShadowRoot;
1122
- readonly contentWrapper: HTMLDivElement;
1123
- constructor(options?: {
1124
- mode?: "open" | "closed";
1125
- });
1126
- protected addCSS(cssSource: CSSStyleSheet): void;
1127
- protected removeCSS(cssSource: CSSStyleSheet): void;
1128
- addElement<T extends Node>(element: T): T;
1129
- prependElement<T extends Node>(element: T): void;
1130
- removeElement<T extends Node>(element: T): T;
1131
- }
1132
-
1133
- interface CatchUpMove {
1134
- move: Move | null;
1135
- amount: number;
1136
- }
1137
- declare class CatchUpMoveProp extends SimpleTwistyPropSource<CatchUpMove> {
1138
- getDefaultValue(): CatchUpMove;
1139
- protected canReuseValue(v1: CatchUpMove, v2: CatchUpMove): boolean;
1140
- }
1141
-
1142
- type SimpleDirection = Direction.Forwards | Direction.Backwards;
1143
- interface PlayingInfo {
1144
- playing: boolean;
1145
- direction: SimpleDirection;
1146
- untilBoundary: BoundaryType;
1147
- loop: boolean;
1148
- }
1149
- declare class PlayingInfoProp extends TwistyPropSource<PlayingInfo, Partial<PlayingInfo>> {
1150
- getDefaultValue(): Promise<PlayingInfo>;
1151
- protected derive(newInfo: Partial<PlayingInfo>, oldValuePromise: Promise<PlayingInfo>): Promise<PlayingInfo>;
1152
- protected canReuseValue(v1: PlayingInfo, v2: PlayingInfo): boolean;
1153
- }
1154
-
1155
- declare class ArbitraryStringProp extends SimpleTwistyPropSource<string | null> {
1156
- getDefaultValue(): string | null;
1157
- }
1158
-
1159
- declare class URLProp extends TwistyPropSource<URL | null, URL | string | null> {
1160
- getDefaultValue(): URL | null;
1161
- derive(input: URL | string | null): URL | null;
1162
- }
1163
-
1164
- declare class AlgIssues {
1165
- readonly warnings: readonly string[];
1166
- readonly errors: readonly string[];
1167
- constructor(issues?: {
1168
- warnings?: string[];
1169
- errors?: string[];
1170
- });
1171
- add(issues?: {
1172
- warnings?: string[];
1173
- errors?: string[];
1174
- }): AlgIssues;
1175
- /** @deprecated */
1176
- log(): void;
1177
- }
1178
- interface AlgWithIssues {
1179
- alg: Alg;
1180
- issues: AlgIssues;
1181
- }
1182
- declare class AlgProp extends TwistyPropSource<AlgWithIssues, Alg | string> {
1183
- getDefaultValue(): AlgWithIssues;
1184
- protected canReuseValue(v1: AlgWithIssues, v2: AlgWithIssues): boolean;
1185
- protected derive(newAlg: Alg | string): Promise<AlgWithIssues>;
1186
- }
1187
-
1188
- type AlgTransformationPropInputs = {
1189
- setupAlg: AlgWithIssues;
1190
- kpuzzle: KPuzzle;
1191
- };
1192
- declare class AlgTransformationProp extends TwistyPropDerived<AlgTransformationPropInputs, KTransformation> {
1193
- derive(input: AlgTransformationPropInputs): KTransformation;
1194
- }
1195
-
1196
- declare const setupToLocations: {
1197
- start: boolean;
1198
- end: boolean;
1199
- };
1200
- type SetupToLocation = keyof typeof setupToLocations;
1201
- declare class SetupAnchorProp extends SimpleTwistyPropSource<SetupToLocation> {
1202
- getDefaultValue(): SetupToLocation;
1203
- }
1204
-
1205
- interface AnchorTransformationPropInputs {
1206
- setupTransformation: KTransformation | null;
1207
- setupAnchor: SetupToLocation;
1208
- setupAlgTransformation: KTransformation;
1209
- indexer: AlgIndexer;
1210
- }
1211
- declare class AnchorTransformationProp extends TwistyPropDerived<AnchorTransformationPropInputs, KTransformation> {
1212
- derive(inputs: AnchorTransformationPropInputs): KTransformation;
1213
- }
1214
-
1215
- interface CurrentLeavesSimplifiedPropInputs {
1216
- currentMoveInfo: CurrentMoveInfo;
1217
- }
1218
- interface CurrentLeavesSimplified {
1219
- patternIndex: LeafIndex;
1220
- movesFinishing: Move[];
1221
- movesFinished: Move[];
1222
- }
1223
- declare class CurrentLeavesSimplifiedProp extends TwistyPropDerived<CurrentLeavesSimplifiedPropInputs, CurrentLeavesSimplified> {
1224
- protected derive(inputs: CurrentLeavesSimplifiedPropInputs): CurrentLeavesSimplified;
1225
- protected canReuseValue(v1: CurrentLeavesSimplified, v2: CurrentLeavesSimplified): boolean;
1226
- }
1227
-
1228
- declare const smartTimestamps: {
1229
- auto: boolean;
1230
- start: boolean;
1231
- end: boolean;
1232
- anchor: boolean;
1233
- "opposite-anchor": boolean;
1234
- };
1235
- type TimestampRequest = MillisecondTimestamp | keyof typeof smartTimestamps;
1236
- declare class TimestampRequestProp extends SimpleTwistyPropSource<TimestampRequest> {
1237
- getDefaultValue(): TimestampRequest;
1238
- set(v: PromiseOrValue<TimestampRequest>): void;
1239
- protected validInput(v: TimestampRequest): boolean;
1240
- }
1241
-
1242
- interface DetailedTimelineInfoInputs {
1243
- timestampRequest: TimestampRequest;
1244
- timeRange: TimeRange;
1245
- setupAnchor: SetupToLocation;
1246
- setupAlg: AlgWithIssues;
1247
- }
1248
- interface DetailedTimelineInfo {
1249
- timestamp: MillisecondTimestamp;
1250
- timeRange: TimeRange;
1251
- atStart: boolean;
1252
- atEnd: boolean;
1253
- }
1254
- declare class DetailedTimelineInfoProp extends TwistyPropDerived<DetailedTimelineInfoInputs, DetailedTimelineInfo> {
1255
- #private;
1256
- protected derive(inputs: DetailedTimelineInfoInputs): DetailedTimelineInfo;
1257
- protected canReuseValue(v1: DetailedTimelineInfo, v2: DetailedTimelineInfo): boolean;
1258
- }
1259
-
1260
- interface PositionPropInputs {
1261
- indexer: AlgIndexer;
1262
- detailedTimelineInfo: DetailedTimelineInfo;
1263
- catchUpMove: CatchUpMove;
1264
- }
1265
- declare class CurrentMoveInfoProp extends TwistyPropDerived<PositionPropInputs, CurrentMoveInfo> {
1266
- derive(inputs: PositionPropInputs): CurrentMoveInfo;
1267
- }
1268
-
1269
- interface CurrentTransformationPropInputs {
1270
- anchoredStart: KTransformation;
1271
- currentLeavesSimplified: CurrentLeavesSimplified;
1272
- indexer: AlgIndexer;
1273
- }
1274
- declare class CurrentPatternProp extends TwistyPropDerived<CurrentTransformationPropInputs, KPattern> {
1275
- derive(inputs: CurrentTransformationPropInputs): KPattern;
1276
- }
1277
-
1278
- type VisualizationStrategyPropInputs = {
1279
- visualizationRequest: VisualizationFormatWithAuto;
1280
- puzzleID: PuzzleID;
1281
- };
1282
- type VisualizationStrategy = "Cube3D" | "2D" | "experimental-2D-LL" | "experimental-2D-LL-face" | "PG3D";
1283
- declare class VisualizationStrategyProp extends TwistyPropDerived<VisualizationStrategyPropInputs, VisualizationStrategy> {
1284
- derive(inputs: VisualizationStrategyPropInputs): VisualizationStrategy;
1285
- }
1286
-
1287
- declare const indexerStrategyNames: {
1288
- auto: boolean;
1289
- simple: boolean;
1290
- tree: boolean;
1291
- simultaneous: boolean;
1292
- };
1293
- type IndexerStrategyName = keyof typeof indexerStrategyNames;
1294
- declare class IndexerConstructorRequestProp extends SimpleTwistyPropSource<IndexerStrategyName> {
1295
- getDefaultValue(): IndexerStrategyName;
1296
- }
1297
-
1298
- type IndexerConstructor = new (kpuzzle: KPuzzle, alg: Alg, options?: {
1299
- animationTimelineLeaves?: AnimationTimelineLeaves | null;
1300
- }) => AlgIndexer;
1301
- interface IndexerConstructorPropInputs {
1302
- puzzle: PuzzleID;
1303
- alg: AlgWithIssues;
1304
- visualizationStrategy: VisualizationStrategy;
1305
- indexerConstructorRequest: IndexerStrategyName;
1306
- animationTimelineLeaves: AnimationTimelineLeaves | null;
1307
- }
1308
- declare class IndexerConstructorProp extends TwistyPropDerived<IndexerConstructorPropInputs, IndexerConstructor> {
1309
- derive(inputs: IndexerConstructorPropInputs): IndexerConstructor;
1310
- }
1311
-
1312
- type IndexerPropInputs = {
1313
- indexerConstructor: IndexerConstructor;
1314
- algWithIssues: AlgWithIssues;
1315
- kpuzzle: KPuzzle;
1316
- animationTimelineLeaves: AnimationTimelineLeaves | null;
1317
- };
1318
- declare class IndexerProp extends TwistyPropDerived<IndexerPropInputs, AlgIndexer> {
1319
- derive(input: IndexerPropInputs): AlgIndexer;
1320
- }
1321
-
1322
- interface LegacyPositionPropInputs {
1323
- currentMoveInfo: CurrentMoveInfo;
1324
- currentPattern: KPattern;
1325
- }
1326
- declare class LegacyPositionProp extends TwistyPropDerived<LegacyPositionPropInputs, PuzzlePosition> {
1327
- derive(inputs: LegacyPositionPropInputs): PuzzlePosition;
1328
- }
1329
-
1330
- declare class PuzzleAlgProp extends TwistyPropDerived<{
1331
- algWithIssues: AlgWithIssues;
1332
- kpuzzle: KPuzzle;
1333
- }, AlgWithIssues> {
1334
- derive(inputs: {
1335
- algWithIssues: AlgWithIssues;
1336
- kpuzzle: KPuzzle;
1337
- }): Promise<AlgWithIssues>;
1338
- }
1339
-
1340
- declare class SetupTransformationProp extends SimpleTwistyPropSource<KTransformation | null> {
1341
- getDefaultValue(): KTransformation | null;
1342
- }
1343
-
1344
- declare class KPuzzleProp extends TwistyPropDerived<{
1345
- puzzleLoader: PuzzleLoader;
1346
- }, KPuzzle> {
1347
- derive(inputs: {
1348
- puzzleLoader: PuzzleLoader;
1349
- }): Promise<KPuzzle>;
1350
- }
1351
-
1352
- declare class PGPuzzleDescriptionStringProp extends SimpleTwistyPropSource<PuzzleDescriptionString | NoValueType> {
1353
- getDefaultValue(): PuzzleDescriptionString | NoValueType;
1354
- }
1355
-
1356
- declare class PuzzleIDProp extends TwistyPropDerived<{
1357
- puzzleLoader: PuzzleLoader;
1358
- }, PuzzleID> {
1359
- derive(inputs: {
1360
- puzzleLoader: PuzzleLoader;
1361
- }): Promise<PuzzleID>;
1362
- }
1363
-
1364
- interface PuzzleLoaderPropInputs {
1365
- puzzleIDRequest: PuzzleID | NoValueType;
1366
- puzzleDescriptionRequest: PuzzleDescriptionString | NoValueType;
1367
- }
1368
- declare class PuzzleLoaderProp extends TwistyPropDerived<PuzzleLoaderPropInputs, PuzzleLoader> {
1369
- derive(inputs: PuzzleLoaderPropInputs): PuzzleLoader;
1370
- }
1371
-
1372
- declare class TwistyPlayerController {
1373
- private model;
1374
- animationController: TwistyAnimationController;
1375
- constructor(model: TwistyPlayerModel, delegate: TwistyAnimationControllerDelegate);
1376
- jumpToStart(options?: {
1377
- flash: boolean;
1378
- }): void;
1379
- jumpToEnd(options?: {
1380
- flash: boolean;
1381
- }): void;
1382
- togglePlay(play?: boolean): void;
1383
- visitTwizzleLink(): Promise<void>;
1384
- }
1385
-
1386
- declare const viewerLinkPages: {
1387
- twizzle: boolean;
1388
- "experimental-twizzle-explorer": boolean;
1389
- none: boolean;
1390
- };
1391
- type ViewerLinkPage = keyof typeof viewerLinkPages;
1392
- type ViewerLinkPageWithAuto = ViewerLinkPage | "auto";
1393
- declare class ViewerLinkProp extends SimpleTwistyPropSource<ViewerLinkPageWithAuto> {
1394
- getDefaultValue(): ViewerLinkPageWithAuto;
1395
- }
1396
-
1397
- declare const buttonIcons: string[];
1398
- type ButtonIcon = (typeof buttonIcons)[number];
1399
- interface ButtonAppearance {
1400
- enabled: boolean;
1401
- icon: ButtonIcon;
1402
- title: string;
1403
- hidden?: boolean;
1404
- }
1405
- type ButtonAppearances = Record<ButtonCommand, ButtonAppearance>;
1406
- interface ButtonAppearancePropInputs {
1407
- coarseTimelineInfo: CoarseTimelineInfo;
1408
- viewerLink: ViewerLinkPageWithAuto;
1409
- }
1410
- declare class ButtonAppearanceProp extends TwistyPropDerived<ButtonAppearancePropInputs, ButtonAppearances> {
1411
- derive(inputs: ButtonAppearancePropInputs): ButtonAppearances;
1412
- }
1413
-
1414
- declare const colorSchemes: {
1415
- light: boolean;
1416
- dark: boolean;
1417
- };
1418
- type ColorScheme = keyof typeof colorSchemes;
1419
- type ColorSchemeWithAuto = ColorScheme | "auto";
1420
- declare class ColorSchemeRequestProp extends SimpleTwistyPropSource<ColorSchemeWithAuto> {
1421
- getDefaultValue(): ColorSchemeWithAuto;
1422
- }
1423
-
1424
- declare const buttonCommands: {
1425
- fullscreen: boolean;
1426
- "jump-to-start": boolean;
1427
- "play-step-backwards": boolean;
1428
- "play-pause": boolean;
1429
- "play-step": boolean;
1430
- "jump-to-end": boolean;
1431
- "twizzle-link": boolean;
1432
- };
1433
- type ButtonCommand = keyof typeof buttonCommands;
1434
- declare class TwistyButtons extends ManagedCustomElement {
1435
- #private;
1436
- model?: TwistyPlayerModel | undefined;
1437
- controller?: TwistyPlayerController | undefined;
1438
- private defaultFullscreenElement?;
1439
- buttons: Record<ButtonCommand, TwistyButton> | null;
1440
- constructor(model?: TwistyPlayerModel | undefined, controller?: TwistyPlayerController | undefined, defaultFullscreenElement?: HTMLElement | undefined);
1441
- connectedCallback(): void;
1442
- onFullscreenButton(): Promise<void>;
1443
- update(buttonAppearances: ButtonAppearances): Promise<void>;
1444
- updateColorScheme(colorScheme: ColorScheme): void;
1445
- }
1446
- declare class TwistyButton extends ManagedCustomElement {
1447
- #private;
1448
- htmlButton: HTMLButtonElement;
1449
- updateColorScheme(colorScheme: ColorScheme): void;
1450
- connectedCallback(): void;
1451
- setIcon(iconName: ButtonIcon): void;
1452
- }
1453
-
1454
- interface CoarseTimelineInfoInputs {
1455
- playingInfo: PlayingInfo;
1456
- detailedTimelineInfo: DetailedTimelineInfo;
1457
- }
1458
- interface CoarseTimelineInfo {
1459
- playing: boolean;
1460
- atStart: boolean;
1461
- atEnd: boolean;
1462
- }
1463
- declare class CoarseTimelineInfoProp extends TwistyPropDerived<CoarseTimelineInfoInputs, CoarseTimelineInfo> {
1464
- protected derive(inputs: CoarseTimelineInfoInputs): CoarseTimelineInfo;
1465
- protected canReuseValue(v1: CoarseTimelineInfo, v2: CoarseTimelineInfo): boolean;
1466
- }
1467
-
1468
- declare class TempoScaleProp extends TwistyPropSource<number, number> {
1469
- getDefaultValue(): number;
1470
- derive(v: number): number;
1471
- }
1472
-
1473
- declare const controlsLocations: {
1474
- "bottom-row": boolean;
1475
- none: boolean;
1476
- };
1477
- type ControlsLocation = keyof typeof controlsLocations;
1478
- type ControlPanelThemeWithAuto = ControlsLocation | "auto";
1479
- declare class ControlPanelProp extends SimpleTwistyPropSource<ControlPanelThemeWithAuto> {
1480
- getDefaultValue(): ControlPanelThemeWithAuto;
1481
- }
1482
-
1483
- declare class TimeRangeProp extends TwistyPropDerived<{
1484
- indexer: AlgIndexer;
1485
- }, TimeRange> {
1486
- derive(inputs: {
1487
- indexer: AlgIndexer;
1488
- }): TimeRange;
1489
- }
1490
-
1491
- type FaceletScale = "auto" | number;
1492
- declare class FaceletScaleProp extends SimpleTwistyPropSource<FaceletScale> {
1493
- getDefaultValue(): FaceletScale;
1494
- }
1495
-
1496
- type FoundationDisplay = "auto" | "opaque" | "none";
1497
- declare class FoundationDisplayProp extends SimpleTwistyPropSource<FoundationDisplay> {
1498
- getDefaultValue(): FoundationDisplay;
1499
- }
1500
-
1501
- declare const hintFaceletStyles: {
1502
- floating: boolean;
1503
- none: boolean;
1504
- };
1505
- type HintFaceletStyle = keyof typeof hintFaceletStyles;
1506
- type HintFaceletStyleWithAuto = HintFaceletStyle | "auto";
1507
- declare class HintFaceletProp extends SimpleTwistyPropSource<HintFaceletStyleWithAuto> {
1508
- getDefaultValue(): HintFaceletStyleWithAuto;
1509
- }
1510
-
1511
- type HintFaceletsElevationRequest = "auto" | number;
1512
- declare class HintFaceletsElevationProp extends SimpleTwistyPropSource<"auto" | number> {
1513
- getDefaultValue(): "auto" | number;
1514
- }
1515
-
1516
- type InitialHintFaceletsAnimation = "auto" | "always" | "none";
1517
- declare class InitialHintFaceletsAnimationProp extends SimpleTwistyPropSource<InitialHintFaceletsAnimation> {
1518
- getDefaultValue(): InitialHintFaceletsAnimation;
1519
- }
1520
-
1521
- type SpritePropInputs = {
1522
- spriteURL: URL | null;
1523
- };
1524
- declare class SpriteProp extends TwistyPropDerived<SpritePropInputs, Texture | null> {
1525
- derive(inputs: SpritePropInputs): Promise<Texture | null>;
1526
- }
1527
-
1528
- interface StickeringMaskPropInputs {
1529
- stickeringMaskRequest: StickeringMask | null;
1530
- stickeringRequest: ExperimentalStickering | null;
1531
- puzzleLoader: PuzzleLoader;
1532
- }
1533
- declare class StickeringMaskProp extends TwistyPropDerived<StickeringMaskPropInputs, StickeringMask> {
1534
- getDefaultValue(): StickeringMask;
1535
- derive(inputs: StickeringMaskPropInputs): Promise<StickeringMask>;
1536
- }
1537
-
1538
- declare class StickeringMaskRequestProp extends TwistyPropSource<StickeringMask | null, string | StickeringMask | null> {
1539
- getDefaultValue(): StickeringMask | null;
1540
- derive(input: string | StickeringMask | null): StickeringMask | null;
1541
- }
1542
-
1543
- declare const dragInputModes: {
1544
- auto: boolean;
1545
- none: boolean;
1546
- };
1547
- type DragInputMode = keyof typeof dragInputModes;
1548
- declare class DragInputProp extends SimpleTwistyPropSource<DragInputMode> {
1549
- getDefaultValue(): DragInputMode;
1550
- }
1551
-
1552
- declare class MovePressCancelOptions extends SimpleTwistyPropSource<AppendCancelOptions> {
1553
- getDefaultValue(): AppendCancelOptions;
1554
- }
1555
-
1556
- declare const movePressInputNames: {
1557
- auto: boolean;
1558
- none: boolean;
1559
- basic: boolean;
1560
- };
1561
- type MovePressInput = keyof typeof movePressInputNames;
1562
- declare class MovePressInputProp extends SimpleTwistyPropSource<MovePressInput> {
1563
- getDefaultValue(): MovePressInput;
1564
- }
1565
-
1566
- declare const backgroundThemes: {
1567
- checkered: boolean;
1568
- "checkered-transparent": boolean;
1569
- none: boolean;
1570
- };
1571
- type BackgroundTheme = keyof typeof backgroundThemes;
1572
- type BackgroundThemeWithAuto = BackgroundTheme | "auto";
1573
- declare class BackgroundProp extends SimpleTwistyPropSource<BackgroundThemeWithAuto> {
1574
- getDefaultValue(): BackgroundThemeWithAuto;
1575
- }
1576
-
1577
- interface ColorSchemePropInputs {
1578
- colorSchemeRequest: ColorSchemeWithAuto;
1579
- }
1580
- declare class ColorSchemeProp extends TwistyPropDerived<ColorSchemePropInputs, ColorScheme> {
1581
- protected derive(inputs: ColorSchemePropInputs): ColorScheme;
1582
- }
1583
-
1584
- declare class DOMElementReferenceProp extends SimpleTwistyPropSource<Element | null> {
1585
- getDefaultValue(): Element | null;
1586
- }
1587
-
1588
- type CoordinateDegrees = number;
1589
- interface OrbitCoordinates {
1590
- latitude: CoordinateDegrees;
1591
- longitude: CoordinateDegrees;
1592
- distance: number;
1593
- }
1594
- type OrbitCoordinatesRequest = Partial<OrbitCoordinates> | "auto";
1595
- declare class OrbitCoordinatesRequestProp extends TwistyPropSource<OrbitCoordinatesRequest, Partial<OrbitCoordinates> | "auto"> {
1596
- getDefaultValue(): OrbitCoordinatesRequest;
1597
- protected canReuseValue(v1: OrbitCoordinates, v2: OrbitCoordinates): boolean;
1598
- protected derive(newCoordinates: Partial<OrbitCoordinates> | "auto", oldValuePromise: Promise<OrbitCoordinatesRequest>): Promise<OrbitCoordinatesRequest>;
1599
- }
1600
-
1601
- declare class LatitudeLimitProp extends SimpleTwistyPropSource<CoordinateDegrees> {
1602
- getDefaultValue(): CoordinateDegrees;
1603
- }
1604
-
1605
- interface OrbitCoordinatesPropInputs {
1606
- orbitCoordinatesRequest: OrbitCoordinatesRequest;
1607
- latitudeLimit: CoordinateDegrees;
1608
- puzzleID: PuzzleID;
1609
- strategy: VisualizationStrategy;
1610
- }
1611
- declare class OrbitCoordinatesProp extends TwistyPropDerived<OrbitCoordinatesPropInputs, OrbitCoordinates> {
1612
- canReuseValue(v1: OrbitCoordinates, v2: OrbitCoordinates): boolean;
1613
- derive(inputs: OrbitCoordinatesPropInputs): Promise<OrbitCoordinates>;
1614
- }
1615
-
1616
- declare class TwistySceneModel {
1617
- twistyPlayerModel: TwistyPlayerModel;
1618
- background: BackgroundProp;
1619
- colorSchemeRequest: ColorSchemeRequestProp;
1620
- dragInput: DragInputProp;
1621
- foundationDisplay: FoundationDisplayProp;
1622
- foundationStickerSpriteURL: URLProp;
1623
- fullscreenElement: DOMElementReferenceProp;
1624
- hintFacelet: HintFaceletProp;
1625
- hintStickerSpriteURL: URLProp;
1626
- initialHintFaceletsAnimation: InitialHintFaceletsAnimationProp;
1627
- hintFaceletsElevation: HintFaceletsElevationProp;
1628
- latitudeLimit: LatitudeLimitProp;
1629
- movePressInput: MovePressInputProp;
1630
- movePressCancelOptions: MovePressCancelOptions;
1631
- orbitCoordinatesRequest: OrbitCoordinatesRequestProp;
1632
- stickeringMaskRequest: StickeringMaskRequestProp;
1633
- stickeringRequest: StickeringRequestProp;
1634
- faceletScale: FaceletScaleProp;
1635
- colorScheme: ColorSchemeProp;
1636
- foundationStickerSprite: SpriteProp;
1637
- hintStickerSprite: SpriteProp;
1638
- orbitCoordinates: OrbitCoordinatesProp;
1639
- stickeringMask: StickeringMaskProp;
1640
- constructor(twistyPlayerModel: TwistyPlayerModel);
1641
- }
1642
-
1643
- type Without<T, K extends string[]> = Pick<T, Exclude<keyof T, K[number]>>;
1644
- declare class TwistyPlayerModel {
1645
- userVisibleErrorTracker: UserVisibleErrorTracker;
1646
- /******************************** Depth 0 ********************************/
1647
- alg: AlgProp;
1648
- backView: BackViewProp;
1649
- controlPanel: ControlPanelProp;
1650
- catchUpMove: CatchUpMoveProp;
1651
- indexerConstructorRequest: IndexerConstructorRequestProp;
1652
- playingInfo: PlayingInfoProp;
1653
- puzzleDescriptionRequest: PGPuzzleDescriptionStringProp;
1654
- puzzleIDRequest: PuzzleIDRequestProp;
1655
- setupAnchor: SetupAnchorProp;
1656
- setupAlg: AlgProp;
1657
- setupTransformation: SetupTransformationProp;
1658
- tempoScale: TempoScaleProp;
1659
- timestampRequest: TimestampRequestProp;
1660
- viewerLink: ViewerLinkProp;
1661
- visualizationFormat: VisualizationFormatProp;
1662
- title: ArbitraryStringProp;
1663
- videoURL: URLProp;
1664
- competitionID: ArbitraryStringProp;
1665
- /**
1666
- * `<twisty-player>` interally supports associating custom timing information
1667
- * for this move, but there is not an API for this yet. In order to support
1668
- * exploratory use cases for such a feature in the future, this property
1669
- * allows setting timeline information.
1670
- *
1671
- * Note that this feature may not work as expected when combined with other
1672
- * features. In particular, it will cause sync issues with an associated
1673
- * `<twisty-alg-viewer>` depending on how the alg/moves are constructed.
1674
- *
1675
- * Usage example:
1676
- *
1677
- * ```ts
1678
- * import { Move, Pause } from "cubing/alg";
1679
- * import { TwistyPlayer } from "cubing/twisty";
1680
- *
1681
- * const player = document.body.appendChild(new TwistyPlayer());
1682
- * player.alg = "R U' D2 R'";
1683
- *
1684
- * // Note that:
1685
- * // - The leaves must match those of the alg. (No consistency checks are performed at this time.)
1686
- * // - Leaves may overlap if they can be simultaneously animated.
1687
- * // - There must always be at least one animating leaf at any moment. You can use a `Pause` for this if there is a gap between moves.
1688
- * player.experimentalModel.animationTimelineLeavesRequest.set([
1689
- * { animLeaf: new Move("R", 1), start: 0, end: 200 },
1690
- * { animLeaf: new Pause(), start: 200, end: 218 },
1691
- * { animLeaf: new Move("U", -1), start: 218, end: 370 },
1692
- * { animLeaf: new Move("D", 2), start: 249, end: 520 },
1693
- * { animLeaf: new Pause(), start: 520, end: 530 },
1694
- * { animLeaf: new Move("R", -1), start: 530, end: 790 },
1695
- * ]);
1696
- * ```
1697
- */
1698
- animationTimelineLeavesRequest: AnimationTimelineLeavesRequestProp;
1699
- /******************************** Depth 1 ********************************/
1700
- puzzleLoader: PuzzleLoaderProp;
1701
- /******************************** Depth 2 ********************************/
1702
- kpuzzle: KPuzzleProp;
1703
- puzzleID: PuzzleIDProp;
1704
- /******************************** Depth 3 ********************************/
1705
- puzzleAlg: PuzzleAlgProp;
1706
- puzzleSetupAlg: PuzzleAlgProp;
1707
- visualizationStrategy: VisualizationStrategyProp;
1708
- /******************************** Depth 4 ********************************/
1709
- indexerConstructor: IndexerConstructorProp;
1710
- setupAlgTransformation: AlgTransformationProp;
1711
- /******************************** Depth 5 ********************************/
1712
- indexer: IndexerProp;
1713
- /******************************** Depth 6 ********************************/
1714
- anchorTransformation: AnchorTransformationProp;
1715
- timeRange: TimeRangeProp;
1716
- /******************************** Depth 7 ********************************/
1717
- detailedTimelineInfo: DetailedTimelineInfoProp;
1718
- /******************************** Depth 8 ********************************/
1719
- coarseTimelineInfo: CoarseTimelineInfoProp;
1720
- currentMoveInfo: CurrentMoveInfoProp;
1721
- /******************************** Depth 9 ********************************/
1722
- buttonAppearance: ButtonAppearanceProp;
1723
- currentLeavesSimplified: CurrentLeavesSimplifiedProp;
1724
- /******************************** Depth 10 ********************************/
1725
- currentPattern: CurrentPatternProp;
1726
- /******************************** Depth 11 ********************************/
1727
- legacyPosition: LegacyPositionProp;
1728
- twistySceneModel: TwistySceneModel;
1729
- twizzleLink(): Promise<string>;
1730
- experimentalAddAlgLeaf(algLeaf: AlgLeaf, options?: AppendOptions): void;
1731
- experimentalAddMove(flexibleMove: Move | string, options?: Without<AppendOptions, [
1732
- "puzzleLoader",
1733
- "puzzleSpecificSimplifyOptions"
1734
- ]>): void;
1735
- experimentalRemoveFinalChild(): void;
1736
- }
1737
-
1738
- interface TwistyAnimationControllerDelegate {
1739
- flash(): void;
1740
- }
1741
- declare class TwistyAnimationController {
1742
- #private;
1743
- private delegate;
1744
- private playing;
1745
- private direction;
1746
- private catchUpHelper;
1747
- private model;
1748
- private lastDatestamp;
1749
- private lastTimestampPromise;
1750
- private scheduler;
1751
- constructor(model: TwistyPlayerModel, delegate: TwistyAnimationControllerDelegate);
1752
- onPlayingProp(playingInfo: PlayingInfo): Promise<void>;
1753
- onCatchUpMoveProp(catchUpMove: CatchUpMove): Promise<void>;
1754
- jumpToStart(options?: {
1755
- flash: boolean;
1756
- }): void;
1757
- jumpToEnd(options?: {
1758
- flash: boolean;
1759
- }): void;
1760
- playPause(): void;
1761
- play(options?: {
1762
- direction?: SimpleDirection;
1763
- untilBoundary?: BoundaryType;
1764
- autoSkipToOtherEndIfStartingAtBoundary?: boolean;
1765
- loop?: boolean;
1766
- }): void;
1767
- pause(): void;
1768
- animFrame(frameDatestamp: MillisecondTimestamp): Promise<void>;
1769
- }
1770
-
1771
- /**
1772
- * @author mrdoob / http://mrdoob.com/
1773
- * ESM conversion by Lucas Garron, 2021-12-21
1774
- */
1775
- declare class Stats {
1776
- mode: number;
1777
- dom: HTMLDivElement;
1778
- constructor();
1779
- addPanel(panel: StatsPanel): StatsPanel;
1780
- showPanel(id: number): void;
1781
- beginTime: number;
1782
- prevTime: number;
1783
- frames: number;
1784
- fpsPanel: StatsPanel;
1785
- msPanel: StatsPanel;
1786
- memPanel: StatsPanel | null;
1787
- REVISION: number;
1788
- begin(): void;
1789
- end(): number;
1790
- update(): void;
1791
- }
1792
- declare class StatsPanel {
1793
- private name;
1794
- private fg;
1795
- private bg;
1796
- min: number;
1797
- max: number;
1798
- dom: HTMLCanvasElement;
1799
- context: CanvasRenderingContext2D;
1800
- constructor(name: string, fg: string, bg: string);
1801
- update(value: number, maxValue: number): void;
1802
- }
1803
-
1804
- interface Schedulable {
1805
- scheduleRender(): void;
1806
- }
1807
-
1808
- interface DragMovementInfo {
1809
- attachedInfo: Record<any, any>;
1810
- movementX: number;
1811
- movementY: number;
1812
- elapsedMs: number;
1813
- }
1814
- interface PressInfo {
1815
- normalizedX: number;
1816
- normalizedY: number;
1817
- rightClick: boolean;
1818
- keys: {
1819
- altKey: boolean;
1820
- ctrlOrMetaKey: boolean;
1821
- shiftKey: boolean;
1822
- };
1823
- }
1824
- declare class DragTracker extends EventTarget {
1825
- #private;
1826
- readonly target: HTMLElement;
1827
- constructor(target: HTMLElement);
1828
- start(): void;
1829
- stop(): void;
1830
- addTargetListener(eventType: string, listener: ((e: MouseEvent) => any) | ((e: PointerEvent) => any)): void;
1831
- private onPointerDown;
1832
- private onPointerMove;
1833
- private onPointerUp;
1834
- }
1835
-
1836
- interface Twisty3DPuzzle extends Object3D {
1837
- onPositionChange(position: PuzzlePosition): void;
1838
- setStickeringMask(stickeringMask: StickeringMask): void;
1839
- }
1840
-
1841
- declare class Twisty3DPuzzleWrapper extends EventTarget implements Schedulable {
1842
- #private;
1843
- private model;
1844
- schedulable: Schedulable;
1845
- private puzzleLoader;
1846
- private visualizationStrategy;
1847
- constructor(model: TwistyPlayerModel, schedulable: Schedulable, puzzleLoader: PuzzleLoader, visualizationStrategy: VisualizationStrategy);
1848
- disconnect(): void;
1849
- scheduleRender(): void;
1850
- twisty3DPuzzle(): Promise<Twisty3DPuzzle>;
1851
- raycastMove(raycasterPromise: Promise<Raycaster>, transformations: {
1852
- invert: boolean;
1853
- depth?: "secondSlice" | "rotation" | "none";
1854
- }): Promise<void>;
1855
- }
1856
-
1857
- declare class Twisty3DSceneWrapper extends ManagedCustomElement implements Schedulable {
1858
- #private;
1859
- model?: TwistyPlayerModel | undefined;
1860
- disconnect(): void;
1861
- constructor(model?: TwistyPlayerModel | undefined);
1862
- connectedCallback(): Promise<void>;
1863
- setBackView(backView: BackViewLayout): void;
1864
- onPress(e: CustomEvent<{
1865
- pressInfo: PressInfo;
1866
- cameraPromise: Promise<PerspectiveCamera>;
1867
- }>): Promise<void>;
1868
- scene(): Promise<Scene>;
1869
- addVantage(vantage: Twisty3DVantage): void;
1870
- removeVantage(vantage: Twisty3DVantage): void;
1871
- experimentalVantages(): Iterable<Twisty3DVantage>;
1872
- scheduleRender(): void;
1873
- setCurrentTwisty3DPuzzleWrapper(scene: Scene, twisty3DPuzzleWrapper: Twisty3DPuzzleWrapper): Promise<void>;
1874
- /** @deprecated */
1875
- experimentalTwisty3DPuzzleWrapper(): Promise<Twisty3DPuzzleWrapper>;
1876
- onPuzzle(inputs: [
1877
- puzzleLoader: PuzzleLoader,
1878
- visualizationStrategy: VisualizationStrategy
1879
- ]): Promise<void>;
1880
- }
1881
-
1882
- declare class TwistyOrbitControls {
1883
- private model;
1884
- private mirror;
1885
- private canvas;
1886
- private dragTracker;
1887
- /** @deprecated */
1888
- experimentalInertia: boolean;
1889
- private onMovementBound;
1890
- experimentalHasBeenMoved: boolean;
1891
- constructor(model: TwistyPlayerModel, mirror: boolean, canvas: HTMLCanvasElement, dragTracker: DragTracker);
1892
- temperMovement(f: number): number;
1893
- onMove(e: CustomEvent<DragMovementInfo>): void;
1894
- onMovement(movementX: number, movementY: number): {
1895
- temperedX: number;
1896
- temperedY: number;
1897
- };
1898
- onUp(e: CustomEvent<DragMovementInfo>): void;
1899
- }
1900
-
1901
- declare class Twisty3DVantage extends ManagedCustomElement {
1902
- #private;
1903
- private model?;
1904
- private options?;
1905
- scene: Twisty3DSceneWrapper | null;
1906
- stats: Stats | null;
1907
- private rendererIsShared;
1908
- loadingElement: HTMLDivElement | null;
1909
- constructor(model?: TwistyPlayerModel | undefined, scene?: Twisty3DSceneWrapper, options?: {
1910
- backView?: boolean;
1911
- } | undefined);
1912
- connectedCallback(): Promise<void>;
1913
- clearCanvas(): Promise<void>;
1914
- renderer(): Promise<WebGLRenderer>;
1915
- canvasInfo(): Promise<{
1916
- canvas: HTMLCanvasElement;
1917
- context: CanvasRenderingContext2D;
1918
- }>;
1919
- camera(): Promise<PerspectiveCamera>;
1920
- orbitControls(): Promise<TwistyOrbitControls>;
1921
- addListener<T>(prop: TwistyPropParent<T>, listener: (value: T) => void): void;
1922
- disconnect(): void;
1923
- experimentalNextRenderFinishedCallback(callback: () => void): void;
1924
- render(): Promise<void>;
1925
- scheduleRender(): void;
1926
- }
1927
-
1928
- declare abstract class TwistyPlayerSettable extends ManagedCustomElement {
1929
- experimentalModel: TwistyPlayerModel;
1930
- set alg(newAlg: Alg | string);
1931
- get alg(): never;
1932
- set experimentalSetupAlg(newSetup: Alg | string);
1933
- get experimentalSetupAlg(): never;
1934
- set experimentalSetupAnchor(anchor: SetupToLocation);
1935
- get experimentalSetupAnchor(): never;
1936
- set puzzle(puzzleID: PuzzleID);
1937
- get puzzle(): never;
1938
- set experimentalPuzzleDescription(puzzleDescription: PuzzleDescriptionString);
1939
- get experimentalPuzzleDescription(): never;
1940
- set timestamp(timestamp: TimestampRequest);
1941
- get timestamp(): never;
1942
- set hintFacelets(hintFaceletStyle: HintFaceletStyleWithAuto);
1943
- get hintFacelets(): never;
1944
- set experimentalStickering(stickering: ExperimentalStickering);
1945
- get experimentalStickering(): never;
1946
- set experimentalStickeringMaskOrbits(stickeringMask: string | StickeringMask);
1947
- get experimentalStickeringMaskOrbits(): never;
1948
- set experimentalFaceletScale(faceletScale: FaceletScale);
1949
- get experimentalFaceletScale(): never;
1950
- set backView(backView: BackViewLayoutWithAuto);
1951
- get backView(): never;
1952
- set background(backgroundTheme: BackgroundThemeWithAuto);
1953
- get background(): never;
1954
- set colorScheme(colorScheme: ColorSchemeWithAuto);
1955
- get colorScheme(): never;
1956
- set controlPanel(newControlPanel: ControlPanelThemeWithAuto);
1957
- get controlPanel(): never;
1958
- set visualization(visualizationFormat: VisualizationFormatWithAuto);
1959
- get visualization(): never;
1960
- set experimentalTitle(title: string | null);
1961
- get experimentalTitle(): never;
1962
- set experimentalVideoURL(videoURL: string | null);
1963
- get experimentalVideoURL(): never;
1964
- set experimentalCompetitionID(competitionID: string | null);
1965
- get experimentalCompetitionID(): never;
1966
- set viewerLink(viewerLinkPage: ViewerLinkPageWithAuto);
1967
- get viewerLink(): never;
1968
- set experimentalMovePressInput(movePressInput: MovePressInput);
1969
- get experimentalMovePressInput(): never;
1970
- set experimentalMovePressCancelOptions(movePressCancelOptions: AppendCancelOptions);
1971
- get experimentalMovePressCancelOptions(): never;
1972
- set cameraLatitude(latitude: number);
1973
- get cameraLatitude(): never;
1974
- set cameraLongitude(longitude: number);
1975
- get cameraLongitude(): never;
1976
- set cameraDistance(distance: number);
1977
- get cameraDistance(): never;
1978
- set cameraLatitudeLimit(latitudeLimit: number);
1979
- get cameraLatitudeLimit(): never;
1980
- set indexer(indexer: IndexerStrategyName);
1981
- get indexer(): never;
1982
- set tempoScale(newTempoScale: number);
1983
- get tempoScale(): never;
1984
- set experimentalSprite(url: string | URL);
1985
- get experimentalSprite(): never;
1986
- set experimentalHintSprite(url: string | URL);
1987
- get experimentalHintSprite(): never;
1988
- set fullscreenElement(element: Element | null);
1989
- get fullscreenElement(): never;
1990
- set experimentalInitialHintFaceletsAnimation(anim: InitialHintFaceletsAnimation);
1991
- get experimentalInitialHintFaceletsAnimation(): never;
1992
- set experimentalHintFaceletsElevation(elevation: "auto" | number);
1993
- get experimentalHintFaceletsElevation(): never;
1994
- set experimentalDragInput(dragInputMode: DragInputMode);
1995
- get experimentalDragInput(): never;
1996
- experimentalGet: ExperimentalGetters;
1997
- }
1998
- declare class ExperimentalGetters {
1999
- private model;
2000
- constructor(model: TwistyPlayerModel);
2001
- alg(): Promise<Alg>;
2002
- setupAlg(): Promise<Alg>;
2003
- puzzleID(): Promise<PuzzleID>;
2004
- timestamp(): Promise<MillisecondTimestamp>;
2005
- }
2006
-
2007
- /**
2008
- * The config argument passed to {@link TwistyPlayer} when calling the
2009
- * constructor. This interface type be useful for avoiding bugs when you would
2010
- * like to create a {@link TwistyPlayer} using a dynamic config, or by combining
2011
- * configs.
2012
- *
2013
- * ```js
2014
- * import { TwistyPlayer, type TwistyPlayerConfig } from "cubing/twisty";
2015
- *
2016
- * const MY_DEFAULT_CONFIG: TwistyPlayerConfig = {
2017
- * puzzle: "megaminx",
2018
- * alg: "R U R'"
2019
- * };
2020
- * export function createTwistyPlayer(overrideConfig: TwistyPlayerConfig) {
2021
- * const options = { ...MY_DEFAULT_CONFIG, ...overrideConfig };
2022
- * return new TwistyPlayer(options);
2023
- * }
2024
- *
2025
- * // Example: if the current page is https://alpha.twizzle.net/edit/?alg=M2+E2+S2
2026
- * // then this gives us the "alg" param value "M2 E2 S2".
2027
- * const myOverrideConfig: TwistyPlayerConfig = {};
2028
- * const algParam = new URL(location.href).searchParams.get("alg");
2029
- * if (algParam) {
2030
- * myOverrideConfig.alg = algParam;
2031
- * }
2032
- * createTwistyPlayer(myOverrideConfig);
2033
- * ```
2034
- *
2035
- * @category TwistyPlayer
2036
- */
2037
- interface TwistyPlayerConfig {
2038
- alg?: Alg | string;
2039
- experimentalSetupAlg?: Alg | string;
2040
- experimentalSetupAnchor?: SetupToLocation;
2041
- puzzle?: PuzzleID;
2042
- experimentalPuzzleDescription?: PuzzleDescriptionString;
2043
- visualization?: VisualizationFormatWithAuto;
2044
- hintFacelets?: HintFaceletStyleWithAuto;
2045
- experimentalStickering?: ExperimentalStickering | null;
2046
- experimentalStickeringMaskOrbits?: StickeringMask | string;
2047
- background?: BackgroundThemeWithAuto;
2048
- colorScheme?: ColorSchemeWithAuto;
2049
- controlPanel?: ControlPanelThemeWithAuto;
2050
- backView?: BackViewLayoutWithAuto;
2051
- experimentalInitialHintFaceletsAnimation?: InitialHintFaceletsAnimation;
2052
- experimentalFaceletScale?: FaceletScale;
2053
- experimentalHintFaceletsElevation?: HintFaceletsElevationRequest;
2054
- viewerLink?: ViewerLinkPageWithAuto;
2055
- experimentalMovePressInput?: MovePressInput;
2056
- experimentalDragInput?: DragInputMode;
2057
- experimentalTitle?: string | null;
2058
- experimentalVideoURL?: string;
2059
- experimentalCompetitionID?: string;
2060
- cameraLatitude?: number;
2061
- cameraLongitude?: number;
2062
- cameraDistance?: number;
2063
- cameraLatitudeLimit?: number;
2064
- tempoScale?: number;
2065
- experimentalSprite?: string | null;
2066
- experimentalHintSprite?: string | null;
2067
- experimentalMovePressCancelOptions?: AppendCancelOptions;
2068
- }
2069
- declare const intersectedCallback: unique symbol;
2070
- /**
2071
- * TwistyPlayer is the heart of `cubing.js`. It can be used to display a puzzle on a web page like this:
2072
- *
2073
- * <script src="path/to/cubing/twisty" type="module"></script>
2074
- * <twisty-player alg="R U R'"></twisty-player>
2075
- *
2076
- * You can also construct it directly in JavaScript:
2077
- *
2078
- * ```js
2079
- * import { TwistyPlayer } from "cubing/twisty";
2080
- * const twistyPlayer = new TwistyPlayer({alg: "R U R'"});
2081
- * // Once the page has loaded, you can do this:
2082
- * document.body.appendChild(twistyPlayer);
2083
- * ```
2084
- *
2085
- * See {@link https://js.cubing.net/cubing/} for more examples.
2086
- *
2087
- * @category TwistyPlayer
2088
- */
2089
- declare class TwistyPlayer extends TwistyPlayerSettable implements TwistyAnimationControllerDelegate {
2090
- #private;
2091
- controller: TwistyPlayerController;
2092
- buttons?: TwistyButtons;
2093
- experimentalCanvasClickCallback: (...args: any) => void;
2094
- constructor(config?: TwistyPlayerConfig);
2095
- connectedCallback(): void;
2096
- [intersectedCallback](): Promise<void>;
2097
- /** @deprecated */
2098
- experimentalSetFlashLevel(newLevel: "auto" | "none"): void;
2099
- flash(): void;
2100
- experimentalCurrentVantages(): Promise<Iterable<Twisty3DVantage>>;
2101
- experimentalCurrentCanvases(): Promise<HTMLCanvasElement[]>;
2102
- /**
2103
- * Get the first available puzzle `Object3D`. This can be inserted into
2104
- * another `three.js` scene, essentially "adopting" it from the
2105
- * `TwistyPlayer`'s scenes while still allowing the `TwistyPlayer` to animate
2106
- * it. The function returns a `Promise` that returns if and when the
2107
- * `Object3D` is available, and accepts a callback that is called whenever a
2108
- * render is scheduled for the puzzle (essentially, if something about the
2109
- * puzzle has changed, like its appearance or current animated state).
2110
- *
2111
- * Note:
2112
- * - This may never resolve if the player never creates the relevant 3D object
2113
- * under the hood (e.g. if the config is set to 2D, or is not valid for
2114
- * rendering a puzzle)
2115
- * - The architecture of `cubing.js` may change significantly, so it is not
2116
- * guaranteed that a `three.js` `Object3D` will be available from the main
2117
- * thread in the future.
2118
- * - This function only returns the current `three.js` puzzle object (once one
2119
- * exists). If you change e.g. the `puzzle` config for the player, then the
2120
- * object will currently become stale. This may be replaced with more
2121
- * convenient behaviour in the future.
2122
- *
2123
- * @deprecated */
2124
- experimentalCurrentThreeJSPuzzleObject(puzzleRenderScheduledCallback?: () => void): Promise<Object3D>;
2125
- jumpToStart(options?: {
2126
- flash: boolean;
2127
- }): void;
2128
- jumpToEnd(options?: {
2129
- flash: boolean;
2130
- }): void;
2131
- play(): void;
2132
- pause(): void;
2133
- togglePlay(play?: boolean): void;
2134
- experimentalAddMove(flexibleMove: Move | string, options?: AppendOptions): void;
2135
- experimentalAddAlgLeaf(algLeaf: AlgLeaf, options?: AppendOptions): void;
2136
- static get observedAttributes(): string[];
2137
- experimentalRemoveFinalChild(): void;
2138
- attributeChangedCallback(attributeName: string, _oldValue: string, newValue: string): void;
2139
- experimentalScreenshot(options?: {
2140
- width: number;
2141
- height: number;
2142
- }): Promise<string>;
2143
- experimentalDownloadScreenshot(filename?: string): Promise<void>;
2144
- }
2145
- declare global {
2146
- interface HTMLElementTagNameMap {
2147
- "twisty-player": TwistyPlayer;
2148
- }
2149
- }
2150
-
2151
- declare const startCharIndexKey: unique symbol;
2152
- declare const endCharIndexKey: unique symbol;
2153
- interface ParserIndexed {
2154
- [startCharIndexKey]: number;
2155
- [endCharIndexKey]: number;
2156
- }
2157
- type Parsed<T extends Alg | AlgNode> = T & ParserIndexed;
2158
-
2159
- type AnimatedLeafAlgNodeInfo = {
2160
- leaf: Parsed<AnimatedLeafAlgNode>;
2161
- idx: LeafIndex;
2162
- };
2163
- type OrderedLeafTokens = AnimatedLeafAlgNodeInfo[];
2164
-
2165
- declare class TwistyAlgEditorValueProp extends SimpleTwistyPropSource<string> {
2166
- getDefaultValue(): string;
2167
- }
2168
- interface AlgEditorAlgWithIssuesPropInput {
2169
- value: string;
2170
- }
2171
- declare class AlgEditorAlgWithIssuesProp extends TwistyPropDerived<AlgEditorAlgWithIssuesPropInput, AlgWithIssues> {
2172
- derive(input: AlgEditorAlgWithIssuesPropInput): AlgWithIssues;
2173
- }
2174
- interface SelectionInfoPropInput {
2175
- selectionStart: number;
2176
- selectionEnd: number;
2177
- }
2178
- interface SelectionInfo extends SelectionInfoPropInput {
2179
- endChangedMostRecently: boolean;
2180
- }
2181
- declare class TwistyAlgEditorSelectionProp extends TwistyPropSource<SelectionInfo, SelectionInfoPropInput> {
2182
- getDefaultValue(): {
2183
- selectionStart: number;
2184
- selectionEnd: number;
2185
- endChangedMostRecently: boolean;
2186
- };
2187
- derive(input: SelectionInfoPropInput, oldValue: Promise<SelectionInfo>): Promise<SelectionInfo>;
2188
- }
2189
- interface TargetCharPropInputs {
2190
- selectionInfo: SelectionInfo;
2191
- }
2192
- declare class TargetCharProp extends TwistyPropDerived<TargetCharPropInputs, number> {
2193
- derive(inputs: TargetCharPropInputs): number;
2194
- }
2195
- interface LeafTokensPropInputs {
2196
- algWithIssues: AlgWithIssues;
2197
- }
2198
- declare class LeafTokensProp extends TwistyPropDerived<LeafTokensPropInputs, OrderedLeafTokens> {
2199
- derive(inputs: LeafTokensPropInputs): OrderedLeafTokens;
2200
- }
2201
- interface LeafToHighlightPropInputs {
2202
- targetChar: number;
2203
- leafTokens: OrderedLeafTokens;
2204
- }
2205
- type HighlightWhere = "before" | "start" | "inside" | "end" | "after";
2206
- interface HighlightInfo {
2207
- leafInfo: AnimatedLeafAlgNodeInfo;
2208
- where: HighlightWhere;
2209
- }
2210
- declare class LeafToHighlightProp extends TwistyPropDerived<LeafToHighlightPropInputs, HighlightInfo | null> {
2211
- derive(inputs: LeafToHighlightPropInputs): HighlightInfo | null;
2212
- }
2213
- declare class TwistyAlgEditorModel {
2214
- valueProp: TwistyAlgEditorValueProp;
2215
- selectionProp: TwistyAlgEditorSelectionProp;
2216
- targetCharProp: TargetCharProp;
2217
- algEditorAlgWithIssues: AlgEditorAlgWithIssuesProp;
2218
- leafTokensProp: LeafTokensProp;
2219
- leafToHighlight: LeafToHighlightProp;
2220
- }
2221
-
2222
- /**
2223
- * Warning: the current implementation of <twisty-alg-editor> is *not good*,
2224
- * but it is *good enough*. The important parts is that:
2225
- *
2226
- * - The editor can be used in apps without much effort.
2227
- * - The editor handles alg validation and move highlighting *okay* when not
2228
- * connected to a `<twisty-player>`.
2229
- * - The editor stays in sync if it's connected to a `<twisty-player>`.
2230
- *
2231
- * The current implementation still has some race conditions and edge cases. A
2232
- * proper rewrite with a better model would be very welcome.
2233
- */
2234
-
2235
- type TwistyPlayerAlgProp = "alg" | "setupAlg";
2236
- /** @category Other Custom Elements */
2237
- declare class TwistyAlgEditor extends ManagedCustomElement {
2238
- #private;
2239
- model: TwistyAlgEditorModel;
2240
- debugNeverRequestTimestamp: boolean;
2241
- constructor(options?: {
2242
- twistyPlayer?: TwistyPlayer;
2243
- twistyPlayerProp?: TwistyPlayerAlgProp;
2244
- });
2245
- connectedCallback(): void;
2246
- set algString(s: string);
2247
- get algString(): string;
2248
- set placeholder(placeholderText: string);
2249
- onInput(): void;
2250
- onSelectionChange(): Promise<void>;
2251
- onBlur(): Promise<void>;
2252
- setAlgIssueClassForPuzzle(issues: "none" | "warning" | "error"): void;
2253
- highlightLeaf(leaf: Parsed<Move | Pause> | null): void;
2254
- get twistyPlayer(): TwistyPlayer | null;
2255
- set twistyPlayer(twistyPlayer: TwistyPlayer | null);
2256
- protected attributeChangedCallback(attributeName: string, _oldValue: string, newValue: string): void;
2257
- static get observedAttributes(): string[];
2258
- }
2259
- declare global {
2260
- interface HTMLElementTagNameMap {
2261
- "twisty-alg-editor": TwistyAlgEditor;
2262
- }
2263
- }
2264
-
2265
- interface DataDown {
2266
- earliestMoveIndex: LeafIndex;
2267
- twistyAlgViewer: TwistyAlgViewer;
2268
- direction: IterationDirection;
2269
- }
2270
- interface DataUp {
2271
- moveCount: number;
2272
- element: TwistyAlgWrapperElem | TwistyAlgLeafElem;
2273
- }
2274
- declare class TwistyAlgLeafElem extends ManagedCustomElement {
2275
- algOrAlgNode: Alg | AlgNode;
2276
- constructor(className: string, text: string, dataDown: DataDown, algOrAlgNode: Alg | AlgNode, offsetIntoMove: boolean, clickable: boolean);
2277
- pathToIndex(_index: number): (TwistyAlgWrapperElem | TwistyAlgLeafElem)[];
2278
- setCurrentMove(current: boolean): void;
2279
- }
2280
- declare class TwistyAlgWrapperElem extends HTMLElementShim {
2281
- algOrAlgNode: Alg | AlgNode;
2282
- private queue;
2283
- constructor(className: string, algOrAlgNode: Alg | AlgNode);
2284
- addString(str: string): void;
2285
- addElem(dataUp: DataUp): number;
2286
- flushQueue(direction?: IterationDirection): void;
2287
- pathToIndex(_index: number): (TwistyAlgWrapperElem | TwistyAlgLeafElem)[];
2288
- }
2289
- declare class MoveHighlighter {
2290
- moveCharIndexMap: Map<number, TwistyAlgLeafElem>;
2291
- currentElem: TwistyAlgLeafElem | null;
2292
- addMove(charIndex: number, elem: TwistyAlgLeafElem): void;
2293
- set(move: Parsed<Move> | null): void;
2294
- }
2295
- /** @category Other Custom Elements */
2296
- declare class TwistyAlgViewer extends HTMLElementShim {
2297
- #private;
2298
- highlighter: MoveHighlighter;
2299
- lastClickTimestamp: number | null;
2300
- constructor(options?: {
2301
- twistyPlayer?: TwistyPlayer;
2302
- });
2303
- protected connectedCallback(): void;
2304
- private setAlg;
2305
- get twistyPlayer(): TwistyPlayer | null;
2306
- set twistyPlayer(twistyPlayer: TwistyPlayer | null);
2307
- jumpToIndex(index: LeafIndex, offsetIntoMove: boolean): Promise<void>;
2308
- protected attributeChangedCallback(attributeName: string, _oldValue: string, newValue: string): Promise<void>;
2309
- static get observedAttributes(): string[];
2310
- }
2311
- declare global {
2312
- interface HTMLElementTagNameMap {
2313
- "twisty-alg-viewer": TwistyAlgViewer;
2314
- }
2315
- }
2316
-
2317
- declare class TwizzleLink extends ManagedCustomElement {
2318
- #private;
2319
- private options?;
2320
- twistyPlayer: TwistyPlayer | null;
2321
- a: HTMLAnchorElement | null;
2322
- constructor(options?: {
2323
- cdnForumTweaks?: boolean;
2324
- colorScheme?: ColorSchemeWithAuto;
2325
- } | undefined);
2326
- connectedCallback(): Promise<void>;
2327
- }
2328
- declare global {
2329
- interface HTMLElementTagNameMap {
2330
- "twizzle-link": TwizzleLink;
2331
- }
2332
- }
2333
-
2334
- type KeyMapping = {
2335
- [keyCode: string]: AlgLeaf;
2336
- };
2337
- type AlgTransformData = Record<string, {
2338
- replaceMovesByFamily: Record<string, string>;
2339
- invertExceptByFamily?: Set<string>;
2340
- }>;
2341
- interface PuzzleLoader {
2342
- id: string;
2343
- fullName: string;
2344
- inventedBy?: string[];
2345
- inventionYear?: number;
2346
- /** @deprecated */
2347
- def?: never;
2348
- kpuzzle: () => Promise<KPuzzle>;
2349
- svg: () => Promise<string>;
2350
- llSVG?: () => Promise<string>;
2351
- llFaceSVG?: () => Promise<string>;
2352
- pg?: () => Promise<PuzzleGeometry>;
2353
- basePG?: () => Promise<PuzzleGeometry>;
2354
- stickeringMask?: (stickering: ExperimentalStickering) => Promise<StickeringMask>;
2355
- stickerings?: () => Promise<ExperimentalStickering[]>;
2356
- puzzleSpecificSimplifyOptions?: PuzzleSpecificSimplifyOptions;
2357
- puzzleSpecificSimplifyOptionsPromise?: Promise<PuzzleSpecificSimplifyOptions>;
2358
- keyMapping?: () => Promise<KeyMapping>;
2359
- algTransformData?: AlgTransformData;
2360
- }
2361
-
2362
- export { Pause as $, type AlgLeaf as A, type LeafIndex as B, KTransformation as C, type MillisecondDuration as D, type ExperimentalStickering as E, type BackViewLayout as F, TwistyAlgViewer as G, TwistyPlayer as H, type TwistyPlayerConfig as I, TwizzleLink as J, KPattern as K, type LeafCount as L, Move as M, NO_VALUE as N, backViewLayouts as O, Perm as P, Quat as Q, type AlgNode as R, type StickerDat as S, TwistyAlgEditor as T, type AppendOptions as U, type VisualizationFormat as V, Grouping as W, LineComment as X, Commutator as Y, Conjugate as Z, Newline as _, PUZZLE_BASE_SHAPES as a, type KeyMapping as a0, type AlgBranch as a1, type AppendCancelOptions as a2, type ExperimentalNotationType as a3, type Parsed as a4, type ExperimentalSerializationOptions as a5, type GroupingModifications as a6, type MoveModifications as a7, QuantumMove as a8, type SimplifyOptions as a9, type KPatternData as aa, type KPatternOrbitData as ab, type KPuzzleDefinition as ac, type KPuzzleOrbitDefinition as ad, type KTransformationData as ae, type KTransformationOrbitData as af, PUZZLE_CUT_TYPES as b, PGNotation as c, type PuzzleBaseShape as d, type PuzzleCutDescription as e, type PuzzleCutType as f, type PuzzleDescription as g, type PuzzleGeometryOptions as h, PuzzleGeometry as i, type StickerDatAxis as j, type StickerDatFace as k, type StickerDatSticker as l, getPG3DNamedPuzzles as m, getPuzzleDescriptionString as n, getPuzzleGeometryByDesc as o, getPuzzleGeometryByName as p, parsePuzzleDescription as q, Alg as r, type PuzzleLoader as s, type PuzzleID as t, KPuzzle as u, type StickeringMask as v, type PuzzleSpecificSimplifyOptions as w, type AlgTransformData as x, type AlgIndexer as y, type MillisecondTimestamp as z };