AndroidNeeds
Declares what a native module's Android side needs beside its Kotlin class: Gradle dependencies and the manifest entries it adds to the app.
Usage
Connect a reporting service
This type is used by defineModule
// modules/crash-service/crash-service.ts
import { defineModule, fn } from 'kuito';
export default defineModule('CrashService', {
start: fn.main<(key: string) => Promise<void>>(),
ios: { class: 'CrashServiceModule' },
android: { class: 'com.example.myapp.modules.crashservice.CrashServiceModule' },
});Type declaration
export interface AndroidNeeds {
/** The fully qualified Kotlin class implementing the generated `<Name>Spec`, in `android/`. */
class: string;
/** The class's companion `fun launch(application: Application)` runs as the app's process starts. */
launch?: boolean;
/** Gradle coordinates, `group:artifact:version`. */
dependencies?: string[];
/** `uses-permission` entries. */
permissions?: string[];
/** `uses-feature` entries: `required` is true unless it says false. */
features?: { name: string; required?: boolean }[];
/** `<provider>`s: attributes without `android:`, and `resources` naming meta-data resources. */
providers?: ({ name: string; authorities: string; resources?: Record<string, string> } & Record<
string,
unknown
>)[];
/** `<service>`s: attributes without `android:`. */
services?: ({ name: string } & Record<string, string>)[];
/** `<receiver>`s: attributes without `android:`, and the `actions` their intent filter takes. */
receivers?: ({ name: string; actions?: string[] } & Record<string, string | string[]>)[];
}Members 8
| Name | Type | Required | Description |
|---|---|---|---|
class | string | Yes | The fully qualified Kotlin class implementing the generated <Name>Spec, in android/. |
launch | boolean | No | The class's companion fun launch(application: Application) runs as the app's process starts. |
dependencies | string[] | No | Gradle coordinates, group:artifact:version. |
permissions | string[] | No | uses-permission entries. |
features | { name: string; required?: boolean;}[] | No | uses-feature entries: required is true unless it says false. |
providers | ({ name: string; authorities: string; resources?: Record<string, string>;} & Record<string, unknown>)[] | No | <provider>s: attributes without android:, and resources naming meta-data resources. |
services | ({ name: string;} & Record<string, string>)[] | No | <service>s: attributes without android:. |
receivers | ({ name: string; actions?: string[];} & Record<string, string | string[]>)[] | No | <receiver>s: attributes without android:, and the actions their intent filter takes. |
Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.