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.
Utilisation
Connect a reporting service
Ce type est utilisé par 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' },
});Déclaration du type
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[]>)[];
}Membres 8
| Nom | Type | Requis | Description |
|---|---|---|---|
class | string | Oui | The fully qualified Kotlin class implementing the generated <Name>Spec, in android/. |
launch | boolean | Non | The class's companion fun launch(application: Application) runs as the app's process starts. |
dependencies | string[] | Non | Gradle coordinates, group:artifact:version. |
permissions | string[] | Non | uses-permission entries. |
features | { name: string; required?: boolean;}[] | Non | uses-feature entries: required is true unless it says false. |
providers | ({ name: string; authorities: string; resources?: Record<string, string>;} & Record<string, unknown>)[] | Non | <provider>s: attributes without android:, and resources naming meta-data resources. |
services | ({ name: string;} & Record<string, string>)[] | Non | <service>s: attributes without android:. |
receivers | ({ name: string; actions?: string[];} & Record<string, string | string[]>)[] | Non | <receiver>s: attributes without android:, and the actions their intent filter takes. |
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.