Verwendung

Keep a presentation visible

Dieser Typ wird verwendet von 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();

Typdeklaration

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

Mitglieder 1

NameTypErforderlichBeschreibung
scopetypeof appModuleNein—
scope — verschachtelte Felder

scope Felder

NameTypErforderlichBeschreibung
watch<E extends keyof Events>(event: E, listener: Events[E]) => EventSubscriptionJaCalls 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>JaWhether 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.
Standard: AppStateModule.state
openSettings() => Promise<void>JaOpens this app's page in the system Settings.
Standard: AppStateModule.openSettings
watch — Methodensignaturen

Signaturen

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

Typparameter

NameEinschränkungStandard
E"memoryWarning"—

Parameter

NameTypErforderlichBeschreibung
eventEJa—
listenerEvents[E]Ja—

Rückgabe

EventSubscription

openSettings — Methodensignaturen

Signaturen

ts
(): Promise<void>

Parameter

Keine Parameter.

Rückgabe

Promise<void>

Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.