Utilisation

Keep a presentation visible

Ce type est utilisé par keepAwake

tsx
import { Video, keepAwake, app } from 'kuito';

function Player() {
  keepAwake(); // held while Player is mounted
  return <Video src={{ uri: 'https://example.com/movie.mp4' }} flex={1} />;
}

// For the app's life, outside any component; call the result to let go.
const release = keepAwake({ scope: app });
release();

Déclaration du type

ts
export interface ScopeOptions {
  scope?: typeof appModule;
}

Membres 1

NomTypeRequisDescription
scopetypeof appModuleNon—
scope — champs imbriqués

scope champs

NomTypeRequisDescription
watch<E extends keyof Events>(event: E, listener: Events[E]) => EventSubscriptionOuiCalls listener when the system warns that memory runs low. In a component it stops when the component unmounts; elsewhere the returned subscription stops it.
stateReadonlySignal<State>OuiWhether the app is in the foreground. Watched, it follows the platform; starting to observe reports the state the platform starts from, which catches a change made in between.
Par défaut: AppStateModule.state
openSettings() => Promise<void>OuiOpens this app's page in the system Settings.
Par défaut: AppStateModule.openSettings
watch — signatures de méthode

Signatures

ts
<E extends keyof Events>(event: E, listener: Events[E]): EventSubscription

Paramètres de type

NomContraintePar défaut
E"memoryWarning"—

Paramètres

NomTypeRequisDescription
eventEOui—
listenerEvents[E]Oui—

Retourne

EventSubscription

openSettings — signatures de méthode

Signatures

ts
(): Promise<void>

Paramètres

Aucun paramètre.

Retourne

Promise<void>

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.