Interface IconConfig
-
- All Implemented Interfaces:
public interface IconConfigBase interface for all icon library configurations.
Users can implement this interface to support custom icon libraries.
Example:
@Serializable data class MyCustomIconConfig( val style: String = "default" ) : IconConfig { override val libraryId = "my-custom-library" override fun buildUrl(iconName: String, cdnBaseUrl: String): String { return "$cdnBaseUrl/my-library/$iconName.svg" } override fun getCacheKey(iconName: String): String { return "${iconName}_${libraryId}_${style}" } override fun getSignature(): String = style }
-
-
Method Summary
Modifier and Type Method Description abstract StringbuildUrl(String iconName)Build the CDN URL for downloading the icon SVG file. abstract StringgetCacheKey(String iconName)Generate a unique cache key for this icon and configuration combination. abstract StringgetSignature()Generate a signature string used for file naming. abstract StringgetLibraryId()Unique identifier for the icon library. -
-
Method Detail
-
buildUrl
abstract String buildUrl(String iconName)
Build the CDN URL for downloading the icon SVG file.
- Parameters:
iconName- Name of the icon (e.g.- Returns:
Full URL to the SVG file
-
getCacheKey
abstract String getCacheKey(String iconName)
Generate a unique cache key for this icon and configuration combination.
The cache key MUST be unique across all icons and configurations to avoid cache conflicts. It's recommended to include: iconName, libraryId, and all style parameters.
- Parameters:
iconName- Name of the icon- Returns:
Unique cache key string
-
getSignature
abstract String getSignature()
Generate a signature string used for file naming. This appears in the generated Kotlin file names.
Should be short and descriptive (e.g., "W400Outlined", "Fill", "24px")
- Returns:
Signature string for file naming
-
getLibraryId
abstract String getLibraryId()
Unique identifier for the icon library. Must be unique across all icon libraries to avoid cache conflicts.
Recommended format: "library-name" (e.g., "material-symbols", "font-awesome")
-
-
-
-