Utilização

Embed a hosted help page

Este tipo é usado por WebView

tsx
import { WebView } from 'kuito';

export default function Help() {
  return <WebView flex={1} src="https://example.com/help" />;
}

Declaração do tipo

ts
export type WebViewProps = {
  /** The page to load. Set `src` or `html`, not both. */
  src?: WebViewSource;
  /** Inline HTML, resolved against `baseUrl` when given. */
  html?: string | { html: string; baseUrl?: string };
  /**
   * Origins the WebView navigates to, as wildcard patterns (`https://*`).
   * The main frame's navigations elsewhere open through Linking instead.
   * `["http://*", "https://*"]` by default.
   */
  allowedOrigins?: string[];
  /** Runs in the main frame each time a document finishes loading. */
  injectedJavaScript?: string;
  /** True by default. */
  javaScriptEnabled?: boolean;
  /** iOS only: swipe from an edge to go back or forward. False by default. */
  swipeNavigation?: boolean;
  /** Replaces the platform's user agent. */
  userAgent?: string;
  onLoadStart?: (event: WebViewNavigationEvent) => void;
  /** The page loaded. */
  onLoad?: (event: WebViewNavigationEvent) => void;
  /** The load ended, loaded or failed. */
  onLoadEnd?: (event: WebViewNavigationEvent) => void;
  onError?: (event: WebViewErrorEvent) => void;
  /** The URL, title, loading state or history changed. */
  onNavigate?: (event: WebViewNavigationEvent) => void;
  onMessage?: (event: WebViewMessageEvent) => void;
};

Membros 13

NomeTipoObrigatórioDescrição
srcWebViewSourceNãoThe page to load. Set src or html, not both.
htmlstring | { html: string; baseUrl?: string;}NãoInline HTML, resolved against baseUrl when given.
allowedOriginsstring[]NãoOrigins the WebView navigates to, as wildcard patterns (https://*). The main frame's navigations elsewhere open through Linking instead. ["http://*", "https://*"] by default.
injectedJavaScriptstringNãoRuns in the main frame each time a document finishes loading.
javaScriptEnabledbooleanNãoTrue by default.
swipeNavigationbooleanNãoiOS only: swipe from an edge to go back or forward. False by default.
userAgentstringNãoReplaces the platform's user agent.
onLoadStart(event: WebViewNavigationEvent) => voidNão—
onLoad(event: WebViewNavigationEvent) => voidNãoThe page loaded.
onLoadEnd(event: WebViewNavigationEvent) => voidNãoThe load ended, loaded or failed.
onError(event: WebViewErrorEvent) => voidNão—
onNavigate(event: WebViewNavigationEvent) => voidNãoThe URL, title, loading state or history changed.
onMessage(event: WebViewMessageEvent) => voidNão—
onLoadStart — assinaturas de método

Assinaturas

ts
(event: WebViewNavigationEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewNavigationEventSim—

Devolve

void

onLoad — assinaturas de método

Assinaturas

ts
(event: WebViewNavigationEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewNavigationEventSim—

Devolve

void

onLoadEnd — assinaturas de método

Assinaturas

ts
(event: WebViewNavigationEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewNavigationEventSim—

Devolve

void

onError — assinaturas de método

Assinaturas

ts
(event: WebViewErrorEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewErrorEventSim—

Devolve

void

onNavigate — assinaturas de método

Assinaturas

ts
(event: WebViewNavigationEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewNavigationEventSim—

Devolve

void

onMessage — assinaturas de método

Assinaturas

ts
(event: WebViewMessageEvent): void

Parâmetros

NomeTipoObrigatórioDescrição
eventWebViewMessageEventSim—

Devolve

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.