Skip to content
Lucent
SEARCH LUCENT

Search guides, APIs, and examples.

GitHub

Very early and experimental. The language, the generated native code and every package API change without notice. Do not use Lucent in production.

Find an SDK class

lucent sdk search finds classes and members with the import to copy; lucent sdk show prints what Lucent code sees.

terminal
npx lucent sdk search BatteryManager
terminal
android android.os
class BatteryManager import { BatteryManager } from "lucent:android/android.os";
searched 297 modules of 299 (your imports and the SDK cache; lucent sdk prefetch --all to search every module)

The search matches classes and members, in the modules you import and those already cached. The import line is ready to copy. To search everything, run lucent sdk prefetch --all once.

terminal
npx lucent sdk show UIKit.UIDevice.batteryLevel
terminal
// lucent:ios/UIKit
export declare class UIDevice extends NSObject {
readonly batteryLevel: number;
}

sdk show prints what Lucent code sees: a class, or one member. Name it as <module>.<Class>, such as UIKit.UIDevice or android.os.BatteryManager. Doc comments say when a class is main-thread only, and the OS version each member needs.

Your editor shows the same declarations, since lucent build writes them to .lucent/native/types/.