UNPKG

wordnik-api

Version:

Community API for https://wordnik.com with types

44 lines (43 loc) 2.03 kB
import { PartOfSpeech } from "../struct/PartOfSpeech"; import Label from "./Label"; import Citation from "./Citation"; import RelatedWord from "./RelatedWord"; import ExampleUse from "./ExampleUse"; /** * Defines a word. */ export default class Word { readonly id: string; readonly partOfSpeech: PartOfSpeech; readonly attributionText: string | undefined; readonly attributionUrl: string | undefined; readonly sourceDictionary: string | undefined; readonly text: string | undefined; readonly sequence: string; readonly score: number; readonly lables: Label[]; readonly citations: Citation[]; readonly word: string; readonly relatedWords: RelatedWord[]; readonly exampleUses: ExampleUse[]; readonly wordnikUrl: string; /** * Constructor for a word. * * @param id {string} The id of the word. * @param partOfSpeech {PartOfSpeech} The part of speech of the word. * @param attributionText {string | undefined} The attribution text of the word. * @param attributionUrl {string | undefined} The attribution url of the word. * @param sourceDictionary {string | undefined} The source dictionary of the word. * @param text {string | undefined} The text definition of the word. * @param sequence {string} * @param score {number} The score of the word. * @param lables {Label[]} Word labels. * @param citations {Citation[]} Citations for the word. * @param word {string} The word. * @param relatedWords {RelatedWord[]} Related words. * @param exampleUses {ExampleUse[]} Example uses. * @param wordnikUrl {string} The Wordnik url. */ constructor(id: string, partOfSpeech: PartOfSpeech, attributionText: string | undefined, attributionUrl: string | undefined, sourceDictionary: string | undefined, text: string | undefined, sequence: string, score: number, lables: Label[], citations: Citation[], word: string, relatedWords: RelatedWord[], exampleUses: ExampleUse[], wordnikUrl: string); }