You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All API is accessed through static properties and methods on nested structs under the Luminous namespace. No instantiation needed.
import Luminous
// Disk
letfree=Luminous.Disk.freeSpace(in:.gigabytes)lettotal=Luminous.Disk.totalSpaceInBytes
// Network
ifLuminous.Network.isInternetAvailable {letexpensive=Luminous.Network.isExpensive // true on cellular/hotspot
}
// Hardware
letcores=Luminous.Hardware.processorsNumber
letmodel=Luminous.Hardware.modelIdentifier // e.g. "iPhone16,1"
letthermal=Luminous.Hardware.thermalState // ProcessInfo.ThermalState
// OS version comparison
letcurrent=Luminous.Hardware.systemVersion
letios18=OperatingSystemVersion(majorVersion:18, minorVersion:0, patchVersion:0)if current >= ios18 {...}
// Battery — requires @MainActor
letlevel=awaitMainActor.run{Luminous.Battery.level } // Float? (0–100)
letstate=awaitMainActor.run{Luminous.Battery.state } // UIDevice.BatteryState
@MainActor properties
Battery, Hardware.Screen, and Hardware.Device access UIKit APIs and must be called on the main actor:
// In a @MainActor context (e.g. a SwiftUI view or view controller):
letbrightness=Luminous.Hardware.Screen.brightness
letstyle=Luminous.Hardware.Device.userInterfaceStyle // .light / .dark
// From a non-isolated context:
letbrightness=awaitMainActor.run{Luminous.Hardware.Screen.brightness }
API Reference
Luminous.Application
Property
Type
Description
version
String
CFBundleShortVersionString (e.g. "3.0.0"); "" if absent
build
String
CFBundleVersion (e.g. "42"); "" if absent
completeAppVersion
String
"3.0.0 (42)"
bundleIdentifier
String?
Bundle identifier (e.g. "com.example.MyApp"); nil if absent
displayName
String
User-visible app name; "" if absent
Luminous.Audio
Property
Type
Description
currentAudioOutputVolume
Float?
0.0–1.0; does not activate the audio session
secondaryAudioShouldBeSilencedHint
Bool
Another app is playing non-mixable audio
isWiredHeadsetPluggedIn
Bool
3.5 mm / Lightning / USB-C wired headset
isAnyHeadphoneConnected
Bool
Wired, AirPods, or any Bluetooth audio device
Luminous.Battery — @MainActor
Property
Type
Description
level
Float?
0–100; nil in Simulator
state
UIDevice.BatteryState
.unknown / .unplugged / .charging / .full
isCharging
Bool
Convenience shorthand for state == .charging
Luminous.Disk
All size methods accept a UnitInformationStorage parameter (default: .gigabytes).