Usage

Connect a reporting service

This type is used by defineModule

tsx
// 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

ts
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

NameTypeRequiredDescription
classstringYesThe fully qualified Kotlin class implementing the generated <Name>Spec, in android/.
launchbooleanNoThe class's companion fun launch(application: Application) runs as the app's process starts.
dependenciesstring[]NoGradle coordinates, group:artifact:version.
permissionsstring[]Nouses-permission entries.
features{ name: string; required?: boolean;}[]Nouses-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.