diff --git a/.gitignore b/.gitignore index 04c01ba..55f99ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ node_modules/ -dist/ \ No newline at end of file +docs/ \ No newline at end of file diff --git a/src/index.d.ts b/src/index.d.ts new file mode 100644 index 0000000..51f85db --- /dev/null +++ b/src/index.d.ts @@ -0,0 +1,50 @@ +type CellEntity = { + x: number; + y: number; + groupId: number; + groupX: number; + groupY: number; + color: string; + cellId: string; + cubeType: CUBE_TYPE; + rotation: ROTATION_TYPE; +}; +type CellPosition = { + x: number; + y: number; +}; +type CubeBody = { + name: string; + bodyArray: (type: ROTATION_TYPE) => CellPosition[]; + startY: number; + color: string; + previewSize: number; +}; +type CubeDescription = { + [key in CUBE_TYPE]: CubeBody; +}; +declare enum CUBE_TYPE { + CUBE1 = "S", + CUBE2 = "T", + CUBE3 = "I", + CUBE4 = "L", + CUBE5 = "Z", + CUBE6 = "O", + CUBE7 = "J" +} +declare enum ROTATION_TYPE { + TYPE1 = "type1", + TYPE2 = "type2", + TYPE3 = "type3", + TYPE4 = "type4" +} +declare enum MOVE_DIRECTION { + LEFT = "left", + DOWN = "down", + RIGHT = "right", + UP = "up" +} +type CubeAndType = { + cubeItem?: CubeBody; + cubeType?: CUBE_TYPE; +}; diff --git a/tsconfig.json b/tsconfig.json index af7dcae..37f0c9c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,6 @@ "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "outDir": "dist", "rootDir": "src", "declaration": true, "sourceMap": true diff --git a/webpack.config.js b/webpack.config.js index be244d5..40b71df 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -7,7 +7,7 @@ const HtmlWebpackPlugin = require('html-webpack-plugin'); const config = { entry: "./src/index.ts", output: { - path: path.resolve(__dirname, "dist"), + path: path.resolve(__dirname, "docs"), filename: "index.js" }, plugins: [],