Interface IconConfig

  • All Implemented Interfaces:

    
    public interface IconConfig
    
                        

    Base 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
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      abstract String buildUrl(String iconName) Build the CDN URL for downloading the icon SVG file.
      abstract String getCacheKey(String iconName) Generate a unique cache key for this icon and configuration combination.
      abstract String getSignature() Generate a signature string used for file naming.
      abstract String getLibraryId() Unique identifier for the icon library.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • 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")