import type { IAccessibilityProps, IAriaProps, IPressState, IRectOffset, IResponderProps, ITextNativeOnlyProps } from '@symbiote-native/components'; import type { ISymbioteEvent, IStyleProp, ITextStyle, IViewStyle } from '@symbiote-native/engine'; type IEventHandler = (event: ISymbioteEvent) => void; /** * What `[style]` carries on a tag: Angular's own styling binding, decomposed key by key into * `Renderer2.setStyle` exactly as on a DOM element. A style OBJECT or a CSS string - never an array * or a function, which that engine cannot represent. Those are `[styleProp]`. */ export type IAngularStyleBinding = TStyle | string | null | undefined; /** RN's full StyleProp, press-state callback included: the `[styleProp]` binding. */ export type IElementStyleProp = IStyleProp | ((state: IPressState) => IStyleProp); export type IElementProps = IAccessibilityProps & IAriaProps & IResponderProps & { /** RN's modern W3C-named alias for `nativeID`; the renderer folds it (`PROP_ALIASES`). */ id?: string; pointerEvents?: 'auto' | 'none' | 'box-none' | 'box-only'; hitSlop?: IRectOffset | number; focusable?: boolean; collapsable?: boolean; removeClippedSubviews?: boolean; renderToHardwareTextureAndroid?: boolean; shouldRasterizeIOS?: boolean; needsOffscreenAlphaCompositing?: boolean; style?: IAngularStyleBinding; /** * An RN StyleProp as ONE property binding: arrays, falsy entries, and the press-state callback. * The callback is in the union because a subclass cannot widen an inherited property and * ``/`` are the tags that take one; on every other tag the engine resolves * it at `pressed: false`. */ styleProp?: IElementStyleProp; onPress?: IEventHandler; onPressIn?: IEventHandler; onPressOut?: IEventHandler; onPressMove?: IEventHandler; onLongPress?: IEventHandler; onLayout?: IEventHandler; onFocus?: IEventHandler; onBlur?: IEventHandler; }; /** Text's own surface on top of the shared one. `onTextLayout` is an event, so it is not here. */ export type ITextElementProps = ITextNativeOnlyProps & { /** Narrows the shared `style` so `fontSize` / `fontWeight` type-check on a ``. */ style?: IAngularStyleBinding; styleProp?: IStyleProp; numberOfLines?: number; ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip'; selectable?: boolean; adjustsFontSizeToFit?: boolean; minimumFontScale?: number; allowFontScaling?: boolean; maxFontSizeMultiplier?: number | null; selectionColor?: string; disabled?: boolean; }; /** The sticky-header wrapper RN builds in JS (ScrollViewStickyHeader.js). */ export type IStickyHeaderElementProps = { inverted?: boolean; nextHeaderLayoutY?: number | null; scrollAnimatedValue?: unknown; scrollViewHeight?: number | null; }; export {};