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.
Verwendung
Connect a reporting service
Dieser Typ wird verwendet von 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' },
});Typdeklaration
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[]>)[];
}Mitglieder 8
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
class | string | Ja | The fully qualified Kotlin class implementing the generated <Name>Spec, in android/. |
launch | boolean | Nein | The class's companion fun launch(application: Application) runs as the app's process starts. |
dependencies | string[] | Nein | Gradle coordinates, group:artifact:version. |
permissions | string[] | Nein | uses-permission entries. |
features | { name: string; required?: boolean;}[] | Nein | uses-feature entries: required is true unless it says false. |
providers | ({ name: string; authorities: string; resources?: Record<string, string>;} & Record<string, unknown>)[] | Nein | <provider>s: attributes without android:, and resources naming meta-data resources. |
services | ({ name: string;} & Record<string, string>)[] | Nein | <service>s: attributes without android:. |
receivers | ({ name: string; actions?: string[];} & Record<string, string | string[]>)[] | Nein | <receiver>s: attributes without android:, and the actions their intent filter takes. |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.