"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWordDefinition = void 0;
const types_1 = require("@scrabble-solver/types");
const crawl_1 = require("./crawl");
const parse_1 = require("./parse");
const getWordDefinition = async (locale, word, isAllowed) => {
    const html = await (0, crawl_1.crawl)(locale, word);
    const { definitions, exists } = (0, parse_1.parse)(locale, html);
    const wordDefinition = new types_1.WordDefinition({ definitions, exists, isAllowed, word });
    return wordDefinition;
};
exports.getWordDefinition = getWordDefinition;
