aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2024-02-10 23:12:01 -0500
committerGitHub <noreply@github.com>2024-02-11 04:12:01 +0000
commit765f1ede668f70e3af7717bf4d5f05dbf009c7f8 (patch)
treee73f481c93f8bbaa42f7c8216190fb1cb4621301 /types
parent805cf9cb3ea744a6d7c0a5da27fc9ef4e6f08626 (diff)
Eslint rule updates (#665)
* Padding newline rules * Update rules * Update rules * Update rules * Updates * Update object quotes * Merge similar ts and js rules * Change export spacing rules * Move typescript-eslint rules * Spacing * Actually save and commit changes
Diffstat (limited to 'types')
-rw-r--r--types/ext/backend.d.ts1
-rw-r--r--types/ext/dictionary-data.d.ts4
-rw-r--r--types/ext/dictionary-database.d.ts6
-rw-r--r--types/ext/input.d.ts3
-rw-r--r--types/ext/profile-conditions-util.d.ts2
-rw-r--r--types/ext/settings-modifications.d.ts10
-rw-r--r--types/ext/settings.d.ts18
-rw-r--r--types/other/rollup-parse-ast.d.ts1
8 files changed, 41 insertions, 4 deletions
diff --git a/types/ext/backend.d.ts b/types/ext/backend.d.ts
index ce973630..a832e434 100644
--- a/types/ext/backend.d.ts
+++ b/types/ext/backend.d.ts
@@ -18,6 +18,7 @@
import type * as Api from './api';
export type DatabaseUpdateType = 'dictionary';
+
export type DatabaseUpdateCause = 'purge' | 'delete' | 'import';
export type MecabParseResults = [
diff --git a/types/ext/dictionary-data.d.ts b/types/ext/dictionary-data.d.ts
index 434f5a27..0128f83f 100644
--- a/types/ext/dictionary-data.d.ts
+++ b/types/ext/dictionary-data.d.ts
@@ -102,9 +102,13 @@ export type TermGlossaryContent = (
);
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[],
diff --git a/types/ext/dictionary-database.d.ts b/types/ext/dictionary-database.d.ts
index 1ae4603f..84c6da62 100644
--- a/types/ext/dictionary-database.d.ts
+++ b/types/ext/dictionary-database.d.ts
@@ -36,7 +36,9 @@ export type MediaDataArrayBufferContent = MediaDataBase<ArrayBuffer>;
export type MediaDataStringContent = MediaDataBase<string>;
-export type Media<T extends (ArrayBuffer | string) = ArrayBuffer> = {index: number} & MediaDataBase<T>;
+type MediaType = ArrayBuffer | string;
+
+export type Media<T extends MediaType = ArrayBuffer> = {index: number} & MediaDataBase<T>;
export type DatabaseTermEntry = {
expression: string;
@@ -198,7 +200,6 @@ export type ObjectStoreName = (
'media'
);
-/* eslint-disable @stylistic/indent */
export type ObjectStoreData<T extends ObjectStoreName> = (
T extends 'dictionaries' ? DictionaryImporter.Summary :
T extends 'terms' ? DatabaseTermEntry :
@@ -209,7 +210,6 @@ export type ObjectStoreData<T extends ObjectStoreName> = (
T extends 'media' ? MediaDataArrayBufferContent :
never
);
-/* eslint-enable @stylistic/indent */
export type DeleteDictionaryProgressData = {
count: number;
diff --git a/types/ext/input.d.ts b/types/ext/input.d.ts
index ab05f015..e71a0110 100644
--- a/types/ext/input.d.ts
+++ b/types/ext/input.d.ts
@@ -16,6 +16,9 @@
*/
export type ModifierKey = 'alt' | 'ctrl' | 'meta' | 'shift';
+
export type ModifierMouseButton = 'mouse0' | 'mouse1' | 'mouse2' | 'mouse3' | 'mouse4' | 'mouse5';
+
export type Modifier = ModifierKey | ModifierMouseButton;
+
export type ModifierType = 'key' | 'mouse';
diff --git a/types/ext/profile-conditions-util.d.ts b/types/ext/profile-conditions-util.d.ts
index 441c9b97..288a3f78 100644
--- a/types/ext/profile-conditions-util.d.ts
+++ b/types/ext/profile-conditions-util.d.ts
@@ -33,6 +33,6 @@ export type NormalizedOptionsContext1 = Settings.OptionsContext1 & {
export type NormalizedOptionsContext2 = Settings.OptionsContext2;
-export type NormalizedOptionsContext3 = Settings.OptionsContext2;
+export type NormalizedOptionsContext3 = Settings.OptionsContext3;
export type NormalizedOptionsContext = NormalizedOptionsContext1 | NormalizedOptionsContext2 | NormalizedOptionsContext3;
diff --git a/types/ext/settings-modifications.d.ts b/types/ext/settings-modifications.d.ts
index b052ba30..becfea5c 100644
--- a/types/ext/settings-modifications.d.ts
+++ b/types/ext/settings-modifications.d.ts
@@ -68,10 +68,15 @@ export type Modification = (
);
export type ScopedRead = Read & OptionsScope;
+
export type ScopedModificationSet = ModificationSet & OptionsScope;
+
export type ScopedModificationDelete = ModificationDelete & OptionsScope;
+
export type ScopedModificationSwap = ModificationSwap & OptionsScope;
+
export type ScopedModificationSplice = ModificationSplice & OptionsScope;
+
export type ScopedModificationPush = ModificationPush & OptionsScope;
export type ScopedModification = (
@@ -83,14 +88,19 @@ export type ScopedModification = (
);
export type ModificationSetResult = unknown;
+
export type ModificationDeleteResult = true;
+
export type ModificationSwapResult = true;
+
export type ModificationSpliceResult = unknown[];
+
export type ModificationPushResult = number;
export type ModificationResult = (
ModificationSetResult |
ModificationDeleteResult |
+ // eslint-disable-next-line @typescript-eslint/no-duplicate-type-constituents
ModificationSwapResult |
ModificationSpliceResult |
ModificationPushResult
diff --git a/types/ext/settings.d.ts b/types/ext/settings.d.ts
index 96440823..a900dbe6 100644
--- a/types/ext/settings.d.ts
+++ b/types/ext/settings.d.ts
@@ -349,25 +349,39 @@ export type PreventMiddleMouseOptions = {
};
export type ResultOutputMode = 'group' | 'merge' | 'split';
+
export type PopupDisplayMode = 'default' | 'full-width';
+
export type PopupHorizontalTextPosition = 'below' | 'above';
+
export type PopupVerticalTextPosition = 'default' | 'before' | 'after' | 'left' | 'right';
+
export type GlossaryLayoutMode = 'default' | 'compact';
+
export type PopupTheme = 'light' | 'dark' | 'browser';
+
export type PopupOuterTheme = 'light' | 'dark' | 'browser' | 'site';
+
export type PopupCurrentIndicatorMode = 'none' | 'asterisk' | 'triangle' | 'bar-left' | 'bar-right' | 'dot-left' | 'dot-right';
+
export type PopupActionBarVisibility = 'auto' | 'always';
+
export type PopupActionBarLocation = 'left' | 'right' | 'top' | 'bottom';
+
export type FrequencyDisplayMode = 'tags' | 'tags-grouped' | 'split-tags' | 'split-tags-grouped' | 'inline-list' | 'list';
+
export type TermDisplayMode = 'ruby' | 'ruby-and-reading' | 'term-and-reading';
+
export type SortFrequencyDictionaryOrder = 'ascending' | 'descending';
export type PopupWindowType = 'normal' | 'popup';
+
export type PopupWindowState = 'normal' | 'maximized' | 'fullscreen';
export type AudioSourceType = 'jpod101' | 'jpod101-alternate' | 'jisho' | 'text-to-speech' | 'text-to-speech-reading' | 'custom' | 'custom-json';
export type TranslationConvertType = 'false' | 'true' | 'variant';
+
export type TranslationCollapseEmphaticSequences = 'false' | 'true' | 'full';
export type DictionaryDefinitionsCollapsible = 'not-collapsible' | 'expanded' | 'collapsed' | 'force-collapsed' | 'force-expanded';
@@ -375,11 +389,15 @@ export type DictionaryDefinitionsCollapsible = 'not-collapsible' | 'expanded' |
export type ParsingReadingMode = 'hiragana' | 'katakana' | 'romaji' | 'dictionary-reading' | 'none';
export type AnkiScreenshotFormat = 'png' | 'jpeg';
+
export type AnkiDuplicateScope = 'collection' | 'deck' | 'deck-root';
+
export type AnkiDisplayTags = 'never' | 'always' | 'non-standard';
+
export type AnkiNoteGuiMode = 'browse' | 'edit';
export type SentenceTerminationCharacterMode = 'custom' | 'custom-no-newlines' | 'newlines' | 'none';
export type InputsHotkeyModifier = 'alt' | 'ctrl' | 'shift' | 'meta';
+
export type InputsHotkeyScope = 'popup' | 'search' | 'web';
diff --git a/types/other/rollup-parse-ast.d.ts b/types/other/rollup-parse-ast.d.ts
index d798f09e..efc42411 100644
--- a/types/other/rollup-parse-ast.d.ts
+++ b/types/other/rollup-parse-ast.d.ts
@@ -22,4 +22,5 @@
import type {ParseAst, ParseAstAsync} from 'rollup';
export const parseAst: ParseAst;
+
export const parseAstAsync: ParseAstAsync;