@bachman-dev/wanikani-api-types - v2.0.0
    Preparing search index...

    Type Alias Subject

    Subject: BaseResource & { id: number } & (
        | { data: KanaVocabularyData; object: "kana_vocabulary" }
        | { data: KanjiData; object: "kanji" }
        | { data: RadicalData; object: "radical" }
        | { data: VocabularyData; object: "vocabulary" }
    )

    The exact structure of a subject depends on the subject type. The available subject types are kana_vocabulary, kanji, radical, and vocabulary. Note that any attributes called out for the specific subject type behaves differently than the common attribute of the same name.

    This type is for mixed or unknown subject types; it is a discriminated union based on the subject's object key.

    Type declaration

    • id: number

      A unique number identifying the subject.

    • { data: KanaVocabularyData; object: "kana_vocabulary" }
      • data: KanaVocabularyData

        Data for the returned kana-only vocabulary.

      • object: "kana_vocabulary"

        The kind of object returned.

    • { data: KanjiData; object: "kanji" }
      • data: KanjiData

        Data for the returned kanji.

      • object: "kanji"

        The kind of object returned.

    • { data: RadicalData; object: "radical" }
      • data: RadicalData

        Data for the returned radical.

      • object: "radical"

        The kind of object returned.

    • { data: VocabularyData; object: "vocabulary" }
      • data: VocabularyData

        Data for the returned vocabulary.

      • object: "vocabulary"

        The kind of object returned.