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.
Verwendung
Connect a reporting service
Dieser Typ wird verwendet von 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' },
});Typdeklaration
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;
}Mitglieder 1
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
callback | <F extends AsyncFunction>() => F | Ja | Starts on its thread and settles a KuitoPromise once, from any thread: a callback API. |
callback — Methodensignaturen
Signaturen
<F extends AsyncFunction>(): FTypparameter
| Name | Einschränkung | Standard |
|---|---|---|
F | AsyncFunction | — |
Parameter
Keine Parameter.
Rückgabe
F
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.