import { CameraPosition } from '../camerahelpers/CameraPosition'; import { FrameSourceState } from '../frame/FrameSourceState'; import { SizeJSON } from './Size'; export interface DidChangeSizeEventPayload { viewId: number; size: SizeJSON; orientation: string; } export interface DidChangeStatusEventPayload { status: string; } export interface DidChangeStateEventPayload { state: string; } export interface EventPayload { name: string; data: string; viewId?: number; modeId?: number; } /** * Symbol returned by parseIfShouldHandle when an event should be skipped * (filtered out based on viewId/modeId mismatch). */ export declare const SKIP: unique symbol; export declare class EventDataParser { private static parse; /** * Check if an event should be handled based on viewId/modeId filtering. * Used by React Native new architecture for pre-parse filtering to avoid * unnecessary JSON parsing of events not intended for this consumer. * * @param ev The event payload to check * @param ids Object containing optional viewId and/or modeId to match against * @returns true if the event should be handled, false if it should be skipped */ static shouldHandle(ev: EventPayload, ids: { viewId?: number; modeId?: number; }): boolean; /** * Parse event data if it should be handled, otherwise return SKIP. * * Filtering is performed in two stages: * 1. Pre-parse: if the event wrapper carries viewId/modeId, skip parsing entirely on mismatch. * 2. Post-parse: verify the parsed payload's viewId/modeId matches the expected ids. * * @param ev The event payload to check and parse * @param ids Object containing optional viewId and/or modeId to match against * @returns SKIP if filtered out, null if parse failed, or parsed data */ static parseIfShouldHandle(ev: EventPayload, ids: { viewId?: number; modeId?: number; }): T | null | typeof SKIP; } export interface NativeCallResult { data: string; } export interface FrameSourceDidChangeStateEventPayload { state: FrameSourceState; cameraPosition: CameraPosition; }