scrabble-solver
Version:
Scrabble Solver 2 - Free, open-source, cross-platform, multi-language analysis tool for Scrabble, Scrabble Duel, Super Scrabble, Letter League, Literaki, and Kelimelik. Quickly find the top-scoring words using the given board and tiles.
22 lines (17 loc) • 477 B
text/typescript
import { type BoardJson, type Locale } from '@scrabble-solver/types';
import { fetchJson } from './fetchJson';
interface Payload {
board: BoardJson;
game: string;
locale: Locale;
}
interface Response {
invalidWords: string[];
validWords: string[];
}
export const verify = async ({ board, game, locale }: Payload): Promise<Response> => {
return fetchJson<Response>('/api/verify', {
method: 'POST',
body: JSON.stringify({ board, game, locale }),
});
};