cubing 0.53.2 → 0.53.4

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 (32) hide show
  1. package/alg/index.d.ts +1 -1
  2. package/bluetooth/index.d.ts +1 -1
  3. package/dist/bin/chunks/chunk-DFQMTDRG.js +26 -0
  4. package/dist/bin/chunks/chunk-DFQMTDRG.js.map +7 -0
  5. package/dist/bin/order.js +8 -7
  6. package/dist/bin/order.js.map +2 -2
  7. package/dist/bin/scramble.js +9 -30
  8. package/dist/bin/scramble.js.map +3 -3
  9. package/dist/lib/cubing/{TwizzleLink.d-Dde7gyeR.d.ts → TwizzleLink.d-iit8QFEU.d.ts} +1 -1
  10. package/dist/lib/cubing/bluetooth/index.d.ts +4 -4
  11. package/dist/lib/cubing/{bluetooth-puzzle.d-CmjQOGXN.d.ts → bluetooth-puzzle.d-DA4Wx3co.d.ts} +1 -1
  12. package/dist/lib/cubing/{index-SnpOfUNy.d.ts → index-WCV0Si9w.d.ts} +1 -1
  13. package/dist/lib/cubing/kpuzzle/index.d.ts +1 -1
  14. package/dist/lib/cubing/notation/index.d.ts +2 -2
  15. package/dist/lib/cubing/protocol/index.d.ts +1 -1
  16. package/dist/lib/cubing/puzzle-geometry/index.d.ts +2 -2
  17. package/dist/lib/cubing/puzzles/index.d.ts +2 -2
  18. package/dist/lib/cubing/scramble/index.d.ts +2 -2
  19. package/dist/lib/cubing/search/index.d.ts +2 -2
  20. package/dist/lib/cubing/stream/index.d.ts +3 -3
  21. package/dist/lib/cubing/twisty/index.d.ts +3 -3
  22. package/kpuzzle/index.d.ts +1 -1
  23. package/notation/index.d.ts +1 -1
  24. package/package.json +4 -4
  25. package/protocol/index.d.ts +1 -1
  26. package/puzzle-geometry/index.d.ts +1 -1
  27. package/puzzles/index.d.ts +1 -1
  28. package/scramble/index.d.ts +1 -1
  29. package/search/index.d.ts +1 -1
  30. package/stream/index.d.ts +1 -1
  31. package/twisty/index.d.ts +1 -1
  32. package/dist/lib/cubing/{KPattern.d-BYanty6A.d.ts → index-CxSsew9j.d.ts} +109 -109
package/alg/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/alg/index.d.ts";
1
+ export * from "../dist/lib/cubing/alg/index.d.ts";
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/bluetooth/index.d.ts";
1
+ export * from "../dist/lib/cubing/bluetooth/index.d.ts";
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/bin/guards/cmd-ts-too-guard.ts
4
+ import { exit } from "node:process";
5
+ try {
6
+ await import("cmd-ts-too");
7
+ } catch (e) {
8
+ console.error(
9
+ `Could not import \`cmd-ts-too\`. This is not automatically installed as a regular dependency of \`cubing\`.
10
+
11
+ If you are installing globally, consider using \`bun\`: https://bun.sh/
12
+
13
+ bun install --global cubing
14
+
15
+ If you are installing using \`npx\` globally, run:
16
+
17
+ npm install --global cubing cmd-ts-too
18
+
19
+ If you are using \`npx\` within a repo, run:
20
+
21
+ npm install cubing cmd-ts-too
22
+ `
23
+ );
24
+ exit(1);
25
+ }
26
+ //# sourceMappingURL=chunk-DFQMTDRG.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/bin/guards/cmd-ts-too-guard.ts"],
4
+ "sourcesContent": ["import { exit } from \"node:process\";\n\ntry {\n await import(\"cmd-ts-too\");\n} catch (e) {\n // Note that this doesn't fail when installed using `bun install --global`, as `bun` automatically loads deps.\n console.error(\n `Could not import \\`cmd-ts-too\\`. This is not automatically installed as a regular dependency of \\`cubing\\`.\n\nIf you are installing globally, consider using \\`bun\\`: https://bun.sh/\n\n bun install --global cubing\n\nIf you are installing using \\`npx\\` globally, run:\n\n npm install --global cubing cmd-ts-too\n\nIf you are using \\`npx\\` within a repo, run:\n\n npm install cubing cmd-ts-too\n`,\n );\n exit(1);\n}\n"],
5
+ "mappings": ";;;AAAA,SAAS,YAAY;AAErB,IAAI;AACF,QAAM,OAAO,YAAY;AAC3B,SAAS,GAAG;AAEV,UAAQ;AAAA,IACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAcF;AACA,OAAK,CAAC;AACR;",
6
+ "names": []
7
+ }
package/dist/bin/order.js CHANGED
@@ -1,17 +1,18 @@
1
1
  #!/usr/bin/env node
2
+ import "./chunks/chunk-DFQMTDRG.js";
2
3
 
3
4
  // src/bin/order.ts
4
- import {
5
- binary,
6
- string as cmdString,
7
- command,
8
- positional,
9
- run
10
- } from "cmd-ts";
11
5
  import { Alg } from "cubing/alg";
12
6
  import { KPuzzle } from "cubing/kpuzzle";
13
7
  import { getPuzzleGeometryByName } from "cubing/puzzle-geometry";
14
8
  import { puzzles } from "cubing/puzzles";
9
+ var {
10
+ binary,
11
+ string: cmdString,
12
+ command,
13
+ positional,
14
+ run
15
+ } = await import("cmd-ts-too");
15
16
  var ReadAlg = {
16
17
  async from(str) {
17
18
  return Alg.fromString(str);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/bin/order.ts"],
4
- "sourcesContent": ["// To run this file directly:\n// bun run src/bin/order.ts -- 3x3x3 \"R U R' U R U2' R'\"\n\nimport {\n binary,\n string as cmdString,\n command,\n positional,\n run,\n type Type,\n} from \"cmd-ts\";\nimport { Alg } from \"cubing/alg\";\nimport { KPuzzle } from \"cubing/kpuzzle\";\nimport { getPuzzleGeometryByName } from \"cubing/puzzle-geometry\";\nimport { puzzles } from \"cubing/puzzles\";\n\n// TODO: dedup with `screenshot` implementation.\nconst ReadAlg: Type<string, Alg> = {\n async from(str) {\n return Alg.fromString(str);\n },\n};\n\nconst app = command({\n name: \"order\",\n description: \"Example: order 3x3x3 \\\"R U R' U R U2' R'\\\"\",\n args: {\n puzzleGeometryID: positional({\n type: cmdString,\n displayName: \"Puzzle geometry ID\",\n }),\n alg: positional({\n type: ReadAlg,\n displayName: \"Alg\",\n }),\n },\n handler: async ({ puzzleGeometryID, alg }) => {\n /*\n * Turn a name into a geometry.\n */\n\n const puzzleLoader = puzzles[puzzleGeometryID];\n const kpuzzle = await (async () => {\n if (puzzleLoader) {\n return await puzzles[puzzleGeometryID].kpuzzle();\n } else {\n const pg = getPuzzleGeometryByName(puzzleGeometryID, {\n allMoves: true,\n });\n return new KPuzzle(pg.getKPuzzleDefinition(true));\n }\n })();\n const order = kpuzzle.algToTransformation(alg).repetitionOrder();\n console.log(order);\n },\n});\n\nawait run(binary(app), process.argv);\n"],
5
- "mappings": ";;;AAGA;AAAA,EACE;AAAA,EACA,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,eAAe;AAGxB,IAAM,UAA6B;AAAA,EACjC,MAAM,KAAK,KAAK;AACd,WAAO,IAAI,WAAW,GAAG;AAAA,EAC3B;AACF;AAEA,IAAM,MAAM,QAAQ;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,IACJ,kBAAkB,WAAW;AAAA,MAC3B,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,IACD,KAAK,WAAW;AAAA,MACd,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAO,EAAE,kBAAkB,IAAI,MAAM;AAK5C,UAAM,eAAe,QAAQ,gBAAgB;AAC7C,UAAM,UAAU,OAAO,YAAY;AACjC,UAAI,cAAc;AAChB,eAAO,MAAM,QAAQ,gBAAgB,EAAE,QAAQ;AAAA,MACjD,OAAO;AACL,cAAM,KAAK,wBAAwB,kBAAkB;AAAA,UACnD,UAAU;AAAA,QACZ,CAAC;AACD,eAAO,IAAI,QAAQ,GAAG,qBAAqB,IAAI,CAAC;AAAA,MAClD;AAAA,IACF,GAAG;AACH,UAAM,QAAQ,QAAQ,oBAAoB,GAAG,EAAE,gBAAgB;AAC/D,YAAQ,IAAI,KAAK;AAAA,EACnB;AACF,CAAC;AAED,MAAM,IAAI,OAAO,GAAG,GAAG,QAAQ,IAAI;",
4
+ "sourcesContent": ["// To run this file directly:\n// bun run src/bin/order.ts -- 3x3x3 \"R U R' U R U2' R'\"\n\nimport { Alg } from \"cubing/alg\";\nimport { KPuzzle } from \"cubing/kpuzzle\";\nimport { getPuzzleGeometryByName } from \"cubing/puzzle-geometry\";\nimport { puzzles } from \"cubing/puzzles\";\n\nimport type { Type } from \"cmd-ts-too\";\nimport \"./guards/cmd-ts-too-guard\";\n\nconst {\n binary,\n string: cmdString,\n command,\n positional,\n run,\n} = await import(\"cmd-ts-too\");\n\n// TODO: dedup with `screenshot` implementation.\nconst ReadAlg: Type<string, Alg> = {\n async from(str) {\n return Alg.fromString(str);\n },\n};\n\nconst app = command({\n name: \"order\",\n description: \"Example: order 3x3x3 \\\"R U R' U R U2' R'\\\"\",\n args: {\n puzzleGeometryID: positional({\n type: cmdString,\n displayName: \"Puzzle geometry ID\",\n }),\n alg: positional({\n type: ReadAlg,\n displayName: \"Alg\",\n }),\n },\n handler: async ({ puzzleGeometryID, alg }) => {\n /*\n * Turn a name into a geometry.\n */\n\n const puzzleLoader = puzzles[puzzleGeometryID];\n const kpuzzle = await (async () => {\n if (puzzleLoader) {\n return await puzzles[puzzleGeometryID].kpuzzle();\n } else {\n const pg = getPuzzleGeometryByName(puzzleGeometryID, {\n allMoves: true,\n });\n return new KPuzzle(pg.getKPuzzleDefinition(true));\n }\n })();\n const order = kpuzzle.algToTransformation(alg).repetitionOrder();\n console.log(order);\n },\n});\n\nawait run(binary(app), process.argv);\n"],
5
+ "mappings": ";;;;AAGA,SAAS,WAAW;AACpB,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,eAAe;AAKxB,IAAM;AAAA,EACJ;AAAA,EACA,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AACF,IAAI,MAAM,OAAO,YAAY;AAG7B,IAAM,UAA6B;AAAA,EACjC,MAAM,KAAK,KAAK;AACd,WAAO,IAAI,WAAW,GAAG;AAAA,EAC3B;AACF;AAEA,IAAM,MAAM,QAAQ;AAAA,EAClB,MAAM;AAAA,EACN,aAAa;AAAA,EACb,MAAM;AAAA,IACJ,kBAAkB,WAAW;AAAA,MAC3B,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,IACD,KAAK,WAAW;AAAA,MACd,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAO,EAAE,kBAAkB,IAAI,MAAM;AAK5C,UAAM,eAAe,QAAQ,gBAAgB;AAC7C,UAAM,UAAU,OAAO,YAAY;AACjC,UAAI,cAAc;AAChB,eAAO,MAAM,QAAQ,gBAAgB,EAAE,QAAQ;AAAA,MACjD,OAAO;AACL,cAAM,KAAK,wBAAwB,kBAAkB;AAAA,UACnD,UAAU;AAAA,QACZ,CAAC;AACD,eAAO,IAAI,QAAQ,GAAG,qBAAqB,IAAI,CAAC;AAAA,MAClD;AAAA,IACF,GAAG;AACH,UAAM,QAAQ,QAAQ,oBAAoB,GAAG,EAAE,gBAAgB;AAC/D,YAAQ,IAAI,KAAK;AAAA,EACnB;AACF,CAAC;AAED,MAAM,IAAI,OAAO,GAAG,GAAG,QAAQ,IAAI;",
6
6
  "names": []
7
7
  }
@@ -1,32 +1,14 @@
1
1
  #!/usr/bin/env node
2
-
3
- // src/bin/guards/cmd-ts-guard.ts
4
- try {
5
- await import("cmd-ts");
6
- } catch (e) {
7
- throw new Error(
8
- `Could not import \`cmd-ts\`. This is not automatically installed as a regular dependency of \`cubing\`.
9
-
10
- If you are installing globally, consider using \`bun\`: https://bun.sh/
11
-
12
- bun install --global cubing
13
-
14
- If you are installing using \`npx\` globally, run:
15
-
16
- npm install --global cubing cmd-ts
17
-
18
- If you are using \`npx\` within a repo, run:
19
-
20
- npm install cubing cmd-ts
21
- `
22
- );
23
- }
2
+ import "./chunks/chunk-DFQMTDRG.js";
24
3
 
25
4
  // src/bin/scramble.ts
26
- import {
5
+ import { eventInfo } from "cubing/puzzles";
6
+ import { randomScrambleForEvent } from "cubing/scramble";
7
+ import { setSearchDebug } from "cubing/search";
8
+ var {
27
9
  binary,
28
- number as cmdNumber,
29
- string as cmdString,
10
+ number: cmdNumber,
11
+ string: cmdString,
30
12
  command,
31
13
  flag,
32
14
  oneOf,
@@ -34,10 +16,7 @@ import {
34
16
  optional,
35
17
  positional,
36
18
  run
37
- } from "cmd-ts";
38
- import { eventInfo } from "cubing/puzzles";
39
- import { randomScrambleForEvent } from "cubing/scramble";
40
- import { setSearchDebug } from "cubing/search";
19
+ } = await import("cmd-ts-too");
41
20
  var outputFormats = ["text", "link", "json-text"];
42
21
  var notationTypes = ["auto", "LGN"];
43
22
  var app = command({
@@ -65,7 +44,7 @@ var app = command({
65
44
  text: flag({
66
45
  description: "Convenient shorthand for `--format text`.",
67
46
  long: "t",
68
- // TODO: https://github.com/Schniz/cmd-ts/issues/221
47
+ // TODO: https://github.com/lgarron/cmd-ts-too/issues/6
69
48
  short: "t"
70
49
  }),
71
50
  eventID: positional({
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../../src/bin/guards/cmd-ts-guard.ts", "../../src/bin/scramble.ts"],
4
- "sourcesContent": ["try {\n await import(\"cmd-ts\");\n} catch (e) {\n // Note that this doesn't fail when installed using `bun install --global`, as `bun` automatically loads deps.\n throw new Error(\n `Could not import \\`cmd-ts\\`. This is not automatically installed as a regular dependency of \\`cubing\\`.\n\nIf you are installing globally, consider using \\`bun\\`: https://bun.sh/\n\n bun install --global cubing\n\nIf you are installing using \\`npx\\` globally, run:\n\n npm install --global cubing cmd-ts\n\nIf you are using \\`npx\\` within a repo, run:\n\n npm install cubing cmd-ts\n`,\n );\n}\n\nexport {};\n", "// To run this file directly:\n// bun run src/bin/scramble.ts -- 333\n\n// TODO: completions for `bash`, `zsh`, and `fish`: https://github.com/loilo/completarr\n\n// Important! We import this instead of inlining, because `esbuild` preserves import order semantics but hoists imports above any code inlined here.\nimport \"./guards/cmd-ts-guard\";\n\nimport {\n binary,\n number as cmdNumber,\n string as cmdString,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n} from \"cmd-ts\";\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\n\n// TODO: file an issue about printing these values.\nconst outputFormats = [\"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\n\nconst app = command({\n name: \"scramble\",\n args: {\n amount: option({\n description: \"Amount of scrambles\",\n type: cmdNumber,\n long: \"amount\",\n short: \"n\",\n defaultValue: () => 1,\n defaultValueIsSerializable: true,\n }),\n format: option({\n description: `Output format. One of: ${outputFormats.join(\", \")}`,\n type: optional(oneOf(outputFormats)),\n long: \"format\",\n short: \"f\",\n }),\n notation: option({\n description: `Notation type. One of: ${notationTypes.join(\", \")}`,\n type: optional(oneOf([\"auto\", \"LGN\"])),\n long: \"notation\",\n }),\n text: flag({\n description: \"Convenient shorthand for `--format text`.\",\n long: \"t\", // TODO: https://github.com/Schniz/cmd-ts/issues/221\n short: \"t\",\n }),\n eventID: positional({\n type: cmdString,\n displayName: \"WCA or unofficial event ID\",\n }),\n },\n handler: async ({ amount, format: argsFormat, notation, text, eventID }) => {\n const format =\n argsFormat ?? (text || !process.stdout.isTTY ? \"text\" : \"auto\");\n\n setSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\n function scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n }\n\n function scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n }\n\n class JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n }\n\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-ignore This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n // @ts-ignore: Top-level await is okay because this is not part of the main library.\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n }\n jsonListPrinter?.finish();\n }\n },\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],
4
+ "sourcesContent": ["// To run this file directly:\n// bun run src/bin/scramble.ts -- 333\n\n// TODO: completions for `bash`, `zsh`, and `fish`: https://github.com/loilo/completarr\n\n// Important! We import this instead of inlining, because `esbuild` preserves import order semantics but hoists imports above any code inlined here.\n\nimport type { Alg } from \"cubing/alg\";\nimport { eventInfo } from \"cubing/puzzles\";\nimport { randomScrambleForEvent } from \"cubing/scramble\";\nimport { setSearchDebug } from \"cubing/search\";\nimport \"./guards/cmd-ts-too-guard\";\n\nconst {\n binary,\n number: cmdNumber,\n string: cmdString,\n command,\n flag,\n oneOf,\n option,\n optional,\n positional,\n run,\n} = await import(\"cmd-ts-too\");\n\n// TODO: file an issue about printing these values.\nconst outputFormats = [\"text\", \"link\", \"json-text\"] as const;\nconst notationTypes = [\"auto\", \"LGN\"] as const;\n\nconst app = command({\n name: \"scramble\",\n args: {\n amount: option({\n description: \"Amount of scrambles\",\n type: cmdNumber,\n long: \"amount\",\n short: \"n\",\n defaultValue: () => 1,\n defaultValueIsSerializable: true,\n }),\n format: option({\n description: `Output format. One of: ${outputFormats.join(\", \")}`,\n type: optional(oneOf(outputFormats)),\n long: \"format\",\n short: \"f\",\n }),\n notation: option({\n description: `Notation type. One of: ${notationTypes.join(\", \")}`,\n type: optional(oneOf([\"auto\", \"LGN\"])),\n long: \"notation\",\n }),\n text: flag({\n description: \"Convenient shorthand for `--format text`.\",\n long: \"t\", // TODO: https://github.com/lgarron/cmd-ts-too/issues/6\n short: \"t\",\n }),\n eventID: positional({\n type: cmdString,\n displayName: \"WCA or unofficial event ID\",\n }),\n },\n handler: async ({ amount, format: argsFormat, notation, text, eventID }) => {\n const format =\n argsFormat ?? (text || !process.stdout.isTTY ? \"text\" : \"auto\");\n\n setSearchDebug({ logPerf: false, showWorkerInstantiationWarnings: false });\n\n function scrambleText(scramble: Alg): string {\n return scramble.toString({\n // TODO: any\n notation: notation as (typeof notationTypes)[number], // TODO: handle type conversion at arg parse time.\n });\n }\n\n function scrambleLink(scramble: Alg): string {\n const url = new URL(\"https://alpha.twizzle.net/edit/\");\n const puzzleID = eventInfo(eventID)?.puzzleID;\n puzzleID && url.searchParams.set(\"puzzle\", puzzleID);\n url.searchParams.set(\"alg\", scrambleText(scramble));\n return url.toString();\n }\n\n class JSONListPrinter<T> {\n #finished = false;\n #firstValuePrintedAlready = false;\n constructor() {\n process.stdout.write(\"[\\n \");\n }\n\n push(value: T) {\n if (this.#firstValuePrintedAlready) {\n process.stdout.write(\",\\n \");\n }\n this.#firstValuePrintedAlready = true;\n process.stdout.write(JSON.stringify(value));\n }\n\n finish() {\n if (this.#finished) {\n throw new Error(\"Tried to finish JSON list printing multiple times.\");\n }\n this.#finished = true;\n console.log(\"\\n]\");\n }\n }\n\n if (format !== \"json-text\" && amount === 1) {\n const scramble = await randomScrambleForEvent(eventID);\n\n switch (format) {\n case \"text\": {\n console.log(scrambleText(scramble));\n break;\n }\n case \"link\": {\n console.log(scrambleLink(scramble));\n break;\n }\n // @ts-ignore This is a code guard for future refactoring.\n case \"json-text\": {\n throw new Error(\n \"Encountered `json` format in code that is not expected to handle it.\",\n );\n }\n case \"auto\": {\n console.log(`${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n } else {\n const jsonListPrinter: JSONListPrinter<string> | undefined =\n format === \"json-text\" ? new JSONListPrinter() : undefined;\n for (let i = 0; i < amount; i++) {\n // @ts-ignore: Top-level await is okay because this is not part of the main library.\n const scramble = await randomScrambleForEvent(eventID);\n switch (format) {\n case \"text\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleText(scramble)}\\n`);\n break;\n }\n case \"link\": {\n console.log(`// Scramble #${i + 1}`);\n console.log(`${scrambleLink(scramble)}\\n`);\n break;\n }\n case \"json-text\": {\n jsonListPrinter?.push(scramble.toString());\n break;\n }\n case \"auto\": {\n console.log(`// Scramble #${i + 1}\n${scrambleText(scramble)}\n\n\uD83D\uDD17 ${scrambleLink(scramble)}\n`);\n break;\n }\n default: {\n throw new Error(\"Unknown format!\");\n }\n }\n }\n jsonListPrinter?.finish();\n }\n },\n});\n\nawait run(binary(app), process.argv);\n"],
5
+ "mappings": ";;;;AAQA,SAAS,iBAAiB;AAC1B,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAG/B,IAAM;AAAA,EACJ;AAAA,EACA,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,IAAI,MAAM,OAAO,YAAY;AAG7B,IAAM,gBAAgB,CAAC,QAAQ,QAAQ,WAAW;AAClD,IAAM,gBAAgB,CAAC,QAAQ,KAAK;AAEpC,IAAM,MAAM,QAAQ;AAAA,EAClB,MAAM;AAAA,EACN,MAAM;AAAA,IACJ,QAAQ,OAAO;AAAA,MACb,aAAa;AAAA,MACb,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,cAAc,MAAM;AAAA,MACpB,4BAA4B;AAAA,IAC9B,CAAC;AAAA,IACD,QAAQ,OAAO;AAAA,MACb,aAAa,0BAA0B,cAAc,KAAK,IAAI,CAAC;AAAA,MAC/D,MAAM,SAAS,MAAM,aAAa,CAAC;AAAA,MACnC,MAAM;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,IACD,UAAU,OAAO;AAAA,MACf,aAAa,0BAA0B,cAAc,KAAK,IAAI,CAAC;AAAA,MAC/D,MAAM,SAAS,MAAM,CAAC,QAAQ,KAAK,CAAC,CAAC;AAAA,MACrC,MAAM;AAAA,IACR,CAAC;AAAA,IACD,MAAM,KAAK;AAAA,MACT,aAAa;AAAA,MACb,MAAM;AAAA;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,IACD,SAAS,WAAW;AAAA,MAClB,MAAM;AAAA,MACN,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EACA,SAAS,OAAO,EAAE,QAAQ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scene, WebGLRenderer } from 'three';
2
2
  import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf, M as Move, A as Alg, e as Pause, h as AppendCancelOptions, c as AppendOptions, a as AlgNode, I as IterationDirection } from './PuzzleLoader-Bxh01zKY.js';
3
3
  import { P as Parsed } from './parseAlg.d-CCV6A24s.js';
4
- import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './KPattern.d-BYanty6A.js';
4
+ import { s as KPuzzle, d as PuzzleGeometry, K as KPattern, t as KTransformation, u as PuzzleDescriptionString } from './index-CxSsew9j.js';
5
5
 
6
6
  type FaceletMeshStickeringMask = "regular" | "dim" | "oriented" | "experimentalOriented2" | "ignored" | "invisible";
7
7
  type FaceletStickeringMask = {
@@ -1,8 +1,8 @@
1
- import { K as KPattern } from '../KPattern.d-BYanty6A.js';
2
- import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-Dde7gyeR.js';
1
+ import { K as KPattern } from '../index-CxSsew9j.js';
2
+ import { a as PuzzleID, P as PuzzleLoader } from '../TwizzleLink.d-iit8QFEU.js';
3
3
  import { A as Alg, M as Move } from '../PuzzleLoader-Bxh01zKY.js';
4
- import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-CmjQOGXN.js';
5
- export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-CmjQOGXN.js';
4
+ import { B as BluetoothPuzzle } from '../bluetooth-puzzle.d-DA4Wx3co.js';
5
+ export { A as MoveEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-DA4Wx3co.js';
6
6
  import 'three';
7
7
  import '../parseAlg.d-CCV6A24s.js';
8
8
 
@@ -1,5 +1,5 @@
1
1
  import { b as AlgLeaf } from './PuzzleLoader-Bxh01zKY.js';
2
- import { K as KPattern } from './KPattern.d-BYanty6A.js';
2
+ import { K as KPattern } from './index-CxSsew9j.js';
3
3
 
4
4
  interface StreamTransformer {
5
5
  transformAlgLeaf(algLeafEvent: AlgLeafEvent): void;
@@ -1,5 +1,5 @@
1
1
  import { A as Alg } from './PuzzleLoader-Bxh01zKY.js';
2
- import { K as KPattern, s as KPuzzle } from './KPattern.d-BYanty6A.js';
2
+ import { K as KPattern, s as KPuzzle } from './index-CxSsew9j.js';
3
3
 
4
4
  declare enum PrefetchLevel {
5
5
  Auto = "auto",
@@ -1,3 +1,3 @@
1
- export { K as KPattern, w as KPatternData, x as KPatternOrbitData, s as KPuzzle, v as KPuzzleDefinition, t as KTransformation, y as KTransformationData, z as KTransformationOrbitData } from '../KPattern.d-BYanty6A.js';
1
+ export { K as KPattern, w as KPatternData, x as KPatternOrbitData, s as KPuzzle, v as KPuzzleDefinition, t as KTransformation, y as KTransformationData, z as KTransformationOrbitData } from '../index-CxSsew9j.js';
2
2
  import '../PuzzleLoader-Bxh01zKY.js';
3
3
  import 'three';
@@ -1,8 +1,8 @@
1
1
  import { A as Alg } from '../PuzzleLoader-Bxh01zKY.js';
2
- import { P as PuzzleLoader } from '../TwizzleLink.d-Dde7gyeR.js';
2
+ import { P as PuzzleLoader } from '../TwizzleLink.d-iit8QFEU.js';
3
3
  import 'three';
4
4
  import '../parseAlg.d-CCV6A24s.js';
5
- import '../KPattern.d-BYanty6A.js';
5
+ import '../index-CxSsew9j.js';
6
6
 
7
7
  declare enum CommonMetric {
8
8
  OuterBlockTurnMetric = "OBTM",
@@ -1,5 +1,5 @@
1
1
  import '../PuzzleLoader-Bxh01zKY.js';
2
- import { K as KPattern } from '../KPattern.d-BYanty6A.js';
2
+ import { K as KPattern } from '../index-CxSsew9j.js';
3
3
  import 'three';
4
4
 
5
5
  type Binary3x3x3Pattern = Uint8Array;
@@ -1,5 +1,5 @@
1
- import { P as Perm } from '../KPattern.d-BYanty6A.js';
2
- export { q as EXPERIMENTAL_PUZZLE_BASE_SHAPES, n as EXPERIMENTAL_PUZZLE_CUT_TYPES, k as ExperimentalPGNotation, r as ExperimentalPuzzleBaseShape, l as ExperimentalPuzzleCutDescription, o as ExperimentalPuzzleCutType, m as ExperimentalPuzzleDescription, j as ExperimentalPuzzleGeometryOptions, d as PuzzleGeometry, Q as Quat, S as StickerDat, e as StickerDatAxis, f as StickerDatFace, h as StickerDatSticker, c as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, a as getPuzzleGeometryByDesc, b as getPuzzleGeometryByName, i as parseOptions, p as parsePuzzleDescription } from '../KPattern.d-BYanty6A.js';
1
+ import { P as Perm } from '../index-CxSsew9j.js';
2
+ export { q as EXPERIMENTAL_PUZZLE_BASE_SHAPES, n as EXPERIMENTAL_PUZZLE_CUT_TYPES, k as ExperimentalPGNotation, r as ExperimentalPuzzleBaseShape, l as ExperimentalPuzzleCutDescription, o as ExperimentalPuzzleCutType, m as ExperimentalPuzzleDescription, j as ExperimentalPuzzleGeometryOptions, d as PuzzleGeometry, Q as Quat, S as StickerDat, e as StickerDatAxis, f as StickerDatFace, h as StickerDatSticker, c as getPG3DNamedPuzzles, g as getPuzzleDescriptionString, a as getPuzzleGeometryByDesc, b as getPuzzleGeometryByName, i as parseOptions, p as parsePuzzleDescription } from '../index-CxSsew9j.js';
3
3
  import '../PuzzleLoader-Bxh01zKY.js';
4
4
  import 'three';
5
5
 
@@ -1,6 +1,6 @@
1
- import { a as PuzzleID, P as PuzzleLoader, E as ExperimentalStickering, S as StickeringMask } from '../TwizzleLink.d-Dde7gyeR.js';
1
+ import { a as PuzzleID, P as PuzzleLoader, E as ExperimentalStickering, S as StickeringMask } from '../TwizzleLink.d-iit8QFEU.js';
2
2
  import { P as PuzzleSpecificSimplifyOptions, b as AlgLeaf } from '../PuzzleLoader-Bxh01zKY.js';
3
- import { s as KPuzzle, d as PuzzleGeometry } from '../KPattern.d-BYanty6A.js';
3
+ import { s as KPuzzle, d as PuzzleGeometry } from '../index-CxSsew9j.js';
4
4
  import 'three';
5
5
  import '../parseAlg.d-CCV6A24s.js';
6
6
 
@@ -1,4 +1,4 @@
1
- export { r as randomScrambleForEvent } from '../index-SnpOfUNy.js';
1
+ export { r as randomScrambleForEvent } from '../index-WCV0Si9w.js';
2
2
  import '../PuzzleLoader-Bxh01zKY.js';
3
- import '../KPattern.d-BYanty6A.js';
3
+ import '../index-CxSsew9j.js';
4
4
  import 'three';
@@ -1,6 +1,6 @@
1
- export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, f as experimentalSolveTwsearch, d as setSearchDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../index-SnpOfUNy.js';
1
+ export { a as experimentalSolve2x2x2, e as experimentalSolve3x3x3IgnoringCenters, f as experimentalSolveTwsearch, d as setSearchDebug, c as solveMegaminx, b as solvePyraminx, s as solveSkewb } from '../index-WCV0Si9w.js';
2
2
  import '../PuzzleLoader-Bxh01zKY.js';
3
- import { K as KPattern } from '../KPattern.d-BYanty6A.js';
3
+ import { K as KPattern } from '../index-CxSsew9j.js';
4
4
  import 'three';
5
5
 
6
6
  declare function random333Pattern(): Promise<KPattern>;
@@ -1,9 +1,9 @@
1
1
  import '../PuzzleLoader-Bxh01zKY.js';
2
- import '../TwizzleLink.d-Dde7gyeR.js';
3
- import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-CmjQOGXN.js';
2
+ import '../TwizzleLink.d-iit8QFEU.js';
3
+ import { A as AlgLeafEvent, O as OrientationEvent } from '../bluetooth-puzzle.d-DA4Wx3co.js';
4
4
  import 'three';
5
5
  import '../parseAlg.d-CCV6A24s.js';
6
- import '../KPattern.d-BYanty6A.js';
6
+ import '../index-CxSsew9j.js';
7
7
 
8
8
  interface ProxyMoveEvent {
9
9
  event: "move";
@@ -1,7 +1,7 @@
1
- import { A as AlgIndexer, T as Timestamp, D as Duration, S as StickeringMask } from '../TwizzleLink.d-Dde7gyeR.js';
2
- export { B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, a as PuzzleID, d as TwistyAlgEditor, c as TwistyAlgViewer, b as TwistyPlayer, e as TwistyPlayerConfig, g as TwizzleLink, V as VisualizationFormat, f as backViewLayouts } from '../TwizzleLink.d-Dde7gyeR.js';
1
+ import { A as AlgIndexer, T as Timestamp, D as Duration, S as StickeringMask } from '../TwizzleLink.d-iit8QFEU.js';
2
+ export { B as BackViewLayout, N as EXPERIMENTAL_PROP_NO_VALUE, M as ExperimentalMillisecondTimestamp, E as ExperimentalStickering, a as PuzzleID, d as TwistyAlgEditor, c as TwistyAlgViewer, b as TwistyPlayer, e as TwistyPlayerConfig, g as TwizzleLink, V as VisualizationFormat, f as backViewLayouts } from '../TwizzleLink.d-iit8QFEU.js';
3
3
  import { A as Alg, M as Move } from '../PuzzleLoader-Bxh01zKY.js';
4
- import { s as KPuzzle, K as KPattern, t as KTransformation } from '../KPattern.d-BYanty6A.js';
4
+ import { s as KPuzzle, K as KPattern, t as KTransformation } from '../index-CxSsew9j.js';
5
5
  import 'three';
6
6
  import '../parseAlg.d-CCV6A24s.js';
7
7
 
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/kpuzzle/index.d.ts";
1
+ export * from "../dist/lib/cubing/kpuzzle/index.d.ts";
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/notation/index.d.ts";
1
+ export * from "../dist/lib/cubing/notation/index.d.ts";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cubing",
3
- "version": "0.53.2",
3
+ "version": "0.53.4",
4
4
  "description": "A collection of JavaScript cubing libraries.",
5
5
  "author": "The js.cubing.net team",
6
6
  "type": "module",
@@ -60,7 +60,7 @@
60
60
  "@types/web-bluetooth": "^0.0.20",
61
61
  "comlink": "^4.4.1",
62
62
  "random-uint-below": "v3.3.0",
63
- "three": "^0.169.0"
63
+ "three": "^0.170.0"
64
64
  },
65
65
  "devDependencies": {
66
66
  "@biomejs/biome": "^1.9.3",
@@ -73,8 +73,8 @@
73
73
  "@web/test-runner": "^0.19.0",
74
74
  "@web/test-runner-playwright": "^0.11.0",
75
75
  "barely-a-dev-server": "latest",
76
- "cmd-ts": "^0.13.0",
77
76
  "chai": "^5.1.1",
77
+ "cmd-ts-too": "v0.15.0",
78
78
  "esbuild": "latest",
79
79
  "getbuiltinmodule-ponyfill": "^1.0.1",
80
80
  "jszip": "^3.10.1",
@@ -90,7 +90,7 @@
90
90
  "esbuild",
91
91
  "jszip",
92
92
  "@biomejs/biome",
93
- "cmd-ts"
93
+ "cmd-ts-too"
94
94
  ],
95
95
  "engines": {
96
96
  "node": ">=20.16.0",
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/protocol/index.d.ts";
1
+ export * from "../dist/lib/cubing/protocol/index.d.ts";
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/puzzle-geometry/index.d.ts";
1
+ export * from "../dist/lib/cubing/puzzle-geometry/index.d.ts";
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/puzzles/index.d.ts";
1
+ export * from "../dist/lib/cubing/puzzles/index.d.ts";
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/scramble/index.d.ts";
1
+ export * from "../dist/lib/cubing/scramble/index.d.ts";
package/search/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/search/index.d.ts";
1
+ export * from "../dist/lib/cubing/search/index.d.ts";
package/stream/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/stream/index.d.ts";
1
+ export * from "../dist/lib/cubing/stream/index.d.ts";
package/twisty/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "../dist/lib/cubing/twisty/index.d.ts";
1
+ export * from "../dist/lib/cubing/twisty/index.d.ts";
@@ -1,5 +1,114 @@
1
1
  import { M as Move, A as Alg } from './PuzzleLoader-Bxh01zKY.js';
2
2
 
3
+ type PuzzleDescriptionString = string;
4
+ declare const PGPuzzles: {
5
+ [name: string]: PuzzleDescriptionString;
6
+ };
7
+ type PuzzleName = keyof typeof PGPuzzles;
8
+
9
+ interface NotationMapper {
10
+ notationToInternal(move: Move): Move | null;
11
+ notationToExternal(move: Move): Move | null;
12
+ }
13
+
14
+ declare function parseOptions(argv: string[]): {
15
+ puzzleDescription: PuzzleDescription | null;
16
+ options: PuzzleGeometryOptions;
17
+ };
18
+ type FaceName = string;
19
+ type OrientationDirection = [number, number, number];
20
+ type FaceBasedOrientationDescription = [
21
+ [
22
+ FaceName,
23
+ OrientationDirection
24
+ ],
25
+ [
26
+ FaceName,
27
+ OrientationDirection
28
+ ]
29
+ ];
30
+ type BaseFaceCount = 4 | 6 | 8 | 12 | 20;
31
+ type FaceBasedOrientationDescriptionLookup = Record<BaseFaceCount, FaceBasedOrientationDescription>;
32
+ declare class PuzzleGeometryFullOptions {
33
+ verbosity: number;
34
+ allMoves: boolean;
35
+ outerBlockMoves: boolean;
36
+ vertexMoves: boolean;
37
+ addRotations: boolean;
38
+ moveList: string[] | null;
39
+ fixedOrientation: boolean;
40
+ fixedPieceType: null | "e" | "v" | "f";
41
+ orientCenters: boolean;
42
+ includeCornerOrbits: boolean;
43
+ includeCenterOrbits: boolean;
44
+ includeEdgeOrbits: boolean;
45
+ excludeOrbits: string[];
46
+ optimizeOrbits: boolean;
47
+ grayCorners: boolean;
48
+ grayCenters: boolean;
49
+ grayEdges: boolean;
50
+ puzzleOrientation: FaceBasedOrientationDescription | null;
51
+ puzzleOrientations: FaceBasedOrientationDescriptionLookup | null;
52
+ scrambleAmount: number;
53
+ constructor(options?: PuzzleGeometryOptions);
54
+ }
55
+ type PuzzleGeometryOptions = Partial<PuzzleGeometryFullOptions>;
56
+
57
+ declare class Perm {
58
+ n: number;
59
+ p: number[];
60
+ constructor(a: number[]);
61
+ toString(): string;
62
+ mul(p2: Perm): Perm;
63
+ rmul(p2: Perm): Perm;
64
+ inv(): Perm;
65
+ compareTo(p2: Perm): number;
66
+ toGap(): string;
67
+ toMathematica(): string;
68
+ order(): number;
69
+ }
70
+
71
+ declare class KTransformation {
72
+ #private;
73
+ readonly kpuzzle: KPuzzle;
74
+ readonly transformationData: KTransformationData;
75
+ constructor(kpuzzle: KPuzzle, transformationData: KTransformationData);
76
+ toJSON(): any;
77
+ invert(): KTransformation;
78
+ isIdentityTransformation(): boolean;
79
+ /** @deprecated */
80
+ static experimentalConstructIdentity(kpuzzle: KPuzzle): KTransformation;
81
+ isIdentical(t2: KTransformation): boolean;
82
+ /** @deprecated */
83
+ apply(source: KTransformationSource): KTransformation;
84
+ applyTransformation(t2: KTransformation): KTransformation;
85
+ applyMove(move: Move | string): KTransformation;
86
+ applyAlg(alg: Alg | string): KTransformation;
87
+ toKPattern(): KPattern;
88
+ repetitionOrder(): number;
89
+ selfMultiply(amount: number): KTransformation;
90
+ }
91
+
92
+ declare class KPattern {
93
+ readonly kpuzzle: KPuzzle;
94
+ readonly patternData: KPatternData;
95
+ constructor(kpuzzle: KPuzzle, patternData: KPatternData);
96
+ toJSON(): any;
97
+ static fromTransformation(transformation: KTransformation): KPattern;
98
+ /** @deprecated */
99
+ apply(source: KTransformationSource): KPattern;
100
+ applyTransformation(transformation: KTransformation): KPattern;
101
+ applyMove(move: Move | string): KPattern;
102
+ applyAlg(alg: Alg | string): KPattern;
103
+ isIdentical(other: KPattern): boolean;
104
+ /** @deprecated */
105
+ experimentalToTransformation(): KTransformation | null;
106
+ experimentalIsSolved(options: {
107
+ ignorePuzzleOrientation: boolean;
108
+ ignoreCenterOrientation: boolean;
109
+ }): boolean;
110
+ }
111
+
3
112
  type KPatternData = Record<string, KPatternOrbitData>;
4
113
  interface KPatternOrbitData {
5
114
  pieces: number[];
@@ -151,89 +260,6 @@ interface KPuzzleDefinition {
151
260
  }) => boolean;
152
261
  }
153
262
 
154
- declare class KTransformation {
155
- #private;
156
- readonly kpuzzle: KPuzzle;
157
- readonly transformationData: KTransformationData;
158
- constructor(kpuzzle: KPuzzle, transformationData: KTransformationData);
159
- toJSON(): any;
160
- invert(): KTransformation;
161
- isIdentityTransformation(): boolean;
162
- /** @deprecated */
163
- static experimentalConstructIdentity(kpuzzle: KPuzzle): KTransformation;
164
- isIdentical(t2: KTransformation): boolean;
165
- /** @deprecated */
166
- apply(source: KTransformationSource): KTransformation;
167
- applyTransformation(t2: KTransformation): KTransformation;
168
- applyMove(move: Move | string): KTransformation;
169
- applyAlg(alg: Alg | string): KTransformation;
170
- toKPattern(): KPattern;
171
- repetitionOrder(): number;
172
- selfMultiply(amount: number): KTransformation;
173
- }
174
-
175
- interface NotationMapper {
176
- notationToInternal(move: Move): Move | null;
177
- notationToExternal(move: Move): Move | null;
178
- }
179
-
180
- declare function parseOptions(argv: string[]): {
181
- puzzleDescription: PuzzleDescription | null;
182
- options: PuzzleGeometryOptions;
183
- };
184
- type FaceName = string;
185
- type OrientationDirection = [number, number, number];
186
- type FaceBasedOrientationDescription = [
187
- [
188
- FaceName,
189
- OrientationDirection
190
- ],
191
- [
192
- FaceName,
193
- OrientationDirection
194
- ]
195
- ];
196
- type BaseFaceCount = 4 | 6 | 8 | 12 | 20;
197
- type FaceBasedOrientationDescriptionLookup = Record<BaseFaceCount, FaceBasedOrientationDescription>;
198
- declare class PuzzleGeometryFullOptions {
199
- verbosity: number;
200
- allMoves: boolean;
201
- outerBlockMoves: boolean;
202
- vertexMoves: boolean;
203
- addRotations: boolean;
204
- moveList: string[] | null;
205
- fixedOrientation: boolean;
206
- fixedPieceType: null | "e" | "v" | "f";
207
- orientCenters: boolean;
208
- includeCornerOrbits: boolean;
209
- includeCenterOrbits: boolean;
210
- includeEdgeOrbits: boolean;
211
- excludeOrbits: string[];
212
- optimizeOrbits: boolean;
213
- grayCorners: boolean;
214
- grayCenters: boolean;
215
- grayEdges: boolean;
216
- puzzleOrientation: FaceBasedOrientationDescription | null;
217
- puzzleOrientations: FaceBasedOrientationDescriptionLookup | null;
218
- scrambleAmount: number;
219
- constructor(options?: PuzzleGeometryOptions);
220
- }
221
- type PuzzleGeometryOptions = Partial<PuzzleGeometryFullOptions>;
222
-
223
- declare class Perm {
224
- n: number;
225
- p: number[];
226
- constructor(a: number[]);
227
- toString(): string;
228
- mul(p2: Perm): Perm;
229
- rmul(p2: Perm): Perm;
230
- inv(): Perm;
231
- compareTo(p2: Perm): number;
232
- toGap(): string;
233
- toMathematica(): string;
234
- order(): number;
235
- }
236
-
237
263
  declare class PGOrbitDef {
238
264
  size: number;
239
265
  mod: number;
@@ -303,12 +329,6 @@ declare class VisibleState extends PGTransformBase {
303
329
  mul(b: PGTransform): VisibleState;
304
330
  }
305
331
 
306
- type PuzzleDescriptionString = string;
307
- declare const PGPuzzles: {
308
- [name: string]: PuzzleDescriptionString;
309
- };
310
- type PuzzleName = keyof typeof PGPuzzles;
311
-
312
332
  declare class Quat {
313
333
  a: number;
314
334
  b: number;
@@ -527,24 +547,4 @@ declare class KPuzzle {
527
547
  canConvertDefaultPatternToUniqueTransformation(): boolean;
528
548
  }
529
549
 
530
- declare class KPattern {
531
- readonly kpuzzle: KPuzzle;
532
- readonly patternData: KPatternData;
533
- constructor(kpuzzle: KPuzzle, patternData: KPatternData);
534
- toJSON(): any;
535
- static fromTransformation(transformation: KTransformation): KPattern;
536
- /** @deprecated */
537
- apply(source: KTransformationSource): KPattern;
538
- applyTransformation(transformation: KTransformation): KPattern;
539
- applyMove(move: Move | string): KPattern;
540
- applyAlg(alg: Alg | string): KPattern;
541
- isIdentical(other: KPattern): boolean;
542
- /** @deprecated */
543
- experimentalToTransformation(): KTransformation | null;
544
- experimentalIsSolved(options: {
545
- ignorePuzzleOrientation: boolean;
546
- ignoreCenterOrientation: boolean;
547
- }): boolean;
548
- }
549
-
550
550
  export { KPattern as K, Perm as P, Quat as Q, type StickerDat as S, getPuzzleGeometryByDesc as a, getPuzzleGeometryByName as b, getPG3DNamedPuzzles as c, PuzzleGeometry as d, type StickerDatAxis as e, type StickerDatFace as f, getPuzzleDescriptionString as g, type StickerDatSticker as h, parseOptions as i, type PuzzleGeometryOptions as j, PGNotation as k, type PuzzleCutDescription as l, type PuzzleDescription as m, PUZZLE_CUT_TYPES as n, type PuzzleCutType as o, parsePuzzleDescription as p, PUZZLE_BASE_SHAPES as q, type PuzzleBaseShape as r, KPuzzle as s, KTransformation as t, type PuzzleDescriptionString as u, type KPuzzleDefinition as v, type KPatternData as w, type KPatternOrbitData as x, type KTransformationData as y, type KTransformationOrbitData as z };