import type {ForwardRefExoticComponent, RefAttributes} from 'react'; import type {ViewProps} from 'react-native'; import type {InsiderAppFramesError} from './InsiderAppFramesError'; import type {InsiderAppFrameStatusType} from './InsiderAppFrameStatus'; export interface InsiderAppFrameProps extends ViewProps { /** The placement whose content this frame renders. */ placementId: string; /** Called on every status transition with the new status and the one it replaced. */ onStatusChange?: ( status: InsiderAppFrameStatusType, previousStatus: InsiderAppFrameStatusType, ) => void; /** Called when resolving, downloading or rendering the content fails. */ onLoadError?: (error: InsiderAppFramesError) => void; /** * Called when the content reports a new height, in dp. The frame applies this height itself * unless `style.height` is set, which always wins. */ onHeightChange?: (height: number) => void; /** Called when the content asks to be dismissed. A request, not a command. */ onDismissRequest?: () => void; /** Called with the payload of a custom action defined in the content. */ onAction?: (data: Record) => void; } /** Imperative access to a frame's current state, through a ref. */ export interface InsiderAppFrameHandle { /** The frame's current status; `DETACHED` until the first transition. */ getStatus(): InsiderAppFrameStatusType; /** The error behind the current status; non-null only while the status is an `ERROR_*` value. */ getError(): InsiderAppFramesError | null; } /** * Renders the content of an App Frames placement. * * On iOS, requires the New Architecture and React Native 0.77 or later. Without the New * Architecture the frame renders nothing; below 0.77 it may not register. Either case logs a * one-time warning in development. */ declare const InsiderAppFrame: ForwardRefExoticComponent< InsiderAppFrameProps & RefAttributes >; export default InsiderAppFrame;