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.
Utilisation
Connect a reporting service
Ce type est utilisé par 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' },
});Déclaration du type
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;
}Membres 1
| Nom | Type | Requis | Description |
|---|---|---|---|
callback | <F extends AsyncFunction>() => F | Oui | Starts on its thread and settles a KuitoPromise once, from any thread: a callback API. |
callback — signatures de méthode
Signatures
<F extends AsyncFunction>(): FParamètres de type
| Nom | Contrainte | Par défaut |
|---|---|---|
F | AsyncFunction | — |
Paramètres
Aucun paramètre.
Retourne
F
Généré depuis les déclarations TypeScript publiques : signatures, props et valeurs par défaut viennent de la source vérifiée, les descriptions de sa JSDoc. Aucune valeur par défaut n'est inventée.