SettingsSchema

interface SettingsSchema<T>

Schema definition for a settings data class. Generated by KSP from annotated properties.

Properties

Link copied to clipboard
abstract val default: T

Default instance of the settings class

Link copied to clipboard
abstract val fields: List<SettingField<T, *>>

All fields (both @Setting and @Persisted)

Functions

Link copied to clipboard
open fun fieldByKey(key: String): SettingField<T, *>?

Find field by DataStore key

Link copied to clipboard
open fun fieldByName(name: String): SettingField<T, *>?

Find field by property name

Link copied to clipboard
open fun groupedByCategory(platform: SettingPlatform = currentPlatform): Map<KClass<*>, List<SettingField<T, *>>>

Group visible UI fields by category, sorted by order.

Link copied to clipboard
open fun isEnabled(model: T, field: SettingField<T, *>): Boolean

Check if a setting is enabled based on its dependency

Link copied to clipboard
open fun orderedCategories(platform: SettingPlatform = currentPlatform): List<KClass<*>>

Get ordered list of categories with visible fields

Link copied to clipboard

Get fields that can be reset

Link copied to clipboard
open fun resettableFieldsInCategory(category: KClass<*>): List<SettingField<T, *>>

Get fields in a category that can be reset

Link copied to clipboard
open fun uiFields(): List<SettingField<T, *>>

All fields with UI metadata (excludes @Persisted-only)

Link copied to clipboard
open fun visibleUiFields(platform: SettingPlatform = currentPlatform): List<SettingField<T, *>>

All UI fields visible on the current platform.