import type { IScreenChangePayload } from '../NativeDxaReactNative'; /** * Payload sent to the native module to report a screen change event. */ export class ScreenChangePayload implements IScreenChangePayload { /** * @param {ScreenHierarchyElement[]} screenHierarchy - Hierarchy of active screens that make up the UI. * @param {ScreenChangeType} changeType - Type of the screen change. * @param {ScreenDetectionType} detectionType - Method of detecting the screen change. */ constructor( public screenHierarchy: ScreenHierarchyElement[], public changeType: ScreenChangeType, public detectionType: ScreenDetectionType ) {} } /** * Represents a screen element in the hierarchy. */ export class ScreenHierarchyElement { /** * @param {string} screenName - The name of the screen. * @param {string} [screenType='screen'] - The type of the screen (default is 'screen'). */ constructor( public screenName: string, public screenType: string = 'screen' ) {} } /** * Type of the screen change (allowed values). */ export const SCREEN_CHANGE_TYPE_VALUES = ['appear', 'disappear'] as const; /** * Type of the screen change. */ export type ScreenChangeType = (typeof SCREEN_CHANGE_TYPE_VALUES)[number]; /** * Method of detecting the screen change (allowed values). */ export const SCREEN_DETECTION_TYPE_VALUES = ['auto', 'manual'] as const; /** * Method of detecting the screen change. */ export type ScreenDetectionType = (typeof SCREEN_DETECTION_TYPE_VALUES)[number];