Update global declarations

This commit is contained in:
toasted-nutbread 2020-03-10 22:30:36 -04:00
parent 5837d273f6
commit 64fc0349a1
36 changed files with 272 additions and 70 deletions

View File

@ -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"],

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*global requestJson*/
/* global
* requestJson
*/
/*
* AnkiConnect

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*global jpIsStringEntirelyKana*/
/* global
* jpIsStringEntirelyKana
*/
class AudioUriBuilder {
constructor() {

View File

@ -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() {

View File

@ -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}) {

View File

@ -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');

View File

@ -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() {

View File

@ -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);

View File

@ -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([
['ヲ', 'ヲヺ-'],

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*global utilStringHashCode*/
/* global
* utilStringHashCode
*/
/*
* Generic options functions

View File

@ -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();

View File

@ -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() {

View File

@ -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) {

View File

@ -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() {

View File

@ -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();

View File

@ -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

View File

@ -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;

View File

@ -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

View File

@ -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) {

View File

@ -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;

View File

@ -16,13 +16,26 @@
* 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) {
return utilBackend().getOptions(

View File

@ -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() {

View File

@ -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;

View File

@ -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;

View File

@ -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() {

View File

@ -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*\)/;

View File

@ -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() {

View File

@ -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();

View File

@ -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) {

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
/*global apiOptionsGet*/
/* global
* apiOptionsGet
*/
let popupNestedInitialized = false;

View File

@ -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() {

View File

@ -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) {

View File

@ -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) {

View File

@ -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() {

View File

@ -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) {

View File

@ -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) {