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
/**
* @type {{[key: string]: string}}
*/
const substitutions = {
"code-url-handler": "visual-studio-code",
"Code": "visual-studio-code",
@@ -13,6 +16,10 @@ const substitutions = {
"zen": "zen-browser",
"": "image-missing"
}
/**
* @type {{[key: string]: string}}
*/
const regexSubstitutions = [
{
"regex": "/^steam_app_(\\d+)$/",
@@ -20,11 +27,18 @@ const regexSubstitutions = [
}
]
/**
* @param { string } iconName
* @returns { boolean }
*/
function iconExists(iconName) {
return false; // TODO: Make this work without Gtk
}
/**
* @param { string } str
* @returns { string }
*/
function substitute(str) {
// Normal substitutions
if (substitutions[str])
@@ -47,6 +61,10 @@ function substitute(str) {
return str;
}
/**
* @param { string | undefined } str
* @returns { string }
*/
function noKnowledgeIconGuess(str) {
if (!str) return "image-missing";