import type { ViewProps, HostComponent, HostInstance } from 'react-native'; import type { BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes'; import type { WithDefault } from 'react-native/Libraries/Types/CodegenTypesNamespace'; export interface MenuItem { identifier: string; title: string; subtitle?: string; destructive?: boolean; iosSymbol?: string; /** * What a screen reader announces for this item, replacing the visible text. * Defaults to `title`, followed by `subtitle` when present. */ accessibilityLabel?: string; /** * Extra guidance announced after the label, e.g. "Permanently deletes the item". * Destructive items already announce as destructive without this. */ accessibilityHint?: string; /** * Test identifier for this item, for E2E frameworks that drive the UI through the * accessibility layer (Detox, Appium, XCUITest). * * Defaults to `identifier`, so every item is already addressable without setting this — * use it only to decouple the test handle from your business identifier. * * Not supported on Android with `androidDisplayMode="tooltip"`: those rows are * `MenuItem`s rather than views, and have nowhere to carry a resource id. */ testID?: string; } export interface MenuSelectEvent { identifier: string; title: string; } export interface NativeProps extends ViewProps { title?: string; themeVariant?: WithDefault<'light' | 'dark' | 'system', 'system'>; color?: string; checkedColor?: string; uncheckedColor?: string; menuItems?: ReadonlyArray; selectedIdentifier?: string; disabled?: boolean; androidDisplayMode?: WithDefault<'dialog' | 'tooltip', 'dialog'>; onMenuSelect?: BubblingEventHandler; /** * Expands the trigger's *hit area* to at least 44pt (iOS) / 48dp (Android) when the * rendered view is smaller, satisfying WCAG 2.2 target-size guidance. * * This only affects touch and accessibility hit-testing — it never changes layout, so * nothing moves on screen. Set to `false` to opt out. */ enforceMinimumTouchTarget?: WithDefault; /** * Announced after the trigger's label to explain what activating it does. * Defaults to a platform-appropriate phrase such as "Opens a menu". */ menuAccessibilityHint?: string; } type MenuViewRef = HostInstance; type ComponentType = HostComponent; /** * Two incompatible requirements meet here, so read before changing: * * - React Native's codegen parser checks this annotation *syntactically* and rejects * anything that is not literally `React.ElementRef<>` or `React.ComponentRef<>`. Using * an alias makes codegen fail with "The first argument of method open must be of type * React.ElementRef<> or React.ComponentRef<>" and emit an EMPTY props struct — every * prop silently disappears from the native side. * - TypeScript resolves `React.ComponentRef>` to `never` under the * `react-native-strict-api` condition this project compiles with (see tsconfig.json), * where `HostComponent` is a function type. That makes every command call a type error. * * So: keep the codegen-required syntax here, verbatim. Do NOT add an `as` cast to the * export either — that wraps the call in an expression codegen cannot parse, and commands * stop being generated (props still are, so the breakage is easy to miss). Callers * re-narrow the ref type instead; see `MenuViewRef` use in ./index.tsx. */ interface NativeCommands { open: (viewRef: React.ComponentRef) => void; close: (viewRef: React.ComponentRef) => void; } export declare const Commands: NativeCommands; declare const _default: import("react-native/types_generated/Libraries/Utilities/codegenNativeComponent").NativeComponentType; export default _default; export type { NativeProps as MenuViewProps, MenuViewRef }; //# sourceMappingURL=MenuViewNativeComponent.d.ts.map