mirror of
https://github.com/koloml/furbooru-tagging-assistant.git
synced 2025-12-24 07:12:57 +00:00
Removing extensions for JS and TS in imports, reformatting
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import PostParser from "$lib/booru/scraped/parsing/PostParser.js";
|
||||
import PostParser from "$lib/booru/scraped/parsing/PostParser";
|
||||
|
||||
export default class ScrapedAPI {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import PageParser from "$lib/booru/scraped/parsing/PageParser.js";
|
||||
import {buildTagsAndAliasesMap} from "$lib/booru/TagsUtils.js";
|
||||
import PageParser from "$lib/booru/scraped/parsing/PageParser";
|
||||
import { buildTagsAndAliasesMap } from "$lib/booru/TagsUtils";
|
||||
|
||||
export default class PostParser extends PageParser {
|
||||
/** @type {HTMLFormElement} */
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
*/
|
||||
class StorageHelper {
|
||||
/**
|
||||
* @type {import('@types/chrome').storage.StorageArea}
|
||||
* @type {chrome.storage.StorageArea}
|
||||
*/
|
||||
#storageArea;
|
||||
|
||||
/**
|
||||
* @param {import('@types/chrome').storage.StorageArea} storageArea
|
||||
* @param {chrome.storage.StorageArea} storageArea
|
||||
*/
|
||||
constructor(storageArea) {
|
||||
this.#storageArea = storageArea;
|
||||
@@ -39,7 +39,7 @@ class StorageHelper {
|
||||
|
||||
/**
|
||||
* Subscribe to changes in the local storage.
|
||||
* @param {function(Record<string, StorageChange>): void} callback
|
||||
* @param {function(Record<string, chrome.storage.StorageChange>): void} callback
|
||||
*/
|
||||
subscribe(callback) {
|
||||
this.#storageArea.onChanged.addListener(callback);
|
||||
@@ -47,11 +47,11 @@ class StorageHelper {
|
||||
|
||||
/**
|
||||
* Unsubscribe from changes in the local storage.
|
||||
* @param {function(Record<string, StorageChange>): void} callback
|
||||
* @param {function(Record<string, chrome.storage.StorageChange>): void} callback
|
||||
*/
|
||||
unsubscribe(callback) {
|
||||
this.#storageArea.onChanged.removeListener(callback);
|
||||
}
|
||||
}
|
||||
|
||||
export default StorageHelper;
|
||||
export default StorageHelper;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import MiscSettings from "$lib/extension/settings/MiscSettings.ts";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import MiscSettings from "$lib/extension/settings/MiscSettings";
|
||||
|
||||
export class FullscreenViewer extends BaseComponent {
|
||||
/** @type {HTMLVideoElement} */
|
||||
@@ -189,7 +189,7 @@ export class FullscreenViewer extends BaseComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {import("$lib/extension/settings/MiscSettings.js").FullscreenViewerSize} size
|
||||
* @param {import("$lib/extension/settings/MiscSettings").FullscreenViewerSize} size
|
||||
*/
|
||||
#onSizeResolved(size) {
|
||||
this.#sizeSelectorElement.value = size;
|
||||
@@ -325,7 +325,7 @@ export class FullscreenViewer extends BaseComponent {
|
||||
static #minRequiredDistance = 50;
|
||||
|
||||
/**
|
||||
* @type {Record<import("$lib/extension/settings/MiscSettings.js").FullscreenViewerSize, string>}
|
||||
* @type {Record<import("$lib/extension/settings/MiscSettings").FullscreenViewerSize, string>}
|
||||
*/
|
||||
static #previewSizes = {
|
||||
full: 'Full',
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import MiscSettings from "$lib/extension/settings/MiscSettings.ts";
|
||||
import {FullscreenViewer} from "$lib/components/FullscreenViewer.js";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import MiscSettings from "$lib/extension/settings/MiscSettings";
|
||||
import { FullscreenViewer } from "$lib/components/FullscreenViewer";
|
||||
|
||||
export class ImageShowFullscreenButton extends BaseComponent {
|
||||
/**
|
||||
* @type {MediaBoxTools}
|
||||
* @type {import('./MediaBoxTools').MediaBoxTools|null}
|
||||
*/
|
||||
#mediaBoxTools;
|
||||
#mediaBoxTools= null;
|
||||
#isFullscreenButtonEnabled = false;
|
||||
|
||||
build() {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings.ts";
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile.ts";
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import ScrapedAPI from "$lib/booru/scraped/ScrapedAPI.js";
|
||||
import {tagsBlacklist} from "$config/tags.ts";
|
||||
import {emitterAt} from "$lib/components/events/comms";
|
||||
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings";
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import ScrapedAPI from "$lib/booru/scraped/ScrapedAPI";
|
||||
import { tagsBlacklist } from "$config/tags";
|
||||
import { emitterAt } from "$lib/components/events/comms";
|
||||
import {
|
||||
eventActiveProfileChanged,
|
||||
eventMaintenanceStateChanged,
|
||||
@@ -33,7 +33,7 @@ export class MaintenancePopup extends BaseComponent {
|
||||
/** @type {MaintenanceProfile|null} */
|
||||
#activeProfile = null;
|
||||
|
||||
/** @type {import('$lib/components/MediaBoxTools.js').MediaBoxTools} */
|
||||
/** @type {import('$lib/components/MediaBoxTools').MediaBoxTools} */
|
||||
#mediaBoxTools = null;
|
||||
|
||||
/** @type {Set<string>} */
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import {on} from "$lib/components/events/comms";
|
||||
import {eventMaintenanceStateChanged} from "$lib/components/events/maintenance-popup-events";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import { on } from "$lib/components/events/comms";
|
||||
import { eventMaintenanceStateChanged } from "$lib/components/events/maintenance-popup-events";
|
||||
|
||||
export class MaintenanceStatusIcon extends BaseComponent {
|
||||
/** @type {import('MediaBoxTools.js').MediaBoxTools} */
|
||||
/** @type {import('./MediaBoxTools').MediaBoxTools} */
|
||||
#mediaBoxTools;
|
||||
|
||||
build() {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import {MaintenancePopup} from "$lib/components/MaintenancePopup.js";
|
||||
import {on} from "$lib/components/events/comms";
|
||||
import {eventActiveProfileChanged} from "$lib/components/events/maintenance-popup-events";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import { MaintenancePopup } from "$lib/components/MaintenancePopup";
|
||||
import { on } from "$lib/components/events/comms";
|
||||
import { eventActiveProfileChanged } from "$lib/components/events/maintenance-popup-events";
|
||||
|
||||
export class MediaBoxTools extends BaseComponent {
|
||||
/** @type {import('MediaBoxWrapper.js').MediaBoxWrapper|null} */
|
||||
/** @type {import('./MediaBoxWrapper').MediaBoxWrapper|null} */
|
||||
#mediaBox;
|
||||
|
||||
/** @type {MaintenancePopup|null} */
|
||||
@@ -40,7 +40,7 @@ export class MediaBoxTools extends BaseComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {CustomEvent<import('$entities/MaintenanceProfile.js').default|null>} profileChangedEvent
|
||||
* @param {CustomEvent<import('$entities/MaintenanceProfile').default|null>} profileChangedEvent
|
||||
*/
|
||||
#onActiveProfileChanged(profileChangedEvent) {
|
||||
this.container.classList.toggle('has-active-profile', profileChangedEvent.detail !== null);
|
||||
@@ -54,7 +54,7 @@ export class MediaBoxTools extends BaseComponent {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('MediaBoxWrapper.js').MediaBoxWrapper|null}
|
||||
* @return {import('./MediaBoxWrapper').MediaBoxWrapper|null}
|
||||
*/
|
||||
get mediaBox() {
|
||||
return this.#mediaBox;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import {buildTagsAndAliasesMap} from "$lib/booru/TagsUtils.js";
|
||||
import {on} from "$lib/components/events/comms";
|
||||
import {eventTagsUpdated} from "$lib/components/events/maintenance-popup-events";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import { buildTagsAndAliasesMap } from "$lib/booru/TagsUtils";
|
||||
import { on } from "$lib/components/events/comms";
|
||||
import { eventTagsUpdated } from "$lib/components/events/maintenance-popup-events";
|
||||
|
||||
export class MediaBoxWrapper extends BaseComponent {
|
||||
#thumbnailContainer = null;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {QueryLexer, QuotedTermToken, TermToken, Token} from "$lib/booru/search/QueryLexer.js";
|
||||
import SearchSettings from "$lib/extension/settings/SearchSettings.ts";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { QueryLexer, QuotedTermToken, TermToken, Token } from "$lib/booru/search/QueryLexer";
|
||||
import SearchSettings from "$lib/extension/settings/SearchSettings";
|
||||
|
||||
export class SearchWrapper extends BaseComponent {
|
||||
/** @type {HTMLInputElement|null} */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {SearchWrapper} from "$lib/components/SearchWrapper.js";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { SearchWrapper } from "$lib/components/SearchWrapper";
|
||||
|
||||
class SiteHeaderWrapper extends BaseComponent {
|
||||
/** @type {SearchWrapper|null} */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile.ts";
|
||||
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings.ts";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile";
|
||||
import MaintenanceSettings from "$lib/extension/settings/MaintenanceSettings";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
import CustomCategoriesResolver from "$lib/extension/CustomCategoriesResolver";
|
||||
|
||||
const isTagEditorProcessedKey = Symbol();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent.js";
|
||||
import {getComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
import { getComponent } from "$lib/components/base/ComponentUtils";
|
||||
|
||||
export class TagsForm extends BaseComponent {
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {bindComponent} from "$lib/components/base/ComponentUtils.js";
|
||||
import { bindComponent } from "$lib/components/base/ComponentUtils";
|
||||
|
||||
/**
|
||||
* @abstract
|
||||
|
||||
@@ -2,7 +2,7 @@ const instanceSymbol = Symbol('instance');
|
||||
|
||||
/**
|
||||
* @param {HTMLElement} element
|
||||
* @return {import('./BaseComponent.js').BaseComponent|null}
|
||||
* @return {import('./BaseComponent').BaseComponent|null}
|
||||
*/
|
||||
export function getComponent(element) {
|
||||
return element[instanceSymbol] || null;
|
||||
@@ -11,7 +11,7 @@ export function getComponent(element) {
|
||||
/**
|
||||
* Bind the component to the selected element.
|
||||
* @param {HTMLElement} element The element to bind the component to.
|
||||
* @param {import('./BaseComponent.js').BaseComponent} instance The component instance.
|
||||
* @param {import('./BaseComponent').BaseComponent} instance The component instance.
|
||||
*/
|
||||
export function bindComponent(element, instance) {
|
||||
if (element[instanceSymbol]) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type {MaintenancePopupEventsMap} from "$lib/components/events/maintenance-popup-events.ts";
|
||||
import {BaseComponent} from "$lib/components/base/BaseComponent";
|
||||
import type { MaintenancePopupEventsMap } from "$lib/components/events/maintenance-popup-events";
|
||||
import { BaseComponent } from "$lib/components/base/BaseComponent";
|
||||
|
||||
interface EventsMapping extends MaintenancePopupEventsMap {
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type MaintenanceProfile from "$entities/MaintenanceProfile.ts";
|
||||
import type MaintenanceProfile from "$entities/MaintenanceProfile";
|
||||
|
||||
export const eventActiveProfileChanged = 'active-profile-changed';
|
||||
export const eventMaintenanceStateChanged = 'maintenance-state-change';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import StorageHelper from "$lib/browser/StorageHelper.js";
|
||||
import StorageHelper from "$lib/browser/StorageHelper";
|
||||
|
||||
export default class ConfigurationController {
|
||||
/** @type {string} */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type {TagDropdownWrapper} from "$lib/components/TagDropdownWrapper";
|
||||
import TagGroup from "$entities/TagGroup.ts";
|
||||
import {escapeRegExp} from "$lib/utils";
|
||||
import type { TagDropdownWrapper } from "$lib/components/TagDropdownWrapper";
|
||||
import TagGroup from "$entities/TagGroup";
|
||||
import { escapeRegExp } from "$lib/utils";
|
||||
|
||||
export default class CustomCategoriesResolver {
|
||||
#tagCategories = new Map<string, string>();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import StorageHelper from "$lib/browser/StorageHelper.js";
|
||||
import type StorageEntity from "$lib/extension/base/StorageEntity.ts";
|
||||
import StorageHelper from "$lib/browser/StorageHelper";
|
||||
import type StorageEntity from "$lib/extension/base/StorageEntity";
|
||||
|
||||
export default class EntitiesController {
|
||||
static #storageHelper = new StorageHelper(chrome.storage.local);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import {validateImportedEntity} from "$lib/extension/transporting/validators.js";
|
||||
import {exportEntityToObject} from "$lib/extension/transporting/exporters.ts";
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity.ts";
|
||||
import {compressToEncodedURIComponent, decompressFromEncodedURIComponent} from "lz-string";
|
||||
import { validateImportedEntity } from "$lib/extension/transporting/validators";
|
||||
import { exportEntityToObject } from "$lib/extension/transporting/exporters";
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity";
|
||||
import { compressToEncodedURIComponent, decompressFromEncodedURIComponent } from "lz-string";
|
||||
|
||||
export default class EntitiesTransporter<EntityType> {
|
||||
readonly #targetEntityConstructor: new (...any: any[]) => EntityType;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import ConfigurationController from "$lib/extension/ConfigurationController.js";
|
||||
import ConfigurationController from "$lib/extension/ConfigurationController";
|
||||
|
||||
export default class CacheableSettings<Fields> {
|
||||
#controller: ConfigurationController;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import EntitiesController from "$lib/extension/EntitiesController.js";
|
||||
import EntitiesController from "$lib/extension/EntitiesController";
|
||||
|
||||
export default abstract class StorageEntity<SettingsType extends Object = {}> {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity.ts";
|
||||
import EntitiesController from "$lib/extension/EntitiesController.ts";
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity";
|
||||
|
||||
export interface MaintenanceProfileSettings {
|
||||
name: string;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity.ts";
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity";
|
||||
|
||||
export interface TagGroupSettings {
|
||||
name: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile.ts";
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings.ts";
|
||||
import MaintenanceProfile from "$entities/MaintenanceProfile";
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings";
|
||||
|
||||
interface MaintenanceSettingsFields {
|
||||
activeProfile: string | null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings.ts";
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings";
|
||||
|
||||
export type FullscreenViewerSize = 'small' | 'medium' | 'large' | 'full';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings.ts";
|
||||
import CacheableSettings from "$lib/extension/base/CacheableSettings";
|
||||
|
||||
interface SearchSettingsFields {
|
||||
suggestProperties: boolean;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity.ts";
|
||||
import StorageEntity from "$lib/extension/base/StorageEntity";
|
||||
|
||||
type ExportersMap = {
|
||||
[EntityName in keyof App.EntityNamesMap]: (entity: App.EntityNamesMap[EntityName]) => Record<string, any>
|
||||
|
||||
Reference in New Issue
Block a user