add JSDoc to icons.js

This commit is contained in:
Greyfeather
2025-05-18 23:59:27 -06:00
parent c5b5cf4d2c
commit 23b6199684
@@ -1,5 +1,8 @@
.pragma library .pragma library
/**
* @type {{[key: string]: string}}
*/
const substitutions = { const substitutions = {
"code-url-handler": "visual-studio-code", "code-url-handler": "visual-studio-code",
"Code": "visual-studio-code", "Code": "visual-studio-code",
@@ -13,6 +16,10 @@ const substitutions = {
"zen": "zen-browser", "zen": "zen-browser",
"": "image-missing" "": "image-missing"
} }
/**
* @type {{[key: string]: string}}
*/
const regexSubstitutions = [ const regexSubstitutions = [
{ {
"regex": "/^steam_app_(\\d+)$/", "regex": "/^steam_app_(\\d+)$/",
@@ -20,11 +27,18 @@ const regexSubstitutions = [
} }
] ]
/**
* @param { string } iconName
* @returns { boolean }
*/
function iconExists(iconName) { function iconExists(iconName) {
return false; // TODO: Make this work without Gtk return false; // TODO: Make this work without Gtk
} }
/**
* @param { string } str
* @returns { string }
*/
function substitute(str) { function substitute(str) {
// Normal substitutions // Normal substitutions
if (substitutions[str]) if (substitutions[str])
@@ -47,6 +61,10 @@ function substitute(str) {
return str; return str;
} }
/**
* @param { string | undefined } str
* @returns { string }
*/
function noKnowledgeIconGuess(str) { function noKnowledgeIconGuess(str) {
if (!str) return "image-missing"; if (!str) return "image-missing";