QueuedDeclaration
Declares a native module function that runs on the main thread or the module's background thread, returning a value or settling through a callback.
Utilização
Connect a reporting service
Este tipo é usado por fn
// 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 QueuedDeclaration {
/** Runs on its thread and returns its result; JavaScript gets a Promise of it. */
<F extends AsyncFunction>(): F;
/** Starts on its thread and settles a `KuitoPromise` once, from any thread: a callback API. */
callback<F extends AsyncFunction>(): F;
}Membros 1
| Nome | Tipo | Obrigatório | Descrição |
|---|---|---|---|
callback | <F extends AsyncFunction>() => F | Sim | Starts on its thread and settles a KuitoPromise once, from any thread: a callback API. |
callback — 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.