Skip to content

Commit

Permalink
Merge pull request #41 from torjusti/feat/type-defs
Browse files Browse the repository at this point in the history
feat: Add TypeScript definitions file
  • Loading branch information
torjusti committed Sep 1, 2019
2 parents f58b23e + cf8b8bc commit 207908b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
10 changes: 10 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
type Scrambler = '3x3' | '2gll' | 'cmll' | 'corners' | 'edges' | 'lse' | 'lsll' | 'pll' | 'zbll' | 'zzls';

type Solver = 'kociemba' | 'cross' | 'eoline' | 'fb' | 'xcross';

declare module 'cube-solver' {
// Main method for generating scrambls.
export const scramble: (scrambler: Scrambler) => string;
// Solve specific subset of a given cube.
export const solve: (scramble: string, type: Solver) => string;
};
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"name": "cube-solver",
"version": "2.0.0",
"version": "2.1.0",
"description": "Solve Rubik's cube using the Kociemba algorithm.",
"author": "Torjus Iveland <torjusti@gmail.com>",
"main": "dist/bundle.js",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/torjusti/cube-solver"
},
"files": [
"dist"
"dist",
"index.d.ts"
],
"bugs": {
"url": "https://github.com/torjusti/cube-solver/issues"
Expand Down

0 comments on commit 207908b

Please sign in to comment.