import { type Locale, WordDefinition, type WordDefinitionJson } from '@scrabble-solver/types'; import { fetchJson } from './fetchJson'; export const findWordDefinitions = async (locale: Locale, word: string): Promise => { const json = await fetchJson(`/api/dictionary/${locale}/${encodeURIComponent(word)}`); return json.map(WordDefinition.fromJson); };