Something went wrong. Try again.
Pop-up dictionary browser extension for language learning. Successor to Yomichan. (PERSONAL FORK)
Something went wrong. Try again.
TypeScript
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201/* * Copyright (C) 2023-2025 Yomitan Authors * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <https://www.gnu.org/licenses/>. */
import type * as StructuredContent from './structured-content';
export type IndexVersion = 1 | 2 | 3;
export type Index = { format?: IndexVersion; version?: IndexVersion; title: string; revision: string; minimumYomitanVersion?: string; sequenced?: boolean; isUpdatable?: true; indexUrl?: string; downloadUrl?: string; author?: string; url?: string; description?: string; attribution?: string; sourceLanguage?: string; targetLanguage?: string; frequencyMode?: 'occurrence-based' | 'rank-based'; tagMeta?: IndexTagMeta;};
export type IndexTagMeta = { [name: string]: IndexTag;};
export type IndexTag = { category: string; order: number; notes: string; score: number;};
export type TermV1Array = TermV1[];
export type TermV1 = [ expression: string, reading: string, definitionTags: string | null, rules: string, score: number, ...glossary: string[],];
export type TermV3Array = TermV3[];
export type TermV3 = [ expression: string, reading: string, definitionTags: string | null, rules: string, score: number, glossary: TermGlossary[], sequence: number, termTags: string,];
export type KanjiV1Array = KanjiV1[];
export type KanjiV1 = [ character: string, onyomi: string, kunyomi: string, tags: string, ...meanings: string[],];
export type KanjiV3Array = KanjiV3[];
export type KanjiV3 = [ character: string, onyomi: string, kunyomi: string, tags: string, meanings: string[], stats: {[name: string]: string},];
export type TermGlossary = ( TermGlossaryContent | TermGlossaryDeinflection);
export type TermGlossaryContent = ( TermGlossaryString | TermGlossaryText | TermGlossaryImage | TermGlossaryStructuredContent);
export type TermGlossaryString = string;
export type TermGlossaryText = {type: 'text', text: string};
export type TermGlossaryImage = {type: 'image'} & TermImage;
export type TermGlossaryStructuredContent = {type: 'structured-content', content: StructuredContent.Content};
export type TermGlossaryDeinflection = [ uninflected: string, inflectionRuleChain: string[],];
export type TermImage = StructuredContent.ImageElementBase & { // Compatibility properties verticalAlign?: undefined; border?: undefined; borderRadius?: undefined; sizeUnits?: undefined;};
export type TagArray = Tag[];
export type Tag = [ name: string, category: string, order: number, notes: string, score: number,];
export type GenericFrequencyData = string | number | { value: number; displayValue?: string; reading?: undefined; // Used for type disambiguation, field does not actually exist};
export type TermMetaArray = TermMeta[];
export type TermMeta = TermMetaFrequency | TermMetaPitch | TermMetaPhonetic;
export type TermMetaFrequencyDataWithReading = { reading: string; frequency: GenericFrequencyData;};
export type TermMetaFrequency = [ expression: string, mode: 'freq', data: GenericFrequencyData | TermMetaFrequencyDataWithReading,];
export type TermMetaPitchData = { reading: string; pitches: { position: number | string; nasal?: number | number[]; devoice?: number | number[]; tags?: string[]; }[];};
export type TermMetaPitch = [ expression: string, mode: 'pitch', data: TermMetaPitchData,];
export type TermMetaPhonetic = [ expression: string, mode: 'ipa', data: TermMetaPhoneticData,];
export type TermMetaPhoneticData = { reading: string; transcriptions: { ipa: string; tags?: string[]; }[];};
export type KanjiMetaArray = KanjiMeta[];
export type KanjiMeta = KanjiMetaFrequency;
export type KanjiMetaFrequency = [ character: string, mode: 'freq', data: GenericFrequencyData,];