types.ts 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. import type * as consts from "./constants.js";
  2. import type { scriptInfo } from "./constants.js";
  3. import type { addSelectorListener } from "./observers.js";
  4. import type resources from "../assets/resources.json";
  5. import type locales from "../assets/locales.json";
  6. import type { getResourceUrl, getSessionId, getVideoTime, TrLocale, t, tp, NanoEmitter, fetchVideoVotes, onInteraction, getThumbnailUrl, getBestThumbnailUrl, getLocale, hasKey, hasKeyFor } from "./utils/index.js";
  7. import type { SiteEventsMap } from "./siteEvents.js";
  8. import type { InterfaceEventsMap, getAutoLikeDataInterface, getFeaturesInterface, getPluginInfo, registerPlugin, saveAutoLikeDataInterface, saveFeaturesInterface, setLocaleInterface } from "./interface.js";
  9. import type { BytmDialog, ExImDialog, createCircularBtn, createHotkeyInput, createRipple, createToggleInput, showIconToast, showToast } from "./components/index.js";
  10. import type { fetchLyricsUrlTop, sanitizeArtists, sanitizeSong } from "./features/lyrics.js";
  11. import type { getLyricsCacheEntry } from "./features/lyricsCache.js";
  12. //#region other
  13. /** Custom CLI args passed to rollup */
  14. export type RollupArgs = Partial<{
  15. "config-mode": "development" | "production";
  16. "config-branch": "main" | "develop";
  17. "config-host": "greasyfork" | "github" | "openuserjs";
  18. "config-assetSource": "local" | "github";
  19. "config-suffix": string;
  20. }>;
  21. // I know TS enums are impure but it doesn't really matter here, plus imo they are cooler than pure enums anyway
  22. export enum LogLevel {
  23. Debug,
  24. Info,
  25. }
  26. /** Which domain this script is currently running on */
  27. export type Domain = "yt" | "ytm";
  28. /** A selection option between one of the supported domains, or all of them */
  29. export type SiteSelection = Domain | "all";
  30. /** A selection option between one of the supported domains, or none of them */
  31. export type SiteSelectionOrNone = SiteSelection | "none";
  32. /** Key of a resource in `assets/resources.json` and extra keys defined by `tools/post-build.ts` */
  33. export type ResourceKey = keyof typeof resources | `trans-${keyof typeof locales}` | "changelog" | "css-bundle";
  34. /** Describes a single hotkey */
  35. export type HotkeyObj = {
  36. code: string,
  37. shift: boolean,
  38. ctrl: boolean,
  39. alt: boolean,
  40. };
  41. export type LyricsCacheEntry = {
  42. artist: string;
  43. song: string;
  44. url: string;
  45. viewed: number;
  46. added: number;
  47. };
  48. export type AutoLikeData = {
  49. channels: {
  50. /** 24-character channel ID or user ID including the @ prefix */
  51. id: string;
  52. /** Channel name (for display purposes only) */
  53. name: string;
  54. /** Whether the channel should be auto-liked */
  55. enabled: boolean;
  56. }[];
  57. };
  58. export type RYDVotesObj = {
  59. /** The watch ID of the video */
  60. id: string;
  61. /** ISO timestamp of when the video was uploaded */
  62. dateCreated: string;
  63. /** Amount of likes */
  64. likes: number;
  65. /** Amount of dislikes */
  66. dislikes: number;
  67. /** Like to dislike ratio from 0.0 to 5.0 */
  68. rating: number;
  69. /** Amount of views */
  70. viewCount: number;
  71. /** Whether the video was deleted */
  72. deleted: boolean;
  73. };
  74. export type VideoVotesObj = {
  75. /** The watch ID of the video */
  76. id: string;
  77. /** Amount of likes */
  78. likes: number;
  79. /** Amount of dislikes */
  80. dislikes: number;
  81. /** Like to dislike ratio from 0.0 to 5.0 */
  82. rating: number;
  83. /** Timestamp of when the data was fetched */
  84. timestamp: number;
  85. };
  86. //#region global
  87. /** All properties of the `unsafeWindow.BYTM` object (also called "plugin interface") */
  88. export type BytmObject =
  89. {
  90. [key: string]: unknown;
  91. locale: TrLocale;
  92. logLevel: LogLevel;
  93. }
  94. // information from the userscript header
  95. & typeof scriptInfo
  96. // certain variables from `src/constants.ts`
  97. & Pick<typeof consts, "mode" | "branch" | "host" | "buildNumber" | "compressionFormat">
  98. // global functions exposed through the interface in `src/interface.ts`
  99. & InterfaceFunctions
  100. // others
  101. & {
  102. NanoEmitter: typeof NanoEmitter;
  103. BytmDialog: typeof BytmDialog;
  104. ExImDialog: typeof ExImDialog;
  105. // the entire UserUtils library
  106. UserUtils: typeof import("@sv443-network/userutils");
  107. // the entire compare-versions library
  108. compareVersions: typeof import("compare-versions");
  109. };
  110. declare global {
  111. interface Window {
  112. // to see the expanded type, install the VS Code extension "MylesMurphy.prettify-ts" and hover over the property below
  113. // alternatively navigate with ctrl+click to find the types
  114. BYTM: BytmObject;
  115. }
  116. }
  117. //#region plugins
  118. /**
  119. * Intents (permissions) BYTM has to grant your plugin for it to be able to access certain features.
  120. * TODO: this feature is unfinished, but you should still specify the intents your plugin needs.
  121. * Never request more permissions than you need, as this is a bad practice and can lead to your plugin being rejected.
  122. */
  123. export enum PluginIntent {
  124. /** Plugin has access to hidden config values */
  125. HiddenConfigValues = 1,
  126. /** Plugin can write to the feature configuration */
  127. WriteFeatureConfig = 2,
  128. /** Plugin can write to the lyrics cache */
  129. WriteLyricsCache = 4,
  130. /** Plugin can add new translations and overwrite existing ones */
  131. WriteTranslations = 8,
  132. /** Plugin can create modal dialogs */
  133. CreateModalDialogs = 16,
  134. /** Plugin can read and write auto-like data */
  135. ReadAndWriteAutoLikeData = 32,
  136. }
  137. /** Result of a plugin registration */
  138. export type PluginRegisterResult = {
  139. /** Public info about the registered plugin */
  140. info: PluginInfo;
  141. /** NanoEmitter instance for plugin events - see {@linkcode PluginEventMap} for a list of events */
  142. events: NanoEmitter<PluginEventMap>;
  143. /** Authentication token for the plugin to use in certain restricted function calls */
  144. token: string;
  145. }
  146. /** Minimal object that describes a plugin - this is all info the other installed plugins can see */
  147. export type PluginInfo = {
  148. /** Name of the plugin */
  149. name: string;
  150. /**
  151. * Adding the namespace and the name property makes the unique identifier for a plugin.
  152. * If one exists with the same name and namespace as this plugin, it may be overwritten at registration.
  153. * I recommend to set this value to a URL pointing to your homepage, or the author's username.
  154. */
  155. namespace: string;
  156. /** Version of the plugin as a semver-compliant string */
  157. version: string;
  158. };
  159. /** Minimum part of the PluginDef object needed to make up the resolvable plugin identifier */
  160. export type PluginDefResolvable = PluginDef | { plugin: Pick<PluginDef["plugin"], "name" | "namespace"> };
  161. /** An object that describes a BYTM plugin */
  162. export type PluginDef = {
  163. plugin: PluginInfo & {
  164. /**
  165. * Descriptions of at least en_US and optionally any other locale supported by BYTM.
  166. * When an untranslated locale is set, the description will default to the value of en_US
  167. */
  168. description: Partial<Record<keyof typeof locales, string>> & {
  169. en_US: string;
  170. };
  171. /** URL to the plugin's icon - recommended size: 48x48 to 128x128 */
  172. iconUrl?: string;
  173. license?: {
  174. /** License name */
  175. name: string;
  176. /** URL to the license text */
  177. url: string;
  178. };
  179. /** Homepage URLs for the plugin */
  180. homepage: {
  181. /** URL to the plugin's source code (i.e. Git repo) - closed source plugins are not officially accepted at the moment. */
  182. source: string;
  183. /** Any other homepage URL */
  184. other?: string;
  185. /** URL to the plugin's bug tracker page, like GitHub issues */
  186. bug?: string;
  187. /** URL to the plugin's GreasyFork page */
  188. greasyfork?: string;
  189. /** URL to the plugin's OpenUserJS page */
  190. openuserjs?: string;
  191. };
  192. };
  193. /** Intents (permissions) BYTM has to grant the plugin for it to work */
  194. intents?: number;
  195. /** Info about the plugin contributors */
  196. contributors?: Array<{
  197. /** Name of this contributor */
  198. name: string;
  199. /** (optional) Email address of this contributor */
  200. email?: string;
  201. /** (optional) URL to this plugin contributor's homepage / GitHub profile */
  202. url?: string;
  203. }>;
  204. };
  205. /** All events that are dispatched to plugins individually, including everything in {@linkcode SiteEventsMap} and {@linkcode InterfaceEventsMap} - these don't have a prefix since they can't conflict with other events */
  206. export type PluginEventMap =
  207. // These are emitted on each plugin individually, with individual data:
  208. & {
  209. /** Emitted when the plugin is registered on BYTM's side */
  210. pluginRegistered: (info: PluginInfo) => void;
  211. }
  212. // These are emitted on every plugin simultaneously, with the same or similar data:
  213. & SiteEventsMap
  214. & InterfaceEventsMap;
  215. /** A plugin in either the queue or registered map */
  216. export type PluginItem =
  217. & {
  218. def: PluginDef;
  219. }
  220. & Pick<PluginRegisterResult, "events">;
  221. /** All functions exposed by the interface on the global `BYTM` object */
  222. export type InterfaceFunctions = {
  223. // meta:
  224. /** Registers a plugin with BYTM. Needed to receive the token for making authenticated function calls. */
  225. registerPlugin: typeof registerPlugin;
  226. /** 🔒 Checks if the plugin with the given name and namespace is registered and returns an info object about it */
  227. getPluginInfo: typeof getPluginInfo;
  228. // bytm-specific:
  229. /**
  230. * Returns the URL of a resource as defined in `assets/resources.json`
  231. * There are also some resources like translation files that get added by `tools/post-build.ts`
  232. *
  233. * The returned URL is a `blob:` URL served up by the userscript extension
  234. * This makes the resource fast to fetch and also prevents CORS issues
  235. */
  236. getResourceUrl: typeof getResourceUrl;
  237. /** Returns the unique session ID for the current tab */
  238. getSessionId: typeof getSessionId;
  239. // dom:
  240. /** Adds a listener to one of the already present SelectorObserver instances */
  241. addSelectorListener: typeof addSelectorListener;
  242. /** Registers accessible interaction listeners (click, enter, space) on the provided element */
  243. onInteraction: typeof onInteraction;
  244. /**
  245. * Returns the current video time (on both YT and YTM)
  246. * In case it can't be determined on YT, mouse movement is simulated to bring up the video time
  247. * In order for that edge case not to error out, the function would need to be called in response to a user interaction event (e.g. click) due to the strict autoplay policy in browsers
  248. */
  249. getVideoTime: typeof getVideoTime;
  250. /** Returns the thumbnail URL for the provided video ID and thumbnail quality */
  251. getThumbnailUrl: typeof getThumbnailUrl;
  252. /** Returns the thumbnail URL with the best quality for the provided video ID */
  253. getBestThumbnailUrl: typeof getBestThumbnailUrl;
  254. // translations:
  255. /** 🔒 Sets the locale for all new translations */
  256. setLocale: typeof setLocaleInterface;
  257. /** Returns the current locale */
  258. getLocale: typeof getLocale;
  259. /** Returns whether a translation key exists for the set locale */
  260. hasKey: typeof hasKey;
  261. /** Returns whether a translation key exists for the provided locale */
  262. hasKeyFor: typeof hasKeyFor;
  263. /** Returns the translation for the provided translation key and set locale (check the files in the folder `assets/translations`) */
  264. t: typeof t;
  265. /** Returns the translation for the provided translation key, including pluralization identifier and set locale (check the files in the folder `assets/translations`) */
  266. tp: typeof tp;
  267. // feature config:
  268. /** 🔒 Returns the current feature configuration */
  269. getFeatures: typeof getFeaturesInterface;
  270. /** 🔒 Overwrites the feature configuration with the provided one */
  271. saveFeatures: typeof saveFeaturesInterface;
  272. // lyrics:
  273. /** Sanitizes the provided artist string - this needs to be done before calling other lyrics related functions! */
  274. sanitizeArtists: typeof sanitizeArtists;
  275. /** Sanitizes the provided song title string - this needs to be done before calling other lyrics related functions! */
  276. sanitizeSong: typeof sanitizeSong;
  277. /** Fetches the lyrics URL of the top search result for the provided song and artist. Before a request is sent, the cache is checked for a match. */
  278. fetchLyricsUrlTop: typeof fetchLyricsUrlTop;
  279. /** Returns the lyrics cache entry for the provided song and artist, if there is one. Never sends a request on its own. */
  280. getLyricsCacheEntry: typeof getLyricsCacheEntry;
  281. // auto-like:
  282. /** 🔒 Returns the current auto-like data */
  283. getAutoLikeData: typeof getAutoLikeDataInterface;
  284. /** 🔒 Overwrites the auto-like data */
  285. saveAutoLikeData: typeof saveAutoLikeDataInterface;
  286. /** Returns the votes for the provided video ID from the ReturnYoutubeDislike API */
  287. fetchVideoVotes: typeof fetchVideoVotes;
  288. // components:
  289. /** Creates a new hotkey input component */
  290. createHotkeyInput: typeof createHotkeyInput;
  291. /** Creates a new toggle input component */
  292. createToggleInput: typeof createToggleInput;
  293. /** Creates a new circular button component */
  294. createCircularBtn: typeof createCircularBtn;
  295. /** Creates a new ripple effect on the provided element or creates an empty element that has the effect */
  296. createRipple: typeof createRipple;
  297. /** Shows a toast with the provided text */
  298. showToast: typeof showToast;
  299. /** Shows a toast with the provided text and an icon */
  300. showIconToast: typeof showIconToast;
  301. };
  302. //#region feature defs
  303. export type FeatureKey = keyof FeatureConfig;
  304. export type FeatureCategory =
  305. | "layout"
  306. | "volume"
  307. | "songLists"
  308. | "behavior"
  309. | "input"
  310. | "lyrics"
  311. | "general";
  312. type SelectOption = {
  313. value: string | number;
  314. label: string;
  315. };
  316. type FeatureTypeProps = ({
  317. type: "toggle";
  318. default: boolean;
  319. } & FeatureFuncProps)
  320. | ({
  321. type: "number";
  322. default: number;
  323. min: number;
  324. max?: number;
  325. step?: number;
  326. unit?: string | ((val: number) => string);
  327. } & FeatureFuncProps)
  328. | ({
  329. type: "select";
  330. default: string | number;
  331. options: SelectOption[] | (() => SelectOption[]);
  332. } & FeatureFuncProps)
  333. | ({
  334. type: "slider";
  335. default: number;
  336. min: number;
  337. max: number;
  338. step?: number;
  339. unit?: string | ((val: number) => string);
  340. } & FeatureFuncProps)
  341. | ({
  342. type: "hotkey";
  343. default: HotkeyObj;
  344. } & FeatureFuncProps)
  345. | ({
  346. type: "text";
  347. default: string;
  348. normalize?: (val: string) => string;
  349. } & FeatureFuncProps)
  350. | {
  351. type: "button";
  352. default?: undefined;
  353. click: () => Promise<void | unknown> | void | unknown;
  354. }
  355. type FeatureFuncProps = (
  356. {
  357. /** Whether the feature requires a page reload to take effect */
  358. reloadRequired: false;
  359. /** Called to instantiate the feature on the page */
  360. enable: (featCfg: FeatureConfig) => void,
  361. }
  362. | {
  363. /** Whether the feature requires a page reload to take effect */
  364. reloadRequired?: true;
  365. /** Called to instantiate the feature on the page */
  366. enable?: undefined;
  367. }
  368. ) & (
  369. {
  370. /** Called to remove all traces of the feature from the page and memory (includes event listeners) */
  371. disable?: (feats: FeatureConfig) => void,
  372. }
  373. | {
  374. /** Called to update the feature's behavior when the config changes */
  375. change?: (key: FeatureKey, initialVal: number | boolean | Record<string, unknown>, newVal: number | boolean | Record<string, unknown>) => void,
  376. }
  377. );
  378. /**
  379. * The feature info object that contains all properties necessary to construct the config menu and the feature config object.
  380. * All values are loosely typed so try to only use this with the `satisfies` keyword.
  381. * Use `typeof featInfo` (from `src/features/index.ts`) instead for full type safety.
  382. */
  383. export type FeatureInfo = Record<
  384. keyof FeatureConfig,
  385. {
  386. category: FeatureCategory;
  387. /**
  388. * HTML string that will be the help text for this feature
  389. * Specifying a function is useful for pluralizing or inserting values into the translation at runtime
  390. */
  391. helpText?: string | (() => string);
  392. /** Whether the value should be hidden in the config menu and from plugins */
  393. valueHidden?: boolean;
  394. /** Transformation function called before the value is rendered in the config menu */
  395. renderValue?: (value: string) => string | Promise<string>;
  396. /** HTML string that is appended to the end of a feature's text description */
  397. textAdornment?: () => (Promise<string | undefined> | string | undefined);
  398. /** Whether to only show this feature when advanced mode is activated (default false) */
  399. advanced?: boolean;
  400. }
  401. & FeatureTypeProps
  402. >;
  403. //#region feature config
  404. /** Feature configuration */
  405. export interface FeatureConfig {
  406. //#region layout
  407. /** Show a BetterYTM watermark under the YTM logo */
  408. watermarkEnabled: boolean;
  409. /** Remove the "si" tracking parameter from links in the share menu? */
  410. removeShareTrackingParam: boolean;
  411. /** On which sites to remove the "si" tracking parameter from links in the share menu */
  412. removeShareTrackingParamSites: SiteSelection;
  413. /** Enable skipping to a specific time in the video by pressing a number key (0-9) */
  414. numKeysSkipToTime: boolean;
  415. /** Fix spacing issues in the layout */
  416. fixSpacing: boolean;
  417. /** Where to show a thumbnail overlay over the video element and whether to show it at all */
  418. thumbnailOverlayBehavior: "never" | "videosOnly" | "songsOnly" | "always";
  419. /** Whether to show a button to toggle the thumbnail overlay in the media controls */
  420. thumbnailOverlayToggleBtnShown: boolean;
  421. /** Whether to show an indicator on the thumbnail overlay when it is active */
  422. thumbnailOverlayShowIndicator: boolean;
  423. /** The opacity of the thumbnail overlay indicator element */
  424. thumbnailOverlayIndicatorOpacity: number;
  425. /** How to fit the thumbnail overlay image */
  426. thumbnailOverlayImageFit: "cover" | "contain" | "fill";
  427. /** Hide the cursor when it's idling on the video element for a while */
  428. hideCursorOnIdle: boolean;
  429. /** Delay in seconds after which the cursor should be hidden */
  430. hideCursorOnIdleDelay: number;
  431. /** Whether to fix various issues in the layout when HDR is supported and active */
  432. fixHdrIssues: boolean;
  433. /** On which sites to disable Dark Reader - does nothing if the extension is not installed */
  434. disableDarkReaderSites: SiteSelectionOrNone;
  435. /** Whether to show the like/dislike ratio on the currently playing song */
  436. showVotes: boolean;
  437. /** Which format to use for the like/dislike ratio on the currently playing song */
  438. showVotesFormat: "short" | "full";
  439. //#region volume
  440. /** Add a percentage label to the volume slider */
  441. volumeSliderLabel: boolean;
  442. /** The width of the volume slider in pixels */
  443. volumeSliderSize: number;
  444. /** Volume slider sensitivity - the smaller this number, the finer the volume control */
  445. volumeSliderStep: number;
  446. /** Volume slider scroll wheel sensitivity */
  447. volumeSliderScrollStep: number;
  448. /** Whether the volume should be locked to the same level across all tabs (changing in one changes in all others too) */
  449. volumeSharedBetweenTabs: boolean;
  450. /** Whether to set an initial volume level for each new session */
  451. setInitialTabVolume: boolean;
  452. /** The initial volume level to set for each new session */
  453. initialTabVolumeLevel: number;
  454. //#region song lists
  455. /** Add a button to each song in the queue to quickly open its lyrics page */
  456. lyricsQueueButton: boolean;
  457. /** Add a button to each song in the queue to quickly remove it */
  458. deleteFromQueueButton: boolean;
  459. /** Where to place the buttons in the queue */
  460. listButtonsPlacement: "queueOnly" | "everywhere";
  461. /** Add a button above the queue to scroll to the currently playing song */
  462. scrollToActiveSongBtn: boolean;
  463. /** Add a button above the queue to clear it */
  464. clearQueueBtn: boolean;
  465. //#region behavior
  466. /** Whether to completely disable the popup that sometimes appears before leaving the site */
  467. disableBeforeUnloadPopup: boolean;
  468. /** After how many milliseconds to close permanent toasts */
  469. closeToastsTimeout: number;
  470. /** Remember the last song's time when reloading or restoring the tab */
  471. rememberSongTime: boolean;
  472. /** Where to remember the song time */
  473. rememberSongTimeSites: SiteSelection;
  474. /** Time in seconds to remember the song time for */
  475. rememberSongTimeDuration: number;
  476. /** Time in seconds to subtract from the remembered song time */
  477. rememberSongTimeReduction: number;
  478. /** Minimum time in seconds the song needs to be played before it is remembered */
  479. rememberSongTimeMinPlayTime: number;
  480. //#region input
  481. /** Arrow keys skip forwards and backwards */
  482. arrowKeySupport: boolean;
  483. /** By how many seconds to skip when pressing the arrow keys */
  484. arrowKeySkipBy: number;
  485. /** Add a hotkey to switch between the YT and YTM sites on a video / song */
  486. switchBetweenSites: boolean;
  487. /** The hotkey that needs to be pressed to initiate the site switch */
  488. switchSitesHotkey: HotkeyObj;
  489. /** Make it so middle clicking a song to open it in a new tab (through thumbnail and song title) is easier */
  490. anchorImprovements: boolean;
  491. /** Whether to auto-like all played videos of configured channels */
  492. autoLikeChannels: boolean;
  493. /** Whether to show toggle buttons on the channel page to enable/disable auto-liking for that channel */
  494. autoLikeChannelToggleBtn: boolean;
  495. // TODO(v2.2):
  496. // /** Whether to show a toggle button in the media controls to enable/disable auto-liking for those channel(s) */
  497. // autoLikePlayerBarToggleBtn: boolean;
  498. /** How long to wait after a video has started playing to auto-like it */
  499. autoLikeTimeout: number;
  500. /** Whether to show a toast when a video is auto-liked */
  501. autoLikeShowToast: boolean;
  502. /** Opens the auto-like channels management dialog */
  503. autoLikeOpenMgmtDialog: undefined;
  504. //#region lyrics
  505. /** Add a button to the media controls to open the current song's lyrics on genius.com in a new tab */
  506. geniusLyrics: boolean;
  507. /** Base URL to use for GeniURL */
  508. geniUrlBase: string;
  509. /** Token to use for GeniURL */
  510. geniUrlToken: string;
  511. /** Max size of lyrics cache */
  512. lyricsCacheMaxSize: number;
  513. /** Max TTL of lyrics cache entries, in ms */
  514. lyricsCacheTTL: number;
  515. /** Button to clear lyrics cache */
  516. clearLyricsCache: undefined;
  517. /** Whether to use advanced filtering when searching for lyrics (exact, exact-ish) */
  518. advancedLyricsFilter: boolean;
  519. //#region misc
  520. /** The locale to use for translations */
  521. locale: TrLocale;
  522. /** Whether to default to US-English if the translation for the set locale is missing */
  523. localeFallback: boolean;
  524. /** Whether to check for updates to the script */
  525. versionCheck: boolean;
  526. /** Button to check for updates */
  527. checkVersionNow: undefined;
  528. /** The console log level - 0 = Debug, 1 = Info */
  529. logLevel: LogLevel;
  530. /** Amount of seconds until the feature initialization times out */
  531. initTimeout: number;
  532. /** Amount of seconds to show BYTM's toasts for */
  533. toastDuration: number;
  534. /** Button that resets the config to the default state */
  535. resetConfig: undefined;
  536. /** Whether to show advanced settings in the config menu */
  537. advancedMode: boolean;
  538. }