Utilização

Connect a reporting service

Este tipo é usado por fn

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

Declaração do tipo

ts
export interface FunctionDeclarations {
  /** Runs on the JS thread and returns its value. Keep it fast, thread-safe and off UIKit and Views. */
  sync<F extends SyncFunction>(): Synchronous<F>;
  /** Runs on the main (UI) thread. */
  main: QueuedDeclaration;
  /** Runs on the module's own serial background thread, in call order. */
  background: QueuedDeclaration;
}

Membros 3

NomeTipoObrigatórioDescrição
sync<F extends SyncFunction>() => Synchronous<F>SimRuns on the JS thread and returns its value. Keep it fast, thread-safe and off UIKit and Views.
mainQueuedDeclarationSimRuns on the main (UI) thread.
backgroundQueuedDeclarationSimRuns on the module's own serial background thread, in call order.
sync — assinaturas de método

Assinaturas

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

Parâmetros de tipo

NomeRestriçãoPredefinição
FSyncFunction—

Parâmetros

Sem parâmetros.

Devolve

Synchronous<F>

main — assinaturas de método

Assinaturas

ts
<F extends AsyncFunction>(): F

Parâmetros de tipo

NomeRestriçãoPredefinição
FAsyncFunction—

Parâmetros

Sem parâmetros.

Devolve

F

background — assinaturas de método

Assinaturas

ts
<F extends AsyncFunction>(): F

Parâmetros de tipo

NomeRestriçãoPredefinição
FAsyncFunction—

Parâmetros

Sem parâmetros.

Devolve

F

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.