NativeViewEvent
An event a native view emits, with its payload's fields.
Verwendung
Type an event emitted by a module view.
// Type an event emitted by a module view.
import { defineModule, view, type NativeViewEvent } from 'kuito';
// modules/rating/rating.ts: a native star rating view and the event it sends.
export type RatingEvent = NativeViewEvent<'rate', { stars: number }>;
export type RatingProps = {
stars?: number;
onRate?: (event: RatingEvent) => void;
};
export default defineModule('Rating', {
view: view<RatingProps>({ events: ['rate'] }),
ios: { class: 'RatingModule' },
android: { class: 'com.example.myapp.modules.rating.RatingModule' },
});Typdeklaration
export type NativeViewEvent<
Type extends string,
Payload = Record<never, never>,
> = KuitoEvent<Type> & Payload;Mitglieder 3
| Name | Typ | Erforderlich | Beschreibung |
|---|---|---|---|
type | Type | Ja | — |
target | unknown | Ja | — |
isTrusted | boolean | Ja | — |
Generiert aus den öffentlichen TypeScript-Deklarationen: Signaturen, Props und Standardwerte stammen aus der geprüften Quelle, Beschreibungen aus deren JSDoc. Kein Standardwert ist erfunden.