NativeViewHandle
A module view's element, as its ref holds it: the element and the view's functions.
Verwendung
Overlay a now-playing caption
Dieser Typ wird verwendet von Blur
import { Blur, Image, Text, VStack } from 'kuito';
export default function NowPlaying() {
return (
<VStack flex={1}>
<Image
src="https://example.com/cover.jpg"
position="absolute"
top={0}
left={0}
right={0}
bottom={0}
/>
<Blur material="thin" position="absolute" bottom={0} left={0} right={0} padding={16}>
<Text>Now playing</Text>
</Blur>
</VStack>
);
}Typdeklaration
export type NativeViewHandle<M = Record<never, never>> = ElementHandle & M;Mitglieder 9
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
idschreibgeschützt | string | Ja | — |
parentschreibgeschützt | ElementHandle | Ja | — |
childrenschreibgeschützt | ElementHandle[] | Ja | — |
focus | () => void | Ja | — |
blur | () => void | Ja | — |
setProperty | <K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null) => void | Ja | Sets a native prop on the view now, until its binding writes it again. |
addEventListener | (type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;}) => void | Ja | — |
removeEventListener | (type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean;}) => void | Ja | — |
dispatchEvent | (event: { type: string; bubbles?: boolean; cancelable?: boolean;}) => boolean | Ja | Sends an event through the tree, capture to bubble, as a native one travels:
a KuitoCustomEvent, or any object with a type. False when a listener
called preventDefault() on a cancelable event. |
focus — Methodensignaturen
Signaturen
(): voidParameter
Keine Parameter.
Rückgabe
void
blur — Methodensignaturen
Signaturen
(): voidParameter
Keine Parameter.
Rückgabe
void
setProperty — Methodensignaturen
Signaturen
<K extends keyof ElementProperties>(key: K, value: ElementProperties[K] | null): voidTypparameter
| Name | Einschränkung | Standard |
|---|---|---|
K | keyof ElementProperties | — |
Parameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
key | K | Ja | — |
value | ElementProperties[K] | Ja | — |
Rückgabe
void
addEventListener — Methodensignaturen
Signaturen
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal; }): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | string | Ja | — |
fn | (e: KuitoNativeEvent) => void | Ja | — |
options | boolean | { capture?: boolean; once?: boolean; signal?: AbortSignal;} | Nein | — |
Rückgabe
void
removeEventListener — Methodensignaturen
Signaturen
(type: string, fn: (e: KuitoNativeEvent) => void, options?: boolean | { capture?: boolean; }): voidParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | string | Ja | — |
fn | (e: KuitoNativeEvent) => void | Ja | — |
options | boolean | { capture?: boolean;} | Nein | — |
Rückgabe
void
dispatchEvent — Methodensignaturen
Signaturen
(event: { type: string; bubbles?: boolean; cancelable?: boolean; }): booleanParameter
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
event | { type: string; bubbles?: boolean; cancelable?: boolean;} | Ja | — |
Rückgabe
boolean
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.