Update global declarations
This commit is contained in:
parent
5837d273f6
commit
64fc0349a1
@ -63,7 +63,7 @@
|
||||
"semi-spacing": ["error", {"before": false, "after": true}],
|
||||
"space-in-parens": ["error", "never"],
|
||||
"space-unary-ops": "error",
|
||||
"spaced-comment": ["error", "always", {"markers": ["global"]}],
|
||||
"spaced-comment": ["error", "always"],
|
||||
"switch-colon-spacing": ["error", {"after": true, "before": false}],
|
||||
"template-curly-spacing": ["error", "never"],
|
||||
"template-tag-spacing": ["error", "never"],
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global requestJson*/
|
||||
/* global
|
||||
* requestJson
|
||||
*/
|
||||
|
||||
/*
|
||||
* AnkiConnect
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsStringEntirelyKana*/
|
||||
/* global
|
||||
* jpIsStringEntirelyKana
|
||||
*/
|
||||
|
||||
class AudioUriBuilder {
|
||||
constructor() {
|
||||
|
@ -16,13 +16,32 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global optionsSave, utilIsolate
|
||||
conditionsTestValue, profileConditionsDescriptor
|
||||
handlebarsRenderDynamic
|
||||
requestText, requestJson, optionsLoad
|
||||
dictConfigured, dictTermsSort, dictEnabledSet
|
||||
jpConvertReading, jpDistributeFuriganaInflected, jpKatakanaToHiragana
|
||||
AnkiNoteBuilder, AudioSystem, AudioUriBuilder, Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema, ClipboardMonitor*/
|
||||
/* global
|
||||
* AnkiConnect
|
||||
* AnkiNoteBuilder
|
||||
* AnkiNull
|
||||
* AudioSystem
|
||||
* AudioUriBuilder
|
||||
* BackendApiForwarder
|
||||
* ClipboardMonitor
|
||||
* JsonSchema
|
||||
* Mecab
|
||||
* Translator
|
||||
* conditionsTestValue
|
||||
* dictConfigured
|
||||
* dictEnabledSet
|
||||
* dictTermsSort
|
||||
* handlebarsRenderDynamic
|
||||
* jpConvertReading
|
||||
* jpDistributeFuriganaInflected
|
||||
* jpKatakanaToHiragana
|
||||
* optionsLoad
|
||||
* optionsSave
|
||||
* profileConditionsDescriptor
|
||||
* requestJson
|
||||
* requestText
|
||||
* utilIsolate
|
||||
*/
|
||||
|
||||
class Backend {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsStringPartiallyJapanese*/
|
||||
/* global
|
||||
* jpIsStringPartiallyJapanese
|
||||
*/
|
||||
|
||||
class ClipboardMonitor extends EventDispatcher {
|
||||
constructor({getClipboard}) {
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiCommandExec, apiGetEnvironmentInfo, apiOptionsGet*/
|
||||
/* global
|
||||
* apiCommandExec
|
||||
* apiGetEnvironmentInfo
|
||||
* apiOptionsGet
|
||||
*/
|
||||
|
||||
function showExtensionInfo() {
|
||||
const node = document.getElementById('extension-info');
|
||||
|
@ -16,7 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global dictFieldSplit, requestJson, JsonSchema, JSZip*/
|
||||
/* global
|
||||
* JSZip
|
||||
* JsonSchema
|
||||
* dictFieldSplit
|
||||
* requestJson
|
||||
*/
|
||||
|
||||
class Database {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global jpIsCodePointKanji, jpDistributeFurigana, Handlebars*/
|
||||
/* global
|
||||
* Handlebars
|
||||
* jpDistributeFurigana
|
||||
* jpIsCodePointKanji
|
||||
*/
|
||||
|
||||
function handlebarsEscape(text) {
|
||||
return Handlebars.Utils.escapeExpression(text);
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global wanakana*/
|
||||
/* global
|
||||
* wanakana
|
||||
*/
|
||||
|
||||
const JP_HALFWIDTH_KATAKANA_MAPPING = new Map([
|
||||
['ヲ', 'ヲヺ-'],
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global utilStringHashCode*/
|
||||
/* global
|
||||
* utilStringHashCode
|
||||
*/
|
||||
|
||||
/*
|
||||
* Generic options functions
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGet*/
|
||||
/* global
|
||||
* apiOptionsGet
|
||||
*/
|
||||
|
||||
async function searchFrontendSetup() {
|
||||
await yomichan.prepare();
|
||||
|
@ -16,7 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetQueryParserTemplatesHtml, TemplateHandler*/
|
||||
/* global
|
||||
* TemplateHandler
|
||||
* apiGetQueryParserTemplatesHtml
|
||||
*/
|
||||
|
||||
class QueryParserGenerator {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,15 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiTermsFind, apiOptionsSet, apiTextParse, apiTextParseMecab, TextScanner, QueryParserGenerator, docSentenceExtract*/
|
||||
/* global
|
||||
* QueryParserGenerator
|
||||
* TextScanner
|
||||
* apiOptionsSet
|
||||
* apiTermsFind
|
||||
* apiTextParse
|
||||
* apiTextParseMecab
|
||||
* docSentenceExtract
|
||||
*/
|
||||
|
||||
class QueryParser extends TextScanner {
|
||||
constructor(search) {
|
||||
|
@ -16,7 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsSet, apiTermsFind, apiClipboardGet, Display, QueryParser, ClipboardMonitor*/
|
||||
/* global
|
||||
* ClipboardMonitor
|
||||
* Display
|
||||
* QueryParser
|
||||
* apiClipboardGet
|
||||
* apiOptionsSet
|
||||
* apiTermsFind
|
||||
*/
|
||||
|
||||
class DisplaySearch extends Display {
|
||||
constructor() {
|
||||
|
@ -16,10 +16,18 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
|
||||
ankiGetFieldMarkers, ankiGetFieldMarkersHtml
|
||||
apiOptionsGet, apiTermsFind, apiGetDefaultAnkiFieldTemplates, apiTemplateRender
|
||||
AnkiNoteBuilder*/
|
||||
/* global
|
||||
* AnkiNoteBuilder
|
||||
* ankiGetFieldMarkers
|
||||
* ankiGetFieldMarkersHtml
|
||||
* apiGetDefaultAnkiFieldTemplates
|
||||
* apiOptionsGet
|
||||
* apiTemplateRender
|
||||
* apiTermsFind
|
||||
* getOptionsContext
|
||||
* getOptionsMutable
|
||||
* settingsSaveOptions
|
||||
*/
|
||||
|
||||
function onAnkiFieldTemplatesReset(e) {
|
||||
e.preventDefault();
|
||||
|
@ -16,9 +16,16 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions
|
||||
utilBackgroundIsolate, utilAnkiGetDeckNames, utilAnkiGetModelNames, utilAnkiGetModelFieldNames
|
||||
onFormOptionsChanged*/
|
||||
/* global
|
||||
* getOptionsContext
|
||||
* getOptionsMutable
|
||||
* onFormOptionsChanged
|
||||
* settingsSaveOptions
|
||||
* utilAnkiGetDeckNames
|
||||
* utilAnkiGetModelFieldNames
|
||||
* utilAnkiGetModelNames
|
||||
* utilBackgroundIsolate
|
||||
*/
|
||||
|
||||
// Private
|
||||
|
||||
|
@ -16,8 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions, apiAudioGetUri
|
||||
AudioSystem, AudioSourceUI*/
|
||||
/* global
|
||||
* AudioSourceUI
|
||||
* AudioSystem
|
||||
* apiAudioGetUri
|
||||
* getOptionsContext
|
||||
* getOptionsMutable
|
||||
* settingsSaveOptions
|
||||
*/
|
||||
|
||||
let audioSourceUI = null;
|
||||
let audioSystem = null;
|
||||
|
@ -16,9 +16,17 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGetFull, apiGetEnvironmentInfo, apiGetDefaultAnkiFieldTemplates
|
||||
utilBackend, utilIsolate, utilBackgroundIsolate, utilReadFileArrayBuffer
|
||||
optionsGetDefault, optionsUpdateVersion*/
|
||||
/* global
|
||||
* apiGetDefaultAnkiFieldTemplates
|
||||
* apiGetEnvironmentInfo
|
||||
* apiOptionsGetFull
|
||||
* optionsGetDefault
|
||||
* optionsUpdateVersion
|
||||
* utilBackend
|
||||
* utilBackgroundIsolate
|
||||
* utilIsolate
|
||||
* utilReadFileArrayBuffer
|
||||
*/
|
||||
|
||||
// Exporting
|
||||
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global conditionsNormalizeOptionValue*/
|
||||
/* global
|
||||
* conditionsNormalizeOptionValue
|
||||
*/
|
||||
|
||||
class ConditionsUI {
|
||||
static instantiateTemplate(templateSelector) {
|
||||
|
@ -16,11 +16,23 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull, apiOptionsGet
|
||||
utilBackgroundIsolate, utilDatabaseDeleteDictionary, utilDatabaseGetDictionaryInfo, utilDatabaseGetDictionaryCounts
|
||||
utilDatabasePurge, utilDatabaseImport
|
||||
storageUpdateStats, storageEstimate
|
||||
PageExitPrevention*/
|
||||
/* global
|
||||
* PageExitPrevention
|
||||
* apiOptionsGet
|
||||
* apiOptionsGetFull
|
||||
* getOptionsContext
|
||||
* getOptionsFullMutable
|
||||
* getOptionsMutable
|
||||
* settingsSaveOptions
|
||||
* storageEstimate
|
||||
* storageUpdateStats
|
||||
* utilBackgroundIsolate
|
||||
* utilDatabaseDeleteDictionary
|
||||
* utilDatabaseGetDictionaryCounts
|
||||
* utilDatabaseGetDictionaryInfo
|
||||
* utilDatabaseImport
|
||||
* utilDatabasePurge
|
||||
*/
|
||||
|
||||
let dictionaryUI = null;
|
||||
|
||||
|
@ -16,12 +16,25 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsContext, apiOptionsSave
|
||||
utilBackend, utilIsolate, utilBackgroundIsolate
|
||||
ankiErrorShown, ankiFieldsToDict
|
||||
ankiTemplatesUpdateValue, onAnkiOptionsChanged, onDictionaryOptionsChanged
|
||||
appearanceInitialize, audioSettingsInitialize, profileOptionsSetup, dictSettingsInitialize
|
||||
ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize, backupInitialize
|
||||
/* global
|
||||
* ankiErrorShown
|
||||
* ankiFieldsToDict
|
||||
* ankiInitialize
|
||||
* ankiTemplatesInitialize
|
||||
* ankiTemplatesUpdateValue
|
||||
* apiOptionsSave
|
||||
* appearanceInitialize
|
||||
* audioSettingsInitialize
|
||||
* backupInitialize
|
||||
* dictSettingsInitialize
|
||||
* getOptionsContext
|
||||
* onAnkiOptionsChanged
|
||||
* onDictionaryOptionsChanged
|
||||
* profileOptionsSetup
|
||||
* storageInfoInitialize
|
||||
* utilBackend
|
||||
* utilBackgroundIsolate
|
||||
* utilIsolate
|
||||
*/
|
||||
|
||||
function getOptionsMutable(optionsContext) {
|
||||
|
@ -16,7 +16,13 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGet, Popup, PopupProxyHost, Frontend, TextSourceRange*/
|
||||
/* global
|
||||
* Frontend
|
||||
* Popup
|
||||
* PopupProxyHost
|
||||
* TextSourceRange
|
||||
* apiOptionsGet
|
||||
*/
|
||||
|
||||
class SettingsPopupPreview {
|
||||
constructor() {
|
||||
|
@ -16,9 +16,17 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull
|
||||
utilBackgroundIsolate, formWrite
|
||||
conditionsClearCaches, ConditionsUI, profileConditionsDescriptor*/
|
||||
/* global
|
||||
* ConditionsUI
|
||||
* apiOptionsGetFull
|
||||
* conditionsClearCaches
|
||||
* formWrite
|
||||
* getOptionsFullMutable
|
||||
* getOptionsMutable
|
||||
* profileConditionsDescriptor
|
||||
* settingsSaveOptions
|
||||
* utilBackgroundIsolate
|
||||
*/
|
||||
|
||||
let currentProfileIndex = 0;
|
||||
let profileConditionsContainer = null;
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetEnvironmentInfo*/
|
||||
/* global
|
||||
* apiGetEnvironmentInfo
|
||||
*/
|
||||
|
||||
function storageBytesToLabeledString(size) {
|
||||
const base = 1000;
|
||||
|
@ -16,12 +16,28 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global requestJson
|
||||
dictTermsMergeBySequence, dictTagBuildSource, dictTermsMergeByGloss, dictTermsSort, dictTagsSort
|
||||
dictEnabledSet, dictTermsGroup, dictTermsCompressTags, dictTermsUndupe, dictTagSanitize
|
||||
jpDistributeFurigana, jpConvertHalfWidthKanaToFullWidth, jpConvertNumericTofullWidth
|
||||
jpConvertAlphabeticToKana, jpHiraganaToKatakana, jpKatakanaToHiragana, jpIsCodePointJapanese
|
||||
Database, Deinflector*/
|
||||
/* global
|
||||
* Database
|
||||
* Deinflector
|
||||
* dictEnabledSet
|
||||
* dictTagBuildSource
|
||||
* dictTagSanitize
|
||||
* dictTagsSort
|
||||
* dictTermsCompressTags
|
||||
* dictTermsGroup
|
||||
* dictTermsMergeByGloss
|
||||
* dictTermsMergeBySequence
|
||||
* dictTermsSort
|
||||
* dictTermsUndupe
|
||||
* jpConvertAlphabeticToKana
|
||||
* jpConvertHalfWidthKanaToFullWidth
|
||||
* jpConvertNumericTofullWidth
|
||||
* jpDistributeFurigana
|
||||
* jpHiraganaToKatakana
|
||||
* jpIsCodePointJapanese
|
||||
* jpKatakanaToHiragana
|
||||
* requestJson
|
||||
*/
|
||||
|
||||
class Translator {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global TextSourceElement, TextSourceRange, DOM*/
|
||||
/* global
|
||||
* DOM
|
||||
* TextSourceElement
|
||||
* TextSourceRange
|
||||
*/
|
||||
|
||||
const REGEX_TRANSPARENT_COLOR = /rgba\s*\([^)]*,\s*0(?:\.0+)?\s*\)/;
|
||||
|
||||
|
@ -16,7 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global popupNestedInitialize, apiForward, apiGetMessageToken, Display*/
|
||||
/* global
|
||||
* Display
|
||||
* apiForward
|
||||
* apiGetMessageToken
|
||||
* popupNestedInitialize
|
||||
*/
|
||||
|
||||
class DisplayFloat extends Display {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global PopupProxyHost, PopupProxy, Frontend*/
|
||||
/* global
|
||||
* Frontend
|
||||
* PopupProxy
|
||||
* PopupProxyHost
|
||||
*/
|
||||
|
||||
async function main() {
|
||||
await yomichan.prepare();
|
||||
|
@ -16,7 +16,14 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetZoom, apiOptionsGet, apiTermsFind, apiKanjiFind, docSentenceExtract, TextScanner*/
|
||||
/* global
|
||||
* TextScanner
|
||||
* apiGetZoom
|
||||
* apiKanjiFind
|
||||
* apiOptionsGet
|
||||
* apiTermsFind
|
||||
* docSentenceExtract
|
||||
*/
|
||||
|
||||
class Frontend extends TextScanner {
|
||||
constructor(popup, ignoreNodes) {
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiOptionsGet*/
|
||||
/* global
|
||||
* apiOptionsGet
|
||||
*/
|
||||
|
||||
let popupNestedInitialized = false;
|
||||
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiFrameInformationGet, FrontendApiReceiver, Popup*/
|
||||
/* global
|
||||
* FrontendApiReceiver
|
||||
* Popup
|
||||
* apiFrameInformationGet
|
||||
*/
|
||||
|
||||
class PopupProxyHost {
|
||||
constructor() {
|
||||
|
@ -16,7 +16,9 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global FrontendApiSender*/
|
||||
/* global
|
||||
* FrontendApiSender
|
||||
*/
|
||||
|
||||
class PopupProxy {
|
||||
constructor(id, depth, parentId, parentFrameId, url) {
|
||||
|
@ -16,7 +16,10 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiInjectStylesheet, apiGetMessageToken*/
|
||||
/* global
|
||||
* apiGetMessageToken
|
||||
* apiInjectStylesheet
|
||||
*/
|
||||
|
||||
class Popup {
|
||||
constructor(id, depth, frameIdPromise) {
|
||||
|
@ -16,7 +16,10 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global apiGetDisplayTemplatesHtml, TemplateHandler*/
|
||||
/* global
|
||||
* TemplateHandler
|
||||
* apiGetDisplayTemplatesHtml
|
||||
*/
|
||||
|
||||
class DisplayGenerator {
|
||||
constructor() {
|
||||
|
@ -16,10 +16,24 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global docRangeFromPoint, docSentenceExtract
|
||||
apiKanjiFind, apiTermsFind, apiNoteView, apiOptionsGet, apiDefinitionsAddable, apiDefinitionAdd
|
||||
apiScreenshotGet, apiForward, apiAudioGetUri
|
||||
AudioSystem, DisplayGenerator, WindowScroll, DisplayContext, DOM*/
|
||||
/* global
|
||||
* AudioSystem
|
||||
* DOM
|
||||
* DisplayContext
|
||||
* DisplayGenerator
|
||||
* WindowScroll
|
||||
* apiAudioGetUri
|
||||
* apiDefinitionAdd
|
||||
* apiDefinitionsAddable
|
||||
* apiForward
|
||||
* apiKanjiFind
|
||||
* apiNoteView
|
||||
* apiOptionsGet
|
||||
* apiScreenshotGet
|
||||
* apiTermsFind
|
||||
* docRangeFromPoint
|
||||
* docSentenceExtract
|
||||
*/
|
||||
|
||||
class Display {
|
||||
constructor(spinner, container) {
|
||||
|
@ -16,7 +16,11 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*global docRangeFromPoint, TextSourceRange, DOM*/
|
||||
/* global
|
||||
* DOM
|
||||
* TextSourceRange
|
||||
* docRangeFromPoint
|
||||
*/
|
||||
|
||||
class TextScanner {
|
||||
constructor(node, ignoreNodes, ignoreElements, ignorePoints) {
|
||||
|
Loading…
Reference in New Issue
Block a user