Utilização

Keep a presentation visible

Este tipo é usado por 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();

Declaração do tipo

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

Membros 1

NomeTipoObrigatórioDescrição
scopetypeof appModuleNão—
scope — campos aninhados

scope campos

NomeTipoObrigatórioDescrição
watch<E extends keyof Events>(event: E, listener: Events[E]) => EventSubscriptionSimCalls 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>SimWhether 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.
Predefinição: AppStateModule.state
openSettings() => Promise<void>SimOpens this app's page in the system Settings.
Predefinição: AppStateModule.openSettings
watch — assinaturas de método

Assinaturas

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

Parâmetros de tipo

NomeRestriçãoPredefinição
E"memoryWarning"—

Parâmetros

NomeTipoObrigatórioDescrição
eventESim—
listenerEvents[E]Sim—

Devolve

EventSubscription

openSettings — assinaturas de método

Assinaturas

ts
(): Promise<void>

Parâmetros

Sem parâmetros.

Devolve

Promise<void>

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.