Package-level declarations

Types

Link copied to clipboard
Link copied to clipboard
sealed interface Effect

One-shot effects MosaicApplicationStateHolder could emit — currently empty, no case defined yet.

Link copied to clipboard
sealed interface Event

UI events MosaicApplicationStateHolder handles.

Link copied to clipboard
data class MosaicColorScheme(val lightColorScheme: ColorScheme, val darkColorScheme: ColorScheme)

A light/dark pair of Material ColorSchemes — the initial values MosaicColors starts from, before any SetTheme/ResetTheme event swaps them at runtime.

Link copied to clipboard
data class MosaicDependencyInjectionConfig(val additionalKoinModule: Module, val logger: MosaicLogger, val tileDefinitions: List<TileDefinition<out TileSchema>>, val eventDefinitions: List<EventDefinition<out EventSchema>>, val eventTriggerDefinition: List<EventTriggerDefinition<out EventTrigger>>, val additionalSerializersModule: SerializersModule, val drawableResources: Map<String, DrawableResource>)

Every knob a consuming app can turn on mosaic-client's DI graph — the whole surface for registering custom tiles/events/triggers, swapping the logger, adding Koin bindings of your own (including a custom dev.catbit.mosaic.client.ui.sdui.foundation.data_processor.DataProcessor via additionalKoinModule), and supplying bundled drawables.

Link copied to clipboard
data class MosaicThemeConfig(val colorScheme: MosaicColorScheme, val shapes: Shapes, val typography: Typography, val materialSymbolFontsConfig: MaterialSymbolFontsConfig)

The app's visual theme — colors, shapes, typography and Material Symbol font settings, applied via MosaicTheme inside MosaicApplication.

Link copied to clipboard
sealed interface State

MosaicApplicationStateHolder's own UI state — the 3 states MosaicApplication's root content switches on (MosaicApplicationContent) before any screen exists yet.

Functions

Link copied to clipboard
fun MosaicApplication(applicationId: String, baseUrl: String, themeConfig: MosaicThemeConfig = mosaicThemeConfig(), dependencyInjectionConfig: MosaicDependencyInjectionConfig = mosaicDependencyInjectionConfig(), appSplash: @Composable BoxScope.() -> Unit)

Root composable of a Mosaic client app — sets up the Koin DI graph (via MosaicModules), installs the app's theme, fetches the initial navigation graph, and renders either the loading splash, the failure screen, or the real navigation UI depending on MosaicApplicationStateHolder's current state. Every screen, tile and event in the app ultimately renders/runs inside the Koin scope and CompositionLocals this function establishes — nothing in mosaic-client works meaningfully outside it.

Link copied to clipboard
fun mosaicDependencyInjectionConfig(additionalKoinModule: Module = module { }, logger: MosaicLogger = DefaultMosaicLogger(), tileDefinitions: List<TileDefinition<out TileSchema>> = emptyList(), eventDefinitions: List<EventDefinition<out EventSchema>> = emptyList(), eventTriggerDefinition: List<EventTriggerDefinition<out EventTrigger>> = emptyList(), additionalSerializersModule: SerializersModule = SerializersModule { }, drawableResources: Map<String, DrawableResource> = emptyMap()): MosaicDependencyInjectionConfig

Builds a MosaicDependencyInjectionConfig, every parameter defaulting to "nothing extra" — an app that doesn't extend Mosaic at all can call MosaicApplication(...) without passing this parameter.

Link copied to clipboard
fun mosaicThemeConfig(colorScheme: MosaicColorScheme? = null, shapes: Shapes? = null, typography: Typography? = null, materialSymbolFontsConfig: MaterialSymbolFontsConfig? = null): MosaicThemeConfig

Builds a MosaicThemeConfig, defaulting every parameter to Material 3's own out-of-the-box defaults (lightColorScheme()/darkColorScheme(), MaterialTheme.shapes, MosaicTypography, a default MaterialSymbolFontsConfig) when left null.