"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.WordDefinition = void 0;
class WordDefinition {
    constructor({ definitions, exists, isAllowed, word }) {
        this.definitions = definitions;
        this.exists = exists;
        this.isAllowed = isAllowed;
        this.word = word;
    }
    toJson() {
        return {
            definitions: this.definitions,
            exists: this.exists,
            isAllowed: this.isAllowed,
            word: this.word,
        };
    }
}
exports.WordDefinition = WordDefinition;
WordDefinition.fromJson = (json) => {
    if (!json) {
        return WordDefinition.Null;
    }
    return new WordDefinition({
        definitions: json.definitions,
        exists: json.exists,
        isAllowed: json.isAllowed,
        word: json.word,
    });
};
WordDefinition.Null = Object.freeze({
    definitions: [],
    exists: false,
    isAllowed: false,
    word: '',
    toJson: () => null,
});
