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}], "semi-spacing": ["error", {"before": false, "after": true}],
"space-in-parens": ["error", "never"], "space-in-parens": ["error", "never"],
"space-unary-ops": "error", "space-unary-ops": "error",
"spaced-comment": ["error", "always", {"markers": ["global"]}], "spaced-comment": ["error", "always"],
"switch-colon-spacing": ["error", {"after": true, "before": false}], "switch-colon-spacing": ["error", {"after": true, "before": false}],
"template-curly-spacing": ["error", "never"], "template-curly-spacing": ["error", "never"],
"template-tag-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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global requestJson*/ /* global
* requestJson
*/
/* /*
* AnkiConnect * AnkiConnect

View File

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

View File

@ -16,13 +16,32 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global optionsSave, utilIsolate /* global
conditionsTestValue, profileConditionsDescriptor * AnkiConnect
handlebarsRenderDynamic * AnkiNoteBuilder
requestText, requestJson, optionsLoad * AnkiNull
dictConfigured, dictTermsSort, dictEnabledSet * AudioSystem
jpConvertReading, jpDistributeFuriganaInflected, jpKatakanaToHiragana * AudioUriBuilder
AnkiNoteBuilder, AudioSystem, AudioUriBuilder, Translator, AnkiConnect, AnkiNull, Mecab, BackendApiForwarder, JsonSchema, ClipboardMonitor*/ * BackendApiForwarder
* ClipboardMonitor
* JsonSchema
* Mecab
* Translator
* conditionsTestValue
* dictConfigured
* dictEnabledSet
* dictTermsSort
* handlebarsRenderDynamic
* jpConvertReading
* jpDistributeFuriganaInflected
* jpKatakanaToHiragana
* optionsLoad
* optionsSave
* profileConditionsDescriptor
* requestJson
* requestText
* utilIsolate
*/
class Backend { class Backend {
constructor() { constructor() {

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global jpIsStringPartiallyJapanese*/ /* global
* jpIsStringPartiallyJapanese
*/
class ClipboardMonitor extends EventDispatcher { class ClipboardMonitor extends EventDispatcher {
constructor({getClipboard}) { constructor({getClipboard}) {

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiCommandExec, apiGetEnvironmentInfo, apiOptionsGet*/ /* global
* apiCommandExec
* apiGetEnvironmentInfo
* apiOptionsGet
*/
function showExtensionInfo() { function showExtensionInfo() {
const node = document.getElementById('extension-info'); const node = document.getElementById('extension-info');

View File

@ -16,7 +16,12 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global dictFieldSplit, requestJson, JsonSchema, JSZip*/ /* global
* JSZip
* JsonSchema
* dictFieldSplit
* requestJson
*/
class Database { class Database {
constructor() { constructor() {

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global jpIsCodePointKanji, jpDistributeFurigana, Handlebars*/ /* global
* Handlebars
* jpDistributeFurigana
* jpIsCodePointKanji
*/
function handlebarsEscape(text) { function handlebarsEscape(text) {
return Handlebars.Utils.escapeExpression(text); return Handlebars.Utils.escapeExpression(text);

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global wanakana*/ /* global
* wanakana
*/
const JP_HALFWIDTH_KATAKANA_MAPPING = new Map([ 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/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global utilStringHashCode*/ /* global
* utilStringHashCode
*/
/* /*
* Generic options functions * Generic options functions

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiOptionsGet*/ /* global
* apiOptionsGet
*/
async function searchFrontendSetup() { async function searchFrontendSetup() {
await yomichan.prepare(); await yomichan.prepare();

View File

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

View File

@ -16,7 +16,15 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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 { class QueryParser extends TextScanner {
constructor(search) { constructor(search) {

View File

@ -16,7 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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 { class DisplaySearch extends Display {
constructor() { constructor() {

View File

@ -16,10 +16,18 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions /* global
ankiGetFieldMarkers, ankiGetFieldMarkersHtml * AnkiNoteBuilder
apiOptionsGet, apiTermsFind, apiGetDefaultAnkiFieldTemplates, apiTemplateRender * ankiGetFieldMarkers
AnkiNoteBuilder*/ * ankiGetFieldMarkersHtml
* apiGetDefaultAnkiFieldTemplates
* apiOptionsGet
* apiTemplateRender
* apiTermsFind
* getOptionsContext
* getOptionsMutable
* settingsSaveOptions
*/
function onAnkiFieldTemplatesReset(e) { function onAnkiFieldTemplatesReset(e) {
e.preventDefault(); e.preventDefault();

View File

@ -16,9 +16,16 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions /* global
utilBackgroundIsolate, utilAnkiGetDeckNames, utilAnkiGetModelNames, utilAnkiGetModelFieldNames * getOptionsContext
onFormOptionsChanged*/ * getOptionsMutable
* onFormOptionsChanged
* settingsSaveOptions
* utilAnkiGetDeckNames
* utilAnkiGetModelFieldNames
* utilAnkiGetModelNames
* utilBackgroundIsolate
*/
// Private // Private

View File

@ -16,8 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsContext, getOptionsMutable, settingsSaveOptions, apiAudioGetUri /* global
AudioSystem, AudioSourceUI*/ * AudioSourceUI
* AudioSystem
* apiAudioGetUri
* getOptionsContext
* getOptionsMutable
* settingsSaveOptions
*/
let audioSourceUI = null; let audioSourceUI = null;
let audioSystem = null; let audioSystem = null;

View File

@ -16,9 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiOptionsGetFull, apiGetEnvironmentInfo, apiGetDefaultAnkiFieldTemplates /* global
utilBackend, utilIsolate, utilBackgroundIsolate, utilReadFileArrayBuffer * apiGetDefaultAnkiFieldTemplates
optionsGetDefault, optionsUpdateVersion*/ * apiGetEnvironmentInfo
* apiOptionsGetFull
* optionsGetDefault
* optionsUpdateVersion
* utilBackend
* utilBackgroundIsolate
* utilIsolate
* utilReadFileArrayBuffer
*/
// Exporting // Exporting

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global conditionsNormalizeOptionValue*/ /* global
* conditionsNormalizeOptionValue
*/
class ConditionsUI { class ConditionsUI {
static instantiateTemplate(templateSelector) { static instantiateTemplate(templateSelector) {

View File

@ -16,11 +16,23 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsContext, getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull, apiOptionsGet /* global
utilBackgroundIsolate, utilDatabaseDeleteDictionary, utilDatabaseGetDictionaryInfo, utilDatabaseGetDictionaryCounts * PageExitPrevention
utilDatabasePurge, utilDatabaseImport * apiOptionsGet
storageUpdateStats, storageEstimate * apiOptionsGetFull
PageExitPrevention*/ * getOptionsContext
* getOptionsFullMutable
* getOptionsMutable
* settingsSaveOptions
* storageEstimate
* storageUpdateStats
* utilBackgroundIsolate
* utilDatabaseDeleteDictionary
* utilDatabaseGetDictionaryCounts
* utilDatabaseGetDictionaryInfo
* utilDatabaseImport
* utilDatabasePurge
*/
let dictionaryUI = null; let dictionaryUI = null;

View File

@ -16,13 +16,26 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsContext, apiOptionsSave /* global
utilBackend, utilIsolate, utilBackgroundIsolate * ankiErrorShown
ankiErrorShown, ankiFieldsToDict * ankiFieldsToDict
ankiTemplatesUpdateValue, onAnkiOptionsChanged, onDictionaryOptionsChanged * ankiInitialize
appearanceInitialize, audioSettingsInitialize, profileOptionsSetup, dictSettingsInitialize * ankiTemplatesInitialize
ankiInitialize, ankiTemplatesInitialize, storageInfoInitialize, backupInitialize * ankiTemplatesUpdateValue
*/ * apiOptionsSave
* appearanceInitialize
* audioSettingsInitialize
* backupInitialize
* dictSettingsInitialize
* getOptionsContext
* onAnkiOptionsChanged
* onDictionaryOptionsChanged
* profileOptionsSetup
* storageInfoInitialize
* utilBackend
* utilBackgroundIsolate
* utilIsolate
*/
function getOptionsMutable(optionsContext) { function getOptionsMutable(optionsContext) {
return utilBackend().getOptions( return utilBackend().getOptions(

View File

@ -16,7 +16,13 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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 { class SettingsPopupPreview {
constructor() { constructor() {

View File

@ -16,9 +16,17 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global getOptionsMutable, getOptionsFullMutable, settingsSaveOptions, apiOptionsGetFull /* global
utilBackgroundIsolate, formWrite * ConditionsUI
conditionsClearCaches, ConditionsUI, profileConditionsDescriptor*/ * apiOptionsGetFull
* conditionsClearCaches
* formWrite
* getOptionsFullMutable
* getOptionsMutable
* profileConditionsDescriptor
* settingsSaveOptions
* utilBackgroundIsolate
*/
let currentProfileIndex = 0; let currentProfileIndex = 0;
let profileConditionsContainer = null; let profileConditionsContainer = null;

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiGetEnvironmentInfo*/ /* global
* apiGetEnvironmentInfo
*/
function storageBytesToLabeledString(size) { function storageBytesToLabeledString(size) {
const base = 1000; const base = 1000;

View File

@ -16,12 +16,28 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global requestJson /* global
dictTermsMergeBySequence, dictTagBuildSource, dictTermsMergeByGloss, dictTermsSort, dictTagsSort * Database
dictEnabledSet, dictTermsGroup, dictTermsCompressTags, dictTermsUndupe, dictTagSanitize * Deinflector
jpDistributeFurigana, jpConvertHalfWidthKanaToFullWidth, jpConvertNumericTofullWidth * dictEnabledSet
jpConvertAlphabeticToKana, jpHiraganaToKatakana, jpKatakanaToHiragana, jpIsCodePointJapanese * dictTagBuildSource
Database, Deinflector*/ * dictTagSanitize
* dictTagsSort
* dictTermsCompressTags
* dictTermsGroup
* dictTermsMergeByGloss
* dictTermsMergeBySequence
* dictTermsSort
* dictTermsUndupe
* jpConvertAlphabeticToKana
* jpConvertHalfWidthKanaToFullWidth
* jpConvertNumericTofullWidth
* jpDistributeFurigana
* jpHiraganaToKatakana
* jpIsCodePointJapanese
* jpKatakanaToHiragana
* requestJson
*/
class Translator { class Translator {
constructor() { constructor() {

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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*\)/; 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/>. * 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 { class DisplayFloat extends Display {
constructor() { constructor() {

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global PopupProxyHost, PopupProxy, Frontend*/ /* global
* Frontend
* PopupProxy
* PopupProxyHost
*/
async function main() { async function main() {
await yomichan.prepare(); await yomichan.prepare();

View File

@ -16,7 +16,14 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * 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 { class Frontend extends TextScanner {
constructor(popup, ignoreNodes) { constructor(popup, ignoreNodes) {

View File

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

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiFrameInformationGet, FrontendApiReceiver, Popup*/ /* global
* FrontendApiReceiver
* Popup
* apiFrameInformationGet
*/
class PopupProxyHost { class PopupProxyHost {
constructor() { constructor() {

View File

@ -16,7 +16,9 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global FrontendApiSender*/ /* global
* FrontendApiSender
*/
class PopupProxy { class PopupProxy {
constructor(id, depth, parentId, parentFrameId, url) { constructor(id, depth, parentId, parentFrameId, url) {

View File

@ -16,7 +16,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global apiInjectStylesheet, apiGetMessageToken*/ /* global
* apiGetMessageToken
* apiInjectStylesheet
*/
class Popup { class Popup {
constructor(id, depth, frameIdPromise) { constructor(id, depth, frameIdPromise) {

View File

@ -16,7 +16,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
/*global apiGetDisplayTemplatesHtml, TemplateHandler*/ /* global
* TemplateHandler
* apiGetDisplayTemplatesHtml
*/
class DisplayGenerator { class DisplayGenerator {
constructor() { constructor() {

View File

@ -16,10 +16,24 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global docRangeFromPoint, docSentenceExtract /* global
apiKanjiFind, apiTermsFind, apiNoteView, apiOptionsGet, apiDefinitionsAddable, apiDefinitionAdd * AudioSystem
apiScreenshotGet, apiForward, apiAudioGetUri * DOM
AudioSystem, DisplayGenerator, WindowScroll, DisplayContext, DOM*/ * DisplayContext
* DisplayGenerator
* WindowScroll
* apiAudioGetUri
* apiDefinitionAdd
* apiDefinitionsAddable
* apiForward
* apiKanjiFind
* apiNoteView
* apiOptionsGet
* apiScreenshotGet
* apiTermsFind
* docRangeFromPoint
* docSentenceExtract
*/
class Display { class Display {
constructor(spinner, container) { constructor(spinner, container) {

View File

@ -16,7 +16,11 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>. * along with this program. If not, see <https://www.gnu.org/licenses/>.
*/ */
/*global docRangeFromPoint, TextSourceRange, DOM*/ /* global
* DOM
* TextSourceRange
* docRangeFromPoint
*/
class TextScanner { class TextScanner {
constructor(node, ignoreNodes, ignoreElements, ignorePoints) { constructor(node, ignoreNodes, ignoreElements, ignorePoints) {