scrabble-solver 2.15.9 → 2.15.10
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.
- package/.nx/workspace-data/file-map.json +1332 -1336
- package/.nx/workspace-data/lockfile.hash +1 -1
- package/.nx/workspace-data/nx_files.nxt +0 -0
- package/.nx/workspace-data/parsed-lock-file.json +204 -48
- package/.nx/workspace-data/project-graph.json +215 -49
- package/README.md +1 -1
- package/cypress/support/lib/actions.ts +2 -2
- package/cypress/support/lib/selectors.ts +9 -9
- package/cypress/tsconfig.json +2 -1
- package/cypress.config.ts +1 -0
- package/eslint.config.mjs +31 -8
- package/lerna.json +1 -1
- package/package.json +13 -11
- package/packages/configs/build/games/index.d.ts +1 -0
- package/packages/configs/build/games/index.js +1 -0
- package/packages/configs/build/games/kelimelik.d.ts +2 -1
- package/packages/configs/build/games/kelimelik.js +2 -1
- package/packages/configs/build/games/literaki.d.ts +2 -1
- package/packages/configs/build/games/literaki.js +2 -1
- package/packages/configs/build/games/scrabble.d.ts +2 -1
- package/packages/configs/build/games/scrabble.js +2 -1
- package/packages/configs/build/games/scrabbleDuel.d.ts +17 -0
- package/packages/configs/build/games/scrabbleDuel.js +50 -0
- package/packages/configs/build/games/superScrabble.d.ts +2 -1
- package/packages/configs/build/games/superScrabble.js +2 -1
- package/packages/configs/build/languages/english.d.ts +2 -0
- package/packages/configs/build/languages/english.js +65 -1
- package/packages/configs/package.json +3 -3
- package/packages/configs/src/games/index.ts +1 -0
- package/packages/configs/src/games/kelimelik.ts +2 -1
- package/packages/configs/src/games/literaki.ts +2 -1
- package/packages/configs/src/games/scrabble.ts +2 -1
- package/packages/configs/src/games/scrabbleDuel.ts +56 -0
- package/packages/configs/src/games/superScrabble.ts +2 -1
- package/packages/configs/src/languages/english.ts +67 -1
- package/packages/constants/package.json +1 -1
- package/packages/dictionaries/build/Dictionaries.d.ts +1 -2
- package/packages/dictionaries/build/Dictionaries.js +6 -5
- package/packages/dictionaries/build/index.d.ts +1 -1
- package/packages/dictionaries/build/index.js +2 -5
- package/packages/dictionaries/build/lib/DiskCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/DiskCache.js +7 -6
- package/packages/dictionaries/build/lib/LayeredCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/LayeredCache.js +7 -9
- package/packages/dictionaries/build/lib/MemoryCache.d.ts +1 -2
- package/packages/dictionaries/build/lib/MemoryCache.js +2 -1
- package/packages/dictionaries/build/lib/createAsyncProxy.d.ts +2 -2
- package/packages/dictionaries/build/lib/createAsyncProxy.js +2 -1
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.d.ts +1 -2
- package/packages/dictionaries/build/lib/createCacheTimestampComparator.js +2 -1
- package/packages/dictionaries/build/lib/downloadDictionary.d.ts +1 -2
- package/packages/dictionaries/build/lib/downloadDictionary.js +5 -7
- package/packages/dictionaries/build/lib/getDictionaryFilepath.d.ts +1 -2
- package/packages/dictionaries/build/lib/getDictionaryFilepath.js +2 -1
- package/packages/dictionaries/build/lib/index.d.ts +7 -7
- package/packages/dictionaries/build/lib/index.js +7 -10
- package/packages/dictionaries/build/{types/Cache.d.ts → types.d.ts} +1 -2
- package/packages/dictionaries/package.json +4 -4
- package/packages/dictionaries/src/Dictionaries.ts +3 -4
- package/packages/dictionaries/src/index.ts +2 -1
- package/packages/dictionaries/src/lib/DiskCache.ts +2 -4
- package/packages/dictionaries/src/lib/LayeredCache.ts +4 -6
- package/packages/dictionaries/src/lib/MemoryCache.ts +2 -3
- package/packages/dictionaries/src/lib/createAsyncProxy.ts +1 -3
- package/packages/dictionaries/src/lib/createCacheTimestampComparator.ts +1 -3
- package/packages/dictionaries/src/lib/downloadDictionary.ts +2 -4
- package/packages/dictionaries/src/lib/getDictionaryFilepath.ts +1 -3
- package/packages/dictionaries/src/lib/index.ts +7 -7
- package/packages/dictionaries/src/{types/Cache.ts → types.ts} +1 -3
- package/packages/logger/build/index.d.ts +1 -1
- package/packages/logger/build/index.js +2 -5
- package/packages/logger/build/logger.d.ts +1 -2
- package/packages/logger/build/logger.js +2 -2
- package/packages/logger/package.json +1 -1
- package/packages/logger/src/index.ts +1 -1
- package/packages/logger/src/logger.ts +1 -3
- package/packages/scrabble-solver/.next/BUILD_ID +1 -1
- package/packages/scrabble-solver/.next/build-manifest.json +9 -9
- package/packages/scrabble-solver/.next/cache/.rscinfo +1 -1
- package/packages/scrabble-solver/.next/cache/.tsbuildinfo +1 -1
- package/packages/scrabble-solver/.next/cache/webpack/client-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/client-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/edge-server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/0.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack +0 -0
- package/packages/scrabble-solver/.next/cache/webpack/server-production/index.pack.old +0 -0
- package/packages/scrabble-solver/.next/diagnostics/framework.json +1 -1
- package/packages/scrabble-solver/.next/next-minimal-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/next-server.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/prerender-manifest.json +4 -4
- package/packages/scrabble-solver/.next/required-server-files.json +1 -2
- package/packages/scrabble-solver/.next/routes-manifest.json +1 -1
- package/packages/scrabble-solver/.next/server/chunks/60.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/812.js +1 -1
- package/packages/scrabble-solver/.next/server/chunks/974.js +1 -1
- package/packages/scrabble-solver/.next/server/middleware-build-manifest.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/404.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/500.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/_app.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js +2 -2
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale]/[word].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/dictionary/[locale].js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/solve.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/verify.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/api/visit.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.html +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.js.nft.json +1 -1
- package/packages/scrabble-solver/.next/server/pages/index.json +1 -1
- package/packages/scrabble-solver/.next/server/webpack-api-runtime.js +1 -1
- package/packages/scrabble-solver/.next/static/chunks/{main-b934e2c3dd3b55b5.js → main-016492249b3393e2.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/{404-7451dd58396eaa39.js → 404-590e2a3839c1d9e0.js} +1 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-ac93a74c390f2ab8.js +1 -0
- package/packages/scrabble-solver/.next/static/chunks/pages/index-e5f1caa581e6d3b8.js +1 -0
- package/packages/scrabble-solver/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_buildManifest.js +1 -1
- package/packages/scrabble-solver/.next/trace +23 -23
- package/packages/scrabble-solver/next.config.js +3 -0
- package/packages/scrabble-solver/package.json +9 -9
- package/packages/scrabble-solver/public/service-worker.js +2 -2
- package/packages/scrabble-solver/public/service-worker.js.map +1 -1
- package/packages/scrabble-solver/src/api/getServerLoggingData.ts +1 -3
- package/packages/scrabble-solver/src/api/index.ts +5 -5
- package/packages/scrabble-solver/src/api/isBoardValid.ts +3 -5
- package/packages/scrabble-solver/src/api/isCellValid.ts +4 -6
- package/packages/scrabble-solver/src/api/isCharacterValid.ts +2 -3
- package/packages/scrabble-solver/src/api/isRowValid.ts +3 -5
- package/packages/scrabble-solver/src/components/Alert/Alert.tsx +1 -3
- package/packages/scrabble-solver/src/components/Alert/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Badge/Badge.tsx +1 -3
- package/packages/scrabble-solver/src/components/Badge/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/Board.tsx +2 -4
- package/packages/scrabble-solver/src/components/Board/BoardPure.tsx +2 -2
- package/packages/scrabble-solver/src/components/Board/components/Actions/Actions.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/Actions/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/Cell/Cell.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/Cell/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/InputPrompt.tsx +3 -5
- package/packages/scrabble-solver/src/components/Board/components/InputPrompt/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/ToggleDirectionButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Board/components/ToggleDirectionButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/components/index.ts +4 -4
- package/packages/scrabble-solver/src/components/Board/hooks/index.ts +6 -6
- package/packages/scrabble-solver/src/components/Board/hooks/useBackgroundImage.tsx +7 -9
- package/packages/scrabble-solver/src/components/Board/hooks/useBoardStyle.ts +7 -9
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingActions.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingFocus.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useFloatingInputPrompt.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/hooks/useGrid.ts +2 -4
- package/packages/scrabble-solver/src/components/Board/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Board/lib/getBonusColor.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/lib/getPositionInGrid.ts +1 -3
- package/packages/scrabble-solver/src/components/Board/lib/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Button/Button.tsx +3 -3
- package/packages/scrabble-solver/src/components/Button/Link.tsx +1 -3
- package/packages/scrabble-solver/src/components/Button/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Dictionary/Dictionary.tsx +3 -5
- package/packages/scrabble-solver/src/components/Dictionary/index.ts +1 -1
- package/packages/scrabble-solver/src/components/DictionaryInput/DictionaryInput.tsx +1 -3
- package/packages/scrabble-solver/src/components/DictionaryInput/index.ts +1 -1
- package/packages/scrabble-solver/src/components/EmptyState/EmptyState.tsx +2 -4
- package/packages/scrabble-solver/src/components/EmptyState/index.ts +1 -1
- package/packages/scrabble-solver/src/components/IconButton/IconButton.tsx +3 -3
- package/packages/scrabble-solver/src/components/IconButton/Link.tsx +1 -3
- package/packages/scrabble-solver/src/components/IconButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Key/Key.tsx +1 -3
- package/packages/scrabble-solver/src/components/Key/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Keys/Arrows/Arrows.tsx +2 -4
- package/packages/scrabble-solver/src/components/Keys/Arrows/index.ts +1 -1
- package/packages/scrabble-solver/src/components/{keys.tsx → Keys/index.tsx} +3 -1
- package/packages/scrabble-solver/src/components/Loading/Loading.tsx +2 -4
- package/packages/scrabble-solver/src/components/Loading/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Logo/Logo.tsx +1 -3
- package/packages/scrabble-solver/src/components/Logo/LogoBlueprint.tsx +2 -4
- package/packages/scrabble-solver/src/components/Logo/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/Modal.tsx +3 -3
- package/packages/scrabble-solver/src/components/Modal/components/Section/Section.tsx +1 -3
- package/packages/scrabble-solver/src/components/Modal/components/Section/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Modal/index.ts +1 -1
- package/packages/scrabble-solver/src/components/NavButtons/NavButtons.tsx +3 -3
- package/packages/scrabble-solver/src/components/NavButtons/index.ts +1 -1
- package/packages/scrabble-solver/src/components/NotFound/NotFound.tsx +2 -4
- package/packages/scrabble-solver/src/components/NotFound/index.ts +1 -1
- package/packages/scrabble-solver/src/components/PlainTiles/PlainTiles.tsx +10 -4
- package/packages/scrabble-solver/src/components/PlainTiles/Tile.tsx +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/index.ts +1 -1
- package/packages/scrabble-solver/src/components/PlainTiles/lib/createPlainTile.ts +10 -6
- package/packages/scrabble-solver/src/components/PlainTiles/lib/createPlainTiles.ts +2 -4
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getViewbox.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getX.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/getY.ts +1 -3
- package/packages/scrabble-solver/src/components/PlainTiles/lib/index.ts +6 -6
- package/packages/scrabble-solver/src/components/PlainTiles/lib/randomize.ts +1 -3
- package/packages/scrabble-solver/src/components/Progress/Progress.tsx +1 -3
- package/packages/scrabble-solver/src/components/Progress/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/Rack.tsx +2 -4
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/InputPrompt.tsx +2 -2
- package/packages/scrabble-solver/src/components/Rack/components/InputPrompt/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/RackTile.tsx +4 -7
- package/packages/scrabble-solver/src/components/Rack/components/RackTile/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Rack/components/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Rack/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Radio/Radio.tsx +1 -3
- package/packages/scrabble-solver/src/components/Radio/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Results/Cell.tsx +9 -3
- package/packages/scrabble-solver/src/components/Results/Header.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/HeaderButton.tsx +1 -3
- package/packages/scrabble-solver/src/components/Results/Result.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/Results.tsx +7 -9
- package/packages/scrabble-solver/src/components/Results/SolveButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Results/index.ts +1 -1
- package/packages/scrabble-solver/src/components/ResultsInput/ResultsInput.tsx +1 -3
- package/packages/scrabble-solver/src/components/ResultsInput/index.ts +1 -1
- package/packages/scrabble-solver/src/components/SeoMessage/SeoMessage.tsx +4 -6
- package/packages/scrabble-solver/src/components/SeoMessage/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/Solver.tsx +8 -8
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/InsertButton.tsx +2 -4
- package/packages/scrabble-solver/src/components/Solver/components/InsertButton/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/ResultCandidatePicker.tsx +4 -6
- package/packages/scrabble-solver/src/components/Solver/components/ResultCandidatePicker/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Solver/components/index.ts +2 -2
- package/packages/scrabble-solver/src/components/Solver/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Spinner/Spinner.tsx +1 -3
- package/packages/scrabble-solver/src/components/Spinner/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Tile/Tile.tsx +2 -4
- package/packages/scrabble-solver/src/components/Tile/TilePure.tsx +2 -2
- package/packages/scrabble-solver/src/components/Tile/index.ts +1 -1
- package/packages/scrabble-solver/src/components/Tooltip/TooltipTrigger.tsx +5 -3
- package/packages/scrabble-solver/src/components/index.ts +24 -25
- package/packages/scrabble-solver/src/hooks/index.ts +13 -13
- package/packages/scrabble-solver/src/hooks/useAppLayout.ts +19 -15
- package/packages/scrabble-solver/src/hooks/useColumns.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useDirection.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useEffectOnce.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useIsTouchDevice.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useLanguage.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useLatest.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useLocalStorage.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useMedia.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useMediaQueries.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useMediaQuery.ts +2 -4
- package/packages/scrabble-solver/src/hooks/useOnWindowResize.ts +1 -3
- package/packages/scrabble-solver/src/hooks/useViewportSize.ts +2 -4
- package/packages/scrabble-solver/src/i18n/i18n.ts +1 -3
- package/packages/scrabble-solver/src/i18n/index.ts +1 -1
- package/packages/scrabble-solver/src/lib/arrayEquals.ts +1 -3
- package/packages/scrabble-solver/src/lib/createArray.ts +1 -3
- package/packages/scrabble-solver/src/lib/createComparator.ts +3 -5
- package/packages/scrabble-solver/src/lib/createGridOf.ts +2 -4
- package/packages/scrabble-solver/src/lib/createKeyComparator.ts +6 -5
- package/packages/scrabble-solver/src/lib/createKeyboardNavigation.ts +2 -4
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/createNullMovingComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/createRegExp.ts +1 -3
- package/packages/scrabble-solver/src/lib/createStringComparator.ts +5 -3
- package/packages/scrabble-solver/src/lib/detectLocale.ts +1 -3
- package/packages/scrabble-solver/src/lib/extractCharacters.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/extractCharacters.ts +1 -3
- package/packages/scrabble-solver/src/lib/extractCharactersByCase.test.ts +1 -1
- package/packages/scrabble-solver/src/lib/extractCharactersByCase.ts +2 -4
- package/packages/scrabble-solver/src/lib/extractInputValue.ts +1 -3
- package/packages/scrabble-solver/src/lib/findCell.ts +1 -3
- package/packages/scrabble-solver/src/lib/getCellSize.ts +3 -5
- package/packages/scrabble-solver/src/lib/getCoordinate.ts +1 -3
- package/packages/scrabble-solver/src/lib/getCoordinates.ts +2 -4
- package/packages/scrabble-solver/src/lib/getRemainingTiles.ts +8 -5
- package/packages/scrabble-solver/src/lib/getRemainingTilesCount.ts +1 -3
- package/packages/scrabble-solver/src/lib/getRemainingTilesGroups.ts +3 -5
- package/packages/scrabble-solver/src/lib/getTileSizes.ts +1 -3
- package/packages/scrabble-solver/src/lib/getTotalRemainingTilesCount.ts +1 -3
- package/packages/scrabble-solver/src/lib/groupResults.ts +3 -5
- package/packages/scrabble-solver/src/lib/guessLocale.ts +2 -4
- package/packages/scrabble-solver/src/lib/index.ts +39 -39
- package/packages/scrabble-solver/src/lib/inverseDirection.ts +1 -3
- package/packages/scrabble-solver/src/lib/isCtrl.ts +1 -3
- package/packages/scrabble-solver/src/lib/isMac.ts +3 -4
- package/packages/scrabble-solver/src/lib/isRegExp.ts +1 -3
- package/packages/scrabble-solver/src/lib/isStringArray.ts +1 -3
- package/packages/scrabble-solver/src/lib/isUpperCase.ts +1 -3
- package/packages/scrabble-solver/src/lib/memoize.ts +18 -20
- package/packages/scrabble-solver/src/lib/noop.ts +1 -3
- package/packages/scrabble-solver/src/lib/numberComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/resultMatchesCellFilter.ts +1 -3
- package/packages/scrabble-solver/src/lib/reverseComparator.ts +1 -3
- package/packages/scrabble-solver/src/lib/sortGroupedResults.ts +2 -4
- package/packages/scrabble-solver/src/lib/sortResults.ts +5 -7
- package/packages/scrabble-solver/src/lib/unorderedArraysEqual.ts +2 -4
- package/packages/scrabble-solver/src/lib/zipCharactersAndTiles.ts +1 -3
- package/packages/scrabble-solver/src/modals/DictionaryModal/DictionaryModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/DictionaryModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/KeyMapModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/Mapping.tsx +1 -3
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/Mapping/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/KeyMapModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/MenuModal/MenuModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/MenuModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/RemainingTilesModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/Character.tsx +1 -3
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/Character/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/components/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/RemainingTilesModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/ResultsModal/ResultsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/ResultsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/SettingsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/AutoGroupTilesSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/AutoGroupTilesSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/ConfigSetting.tsx +4 -10
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ConfigSetting/lib.ts +19 -0
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/InputModeSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/InputModeSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/LocaleSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/LocaleSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/ShowCoordinatesSetting.tsx +1 -3
- package/packages/scrabble-solver/src/modals/SettingsModal/components/ShowCoordinatesSetting/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/SettingsModal/components/index.ts +5 -5
- package/packages/scrabble-solver/src/modals/SettingsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/WordsModal/WordsModal.tsx +2 -2
- package/packages/scrabble-solver/src/modals/WordsModal/index.ts +1 -1
- package/packages/scrabble-solver/src/modals/index.ts +7 -7
- package/packages/scrabble-solver/src/pages/_app.tsx +2 -1
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/[word].ts +1 -1
- package/packages/scrabble-solver/src/pages/api/dictionary/[locale]/index.ts +1 -1
- package/packages/scrabble-solver/src/pages/api/solve.ts +6 -4
- package/packages/scrabble-solver/src/pages/api/verify.ts +6 -4
- package/packages/scrabble-solver/src/pages/api/visit.ts +2 -2
- package/packages/scrabble-solver/src/pages/index.tsx +7 -0
- package/packages/scrabble-solver/src/sdk/fetch.ts +1 -3
- package/packages/scrabble-solver/src/sdk/fetchJson.ts +2 -4
- package/packages/scrabble-solver/src/sdk/findWordDefinitions.ts +2 -4
- package/packages/scrabble-solver/src/sdk/getDictionary.ts +2 -4
- package/packages/scrabble-solver/src/sdk/index.ts +4 -4
- package/packages/scrabble-solver/src/sdk/solve.ts +2 -4
- package/packages/scrabble-solver/src/sdk/verify.ts +2 -4
- package/packages/scrabble-solver/src/sdk/visit.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/average.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/expirationManager.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/getDictionary.ts +3 -5
- package/packages/scrabble-solver/src/service-worker/dictionaries/getDictionaryUrl.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/dictionaries/index.ts +2 -2
- package/packages/scrabble-solver/src/service-worker/dictionaries/revalidateDictionary.ts +3 -5
- package/packages/scrabble-solver/src/service-worker/getTrie.ts +1 -3
- package/packages/scrabble-solver/src/service-worker/index.ts +4 -2
- package/packages/scrabble-solver/src/service-worker/routeSolveRequests.ts +17 -11
- package/packages/scrabble-solver/src/service-worker/routeVerifyRequests.ts +7 -5
- package/packages/scrabble-solver/src/serviceWorkerManager.ts +4 -4
- package/packages/scrabble-solver/src/state/index.ts +4 -4
- package/packages/scrabble-solver/src/state/localStorage.ts +10 -12
- package/packages/scrabble-solver/src/state/sagas.ts +4 -1
- package/packages/scrabble-solver/src/state/selectors.ts +2 -5
- package/packages/scrabble-solver/src/state/slices/boardInitialState.ts +6 -7
- package/packages/scrabble-solver/src/state/slices/boardSlice.ts +5 -7
- package/packages/scrabble-solver/src/state/slices/cellFilterInitialState.ts +1 -3
- package/packages/scrabble-solver/src/state/slices/cellFilterSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/dictionaryInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/dictionarySlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/index.ts +16 -16
- package/packages/scrabble-solver/src/state/slices/rackInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/rackSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/resultsInitialState.ts +1 -3
- package/packages/scrabble-solver/src/state/slices/resultsSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/settingsInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/settingsSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/solveInitialState.ts +3 -5
- package/packages/scrabble-solver/src/state/slices/solveSlice.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/verifyInitialState.ts +2 -4
- package/packages/scrabble-solver/src/state/slices/verifySlice.ts +2 -4
- package/packages/scrabble-solver/src/state/store.ts +1 -3
- package/packages/scrabble-solver/src/state/useTranslate.ts +2 -4
- package/packages/scrabble-solver/src/state/useTypedSelector.ts +1 -3
- package/packages/scrabble-solver/src/types/api.ts +15 -0
- package/packages/scrabble-solver/src/types/index.ts +2 -0
- package/packages/scrabble-solver/tsconfig.json +1 -1
- package/packages/solver/build/areDigraphsValid.d.ts +1 -2
- package/packages/solver/build/areDigraphsValid.js +2 -1
- package/packages/solver/build/fillPattern.d.ts +1 -2
- package/packages/solver/build/fillPattern.js +2 -2
- package/packages/solver/build/generateEndIndices.d.ts +1 -2
- package/packages/solver/build/generateEndIndices.js +2 -1
- package/packages/solver/build/generateHorizontalPatterns.d.ts +1 -2
- package/packages/solver/build/generateHorizontalPatterns.js +7 -8
- package/packages/solver/build/generatePattern.d.ts +1 -2
- package/packages/solver/build/generatePattern.js +6 -8
- package/packages/solver/build/generatePatterns.d.ts +1 -2
- package/packages/solver/build/generatePatterns.js +6 -8
- package/packages/solver/build/generateStartIndices.d.ts +1 -2
- package/packages/solver/build/generateStartIndices.js +2 -1
- package/packages/solver/build/generateVectors.d.ts +2 -2
- package/packages/solver/build/generateVectors.js +2 -1
- package/packages/solver/build/generateVerticalPatterns.d.ts +1 -2
- package/packages/solver/build/generateVerticalPatterns.js +7 -8
- package/packages/solver/build/getCellsScore.d.ts +1 -2
- package/packages/solver/build/getCellsScore.js +2 -1
- package/packages/solver/build/getPatternHash.d.ts +1 -2
- package/packages/solver/build/getPatternHash.js +2 -1
- package/packages/solver/build/getPatternScore.d.ts +1 -2
- package/packages/solver/build/getPatternScore.js +4 -6
- package/packages/solver/build/getUniquePatterns.d.ts +1 -2
- package/packages/solver/build/getUniquePatterns.js +4 -6
- package/packages/solver/build/index.d.ts +14 -14
- package/packages/solver/build/index.js +14 -17
- package/packages/solver/build/solve.d.ts +1 -2
- package/packages/solver/build/solve.js +12 -14
- package/packages/solver/package.json +5 -5
- package/packages/solver/src/areDigraphsValid.ts +1 -3
- package/packages/solver/src/fillPattern.test.ts +1 -1
- package/packages/solver/src/fillPattern.ts +1 -3
- package/packages/solver/src/generateEndIndices.test.ts +1 -1
- package/packages/solver/src/generateEndIndices.ts +1 -3
- package/packages/solver/src/generateHorizontalPatterns.test.ts +3 -2
- package/packages/solver/src/generateHorizontalPatterns.ts +5 -6
- package/packages/solver/src/generatePattern.ts +3 -5
- package/packages/solver/src/generatePatterns.test.ts +2 -2
- package/packages/solver/src/generatePatterns.ts +3 -5
- package/packages/solver/src/generateStartIndices.test.ts +1 -1
- package/packages/solver/src/generateStartIndices.ts +1 -3
- package/packages/solver/src/generateVectors.test.ts +1 -1
- package/packages/solver/src/generateVectors.ts +1 -3
- package/packages/solver/src/generateVerticalPatterns.test.ts +3 -2
- package/packages/solver/src/generateVerticalPatterns.ts +5 -6
- package/packages/solver/src/getCellsScore.ts +1 -3
- package/packages/solver/src/getPatternHash.test.ts +1 -1
- package/packages/solver/src/getPatternHash.ts +1 -3
- package/packages/solver/src/getPatternScore.test.ts +1 -1
- package/packages/solver/src/getPatternScore.ts +2 -4
- package/packages/solver/src/getUniquePatterns.ts +2 -4
- package/packages/solver/src/index.ts +14 -14
- package/packages/solver/src/solve.test.ts +1 -1
- package/packages/solver/src/solve.ts +6 -8
- package/packages/types/build/Board.d.ts +5 -6
- package/packages/types/build/Board.js +17 -16
- package/packages/types/build/BoardJson.d.ts +2 -3
- package/packages/types/build/Bonus.d.ts +5 -6
- package/packages/types/build/Bonus.js +2 -1
- package/packages/types/build/BonusJson.d.ts +1 -2
- package/packages/types/build/BonusValue.d.ts +1 -2
- package/packages/types/build/Cell.d.ts +4 -5
- package/packages/types/build/Cell.js +13 -15
- package/packages/types/build/CellJson.d.ts +2 -3
- package/packages/types/build/CellJson.js +2 -5
- package/packages/types/build/CharacterBonus.d.ts +5 -6
- package/packages/types/build/CharacterBonus.js +4 -6
- package/packages/types/build/Collision.d.ts +2 -3
- package/packages/types/build/CollisionJson.d.ts +2 -3
- package/packages/types/build/Config.d.ts +12 -12
- package/packages/types/build/Config.js +14 -13
- package/packages/types/build/ConfigJson.d.ts +7 -7
- package/packages/types/build/Dictionary.d.ts +2 -3
- package/packages/types/build/FinalPattern.d.ts +2 -3
- package/packages/types/build/FinalPattern.js +4 -6
- package/packages/types/build/Game.d.ts +2 -2
- package/packages/types/build/Game.js +3 -3
- package/packages/types/build/HorizontalPattern.d.ts +2 -3
- package/packages/types/build/HorizontalPattern.js +5 -7
- package/packages/types/build/Locale.d.ts +1 -2
- package/packages/types/build/Locale.js +2 -3
- package/packages/types/build/Pattern.d.ts +5 -6
- package/packages/types/build/Pattern.js +2 -1
- package/packages/types/build/PatternJson.d.ts +2 -3
- package/packages/types/build/Result.d.ts +6 -6
- package/packages/types/build/Result.js +11 -13
- package/packages/types/build/ResultJson.d.ts +3 -4
- package/packages/types/build/ShowCoordinates.d.ts +1 -2
- package/packages/types/build/Tile.d.ts +3 -4
- package/packages/types/build/Tile.js +11 -10
- package/packages/types/build/TileConfig.d.ts +1 -2
- package/packages/types/build/TileJson.d.ts +1 -2
- package/packages/types/build/TileJson.js +2 -5
- package/packages/types/build/VerticalPattern.d.ts +2 -3
- package/packages/types/build/VerticalPattern.js +5 -7
- package/packages/types/build/WordBonus.d.ts +3 -4
- package/packages/types/build/WordBonus.js +4 -6
- package/packages/types/build/WordDefinition.d.ts +3 -4
- package/packages/types/build/WordDefinition.js +13 -12
- package/packages/types/build/WordDefinitionJson.d.ts +1 -2
- package/packages/types/build/index.d.ts +31 -31
- package/packages/types/build/index.js +20 -23
- package/packages/types/build/isError.d.ts +1 -2
- package/packages/types/build/isError.js +4 -6
- package/packages/types/build/isObject.d.ts +1 -2
- package/packages/types/build/isObject.js +2 -1
- package/packages/types/package.json +2 -2
- package/packages/types/src/Board.ts +14 -13
- package/packages/types/src/BoardJson.ts +2 -4
- package/packages/types/src/Bonus.ts +5 -7
- package/packages/types/src/BonusJson.ts +1 -3
- package/packages/types/src/BonusValue.ts +1 -3
- package/packages/types/src/Cell.ts +5 -7
- package/packages/types/src/CellJson.ts +3 -5
- package/packages/types/src/CharacterBonus.ts +5 -7
- package/packages/types/src/Collision.ts +2 -4
- package/packages/types/src/CollisionJson.ts +2 -4
- package/packages/types/src/Config.ts +20 -18
- package/packages/types/src/ConfigJson.ts +7 -8
- package/packages/types/src/Dictionary.ts +2 -4
- package/packages/types/src/FinalPattern.ts +2 -4
- package/packages/types/src/Game.ts +2 -3
- package/packages/types/src/HorizontalPattern.ts +2 -4
- package/packages/types/src/Locale.ts +1 -3
- package/packages/types/src/Pattern.ts +5 -7
- package/packages/types/src/PatternJson.ts +2 -4
- package/packages/types/src/Result.ts +6 -8
- package/packages/types/src/ResultJson.ts +3 -5
- package/packages/types/src/ShowCoordinates.ts +1 -3
- package/packages/types/src/Tile.ts +4 -6
- package/packages/types/src/TileConfig.ts +1 -3
- package/packages/types/src/TileJson.ts +2 -4
- package/packages/types/src/VerticalPattern.ts +2 -4
- package/packages/types/src/WordBonus.ts +3 -5
- package/packages/types/src/WordDefinition.ts +4 -6
- package/packages/types/src/WordDefinitionJson.ts +1 -3
- package/packages/types/src/index.ts +31 -31
- package/packages/types/src/isError.ts +2 -4
- package/packages/types/src/isObject.ts +1 -3
- package/packages/word-definitions/build/languages/turkish.js +1 -1
- package/packages/word-definitions/build/lib/index.d.ts +3 -3
- package/packages/word-definitions/build/lib/index.js +7 -17
- package/packages/word-definitions/build/lib/request.js +2 -1
- package/packages/word-definitions/package.json +2 -2
- package/packages/word-definitions/src/languages/turkish.ts +3 -3
- package/packages/word-definitions/src/lib/index.ts +3 -3
- package/packages/word-definitions/src/lib/request.ts +2 -1
- package/packages/word-definitions/src/parse.test.ts +1 -1
- package/packages/word-lists/build/languages/polish.js +1 -1
- package/packages/word-lists/build/lib/downloadFile.d.ts +1 -2
- package/packages/word-lists/build/lib/downloadFile.js +4 -3
- package/packages/word-lists/build/lib/downloadHtml.d.ts +1 -2
- package/packages/word-lists/build/lib/downloadHtml.js +2 -1
- package/packages/word-lists/build/lib/extractWords.d.ts +1 -2
- package/packages/word-lists/build/lib/extractWords.js +4 -6
- package/packages/word-lists/build/lib/findFirstWordIndex.d.ts +1 -2
- package/packages/word-lists/build/lib/findFirstWordIndex.js +2 -1
- package/packages/word-lists/build/lib/getHash.d.ts +1 -2
- package/packages/word-lists/build/lib/getHash.js +2 -1
- package/packages/word-lists/build/lib/getTempFilepath.d.ts +1 -2
- package/packages/word-lists/build/lib/getTempFilepath.js +4 -3
- package/packages/word-lists/build/lib/getTxtWordList.d.ts +1 -2
- package/packages/word-lists/build/lib/getTxtWordList.js +6 -5
- package/packages/word-lists/build/lib/index.d.ts +10 -10
- package/packages/word-lists/build/lib/index.js +10 -13
- package/packages/word-lists/build/lib/transliterateDiacritics.d.ts +1 -2
- package/packages/word-lists/build/lib/transliterateDiacritics.js +4 -6
- package/packages/word-lists/build/lib/unique.d.ts +1 -2
- package/packages/word-lists/build/lib/unique.js +2 -1
- package/packages/word-lists/build/lib/unzip.d.ts +1 -2
- package/packages/word-lists/build/lib/unzip.js +2 -1
- package/packages/word-lists/package.json +2 -2
- package/packages/word-lists/src/languages/polish.ts +1 -1
- package/packages/word-lists/src/lib/downloadFile.ts +2 -4
- package/packages/word-lists/src/lib/downloadHtml.ts +1 -3
- package/packages/word-lists/src/lib/extractWords.ts +2 -4
- package/packages/word-lists/src/lib/findFirstWordIndex.ts +1 -3
- package/packages/word-lists/src/lib/getHash.ts +1 -3
- package/packages/word-lists/src/lib/getTempFilepath.ts +2 -4
- package/packages/word-lists/src/lib/getTxtWordList.ts +3 -5
- package/packages/word-lists/src/lib/index.ts +10 -10
- package/packages/word-lists/src/lib/transliterateDiacritics.ts +2 -4
- package/packages/word-lists/src/lib/unique.ts +1 -3
- package/packages/word-lists/src/lib/unzip.ts +3 -5
- package/tsconfig.jest.json +1 -2
- package/tsconfig.json +2 -1
- package/.eslintrc.js +0 -559
- package/packages/dictionaries/build/types/index.d.ts +0 -1
- package/packages/dictionaries/build/types/index.js +0 -2
- package/packages/dictionaries/src/types/index.ts +0 -1
- package/packages/scrabble-solver/.next/cache/eslint/.cache_8dgz12 +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/_app-735105409cfdb48f.js +0 -1
- package/packages/scrabble-solver/.next/static/chunks/pages/index-d492616d9bc42176.js +0 -1
- package/packages/scrabble-solver/src/components/Keys/index.ts +0 -1
- package/packages/scrabble-solver/tsconfig.jest.json +0 -7
- /package/packages/dictionaries/build/{constants/index.d.ts → constants.d.ts} +0 -0
- /package/packages/dictionaries/build/{constants/index.js → constants.js} +0 -0
- /package/packages/dictionaries/build/{types/Cache.js → types.js} +0 -0
- /package/packages/dictionaries/src/{constants/index.ts → constants.ts} +0 -0
- /package/packages/scrabble-solver/.next/static/{3MlxnccTCLyz9bgD30zY2 → ylO_ttKeJTuoqDYywao5A}/_ssgManifest.js +0 -0
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Trie } from '@kamilmielnik/trie';
|
|
2
2
|
import { Board, Config, ResultJson, Tile } from '@scrabble-solver/types';
|
|
3
3
|
|
|
4
|
-
import areDigraphsValid from './areDigraphsValid';
|
|
5
|
-
import fillPattern from './fillPattern';
|
|
6
|
-
import generatePatterns from './generatePatterns';
|
|
7
|
-
import getPatternScore from './getPatternScore';
|
|
8
|
-
import getUniquePatterns from './getUniquePatterns';
|
|
4
|
+
import { areDigraphsValid } from './areDigraphsValid';
|
|
5
|
+
import { fillPattern } from './fillPattern';
|
|
6
|
+
import { generatePatterns } from './generatePatterns';
|
|
7
|
+
import { getPatternScore } from './getPatternScore';
|
|
8
|
+
import { getUniquePatterns } from './getUniquePatterns';
|
|
9
9
|
|
|
10
|
-
const solve = (trie: Trie, config: Config, board: Board, tiles: Tile[]): ResultJson[] => {
|
|
10
|
+
export const solve = (trie: Trie, config: Config, board: Board, tiles: Tile[]): ResultJson[] => {
|
|
11
11
|
const patterns = generatePatterns(config, board);
|
|
12
12
|
const filledPatterns = patterns.flatMap((pattern) => fillPattern(trie, config, pattern, tiles));
|
|
13
13
|
const validPatterns =
|
|
@@ -24,5 +24,3 @@ const solve = (trie: Trie, config: Config, board: Board, tiles: Tile[]): ResultJ
|
|
|
24
24
|
|
|
25
25
|
return results;
|
|
26
26
|
};
|
|
27
|
-
|
|
28
|
-
export default solve;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import BoardJson from './BoardJson';
|
|
2
|
-
import Cell from './Cell';
|
|
3
|
-
declare class Board {
|
|
4
|
-
static create(
|
|
5
|
-
static fromJson(json: BoardJson)
|
|
1
|
+
import { BoardJson } from './BoardJson';
|
|
2
|
+
import { Cell } from './Cell';
|
|
3
|
+
export declare class Board {
|
|
4
|
+
static create: (width: number, height: number) => Board;
|
|
5
|
+
static fromJson: (json: BoardJson) => Board;
|
|
6
6
|
static fromStringArray(stringArray: string[]): Board;
|
|
7
7
|
readonly columnsCount: number;
|
|
8
8
|
readonly rows: Cell[][];
|
|
@@ -29,4 +29,3 @@ declare class Board {
|
|
|
29
29
|
updateCell(x: number, y: number, updateCell: (cell: Cell) => Cell): void;
|
|
30
30
|
updateRow(y: number, updateRow: (cells: Cell[]) => Cell[]): void;
|
|
31
31
|
}
|
|
32
|
-
export default Board;
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Board = void 0;
|
|
6
4
|
const constants_1 = require("@scrabble-solver/constants");
|
|
7
|
-
const Cell_1 =
|
|
8
|
-
const Tile_1 =
|
|
5
|
+
const Cell_1 = require("./Cell");
|
|
6
|
+
const Tile_1 = require("./Tile");
|
|
9
7
|
class Board {
|
|
10
|
-
static create(size) {
|
|
11
|
-
return Board.fromStringArray(Array(size).fill(Array(size).fill(' ').join('')));
|
|
12
|
-
}
|
|
13
|
-
static fromJson(json) {
|
|
14
|
-
return new Board({
|
|
15
|
-
rows: json.map((row) => row.map(Cell_1.default.fromJson)),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
8
|
static fromStringArray(stringArray) {
|
|
19
9
|
return new Board({
|
|
20
|
-
rows: stringArray.map((row, y) => row.split('').map((character, x) => new Cell_1.
|
|
10
|
+
rows: stringArray.map((row, y) => row.split('').map((character, x) => new Cell_1.Cell({
|
|
21
11
|
isEmpty: !character || character === constants_1.EMPTY_CELL,
|
|
22
|
-
tile: character === constants_1.EMPTY_CELL ? Tile_1.
|
|
12
|
+
tile: character === constants_1.EMPTY_CELL ? Tile_1.Tile.Null : new Tile_1.Tile({ character }),
|
|
23
13
|
x,
|
|
24
14
|
y,
|
|
25
15
|
}))),
|
|
@@ -111,4 +101,15 @@ class Board {
|
|
|
111
101
|
this.rows[y] = updateRow(this.rows[y]);
|
|
112
102
|
}
|
|
113
103
|
}
|
|
114
|
-
exports.
|
|
104
|
+
exports.Board = Board;
|
|
105
|
+
Board.create = (width, height) => {
|
|
106
|
+
const rows = Array(height);
|
|
107
|
+
const emptyRow = Array(width).fill(' ').join('');
|
|
108
|
+
const emptyRows = rows.fill(emptyRow);
|
|
109
|
+
return Board.fromStringArray(emptyRows);
|
|
110
|
+
};
|
|
111
|
+
Board.fromJson = (json) => {
|
|
112
|
+
return new Board({
|
|
113
|
+
rows: json.map((row) => row.map(Cell_1.Cell.fromJson)),
|
|
114
|
+
});
|
|
115
|
+
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BONUS_CHARACTER, BONUS_WORD } from '@scrabble-solver/constants';
|
|
2
|
-
import BonusJson from './BonusJson';
|
|
3
|
-
import BonusValue from './BonusValue';
|
|
4
|
-
import Cell from './Cell';
|
|
5
|
-
import type Config from './Config';
|
|
6
|
-
declare abstract class Bonus {
|
|
2
|
+
import { BonusJson } from './BonusJson';
|
|
3
|
+
import { BonusValue } from './BonusValue';
|
|
4
|
+
import { Cell } from './Cell';
|
|
5
|
+
import { type Config } from './Config';
|
|
6
|
+
export declare abstract class Bonus {
|
|
7
7
|
readonly multiplier: number;
|
|
8
8
|
readonly score: number | undefined;
|
|
9
9
|
abstract readonly type: typeof BONUS_CHARACTER | typeof BONUS_WORD;
|
|
@@ -20,4 +20,3 @@ declare abstract class Bonus {
|
|
|
20
20
|
toJson(): BonusJson;
|
|
21
21
|
get value(): BonusValue;
|
|
22
22
|
}
|
|
23
|
-
export default Bonus;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Bonus = void 0;
|
|
3
4
|
class Bonus {
|
|
4
5
|
constructor({ multiplier, score, x, y }) {
|
|
5
6
|
this.multiplier = multiplier;
|
|
@@ -29,4 +30,4 @@ class Bonus {
|
|
|
29
30
|
};
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
|
-
exports.
|
|
33
|
+
exports.Bonus = Bonus;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import CellJson from './CellJson';
|
|
2
|
-
import Tile from './Tile';
|
|
3
|
-
declare class Cell {
|
|
4
|
-
static fromJson(json: CellJson)
|
|
1
|
+
import { CellJson } from './CellJson';
|
|
2
|
+
import { Tile } from './Tile';
|
|
3
|
+
export declare class Cell {
|
|
4
|
+
static fromJson: (json: CellJson) => Cell;
|
|
5
5
|
readonly isEmpty: boolean;
|
|
6
6
|
tile: Tile;
|
|
7
7
|
readonly x: number;
|
|
@@ -19,4 +19,3 @@ declare class Cell {
|
|
|
19
19
|
toJson(): CellJson;
|
|
20
20
|
toString(): string;
|
|
21
21
|
}
|
|
22
|
-
export default Cell;
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
3
|
+
exports.Cell = void 0;
|
|
4
|
+
const Tile_1 = require("./Tile");
|
|
7
5
|
class Cell {
|
|
8
|
-
|
|
9
|
-
return new Cell({
|
|
10
|
-
isEmpty: json.isEmpty,
|
|
11
|
-
tile: Tile_1.default.fromJson(json.tile),
|
|
12
|
-
x: json.x,
|
|
13
|
-
y: json.y,
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
constructor({ isEmpty = true, tile = Tile_1.default.Null, x, y }) {
|
|
6
|
+
constructor({ isEmpty = true, tile = Tile_1.Tile.Null, x, y }) {
|
|
17
7
|
this.isEmpty = isEmpty;
|
|
18
8
|
this.tile = tile;
|
|
19
9
|
this.x = x;
|
|
@@ -31,7 +21,7 @@ class Cell {
|
|
|
31
21
|
return this.x === other.x && this.y === other.y && this.isEmpty === other.isEmpty && this.tile.equals(other.tile);
|
|
32
22
|
}
|
|
33
23
|
hasTile() {
|
|
34
|
-
return this.tile !== Tile_1.
|
|
24
|
+
return this.tile !== Tile_1.Tile.Null;
|
|
35
25
|
}
|
|
36
26
|
isCandidate() {
|
|
37
27
|
return this.isEmpty && this.hasTile();
|
|
@@ -48,4 +38,12 @@ class Cell {
|
|
|
48
38
|
return this.tile.toString();
|
|
49
39
|
}
|
|
50
40
|
}
|
|
51
|
-
exports.
|
|
41
|
+
exports.Cell = Cell;
|
|
42
|
+
Cell.fromJson = (json) => {
|
|
43
|
+
return new Cell({
|
|
44
|
+
isEmpty: json.isEmpty,
|
|
45
|
+
tile: Tile_1.Tile.fromJson(json.tile),
|
|
46
|
+
x: json.x,
|
|
47
|
+
y: json.y,
|
|
48
|
+
});
|
|
49
|
+
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import TileJson from './TileJson';
|
|
2
|
-
interface CellJson {
|
|
1
|
+
import { TileJson } from './TileJson';
|
|
2
|
+
export interface CellJson {
|
|
3
3
|
isEmpty: boolean;
|
|
4
4
|
tile: TileJson | null;
|
|
5
5
|
x: number;
|
|
6
6
|
y: number;
|
|
7
7
|
}
|
|
8
8
|
export declare const isCellJson: (value: unknown) => value is CellJson;
|
|
9
|
-
export default CellJson;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.isCellJson = void 0;
|
|
7
|
-
const isObject_1 =
|
|
4
|
+
const isObject_1 = require("./isObject");
|
|
8
5
|
const TileJson_1 = require("./TileJson");
|
|
9
6
|
const isCellJson = (value) => {
|
|
10
|
-
return ((0, isObject_1.
|
|
7
|
+
return ((0, isObject_1.isObject)(value) &&
|
|
11
8
|
typeof value.isEmpty === 'boolean' &&
|
|
12
9
|
((0, TileJson_1.isTileJson)(value.tile) || value.tile === null) &&
|
|
13
10
|
typeof value.x === 'number' &&
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import Bonus from './Bonus';
|
|
2
|
-
import BonusValue from './BonusValue';
|
|
3
|
-
import Cell from './Cell';
|
|
4
|
-
import type Config from './Config';
|
|
5
|
-
declare class CharacterBonus extends Bonus {
|
|
1
|
+
import { Bonus } from './Bonus';
|
|
2
|
+
import { BonusValue } from './BonusValue';
|
|
3
|
+
import { Cell } from './Cell';
|
|
4
|
+
import { type Config } from './Config';
|
|
5
|
+
export declare class CharacterBonus extends Bonus {
|
|
6
6
|
readonly type = "BONUS_CHARACTER";
|
|
7
7
|
canApply(config: Config, cell: Cell): boolean;
|
|
8
8
|
matchesCellTileScore(config: Config, cell: Cell): boolean;
|
|
9
9
|
get value(): BonusValue;
|
|
10
10
|
}
|
|
11
|
-
export default CharacterBonus;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CharacterBonus = void 0;
|
|
6
4
|
const constants_1 = require("@scrabble-solver/constants");
|
|
7
|
-
const Bonus_1 =
|
|
8
|
-
class CharacterBonus extends Bonus_1.
|
|
5
|
+
const Bonus_1 = require("./Bonus");
|
|
6
|
+
class CharacterBonus extends Bonus_1.Bonus {
|
|
9
7
|
constructor() {
|
|
10
8
|
super(...arguments);
|
|
11
9
|
this.type = constants_1.BONUS_CHARACTER;
|
|
@@ -26,4 +24,4 @@ class CharacterBonus extends Bonus_1.default {
|
|
|
26
24
|
};
|
|
27
25
|
}
|
|
28
26
|
}
|
|
29
|
-
exports.
|
|
27
|
+
exports.CharacterBonus = CharacterBonus;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import Cell from './Cell';
|
|
2
|
-
type Collision = Cell[];
|
|
3
|
-
export default Collision;
|
|
1
|
+
import { Cell } from './Cell';
|
|
2
|
+
export type Collision = Cell[];
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import CellJson from './CellJson';
|
|
2
|
-
type CollisionJson = CellJson[];
|
|
3
|
-
export default CollisionJson;
|
|
1
|
+
import { CellJson } from './CellJson';
|
|
2
|
+
export type CollisionJson = CellJson[];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import Bonus from './Bonus';
|
|
2
|
-
import BonusValue from './BonusValue';
|
|
3
|
-
import Cell from './Cell';
|
|
4
|
-
import ConfigJson from './ConfigJson';
|
|
5
|
-
import Game from './Game';
|
|
6
|
-
import Locale from './Locale';
|
|
7
|
-
import Tile from './Tile';
|
|
8
|
-
import TileConfig from './TileConfig';
|
|
9
|
-
declare class Config {
|
|
10
|
-
static fromJson(json: ConfigJson)
|
|
1
|
+
import { Bonus } from './Bonus';
|
|
2
|
+
import { BonusValue } from './BonusValue';
|
|
3
|
+
import { Cell } from './Cell';
|
|
4
|
+
import { ConfigJson } from './ConfigJson';
|
|
5
|
+
import { Game } from './Game';
|
|
6
|
+
import { Locale } from './Locale';
|
|
7
|
+
import { Tile } from './Tile';
|
|
8
|
+
import { TileConfig } from './TileConfig';
|
|
9
|
+
export declare class Config {
|
|
10
|
+
static fromJson: (json: ConfigJson) => Config;
|
|
11
11
|
readonly bonuses: Bonus[];
|
|
12
12
|
readonly config: ConfigJson;
|
|
13
13
|
readonly pointsMap: Record<string, number>;
|
|
@@ -16,7 +16,8 @@ declare class Config {
|
|
|
16
16
|
get bingoScore(): number;
|
|
17
17
|
get blankScore(): number;
|
|
18
18
|
get blanksCount(): number;
|
|
19
|
-
get
|
|
19
|
+
get boardHeight(): number;
|
|
20
|
+
get boardWidth(): number;
|
|
20
21
|
get game(): Game;
|
|
21
22
|
get locale(): Locale;
|
|
22
23
|
get twoCharacterTiles(): string[];
|
|
@@ -31,4 +32,3 @@ declare class Config {
|
|
|
31
32
|
get tiles(): TileConfig[];
|
|
32
33
|
toJson(): ConfigJson;
|
|
33
34
|
}
|
|
34
|
-
export default Config;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Config = void 0;
|
|
6
4
|
const constants_1 = require("@scrabble-solver/constants");
|
|
7
|
-
const CharacterBonus_1 =
|
|
8
|
-
const WordBonus_1 =
|
|
5
|
+
const CharacterBonus_1 = require("./CharacterBonus");
|
|
6
|
+
const WordBonus_1 = require("./WordBonus");
|
|
9
7
|
class Config {
|
|
10
|
-
static fromJson(json) {
|
|
11
|
-
return new Config(json);
|
|
12
|
-
}
|
|
13
8
|
constructor(config) {
|
|
14
9
|
this.bonuses = getBonuses(config);
|
|
15
10
|
this.config = config;
|
|
@@ -27,8 +22,11 @@ class Config {
|
|
|
27
22
|
get blanksCount() {
|
|
28
23
|
return this.config.blanksCount;
|
|
29
24
|
}
|
|
30
|
-
get
|
|
31
|
-
return this.config.
|
|
25
|
+
get boardHeight() {
|
|
26
|
+
return this.config.boardHeight;
|
|
27
|
+
}
|
|
28
|
+
get boardWidth() {
|
|
29
|
+
return this.config.boardWidth;
|
|
32
30
|
}
|
|
33
31
|
get game() {
|
|
34
32
|
return this.config.game;
|
|
@@ -82,13 +80,17 @@ class Config {
|
|
|
82
80
|
return this.config;
|
|
83
81
|
}
|
|
84
82
|
}
|
|
83
|
+
exports.Config = Config;
|
|
84
|
+
Config.fromJson = (json) => {
|
|
85
|
+
return new Config(json);
|
|
86
|
+
};
|
|
85
87
|
const getBonuses = (config) => {
|
|
86
88
|
return config.bonuses.map((bonus) => {
|
|
87
89
|
if (bonus.type === constants_1.BONUS_CHARACTER) {
|
|
88
|
-
return new CharacterBonus_1.
|
|
90
|
+
return new CharacterBonus_1.CharacterBonus(bonus);
|
|
89
91
|
}
|
|
90
92
|
if (bonus.type === constants_1.BONUS_WORD) {
|
|
91
|
-
return new WordBonus_1.
|
|
93
|
+
return new WordBonus_1.WordBonus(bonus);
|
|
92
94
|
}
|
|
93
95
|
throw new Error(`Unsupported Bonus type: "${bonus.type}"`);
|
|
94
96
|
});
|
|
@@ -98,4 +100,3 @@ const getPointsMap = (config) => config.tiles.reduce((pointsMap, { character, sc
|
|
|
98
100
|
...pointsMap,
|
|
99
101
|
[character]: score,
|
|
100
102
|
}), {});
|
|
101
|
-
exports.default = Config;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import BonusJson from './BonusJson';
|
|
2
|
-
import Game from './Game';
|
|
3
|
-
import Locale from './Locale';
|
|
4
|
-
import TileConfig from './TileConfig';
|
|
5
|
-
interface ConfigJson {
|
|
1
|
+
import { BonusJson } from './BonusJson';
|
|
2
|
+
import { Game } from './Game';
|
|
3
|
+
import { Locale } from './Locale';
|
|
4
|
+
import { TileConfig } from './TileConfig';
|
|
5
|
+
export interface ConfigJson {
|
|
6
6
|
bingoScore: number;
|
|
7
7
|
blankScore: number;
|
|
8
8
|
blanksCount: number;
|
|
9
|
-
|
|
9
|
+
boardHeight: number;
|
|
10
|
+
boardWidth: number;
|
|
10
11
|
bonuses: BonusJson[];
|
|
11
12
|
game: Game;
|
|
12
13
|
locale: Locale;
|
|
@@ -14,4 +15,3 @@ interface ConfigJson {
|
|
|
14
15
|
rackSize: number;
|
|
15
16
|
tiles: TileConfig[];
|
|
16
17
|
}
|
|
17
|
-
export default ConfigJson;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import Pattern from './Pattern';
|
|
2
|
-
declare class FinalPattern extends Pattern {
|
|
1
|
+
import { Pattern } from './Pattern';
|
|
2
|
+
export declare class FinalPattern extends Pattern {
|
|
3
3
|
private readonly collisions;
|
|
4
4
|
constructor(pattern: Pattern);
|
|
5
5
|
getCollisions(): Pattern[];
|
|
6
6
|
}
|
|
7
|
-
export default FinalPattern;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.FinalPattern = void 0;
|
|
4
|
+
const Pattern_1 = require("./Pattern");
|
|
5
|
+
class FinalPattern extends Pattern_1.Pattern {
|
|
8
6
|
constructor(pattern) {
|
|
9
7
|
super(pattern.board, pattern.cells);
|
|
10
8
|
this.collisions = pattern.getCollisions();
|
|
@@ -13,4 +11,4 @@ class FinalPattern extends Pattern_1.default {
|
|
|
13
11
|
return this.collisions;
|
|
14
12
|
}
|
|
15
13
|
}
|
|
16
|
-
exports.
|
|
14
|
+
exports.FinalPattern = FinalPattern;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
declare enum Game {
|
|
1
|
+
export declare enum Game {
|
|
2
2
|
Kelimelik = "kelimelik",
|
|
3
3
|
Literaki = "literaki",
|
|
4
4
|
Scrabble = "scrabble",
|
|
5
|
+
ScrabbleDuel = "scrabble-duel",
|
|
5
6
|
SuperScrabble = "super-scrabble"
|
|
6
7
|
}
|
|
7
8
|
export declare const isGame: (locale: unknown) => locale is Game;
|
|
8
|
-
export default Game;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isGame = void 0;
|
|
3
|
+
exports.isGame = exports.Game = void 0;
|
|
4
4
|
var Game;
|
|
5
5
|
(function (Game) {
|
|
6
6
|
Game["Kelimelik"] = "kelimelik";
|
|
7
7
|
Game["Literaki"] = "literaki";
|
|
8
8
|
Game["Scrabble"] = "scrabble";
|
|
9
|
+
Game["ScrabbleDuel"] = "scrabble-duel";
|
|
9
10
|
Game["SuperScrabble"] = "super-scrabble";
|
|
10
|
-
})(Game || (Game = {}));
|
|
11
|
+
})(Game || (exports.Game = Game = {}));
|
|
11
12
|
const games = Object.values(Game);
|
|
12
13
|
const isGame = (locale) => games.includes(locale);
|
|
13
14
|
exports.isGame = isGame;
|
|
14
|
-
exports.default = Game;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import Pattern from './Pattern';
|
|
2
|
-
declare class HorizontalPattern extends Pattern {
|
|
1
|
+
import { Pattern } from './Pattern';
|
|
2
|
+
export declare class HorizontalPattern extends Pattern {
|
|
3
3
|
clone(): Pattern;
|
|
4
4
|
getCollisions(): Pattern[];
|
|
5
5
|
}
|
|
6
|
-
export default HorizontalPattern;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
exports.HorizontalPattern = void 0;
|
|
4
|
+
const Pattern_1 = require("./Pattern");
|
|
5
|
+
class HorizontalPattern extends Pattern_1.Pattern {
|
|
8
6
|
clone() {
|
|
9
7
|
return new HorizontalPattern(this.board, this.cells.map((cell) => cell.clone()));
|
|
10
8
|
}
|
|
@@ -26,11 +24,11 @@ class HorizontalPattern extends Pattern_1.default {
|
|
|
26
24
|
const nextCells = column.slice(cell.y + 1, y);
|
|
27
25
|
const cells = [...previousCells, cell, ...nextCells];
|
|
28
26
|
if (cells.length > 1) {
|
|
29
|
-
const pattern = new Pattern_1.
|
|
27
|
+
const pattern = new Pattern_1.Pattern(this.board, cells);
|
|
30
28
|
collisions.push(pattern);
|
|
31
29
|
}
|
|
32
30
|
});
|
|
33
31
|
return collisions;
|
|
34
32
|
}
|
|
35
33
|
}
|
|
36
|
-
exports.
|
|
34
|
+
exports.HorizontalPattern = HorizontalPattern;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* @see https://en.wikipedia.org/wiki/IETF_language_tag
|
|
4
4
|
* @see https://en.wikipedia.org/wiki/ISO_3166-1
|
|
5
5
|
*/
|
|
6
|
-
declare enum Locale {
|
|
6
|
+
export declare enum Locale {
|
|
7
7
|
DE_DE = "de-DE",
|
|
8
8
|
EN_GB = "en-GB",
|
|
9
9
|
EN_US = "en-US",
|
|
@@ -15,4 +15,3 @@ declare enum Locale {
|
|
|
15
15
|
TR_TR = "tr-TR"
|
|
16
16
|
}
|
|
17
17
|
export declare const isLocale: (locale: unknown) => locale is Locale;
|
|
18
|
-
export default Locale;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isLocale = void 0;
|
|
3
|
+
exports.isLocale = exports.Locale = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Locales are defined using IETF language tags
|
|
6
6
|
* @see https://en.wikipedia.org/wiki/IETF_language_tag
|
|
@@ -17,8 +17,7 @@ var Locale;
|
|
|
17
17
|
Locale["PL_PL"] = "pl-PL";
|
|
18
18
|
Locale["RO_RO"] = "ro-RO";
|
|
19
19
|
Locale["TR_TR"] = "tr-TR";
|
|
20
|
-
})(Locale || (Locale = {}));
|
|
20
|
+
})(Locale || (exports.Locale = Locale = {}));
|
|
21
21
|
const locales = Object.values(Locale);
|
|
22
22
|
const isLocale = (locale) => locales.includes(locale);
|
|
23
23
|
exports.isLocale = isLocale;
|
|
24
|
-
exports.default = Locale;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import Board from './Board';
|
|
2
|
-
import Cell from './Cell';
|
|
3
|
-
import Config from './Config';
|
|
4
|
-
import PatternJson from './PatternJson';
|
|
5
|
-
declare class Pattern {
|
|
1
|
+
import { Board } from './Board';
|
|
2
|
+
import { Cell } from './Cell';
|
|
3
|
+
import { Config } from './Config';
|
|
4
|
+
import { PatternJson } from './PatternJson';
|
|
5
|
+
export declare class Pattern {
|
|
6
6
|
readonly board: Board;
|
|
7
7
|
readonly cells: Cell[];
|
|
8
8
|
constructor(board: Board, cells: Cell[]);
|
|
@@ -18,4 +18,3 @@ declare class Pattern {
|
|
|
18
18
|
toJson(): PatternJson;
|
|
19
19
|
toString(): string;
|
|
20
20
|
}
|
|
21
|
-
export default Pattern;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pattern = void 0;
|
|
3
4
|
class Pattern {
|
|
4
5
|
constructor(board, cells) {
|
|
5
6
|
this.board = board;
|
|
@@ -46,4 +47,4 @@ class Pattern {
|
|
|
46
47
|
return this.cells.reduce((result, cell) => result + cell.toString(), '');
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
exports.
|
|
50
|
+
exports.Pattern = Pattern;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import Cell from './Cell';
|
|
2
|
-
import ResultJson from './ResultJson';
|
|
3
|
-
import Tile from './Tile';
|
|
1
|
+
import { Cell } from './Cell';
|
|
2
|
+
import { ResultJson } from './ResultJson';
|
|
3
|
+
import { Tile } from './Tile';
|
|
4
4
|
type Collision = Cell[];
|
|
5
|
-
declare class Result {
|
|
6
|
-
static fromJson(json: ResultJson)
|
|
5
|
+
export declare class Result {
|
|
6
|
+
static fromJson: (json: ResultJson) => Result;
|
|
7
7
|
readonly blanksCount: number;
|
|
8
8
|
readonly cells: Cell[];
|
|
9
9
|
readonly collisions: Collision[];
|
|
@@ -26,4 +26,4 @@ declare class Result {
|
|
|
26
26
|
});
|
|
27
27
|
toJson(): ResultJson;
|
|
28
28
|
}
|
|
29
|
-
export
|
|
29
|
+
export {};
|