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.
Utilização
Connect a reporting service
Este tipo é usado por 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' },
});Declaração do tipo
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[]>)[];
}Membros 8
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
class | string | Sim | The fully qualified Kotlin class implementing the generated <Name>Spec, in android/. |
launch | boolean | Não | The class's companion fun launch(application: Application) runs as the app's process starts. |
dependencies | string[] | Não | Gradle coordinates, group:artifact:version. |
permissions | string[] | Não | uses-permission entries. |
features | { name: string; required?: boolean;}[] | Não | uses-feature entries: required is true unless it says false. |
providers | ({ name: string; authorities: string; resources?: Record<string, string>;} & Record<string, unknown>)[] | Não | <provider>s: attributes without android:, and resources naming meta-data resources. |
services | ({ name: string;} & Record<string, string>)[] | Não | <service>s: attributes without android:. |
receivers | ({ name: string; actions?: string[];} & Record<string, string | string[]>)[] | Não | <receiver>s: attributes without android:, and the actions their intent filter takes. |
Gerado a partir das declarações TypeScript públicas: assinaturas, props e predefinições vêm da fonte verificada, as descrições da sua JSDoc. Nenhuma predefinição é inventada.