Usage

Connect a reporting service

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' },
});

Properties and methods 3

NameTypeRequiredDescription
sync<F extends SyncFunction>() => Synchronous<F>YesRuns on the JS thread and returns its value. Keep it fast, thread-safe and off UIKit and Views.
mainQueuedDeclarationYesRuns on the main (UI) thread.
backgroundQueuedDeclarationYesRuns on the module's own serial background thread, in call order.
sync — method signatures

Signatures

ts
<F extends SyncFunction>(): Synchronous<F>

Type parameters

NameConstraintDefault
FSyncFunction—

Parameters

No parameters.

Returns

Synchronous<F>

main — method signatures

Signatures

ts
<F extends AsyncFunction>(): F

Type parameters

NameConstraintDefault
FAsyncFunction—

Parameters

No parameters.

Returns

F

background — method signatures

Signatures

ts
<F extends AsyncFunction>(): F

Type parameters

NameConstraintDefault
FAsyncFunction—

Parameters

No parameters.

Returns

F

Generated from the public TypeScript declarations: signatures, props and defaults come from the checked source, descriptions from its JSDoc. No defaults are invented.