fn
Declares a module function and the thread it runs on: fn.sync<() => number>().
Utilização
Connect a reporting service
// 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' },
});Propriedades e métodos 3
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
sync | <F extends SyncFunction>() => Synchronous<F> | Sim | Runs on the JS thread and returns its value. Keep it fast, thread-safe and off UIKit and Views. |
main | QueuedDeclaration | Sim | Runs on the main (UI) thread. |
background | QueuedDeclaration | Sim | Runs on the module's own serial background thread, in call order. |
sync — assinaturas de método
Assinaturas
<F extends SyncFunction>(): Synchronous<F>Parâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
F | SyncFunction | — |
Parâmetros
Sem parâmetros.
Devolve
Synchronous<F>
main — assinaturas de método
Assinaturas
<F extends AsyncFunction>(): FParâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
F | AsyncFunction | — |
Parâmetros
Sem parâmetros.
Devolve
F
background — assinaturas de método
Assinaturas
<F extends AsyncFunction>(): FParâmetros de tipo
| Nome | Restrição | Predefinição |
|---|---|---|
F | AsyncFunction | — |
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.