1- import { Snapshot , Settings , ButtonTone , IconName , ButtonRenderOptions } from "./types" ;
1+ import { Snapshot , Settings , ButtonTone , ButtonRenderOptions } from "./types" ;
22import { loadSnapshots , pruneAutosToMax , saveSettings , saveSnapshots } from "./storage" ;
33import { getSnapshotItemNames , getSnapshotDisplayName } from "./names" ;
44import { escapeHtml , downloadJson , setButtonLabel } from "./utils" ;
@@ -19,14 +19,14 @@ const exportingIds = new Set<string>();
1919
2020const DEFAULT_ICON_SIZE = 16 ;
2121
22- function getIconMarkup ( icon : IconName , size = DEFAULT_ICON_SIZE ) : string {
22+ function getIconMarkup ( icon : Spicetify . Icon , size = DEFAULT_ICON_SIZE ) : string {
2323 const iconMap = ( Spicetify . SVGIcons ?? { } ) as Record < string , string > ;
2424 const raw = iconMap [ icon ] ;
2525 if ( ! raw ) return "" ;
2626 return `<span class="qs-btn-icon" data-icon-name="${ escapeHtml ( icon ) } "><svg class="qs-svg-icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false" style="width:${ size } px;height:${ size } px;">${ raw } </svg></span>` ;
2727}
2828
29- function renderButton ( label : string , icon : IconName , options : ButtonRenderOptions = { } ) : string {
29+ function renderButton ( label : string , icon : Spicetify . Icon , options : ButtonRenderOptions = { } ) : string {
3030 const { action, id, tone = "default" , title } = options ;
3131 const classes = [ "qs-btn" ] ;
3232 if ( tone === "danger" ) classes . push ( "danger" ) ;
@@ -41,7 +41,7 @@ function renderButton(label: string, icon: IconName, options: ButtonRenderOption
4141 return `<button type="button" class="${ classes . join ( " " ) } "${ attrString } >${ iconHtml } <span class="qs-btn-label">${ escapeHtml ( label ) } </span></button>` ;
4242}
4343
44- function renderActionIconButton ( action : string , icon : IconName , title : string ) : string {
44+ function renderActionIconButton ( action : string , icon : Spicetify . Icon , title : string ) : string {
4545 return `<button type="button" class="qs-icon-btn" data-action="${ escapeHtml ( action ) } " title="${ escapeHtml ( title ) } ">${ getIconMarkup ( icon ) } </button>` ;
4646}
4747
0 commit comments