aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-06-20 19:27:02 +0200
committerGitHub <noreply@github.com>2024-06-20 17:27:02 +0000
commitd2c930a94d6e445053bcb5e5bb629851165425fc (patch)
tree94ff7034e7d3ab36ed663f353aeb5486bd294d1c /types
parent1a866b3997310a04fc146b91eb47a59a3f049589 (diff)
support css file in dictionaries (#1080)
* get styles in db * get styles in settings * use styles * fix test * scope * fix comma separated * escape dict name in css selector * g regex * get styles in anki * fix tests * more specificity * whitespace * test importing * test handlebars * add styles to glossary-first
Diffstat (limited to 'types')
-rw-r--r--types/ext/anki-note-builder.d.ts2
-rw-r--r--types/ext/anki-templates-internal.d.ts1
-rw-r--r--types/ext/anki-templates.d.ts4
-rw-r--r--types/ext/dictionary-importer.d.ts7
-rw-r--r--types/ext/settings.d.ts1
5 files changed, 15 insertions, 0 deletions
diff --git a/types/ext/anki-note-builder.d.ts b/types/ext/anki-note-builder.d.ts
index e3a1ed6a..510c0687 100644
--- a/types/ext/anki-note-builder.d.ts
+++ b/types/ext/anki-note-builder.d.ts
@@ -41,6 +41,7 @@ export type CreateNoteDetails = {
glossaryLayoutMode: Settings.GlossaryLayoutMode;
compactTags: boolean;
mediaOptions: MediaOptions | null;
+ dictionaryStylesMap: Map<string, string>;
};
export type Field = [
@@ -62,6 +63,7 @@ export type GetRenderingDataDetails = {
glossaryLayoutMode?: Settings.GlossaryLayoutMode;
compactTags?: boolean;
marker: string;
+ dictionaryStylesMap: Map<string, string>;
};
export type CommonData = AnkiTemplatesInternal.CreateDetails;
diff --git a/types/ext/anki-templates-internal.d.ts b/types/ext/anki-templates-internal.d.ts
index ea0a407d..df1b2dfe 100644
--- a/types/ext/anki-templates-internal.d.ts
+++ b/types/ext/anki-templates-internal.d.ts
@@ -51,6 +51,7 @@ export type CreateDetails = {
context: Context;
/** Media data. */
media?: AnkiTemplates.Media;
+ dictionaryStylesMap: Map<string, string>;
};
export type CachedValue<T = unknown> = {
diff --git a/types/ext/anki-templates.d.ts b/types/ext/anki-templates.d.ts
index efa0bad2..44a087eb 100644
--- a/types/ext/anki-templates.d.ts
+++ b/types/ext/anki-templates.d.ts
@@ -188,6 +188,8 @@ export type TermDictionaryEntry = {
readonly reading: string | string[];
readonly expressions: TermHeadword[];
readonly glossary?: DictionaryData.TermGlossary[];
+ readonly glossaryScopedStyles?: string;
+ readonly dictScopedStyles?: string;
readonly definitionTags?: Tag[];
readonly termTags?: Tag[];
readonly definitions?: TermDefinition[];
@@ -228,6 +230,8 @@ export type TermDefinition = {
dictionary: string;
glossary: DictionaryData.TermGlossary[];
definitionTags: Tag[];
+ glossaryScopedStyles: string;
+ dictScopedStyles: string;
only?: string[];
};
diff --git a/types/ext/dictionary-importer.d.ts b/types/ext/dictionary-importer.d.ts
index 8807b3bc..c5d707a1 100644
--- a/types/ext/dictionary-importer.d.ts
+++ b/types/ext/dictionary-importer.d.ts
@@ -61,6 +61,7 @@ export type Summary = {
importDate: number;
prefixWildcardsSupported: boolean;
counts: SummaryCounts;
+ styles: string;
author?: string;
url?: string;
description?: string;
@@ -70,6 +71,12 @@ export type Summary = {
frequencyMode?: 'occurrence-based' | 'rank-based';
};
+export type SummaryDetails = {
+ prefixWildcardsSupported: boolean;
+ counts: SummaryCounts;
+ styles: string;
+};
+
export type SummaryCounts = {
terms: SummaryItemCount;
termMeta: SummaryMetaCount;
diff --git a/types/ext/settings.d.ts b/types/ext/settings.d.ts
index 80fb8a1f..8183befd 100644
--- a/types/ext/settings.d.ts
+++ b/types/ext/settings.d.ts
@@ -263,6 +263,7 @@ export type DictionaryOptions = {
definitionsCollapsible: DictionaryDefinitionsCollapsible;
partsOfSpeechFilter: boolean;
useDeinflections: boolean;
+ styles?: string;
};
export type ParsingOptions = {