/** * GENERATED by `bun run generate` from react-native 0.88.0. Do not edit. * * 191 declarations reached from 25 roots, plus * the AnimatedNode handle from its declaring module. * Everything Tamagui uses from react-native's types on web lives here, so no * non-`.native` file needs react-native installed. To refresh, bump the repo * root's react-native override and re-run `bun run generate` in this package. */ // react-native declares mixin bases as `interface X { new (): Y }`, which is // the shape this rule objects to. Copied verbatim on purpose. /* oxlint-disable typescript/no-misused-new */ import type * as React from 'react' export type AccessibilityActionEvent = NativeSyntheticEvent< Readonly<{ actionName: string }> > export type AccessibilityActionInfo = Readonly<{ name: AccessibilityActionName | string label?: string | undefined }> export type AccessibilityActionName = /** * Generated when a screen reader user double taps the component. */ | 'activate' /** * Generated when a screen reader user increments an adjustable component. */ | 'increment' /** * Generated when a screen reader user decrements an adjustable component. */ | 'decrement' /** * Generated when a TalkBack user places accessibility focus on the component and double taps and holds one finger on the screen. * @platform android */ | 'longpress' /** * Generated when a VoiceOver user places focus on or inside the component and double taps with two fingers. * @platform ios * */ | 'magicTap' /** * Generated when a VoiceOver user places focus on or inside the component and performs a two finger scrub gesture (left, right, left). * @platform ios * */ | 'escape' export interface AccessibilityProps extends AccessibilityPropsAndroid, AccessibilityPropsIOS { /** * When true, indicates that the view is an accessibility element. * By default, all the touchable elements are accessible. */ accessible?: boolean | undefined /** * Provides an array of custom actions available for accessibility. */ accessibilityActions?: ReadonlyArray | undefined /** * Overrides the text that's read by the screen reader when the user interacts with the element. By default, the * label is constructed by traversing all the children and accumulating all the Text nodes separated by space. */ accessibilityLabel?: string | undefined /** * Alias for accessibilityLabel https://reactnative.dev/docs/view#accessibilitylabel * https://github.com/facebook/react-native/issues/34424 */ 'aria-label'?: string | undefined /** * Accessibility Role tells a person using either VoiceOver on iOS or TalkBack on Android the type of element that is focused on. */ accessibilityRole?: AccessibilityRole | undefined /** * Accessibility State tells a person using either VoiceOver on iOS or TalkBack on Android the state of the element currently focused on. */ accessibilityState?: AccessibilityState | undefined /** * alias for accessibilityState * * see https://reactnative.dev/docs/accessibility#accessibilitystate */ 'aria-busy'?: boolean | undefined 'aria-checked'?: boolean | 'mixed' | undefined 'aria-disabled'?: boolean | undefined 'aria-expanded'?: boolean | undefined 'aria-selected'?: boolean | undefined /** * An accessibility hint helps users understand what will happen when they perform an action on the accessibility element when that result is not obvious from the accessibility label. */ accessibilityHint?: string | undefined /** * Represents the current value of a component. It can be a textual description of a component's value, or for range-based components, such as sliders and progress bars, * it contains range information (minimum, current, and maximum). */ accessibilityValue?: AccessibilityValue | undefined 'aria-valuemax'?: AccessibilityValue['max'] | undefined 'aria-valuemin'?: AccessibilityValue['min'] | undefined 'aria-valuenow'?: AccessibilityValue['now'] | undefined 'aria-valuetext'?: AccessibilityValue['text'] | undefined /** * When `accessible` is true, the system will try to invoke this function when the user performs an accessibility custom action. */ onAccessibilityAction?: ((event: AccessibilityActionEvent) => void) | undefined /** * [Android] Controlling if a view fires accessibility events and if it is reported to accessibility services. */ importantForAccessibility?: ('auto' | 'yes' | 'no' | 'no-hide-descendants') | undefined /** * A value indicating whether the accessibility elements contained within * this accessibility element are hidden. */ 'aria-hidden'?: boolean | undefined 'aria-modal'?: boolean | undefined /** * Indicates to accessibility services to treat UI component like a specific role. */ role?: Role | undefined } export interface AccessibilityPropsAndroid { /** * Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props, * the text is read aloud. The value should should match the nativeID of the related element. * * @platform android */ accessibilityLabelledBy?: string | string[] | undefined /** * Identifies the element that labels the element it is applied to. When the assistive technology focuses on the component with this props, * the text is read aloud. The value should should match the nativeID of the related element. * * @platform android */ 'aria-labelledby'?: string | undefined /** * Indicates to accessibility services whether the user should be notified * when this view changes. Works for Android API >= 19 only. * * @platform android * * See https://reactnative.dev/docs/view#accessibilityliveregion */ accessibilityLiveRegion?: 'none' | 'polite' | 'assertive' | undefined /** * Indicates to accessibility services whether the user should be notified * when this view changes. Works for Android API >= 19 only. * * @platform android * * See https://reactnative.dev/docs/view#accessibilityliveregion */ 'aria-live'?: ('polite' | 'assertive' | 'off') | undefined /** * Controls how view is important for accessibility which is if it fires accessibility events * and if it is reported to accessibility services that query the screen. * Works for Android only. See http://developer.android.com/reference/android/R.attr.html#importantForAccessibility for references. * * Possible values: * 'auto' - The system determines whether the view is important for accessibility - default (recommended). * 'yes' - The view is important for accessibility. * 'no' - The view is not important for accessibility. * 'no-hide-descendants' - The view is not important for accessibility, nor are any of its descendant views. * * @platform android */ importantForAccessibility?: 'auto' | 'yes' | 'no' | 'no-hide-descendants' | undefined /** * Enables the view to be screen reader focusable, not keyboard focusable. * * @platform android */ screenReaderFocusable?: boolean | undefined } export interface AccessibilityPropsIOS { /** * A Boolean value indicating whether the accessibility elements contained within this accessibility element * are hidden to the screen reader. * @platform ios */ accessibilityElementsHidden?: boolean | undefined /** * A Boolean value indicating whether VoiceOver should ignore the elements within views that are siblings of the receiver. * @platform ios */ accessibilityViewIsModal?: boolean | undefined /** * When accessible is true, the system will invoke this function when the user performs the escape gesture (scrub with two fingers). * @platform ios */ onAccessibilityEscape?: (() => void) | undefined /** * When `accessible` is true, the system will try to invoke this function when the user performs accessibility tap gesture. * @platform ios */ onAccessibilityTap?: (() => void) | undefined /** * When accessible is true, the system will invoke this function when the user performs the magic tap gesture. * @platform ios */ onMagicTap?: (() => void) | undefined /** * https://reactnative.dev/docs/accessibility#accessibilityignoresinvertcolorsios * @platform ios */ accessibilityIgnoresInvertColors?: boolean | undefined /** * By using the accessibilityLanguage property, the screen reader will understand which language to use while reading the element's label, value and hint. The provided string value must follow the BCP 47 specification (https://www.rfc-editor.org/info/bcp47). * https://reactnative.dev/docs/accessibility#accessibilitylanguage-ios * @platform ios */ accessibilityLanguage?: string | undefined /** * A Boolean value that indicates whether or not to show the item in the large content viewer. * Available on iOS 13.0+ * https://reactnative.dev/docs/accessibility#accessibilityshowslargecontentviewer * @platform ios */ accessibilityShowsLargeContentViewer?: boolean | undefined /** * When `accessibilityShowsLargeContentViewer` is set, this string will be used as title for the large content viewer. * https://reactnative.dev/docs/accessibility#accessibilitylargecontenttitle * @platform ios */ accessibilityLargeContentTitle?: string | undefined /** * Blocks the user from interacting with the component through keyboard while still allowing * screen reader to interact with it if this View is still accessible. * * @platform ios */ accessibilityRespondsToUserInteraction?: boolean | undefined } export type AccessibilityRole = | 'none' | 'button' | 'dropdownlist' | 'togglebutton' | 'link' | 'search' | 'image' | 'keyboardkey' | 'text' | 'adjustable' | 'imagebutton' | 'header' | 'summary' | 'alert' | 'checkbox' | 'combobox' | 'menu' | 'menubar' | 'menuitem' | 'progressbar' | 'radio' | 'radiogroup' | 'scrollbar' | 'spinbutton' | 'switch' | 'tab' | 'tabbar' | 'tablist' | 'timer' | 'list' | 'toolbar' | 'grid' | 'pager' | 'scrollview' | 'horizontalscrollview' | 'viewgroup' | 'webview' | 'drawerlayout' | 'slidingdrawer' | 'iconmenu' export interface AccessibilityState { /** * When true, informs accessible tools if the element is disabled */ disabled?: boolean | undefined /** * When true, informs accessible tools if the element is selected */ selected?: boolean | undefined /** * For items like Checkboxes and Toggle switches, reports their state to accessible tools */ checked?: boolean | 'mixed' | undefined /** * When present, informs accessible tools if the element is busy */ busy?: boolean | undefined /** * When present, informs accessible tools the element is expanded or collapsed */ expanded?: boolean | undefined } export interface AccessibilityValue { /** * The minimum value of this component's range. (should be an integer) */ min?: number | undefined /** * The maximum value of this component's range. (should be an integer) */ max?: number | undefined /** * The current value of this component's range. (should be an integer) */ now?: number | undefined /** * A textual description of this component's value. (will override minimum, current, and maximum if set) */ text?: string | undefined } export type AnimatableNumericValue = number | AnimatedNode export type AnimatableStringValue = string | AnimatedNode export declare class AnimatedNode { /** * Adds an asynchronous listener to the value so you can observe updates from * animations. This is useful because there is no way to * synchronously read the value because it might be driven natively. * * See https://reactnative.dev/docs/animatedvalue.html#addlistener */ addListener(callback: (value: any) => any): string /** * Unregister a listener. The `id` param shall match the identifier * previously returned by `addListener()`. * * See https://reactnative.dev/docs/animatedvalue.html#removelistener */ removeListener(id: string): void /** * Remove all registered listeners. * * See https://reactnative.dev/docs/animatedvalue.html#removealllisteners */ removeAllListeners(): void hasListeners(): boolean } export type BackgroundImageValue = LinearGradientValue | RadialGradientValue export type BackgroundPositionValue = | { top: number | string left: number | string } | { top: number | string right: number | string } | { bottom: number | string left: number | string } | { bottom: number | string right: number | string } export type BackgroundRepeatKeyword = 'repeat' | 'space' | 'round' | 'no-repeat' export type BackgroundRepeatValue = { x: BackgroundRepeatKeyword y: BackgroundRepeatKeyword } export type BackgroundSizeValue = { x: string | number y: string | number } export type BlendMode = | 'normal' | 'multiply' | 'screen' | 'overlay' | 'darken' | 'lighten' | 'color-dodge' | 'color-burn' | 'hard-light' | 'soft-light' | 'difference' | 'exclusion' | 'hue' | 'saturation' | 'color' | 'luminosity' | 'plus-lighter' export type BlurEvent = NativeSyntheticEvent export type BoxShadowValue = { offsetX: number | string offsetY: number | string color?: ColorValue | undefined blurRadius?: string | number | undefined spreadDistance?: number | string | undefined inset?: boolean | undefined } export type ColorValue = string | OpaqueColorValue export type Constructor = new (...args: any[]) => T export type CursorValue = 'auto' | 'pointer' export type DataDetectorTypes = | 'phoneNumber' | 'link' | 'address' | 'calendarEvent' | 'trackingNumber' | 'flightNumber' | 'lookupSuggestion' | 'none' | 'all' export type DimensionValue = number | 'auto' | `${number}%` | AnimatedNode | null export interface DocumentSelectionState extends EventEmitter { new (anchor: number, focus: number): DocumentSelectionState /** * Apply an update to the state. If either offset value has changed, * set the values and emit the `change` event. Otherwise no-op. * */ update(anchor: number, focus: number): void /** * Given a max text length, constrain our selection offsets to ensure * that the selection remains strictly within the text range. * */ constrainLength(maxLength: number): void focus(): void blur(): void hasFocus(): boolean isCollapsed(): boolean isBackward(): boolean getAnchorOffset(): number getFocusOffset(): number getStartOffset(): number getEndOffset(): number overlaps(start: number, end: number): boolean } export type DropShadowValue = { offsetX: number | string offsetY: number | string standardDeviation?: number | string | undefined color?: ColorValue | number | undefined } export interface EmitterSubscription extends EventSubscription { emitter: EventEmitter listener: () => any context: any /** * @param emitter - The event emitter that registered this * subscription * @param subscriber - The subscriber that controls * this subscription * @param listener - Function to invoke when the specified event is * emitted * @param context - Optional context object to use when invoking the * listener */ new ( emitter: EventEmitter, subscriber: EventSubscriptionVendor, listener: () => any, context: any ): EmitterSubscription /** * Removes this subscription from the emitter that registered it. * Note: we're overriding the `remove()` method of EventSubscription here * but deliberately not calling `super.remove()` as the responsibility * for removing the subscription lies with the EventEmitter. */ remove(): void } export type EnterKeyHintType = 'done' | 'go' | 'next' | 'search' | 'send' export type EnterKeyHintTypeAndroid = 'previous' export type EnterKeyHintTypeIOS = 'enter' export type EnterKeyHintTypeOptions = | EnterKeyHintType | EnterKeyHintTypeAndroid | EnterKeyHintTypeIOS export declare class EventEmitter { /** * * @param subscriber - Optional subscriber instance * to use. If omitted, a new subscriber will be created for the emitter. */ constructor(subscriber?: EventSubscriptionVendor | null) /** * Adds a listener to be invoked when events of the specified type are * emitted. An optional calling context may be provided. The data arguments * emitted will be passed to the listener function. * * @param eventType - Name of the event to listen to * @param listener - Function to invoke when the specified event is * emitted * @param context - Optional context object to use when invoking the * listener */ addListener( eventType: string, listener: (...args: any[]) => any, context?: any ): EmitterSubscription /** * Removes all of the registered listeners, including those registered as * listener maps. * * @param eventType - Optional name of the event whose registered * listeners to remove */ removeAllListeners(eventType?: string): void /** * Returns the number of listeners that are currently registered for the given * event. * * @param eventType - Name of the event to query */ listenerCount(eventType: string): number /** * Emits an event of the given type with the given data. All handlers of that * particular type will be notified. * * @param eventType - Name of the event to emit * @param Arbitrary arguments to be passed to each registered listener * * @example * emitter.addListener('someEvent', function(message) { * console.log(message); * }); * * emitter.emit('someEvent', 'abc'); // logs 'abc' */ emit(eventType: string, ...params: any[]): void } export interface EventSubscription { eventType: string key: number subscriber: EventSubscriptionVendor /** * @param subscriber the subscriber that controls * this subscription. */ new (subscriber: EventSubscriptionVendor): EventSubscription /** * Removes this subscription from the subscriber that controls it. */ remove(): void } export declare class EventSubscriptionVendor { constructor() /** * Adds a subscription keyed by an event type. * */ addSubscription(eventType: string, subscription: EventSubscription): EventSubscription /** * Removes a bulk set of the subscriptions. * * @param eventType - Optional name of the event type whose * registered subscriptions to remove, if null remove all subscriptions. */ removeAllSubscriptions(eventType?: string): void /** * Removes a specific subscription. Instead of calling this function, call * `subscription.remove()` directly. * */ removeSubscription(subscription: any): void /** * Returns the array of subscriptions that are currently registered for the * given event type. * * Note: This array can be potentially sparse as subscriptions are deleted * from it when they are removed. * */ getSubscriptionsForType(eventType: string): EventSubscription[] } export type Falsy = undefined | null | false | '' export type FilterFunction = | { brightness: number | string } | { blur: number | string } | { contrast: number | string } | { grayscale: number | string } | { hueRotate: number | string } | { invert: number | string } | { opacity: number | string } | { saturate: number | string } | { sepia: number | string } | { dropShadow: DropShadowValue | string } export type FlexAlignType = 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'baseline' export interface FlexStyle { alignContent?: | 'flex-start' | 'flex-end' | 'center' | 'stretch' | 'space-between' | 'space-around' | 'space-evenly' | undefined alignItems?: FlexAlignType | undefined alignSelf?: 'auto' | FlexAlignType | undefined aspectRatio?: number | string | undefined borderBottomWidth?: number | undefined borderEndWidth?: number | undefined borderLeftWidth?: number | undefined borderRightWidth?: number | undefined borderStartWidth?: number | undefined borderTopWidth?: number | undefined borderWidth?: number | undefined bottom?: DimensionValue | undefined boxSizing?: 'border-box' | 'content-box' | undefined display?: 'none' | 'flex' | 'contents' | undefined end?: DimensionValue | undefined flex?: number | undefined flexBasis?: DimensionValue | undefined flexDirection?: 'row' | 'column' | 'row-reverse' | 'column-reverse' | undefined rowGap?: number | string | undefined gap?: number | string | undefined columnGap?: number | string | undefined flexGrow?: number | undefined flexShrink?: number | undefined flexWrap?: 'wrap' | 'nowrap' | 'wrap-reverse' | undefined height?: DimensionValue | undefined justifyContent?: | 'flex-start' | 'flex-end' | 'center' | 'space-between' | 'space-around' | 'space-evenly' | undefined left?: DimensionValue | undefined margin?: DimensionValue | undefined marginBottom?: DimensionValue | undefined marginEnd?: DimensionValue | undefined marginHorizontal?: DimensionValue | undefined marginLeft?: DimensionValue | undefined marginRight?: DimensionValue | undefined marginStart?: DimensionValue | undefined marginTop?: DimensionValue | undefined marginVertical?: DimensionValue | undefined maxHeight?: DimensionValue | undefined maxWidth?: DimensionValue | undefined minHeight?: DimensionValue | undefined minWidth?: DimensionValue | undefined overflow?: 'visible' | 'hidden' | 'scroll' | undefined padding?: DimensionValue | undefined paddingBottom?: DimensionValue | undefined paddingEnd?: DimensionValue | undefined paddingHorizontal?: DimensionValue | undefined paddingLeft?: DimensionValue | undefined paddingRight?: DimensionValue | undefined paddingStart?: DimensionValue | undefined paddingTop?: DimensionValue | undefined paddingVertical?: DimensionValue | undefined position?: 'absolute' | 'relative' | 'static' | undefined right?: DimensionValue | undefined start?: DimensionValue | undefined top?: DimensionValue | undefined width?: DimensionValue | undefined zIndex?: number | undefined direction?: 'inherit' | 'ltr' | 'rtl' | undefined /** * Equivalent to `top`, `bottom`, `right` and `left` */ inset?: DimensionValue | undefined /** * Equivalent to `top`, `bottom` */ insetBlock?: DimensionValue | undefined /** * Equivalent to `bottom` */ insetBlockEnd?: DimensionValue | undefined /** * Equivalent to `top` */ insetBlockStart?: DimensionValue | undefined /** * Equivalent to `right` and `left` */ insetInline?: DimensionValue | undefined /** * Equivalent to `right` or `left` */ insetInlineEnd?: DimensionValue | undefined /** * Equivalent to `right` or `left` */ insetInlineStart?: DimensionValue | undefined /** * Equivalent to `marginVertical` */ marginBlock?: DimensionValue | undefined /** * Equivalent to `marginBottom` */ marginBlockEnd?: DimensionValue | undefined /** * Equivalent to `marginTop` */ marginBlockStart?: DimensionValue | undefined /** * Equivalent to `marginHorizontal` */ marginInline?: DimensionValue | undefined /** * Equivalent to `marginEnd` */ marginInlineEnd?: DimensionValue | undefined /** * Equivalent to `marginStart` */ marginInlineStart?: DimensionValue | undefined /** * Equivalent to `paddingVertical` */ paddingBlock?: DimensionValue | undefined /** * Equivalent to `paddingBottom` */ paddingBlockEnd?: DimensionValue | undefined /** * Equivalent to `paddingTop` */ paddingBlockStart?: DimensionValue | undefined /** * Equivalent to `paddingHorizontal` */ paddingInline?: DimensionValue | undefined /** * Equivalent to `paddingEnd` */ paddingInlineEnd?: DimensionValue | undefined /** * Equivalent to `paddingStart` */ paddingInlineStart?: DimensionValue | undefined } export type FocusEvent = NativeSyntheticEvent export type FontVariant = | 'small-caps' | 'oldstyle-nums' | 'lining-nums' | 'tabular-nums' | 'common-ligatures' | 'no-common-ligatures' | 'discretionary-ligatures' | 'no-discretionary-ligatures' | 'historical-ligatures' | 'no-historical-ligatures' | 'contextual' | 'no-contextual' | 'proportional-nums' | 'stylistic-one' | 'stylistic-two' | 'stylistic-three' | 'stylistic-four' | 'stylistic-five' | 'stylistic-six' | 'stylistic-seven' | 'stylistic-eight' | 'stylistic-nine' | 'stylistic-ten' | 'stylistic-eleven' | 'stylistic-twelve' | 'stylistic-thirteen' | 'stylistic-fourteen' | 'stylistic-fifteen' | 'stylistic-sixteen' | 'stylistic-seventeen' | 'stylistic-eighteen' | 'stylistic-nineteen' | 'stylistic-twenty' export type FontVariationSettings = string | Readonly> export interface GestureResponderEvent extends NativeSyntheticEvent {} export interface GestureResponderHandlers { /** * A view can become the touch responder by implementing the correct negotiation methods. * There are two methods to ask the view if it wants to become responder: */ /** * Does this view want to become responder on the start of a touch? */ onStartShouldSetResponder?: ((event: GestureResponderEvent) => boolean) | undefined /** * Called for every touch move on the View when it is not the responder: does this view want to "claim" touch responsiveness? */ onMoveShouldSetResponder?: ((event: GestureResponderEvent) => boolean) | undefined /** * If the View returns true and attempts to become the responder, one of the following will happen: */ onResponderEnd?: ((event: GestureResponderEvent) => void) | undefined /** * The View is now responding for touch events. * This is the time to highlight and show the user what is happening */ onResponderGrant?: ((event: GestureResponderEvent) => void) | undefined /** * Something else is the responder right now and will not release it */ onResponderReject?: ((event: GestureResponderEvent) => void) | undefined /** * If the view is responding, the following handlers can be called: */ /** * The user is moving their finger */ onResponderMove?: ((event: GestureResponderEvent) => void) | undefined /** * Fired at the end of the touch, ie "touchUp" */ onResponderRelease?: ((event: GestureResponderEvent) => void) | undefined onResponderStart?: ((event: GestureResponderEvent) => void) | undefined /** * Something else wants to become responder. * Should this view release the responder? Returning true allows release */ onResponderTerminationRequest?: ((event: GestureResponderEvent) => boolean) | undefined /** * The responder has been taken from the View. * Might be taken by other views after a call to onResponderTerminationRequest, * or might be taken by the OS without asking (happens with control center/ notification center on iOS) */ onResponderTerminate?: ((event: GestureResponderEvent) => void) | undefined /** * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, * where the deepest node is called first. * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. * This is desirable in most cases, because it makes sure all controls and buttons are usable. * * However, sometimes a parent will want to make sure that it becomes responder. * This can be handled by using the capture phase. * Before the responder system bubbles up from the deepest component, * it will do a capture phase, firing on*ShouldSetResponderCapture. * So if a parent View wants to prevent the child from becoming responder on a touch start, * it should have a onStartShouldSetResponderCapture handler which returns true. */ onStartShouldSetResponderCapture?: | ((event: GestureResponderEvent) => boolean) | undefined /** * onStartShouldSetResponder and onMoveShouldSetResponder are called with a bubbling pattern, * where the deepest node is called first. * That means that the deepest component will become responder when multiple Views return true for *ShouldSetResponder handlers. * This is desirable in most cases, because it makes sure all controls and buttons are usable. * * However, sometimes a parent will want to make sure that it becomes responder. * This can be handled by using the capture phase. * Before the responder system bubbles up from the deepest component, * it will do a capture phase, firing on*ShouldSetResponderCapture. * So if a parent View wants to prevent the child from becoming responder on a touch start, * it should have a onStartShouldSetResponderCapture handler which returns true. */ onMoveShouldSetResponderCapture?: | ((event: GestureResponderEvent) => boolean) | undefined } export type HostInstance = ReactNativeElement export interface HTMLCollection extends Iterable, ArrayLike { [index: number]: T readonly length: number item(index: number): null | T namedItem(name: string): null | T [Symbol.iterator](): Iterator } export declare class Image extends ImageBase { static getSize(uri: string): Promise static getSize( uri: string, success: (width: number, height: number) => void, failure?: (error: any) => void ): void static getSizeWithHeaders( uri: string, headers: { [index: string]: string } ): Promise static getSizeWithHeaders( uri: string, headers: { [index: string]: string }, success: (width: number, height: number) => void, failure?: (error: any) => void ): void static prefetch(url: string): Promise static prefetchWithMetadata( url: string, queryRootName: string, rootTag?: number ): Promise static abortPrefetch?(requestId: number): void static queryCache?( urls: string[] ): Promise<{ [url: string]: 'memory' | 'disk' | 'disk/memory' }> /** * @see https://reactnative.dev/docs/image#resolveassetsource */ static resolveAssetSource(source: ImageSourcePropType): ImageResolvedAssetSource } export declare const ImageBase: Constructor & typeof ImageComponent export declare class ImageComponent extends React.Component {} export type ImageErrorEvent = NativeSyntheticEvent export interface ImageErrorEventData { error: any } export type ImageLoadEvent = NativeSyntheticEvent export interface ImageLoadEventData { source: { height: number width: number uri: string } } export interface ImageProgressEventDataIOS { loaded: number total: number } export type ImageProgressEventIOS = NativeSyntheticEvent export interface ImageProps extends ImagePropsBase { /** * * Style */ style?: StyleProp | undefined } export interface ImagePropsAndroid { /** * The mechanism that should be used to resize the image when the image's dimensions * differ from the image view's dimensions. Defaults to `auto`. * * - `auto`: Use heuristics to pick between `resize` and `scale`. * * - `resize`: A software operation which changes the encoded image in memory before it * gets decoded. This should be used instead of `scale` when the image is much larger * than the view. * * - `scale`: The image gets drawn downscaled or upscaled. Compared to `resize`, `scale` is * faster (usually hardware accelerated) and produces higher quality images. This * should be used if the image is smaller than the view. It should also be used if the * image is slightly bigger than the view. * * - `none`: No sampling is performed and the image is displayed in its full resolution. This * should only be used in rare circumstances because it is considered unsafe as Android will * throw a runtime exception when trying to render images that consume too much memory. * * More details about `resize` and `scale` can be found at http://frescolib.org/docs/resizing-rotating.html. * * @platform android */ resizeMethod?: 'auto' | 'resize' | 'scale' | 'none' | undefined /** * Duration of fade in animation in ms. Defaults to 300 * * @platform android */ fadeDuration?: number | undefined } export interface ImagePropsBase extends ImagePropsIOS, ImagePropsAndroid, AccessibilityProps { /** * Used to reference react managed images from native code. */ id?: string | undefined /** * onLayout function * * Invoked on mount and layout changes with * * {nativeEvent: { layout: {x, y, width, height} }}. */ onLayout?: ((event: LayoutChangeEvent) => void) | undefined /** * Invoked on load error with {nativeEvent: {error}} */ onError?: ((error: ImageErrorEvent) => void) | undefined /** * Invoked when load completes successfully * { source: { uri, height, width } }. */ onLoad?: ((event: ImageLoadEvent) => void) | undefined /** * Invoked when load either succeeds or fails */ onLoadEnd?: (() => void) | undefined /** * Invoked on load start */ onLoadStart?: (() => void) | undefined progressiveRenderingEnabled?: boolean | undefined borderRadius?: number | undefined borderTopLeftRadius?: number | undefined borderTopRightRadius?: number | undefined borderBottomLeftRadius?: number | undefined borderBottomRightRadius?: number | undefined /** * Determines how to resize the image when the frame doesn't match the raw * image dimensions. * * 'cover': Scale the image uniformly (maintain the image's aspect ratio) * so that both dimensions (width and height) of the image will be equal * to or larger than the corresponding dimension of the view (minus padding). * * 'contain': Scale the image uniformly (maintain the image's aspect ratio) * so that both dimensions (width and height) of the image will be equal to * or less than the corresponding dimension of the view (minus padding). * * 'stretch': Scale width and height independently, This may change the * aspect ratio of the src. * * 'repeat': Repeat the image to cover the frame of the view. * The image will keep it's size and aspect ratio. (iOS only) * * 'center': Scale the image down so that it is completely visible, * if bigger than the area of the view. * The image will not be scaled up. * * 'none': Do not resize the image. The image will be displayed at its intrinsic size. */ resizeMode?: ImageResizeMode | undefined /** * The image source (either a remote URL or a local file resource). * * This prop can also contain several remote URLs, specified together with their width and height and potentially with scale/other URI arguments. * The native side will then choose the best uri to display based on the measured size of the image container. * A cache property can be added to control how networked request interacts with the local cache. * * The currently supported formats are png, jpg, jpeg, bmp, gif, webp (Android only), psd (iOS only). */ source?: ImageSourcePropType | undefined /** * A string representing the resource identifier for the image. Similar to * src from HTML. * * See https://reactnative.dev/docs/image#src */ src?: string | undefined /** * Similar to srcset from HTML. * * See https://reactnative.dev/docs/image#srcset */ srcSet?: string | undefined /** * similarly to `source`, this property represents the resource used to render * the loading indicator for the image, displayed until image is ready to be * displayed, typically after when it got downloaded from network. */ loadingIndicatorSource?: ImageURISource | undefined /** * A unique identifier for this element to be used in UI Automation testing scripts. */ testID?: string | undefined /** * Used to reference react managed images from native code. */ nativeID?: string | undefined /** * A static image to display while downloading the final image off the network. */ defaultSource?: ImageURISource | ImageRequireSource | undefined /** * The text that's read by the screen reader when the user interacts with * the image. * * See https://reactnative.dev/docs/image#alt */ alt?: string | undefined /** * Height of the image component. * * See https://reactnative.dev/docs/image#height */ height?: number | undefined /** * Width of the image component. * * See https://reactnative.dev/docs/image#width */ width?: number | undefined /** * Adds the CORS related header to the request. * Similar to crossorigin from HTML. * * See https://reactnative.dev/docs/image#crossorigin */ crossOrigin?: 'anonymous' | 'use-credentials' | undefined /** * Changes the color of all the non-transparent pixels to the tintColor. * * See https://reactnative.dev/docs/image#tintcolor */ tintColor?: ColorValue | undefined /** * A string indicating which referrer to use when fetching the resource. * Similar to referrerpolicy from HTML. * * See https://reactnative.dev/docs/image#referrerpolicy */ referrerPolicy?: | 'no-referrer' | 'no-referrer-when-downgrade' | 'origin' | 'origin-when-cross-origin' | 'same-origin' | 'strict-origin' | 'strict-origin-when-cross-origin' | 'unsafe-url' | undefined } export interface ImagePropsIOS { /** * blurRadius: the blur radius of the blur filter added to the image * @platform ios */ blurRadius?: number | undefined /** * When the image is resized, the corners of the size specified by capInsets will stay a fixed size, * but the center content and borders of the image will be stretched. * This is useful for creating resizable rounded buttons, shadows, and other resizable assets. * More info on Apple documentation */ capInsets?: Insets | undefined /** * Invoked on download progress with {nativeEvent: {loaded, total}} */ onProgress?: ((event: ImageProgressEventIOS) => void) | undefined /** * Invoked when a partial load of the image is complete. The definition of * what constitutes a "partial load" is loader specific though this is meant * for progressive JPEG loads. * @platform ios */ onPartialLoad?: (() => void) | undefined } export type ImageRequireSource = number export type ImageResizeMode = | 'cover' | 'contain' | 'stretch' | 'repeat' | 'center' | 'none' export interface ImageResolvedAssetSource { height: number width: number scale: number uri: string } export interface ImageSize { width: number height: number } export type ImageSourcePropType = ImageURISource | ImageURISource[] | ImageRequireSource export interface ImageStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { resizeMode?: ImageResizeMode | undefined backfaceVisibility?: 'visible' | 'hidden' | undefined borderBottomLeftRadius?: AnimatableNumericValue | string | undefined borderBottomRightRadius?: AnimatableNumericValue | string | undefined backgroundColor?: ColorValue | undefined borderColor?: ColorValue | undefined borderRadius?: AnimatableNumericValue | string | undefined borderTopLeftRadius?: AnimatableNumericValue | string | undefined borderTopRightRadius?: AnimatableNumericValue | string | undefined overflow?: 'visible' | 'hidden' | undefined overlayColor?: ColorValue | undefined tintColor?: ColorValue | undefined opacity?: AnimatableNumericValue | undefined objectFit?: 'cover' | 'contain' | 'fill' | 'scale-down' | 'none' | undefined cursor?: CursorValue | undefined } export interface ImageURISource { /** * `uri` is a string representing the resource identifier for the image, which * could be an http address, a local file path, or the name of a static image * resource (which should be wrapped in the `require('./path/to/image.png')` * function). */ uri?: string | undefined /** * `bundle` is the iOS asset bundle which the image is included in. This * will default to [NSBundle mainBundle] if not set. * @platform ios */ bundle?: string | undefined /** * `method` is the HTTP Method to use. Defaults to GET if not specified. */ method?: string | undefined /** * `headers` is an object representing the HTTP headers to send along with the * request for a remote image. */ headers?: { [key: string]: string } | undefined /** * `cache` determines how the requests handles potentially cached * responses. * * - `default`: Use the native platforms default strategy. `useProtocolCachePolicy` on iOS. * * - `reload`: The data for the URL will be loaded from the originating source. * No existing cache data should be used to satisfy a URL load request. * * - `force-cache`: The existing cached data will be used to satisfy the request, * regardless of its age or expiration date. If there is no existing data in the cache * corresponding the request, the data is loaded from the originating source. * * - `only-if-cached`: The existing cache data will be used to satisfy a request, regardless of * its age or expiration date. If there is no existing data in the cache corresponding * to a URL load request, no attempt is made to load the data from the originating source, * and the load is considered to have failed. */ cache?: 'default' | 'reload' | 'force-cache' | 'only-if-cached' | undefined /** * `body` is the HTTP body to send with the request. This must be a valid * UTF-8 string, and will be sent exactly as specified, with no * additional encoding (e.g. URL-escaping or base64) applied. */ body?: string | undefined /** * `width` and `height` can be specified if known at build time, in which case * these will be used to set the default `` component dimensions. */ width?: number | undefined height?: number | undefined /** * `scale` is used to indicate the scale factor of the image. Defaults to 1.0 if * unspecified, meaning that one image pixel equates to one display point / DIP. */ scale?: number | undefined } export type InputModeOptions = | 'none' | 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' export interface Insets { top?: number | undefined left?: number | undefined bottom?: number | undefined right?: number | undefined } export type KeyboardType = | 'default' | 'number-pad' | 'decimal-pad' | 'numeric' | 'email-address' | 'phone-pad' | 'url' export type KeyboardTypeAndroid = 'visible-password' export type KeyboardTypeIOS = | 'ascii-capable' | 'numbers-and-punctuation' | 'name-phone-pad' | 'twitter' | 'web-search' export type KeyboardTypeOptions = KeyboardType | KeyboardTypeAndroid | KeyboardTypeIOS export type LayoutChangeEvent = NativeSyntheticEvent<{ layout: LayoutRectangle }> export interface LayoutRectangle { x: number y: number width: number height: number } export type LinearGradientValue = { type: 'linear-gradient' // Angle or direction enums direction?: string | undefined colorStops: ReadonlyArray<{ color: ColorValue | null positions?: ReadonlyArray | undefined }> } export interface MatrixTransform { matrix: AnimatableNumericValue[] } export type MaximumOneOf = K extends keyof T ? { [P in K]: T[K] } & { [P in Exclude]?: never } : never export type MeasureInWindowOnSuccessCallback = ( x: number, y: number, width: number, height: number ) => void export type MeasureLayoutOnSuccessCallback = ( left: number, top: number, width: number, height: number ) => void export type MeasureOnSuccessCallback = ( x: number, y: number, width: number, height: number, pageX: number, pageY: number ) => void export interface MouseEvent extends NativeSyntheticEvent {} export interface NativeMethods { /** * Determines the location on screen, width, and height of the given view and * returns the values via an async callback. If successful, the callback will * be called with the following arguments: * * - x * - y * - width * - height * - pageX * - pageY * * Note that these measurements are not available until after the rendering * has been completed in native. If you need the measurements as soon as * possible, consider using the [`onLayout` * prop](docs/view.html#onlayout) instead. */ measure(callback: MeasureOnSuccessCallback): void /** * Determines the location of the given view in the window and returns the * values via an async callback. If the React root view is embedded in * another native view, this will give you the absolute coordinates. If * successful, the callback will be called with the following * arguments: * * - x * - y * - width * - height * * Note that these measurements are not available until after the rendering * has been completed in native. */ measureInWindow(callback: MeasureInWindowOnSuccessCallback): void /** * Like [`measure()`](#measure), but measures the view relative an ancestor, * specified as `relativeToNativeComponentRef`. This means that the returned x, y * are relative to the origin x, y of the ancestor view. * _Can also be called with a relativeNativeNodeHandle but is deprecated._ */ measureLayout( relativeToNativeComponentRef: HostInstance | number, onSuccess: MeasureLayoutOnSuccessCallback, onFail?: () => void ): void /** * This function sends props straight to native. They will not participate in * future diff process - this means that if you do not include them in the * next render, they will remain active (see [Direct * Manipulation](https://reactnative.dev/docs/the-new-architecture/direct-manipulation-new-architecture)). */ setNativeProps(nativeProps: object): void /** * Requests focus for the given input or view. The exact behavior triggered * will depend on the platform and type of view. */ focus(): void /** * Removes focus from an input or view. This is the opposite of `focus()`. */ blur(): void } export interface NativeMouseEvent extends NativeUIEvent { /** * The X coordinate of the mouse pointer in global (screen) coordinates. */ readonly screenX: number /** * The Y coordinate of the mouse pointer in global (screen) coordinates. */ readonly screenY: number /** * The X coordinate of the mouse pointer relative to the whole document. */ readonly pageX: number /** * The Y coordinate of the mouse pointer relative to the whole document. */ readonly pageY: number /** * The X coordinate of the mouse pointer in local (DOM content) coordinates. */ readonly clientX: number /** * The Y coordinate of the mouse pointer in local (DOM content) coordinates. */ readonly clientY: number /** * Alias for NativeMouseEvent.clientX */ readonly x: number /** * Alias for NativeMouseEvent.clientY */ readonly y: number /** * Returns true if the control key was down when the mouse event was fired. */ readonly ctrlKey: boolean /** * Returns true if the shift key was down when the mouse event was fired. */ readonly shiftKey: boolean /** * Returns true if the alt key was down when the mouse event was fired. */ readonly altKey: boolean /** * Returns true if the meta key was down when the mouse event was fired. */ readonly metaKey: boolean /** * The button number that was pressed (if applicable) when the mouse event was fired. */ readonly button: number /** * The buttons being depressed (if any) when the mouse event was fired. */ readonly buttons: number /** * The secondary target for the event, if there is one. */ readonly relatedTarget: null | number | HostInstance // offset is proposed: https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface /** * The X coordinate of the mouse pointer between that event and the padding edge of the target node */ readonly offsetX: number /** * The Y coordinate of the mouse pointer between that event and the padding edge of the target node */ readonly offsetY: number } export interface NativePointerEvent extends NativeMouseEvent { /** * A unique identifier for the pointer causing the event. */ readonly pointerId: number /** * The width (magnitude on the X axis), in CSS pixels, of the contact geometry of the pointer */ readonly width: number /** * The height (magnitude on the Y axis), in CSS pixels, of the contact geometry of the pointer. */ readonly height: number /** * The normalized pressure of the pointer input in the range 0 to 1, where 0 and 1 represent * the minimum and maximum pressure the hardware is capable of detecting, respectively. */ readonly pressure: number /** * The normalized tangential pressure of the pointer input (also known as barrel pressure or * cylinder stress) in the range -1 to 1, where 0 is the neutral position of the control. */ readonly tangentialPressure: number /** * The plane angle (in degrees, in the range of -90 to 90) between the Y–Z plane and the plane * containing both the pointer (e.g. pen stylus) axis and the Y axis. */ readonly tiltX: number /** * The plane angle (in degrees, in the range of -90 to 90) between the X–Z plane and the plane * containing both the pointer (e.g. pen stylus) axis and the X axis. */ readonly tiltY: number /** * The clockwise rotation of the pointer (e.g. pen stylus) around its major axis in degrees, * with a value in the range 0 to 359. */ readonly twist: number /** * Indicates the device type that caused the event (mouse, pen, touch, etc.) */ readonly pointerType: string /** * Indicates if the pointer represents the primary pointer of this pointer type. */ readonly isPrimary: boolean } export interface NativeScrollEvent { contentInset: NativeScrollRectangle contentOffset: NativeScrollPoint contentSize: NativeScrollSize layoutMeasurement: NativeScrollSize velocity?: NativeScrollVelocity | undefined zoomScale: number /** * @platform ios */ targetContentOffset?: NativeScrollPoint | undefined } export interface NativeScrollPoint { x: number y: number } export interface NativeScrollRectangle { left: number top: number bottom: number right: number } export interface NativeScrollSize { height: number width: number } export interface NativeScrollVelocity { x: number y: number } export interface NativeSyntheticEvent extends React.BaseSyntheticEvent< T, HostInstance, HostInstance > {} export interface NativeTouchEvent { /** * Array of all touch events that have changed since the last event */ changedTouches: NativeTouchEvent[] /** * The ID of the touch */ identifier: string /** * The X position of the touch, relative to the element */ locationX: number /** * The Y position of the touch, relative to the element */ locationY: number /** * The X position of the touch, relative to the screen */ pageX: number /** * The Y position of the touch, relative to the screen */ pageY: number /** * The node id of the element receiving the touch event */ target: string /** * A time identifier for the touch, useful for velocity calculation */ timestamp: number /** * Array of all current touches on the screen */ touches: NativeTouchEvent[] /** * 3D Touch reported force * @platform ios */ force?: number | undefined } export interface NativeUIEvent { /** * Returns a long with details about the event, depending on the event type. */ readonly detail: number } export interface NodeList extends Iterable, ArrayLike { [index: number]: T readonly length: number entries(): Iterator<[number, T]> forEach( callbackFn: (value: T, index: number, array: NodeList) => unknown, thisArg?: ThisType ): void item(index: number): null | T keys(): Iterator values(): Iterator [Symbol.iterator](): Iterator } export type OpaqueColorValue = symbol & { __TYPE__: 'Color' } export interface PanResponderGestureState { /** * ID of the gestureState- persisted as long as there at least one touch on */ stateID: number /** * the latest screen coordinates of the recently-moved touch */ moveX: number /** * the latest screen coordinates of the recently-moved touch */ moveY: number /** * the screen coordinates of the responder grant */ x0: number /** * the screen coordinates of the responder grant */ y0: number /** * accumulated distance of the gesture since the touch started */ dx: number /** * accumulated distance of the gesture since the touch started */ dy: number /** * current velocity of the gesture */ vx: number /** * current velocity of the gesture */ vy: number /** * Number of touches currently on screen */ numberActiveTouches: number // All `gestureState` accounts for timeStamps up until: _accountsForMovesUpTo: number } export interface PerspectiveTransform { perspective: AnimatableNumericValue } export type PointerEvent = NativeSyntheticEvent export interface PointerEvents { onPointerEnter?: ((event: PointerEvent) => void) | undefined onPointerEnterCapture?: ((event: PointerEvent) => void) | undefined onPointerLeave?: ((event: PointerEvent) => void) | undefined onPointerLeaveCapture?: ((event: PointerEvent) => void) | undefined onPointerMove?: ((event: PointerEvent) => void) | undefined onPointerMoveCapture?: ((event: PointerEvent) => void) | undefined onPointerCancel?: ((event: PointerEvent) => void) | undefined onPointerCancelCapture?: ((event: PointerEvent) => void) | undefined onPointerDown?: ((event: PointerEvent) => void) | undefined onPointerDownCapture?: ((event: PointerEvent) => void) | undefined onPointerUp?: ((event: PointerEvent) => void) | undefined onPointerUpCapture?: ((event: PointerEvent) => void) | undefined onPointerOver?: ((event: PointerEvent) => void) | undefined onPointerOverCapture?: ((event: PointerEvent) => void) | undefined onPointerOut?: ((event: PointerEvent) => void) | undefined onPointerOutCapture?: ((event: PointerEvent) => void) | undefined onGotPointerCapture?: ((event: PointerEvent) => void) | undefined onGotPointerCaptureCapture?: ((event: PointerEvent) => void) | undefined onLostPointerCapture?: ((event: PointerEvent) => void) | undefined onLostPointerCaptureCapture?: ((event: PointerEvent) => void) | undefined } export interface PointProp { x: number y: number } export interface PressableAndroidRippleConfig { color?: null | ColorValue | undefined borderless?: null | boolean | undefined radius?: null | number | undefined foreground?: null | boolean | undefined alpha?: null | number | undefined } export interface PressableProps extends AccessibilityProps, Omit { /** * Called when the hover is activated to provide visual feedback. */ onHoverIn?: null | ((event: MouseEvent) => void) | undefined /** * Called when the hover is deactivated to undo visual feedback. */ onHoverOut?: null | ((event: MouseEvent) => void) | undefined /** * Called when a single tap gesture is detected. */ onPress?: null | ((event: GestureResponderEvent) => void) | undefined /** * Called when a touch is engaged before `onPress`. */ onPressIn?: null | ((event: GestureResponderEvent) => void) | undefined /** * Called when the press location moves. */ onPressMove?: null | ((event: GestureResponderEvent) => void) | undefined /** * Called when a touch is released before `onPress`. */ onPressOut?: null | ((event: GestureResponderEvent) => void) | undefined /** * Called when a long-tap gesture is detected. */ onLongPress?: null | ((event: GestureResponderEvent) => void) | undefined /** * Called after the element loses focus. * @platform macos windows */ onBlur?: null | ((event: NativeSyntheticEvent) => void) | undefined /** * Called after the element is focused. * @platform macos windows */ onFocus?: null | ((event: NativeSyntheticEvent) => void) | undefined /** * Either children or a render prop that receives a boolean reflecting whether * the component is currently pressed. */ children?: | React.ReactNode | ((state: PressableStateCallbackType) => React.ReactNode) | undefined /** * Whether a press gesture can be interrupted by a parent gesture such as a * scroll event. Defaults to true. */ cancelable?: null | boolean | undefined /** * Duration to wait after hover in before calling `onHoverIn`. * @platform macos windows */ delayHoverIn?: number | null | undefined /** * Duration to wait after hover out before calling `onHoverOut`. * @platform macos windows */ delayHoverOut?: number | null | undefined /** * Duration (in milliseconds) from `onPressIn` before `onLongPress` is called. */ delayLongPress?: null | number | undefined /** * Whether the press behavior is disabled. */ disabled?: null | boolean | undefined /** * Additional distance outside of this view in which a press is detected. */ hitSlop?: null | Insets | number | undefined /** * Additional distance outside of this view in which a touch is considered a * press before `onPressOut` is triggered. */ pressRetentionOffset?: null | Insets | number | undefined /** * If true, doesn't play system sound on touch. */ android_disableSound?: null | boolean | undefined /** * Enables the Android ripple effect and configures its color. */ android_ripple?: null | PressableAndroidRippleConfig | undefined /** * Used only for documentation or testing (e.g. snapshot testing). */ testOnly_pressed?: null | boolean | undefined /** * Either view styles or a function that receives a boolean reflecting whether * the component is currently pressed and returns view styles. */ style?: | StyleProp | ((state: PressableStateCallbackType) => StyleProp) | undefined /** * Duration (in milliseconds) to wait after press down before calling onPressIn. */ unstable_pressDelay?: number | undefined } export interface PressableStateCallbackType { readonly pressed: boolean } export type RadialExtent = | 'closest-corner' | 'closest-side' | 'farthest-corner' | 'farthest-side' export type RadialGradientPosition = | { top: number | string left: number | string } | { top: number | string right: number | string } | { bottom: number | string left: number | string } | { bottom: number | string right: number | string } export type RadialGradientShape = 'circle' | 'ellipse' export type RadialGradientSize = | RadialExtent | { x: string | number y: string | number } export type RadialGradientValue = { type: 'radial-gradient' shape: RadialGradientShape size: RadialGradientSize position: RadialGradientPosition colorStops: ReadonlyArray<{ color: ColorValue | null positions?: ReadonlyArray | undefined }> } export interface ReactNativeDocument extends ReadOnlyNode { get childElementCount(): number get children(): HTMLCollection get documentElement(): ReactNativeElement get firstElementChild(): null | ReadOnlyElement getElementById(id: string): null | ReadOnlyElement get lastElementChild(): null | ReadOnlyElement get nodeName(): string get nodeType(): number get nodeValue(): null } export interface ReactNativeElement extends ReadOnlyElement, NativeMethods { blur(): void focus(): void get offsetHeight(): number get offsetLeft(): number get offsetParent(): null | ReadOnlyElement get offsetTop(): number get offsetWidth(): number setNativeProps(nativeProps: {}): void } export interface ReadOnlyElement extends ReadOnlyNode { get childElementCount(): number get children(): HTMLCollection get clientHeight(): number get clientLeft(): number get clientTop(): number get clientWidth(): number get firstElementChild(): null | ReadOnlyElement getBoundingClientRect(): DOMRect hasPointerCapture(pointerId: number): boolean get id(): string get lastElementChild(): null | ReadOnlyElement get nextElementSibling(): null | ReadOnlyElement get nodeName(): string get nodeType(): number get nodeValue(): null | string set nodeValue(value: string) get previousElementSibling(): null | ReadOnlyElement releasePointerCapture(pointerId: number): void get scrollHeight(): number get scrollLeft(): number get scrollTop(): number get scrollWidth(): number setPointerCapture(pointerId: number): void get tagName(): string get textContent(): string } export interface ReadOnlyNode { get childNodes(): NodeList compareDocumentPosition(otherNode: ReadOnlyNode): number contains(otherNode: ReadOnlyNode): boolean get firstChild(): null | ReadOnlyNode getRootNode(): ReadOnlyNode hasChildNodes(): boolean get isConnected(): boolean get lastChild(): null | ReadOnlyNode get nextSibling(): null | ReadOnlyNode get nodeName(): string get nodeType(): number get nodeValue(): null | string get ownerDocument(): null | ReactNativeDocument get parentElement(): null | ReadOnlyElement get parentNode(): null | ReadOnlyNode get previousSibling(): null | ReadOnlyNode get textContent(): string } export interface RecursiveArray extends Array< T | ReadonlyArray | RecursiveArray > {} export interface RefreshControlProps extends RefreshControlPropsIOS, RefreshControlPropsAndroid { /** * Called when the view starts refreshing. */ onRefresh?: (() => void) | undefined /** * Whether the view should be indicating an active refresh. */ refreshing: boolean /** * Progress view top offset */ progressViewOffset?: number | undefined } export interface RefreshControlPropsAndroid extends ViewProps { /** * The colors (at least one) that will be used to draw the refresh indicator. */ colors?: ColorValue[] | undefined /** * Whether the pull to refresh functionality is enabled. */ enabled?: boolean | undefined /** * The background color of the refresh indicator. */ progressBackgroundColor?: ColorValue | undefined /** * Size of the refresh indicator, see RefreshControl.SIZE. */ size?: 'default' | 'large' | undefined } export interface RefreshControlPropsIOS extends ViewProps { /** * The color of the refresh indicator. */ tintColor?: ColorValue | undefined /** * The title displayed under the refresh indicator. */ title?: string | undefined /** * Title color. */ titleColor?: ColorValue | undefined } export type ReturnKeyType = 'done' | 'go' | 'next' | 'search' | 'send' export type ReturnKeyTypeAndroid = 'none' | 'previous' export type ReturnKeyTypeIOS = | 'default' | 'google' | 'join' | 'route' | 'yahoo' | 'emergency-call' export type ReturnKeyTypeOptions = ReturnKeyType | ReturnKeyTypeAndroid | ReturnKeyTypeIOS export type Role = | 'alert' | 'alertdialog' | 'application' | 'article' | 'banner' | 'button' | 'cell' | 'checkbox' | 'columnheader' | 'combobox' | 'complementary' | 'contentinfo' | 'definition' | 'dialog' | 'directory' | 'document' | 'feed' | 'figure' | 'form' | 'grid' | 'group' | 'heading' | 'img' | 'link' | 'list' | 'listitem' | 'log' | 'main' | 'marquee' | 'math' | 'menu' | 'menubar' | 'menuitem' | 'meter' | 'navigation' | 'none' | 'note' | 'option' | 'presentation' | 'progressbar' | 'radio' | 'radiogroup' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'scrollbar' | 'searchbox' | 'separator' | 'slider' | 'spinbutton' | 'status' | 'summary' | 'switch' | 'tab' | 'table' | 'tablist' | 'tabpanel' | 'term' | 'timer' | 'toolbar' | 'tooltip' | 'tree' | 'treegrid' | 'treeitem' export interface RotateTransform { rotate: AnimatableStringValue } export interface RotateXTransform { rotateX: AnimatableStringValue } export interface RotateYTransform { rotateY: AnimatableStringValue } export interface RotateZTransform { rotateZ: AnimatableStringValue } export interface ScaledSize { width: number height: number scale: number fontScale: number } export interface ScaleTransform { scale: AnimatableNumericValue } export interface ScaleXTransform { scaleX: AnimatableNumericValue } export interface ScaleYTransform { scaleY: AnimatableNumericValue } export type ScrollResponderType = ScrollViewImperativeMethods export interface ScrollView extends ScrollViewImperativeMethods {} export interface ScrollViewImperativeMethods { /** * Returns a reference to the underlying scroll responder, which supports * operations like `scrollTo`. All ScrollView-like components should * implement this method so that they can be composed while providing access * to the underlying scroll responder's methods. */ readonly getScrollResponder: () => ScrollResponderType readonly getScrollableNode: () => number | undefined readonly getInnerViewNode: () => number | undefined readonly getInnerViewRef: () => React.ComponentRef | null /** * Returns a reference to the underlying native scroll view, or null if the * native instance is not mounted. */ readonly getNativeScrollRef: () => HostInstance | null /** * Scrolls to a given x, y offset, either immediately or with a smooth animation. * Syntax: * * scrollTo(options: {x: number = 0; y: number = 0; animated: boolean = true}) * * Note: The weird argument signature is due to the fact that, for historical reasons, * the function also accepts separate arguments as an alternative to the options object. * This is deprecated due to ambiguity (y before x), and SHOULD NOT BE USED. */ readonly scrollTo: ( options?: ScrollViewScrollToOptions | number, deprecatedX?: number, deprecatedAnimated?: boolean ) => void /** * A helper function that scrolls to the end of the scrollview; * If this is a vertical ScrollView, it scrolls to the bottom. * If this is a horizontal ScrollView scrolls to the right. * * The options object has an animated prop, that enables the scrolling animation or not. * The animated prop defaults to true */ readonly scrollToEnd: (options?: ScrollViewScrollToOptions | null) => void /** * Displays the scroll indicators momentarily. */ readonly flashScrollIndicators: () => void scrollResponderZoomTo( rect: { x: number y: number width: number height: number animated?: boolean | undefined }, animated?: boolean // deprecated, put this inside the rect argument instead ): void scrollResponderScrollNativeHandleToKeyboard( nodeHandle: number | HostInstance, additionalOffset?: number, preventNegativeScrollOffset?: boolean ): void } export interface ScrollViewProps extends ViewProps, ScrollViewPropsIOS, ScrollViewPropsAndroid, Touchable { /** * These styles will be applied to the scroll view content container which * wraps all of the child views. Example: * * return ( * * * ); * ... * const styles = StyleSheet.create({ * contentContainer: { * paddingVertical: 20 * } * }); */ contentContainerStyle?: StyleProp | undefined /** * A ref to the inner View element of the ScrollView. This should be used * instead of calling `getInnerViewRef`. */ innerViewRef?: React.RefObject | undefined /** * A ref to the Native ScrollView component. This ref can be used to call * all of ScrollView's public methods, in addition to native methods like * measure, measureLayout, etc. */ scrollViewRef?: React.RefObject | undefined /** * A floating-point number that determines how quickly the scroll view * decelerates after the user lifts their finger. You may also use string * shortcuts `"normal"` and `"fast"` which match the underlying iOS settings * for `UIScrollViewDecelerationRateNormal` and * `UIScrollViewDecelerationRateFast` respectively. * * - `'normal'`: 0.998 on iOS, 0.985 on Android (the default) * - `'fast'`: 0.99 on iOS, 0.9 on Android */ decelerationRate?: 'fast' | 'normal' | number | undefined /** * When true the scroll view's children are arranged horizontally in a row * instead of vertically in a column. The default value is false. */ horizontal?: boolean | null | undefined /** * If sticky headers should stick at the bottom instead of the top of the * ScrollView. This is usually used with inverted ScrollViews. */ invertStickyHeaders?: boolean | undefined /** * Determines whether the keyboard gets dismissed in response to a drag. * - 'none' (the default) drags do not dismiss the keyboard. * - 'onDrag' the keyboard is dismissed when a drag begins. * - 'interactive' the keyboard is dismissed interactively with the drag * and moves in synchrony with the touch; dragging upwards cancels the * dismissal. */ keyboardDismissMode?: 'none' | 'interactive' | 'on-drag' | undefined /** * Determines when the keyboard should stay visible after a tap. * - 'never' (the default), tapping outside of the focused text input when the keyboard is up dismisses the keyboard. When this happens, children won't receive the tap. * - 'always', the keyboard will not dismiss automatically, and the scroll view will not catch taps, but children of the scroll view can catch taps. * - 'handled', the keyboard will not dismiss automatically when the tap was handled by a children, (or captured by an ancestor). */ keyboardShouldPersistTaps?: 'always' | 'never' | 'handled' | undefined /** * Called when scrollable content view of the ScrollView changes. * Handler function is passed the content width and content height as parameters: (contentWidth, contentHeight) * It's implemented using onLayout handler attached to the content container which this ScrollView renders. * */ onContentSizeChange?: | ((contentWidth: number, contentHeight: number) => void) | undefined /** * Fires at most once per frame during scrolling. */ onScroll?: ((event: NativeSyntheticEvent) => void) | undefined /** * Fires if a user initiates a scroll gesture. */ onScrollBeginDrag?: | ((event: NativeSyntheticEvent) => void) | undefined /** * Fires when a user has finished scrolling. */ onScrollEndDrag?: ((event: NativeSyntheticEvent) => void) | undefined /** * Fires when scroll view has finished moving */ onMomentumScrollEnd?: | ((event: NativeSyntheticEvent) => void) | undefined /** * Fires when scroll view has begun moving */ onMomentumScrollBegin?: | ((event: NativeSyntheticEvent) => void) | undefined /** * When true the scroll view stops on multiples of the scroll view's size * when scrolling. This can be used for horizontal pagination. The default * value is false. */ pagingEnabled?: boolean | undefined /** * When false, the content does not scroll. The default value is true */ scrollEnabled?: boolean | undefined // true /** * Experimental: When true offscreen child views (whose `overflow` value is * `hidden`) are removed from their native backing superview when offscreen. * This can improve scrolling performance on long lists. The default value is * false. */ removeClippedSubviews?: boolean | undefined /** * When true, shows a horizontal scroll indicator. */ showsHorizontalScrollIndicator?: boolean | undefined /** * When true, shows a vertical scroll indicator. */ showsVerticalScrollIndicator?: boolean | undefined /** * When true, Sticky header is hidden when scrolling down, and dock at the top when scrolling up. */ stickyHeaderHiddenOnScroll?: boolean | undefined /** * Style */ style?: StyleProp | undefined /** * A RefreshControl component, used to provide pull-to-refresh * functionality for the ScrollView. */ refreshControl?: React.ReactElement | undefined /** * When set, causes the scroll view to stop at multiples of the value of `snapToInterval`. * This can be used for paginating through children that have lengths smaller than the scroll view. * Used in combination with `snapToAlignment` and `decelerationRate="fast"`. Overrides less * configurable `pagingEnabled` prop. */ snapToInterval?: number | undefined /** * When set, causes the scroll view to stop at the defined offsets. This can be used for * paginating through variously sized children that have lengths smaller than the scroll view. * Typically used in combination with `decelerationRate="fast"`. Overrides less configurable * `pagingEnabled` and `snapToInterval` props. */ snapToOffsets?: number[] | undefined /** * Use in conjunction with `snapToOffsets`. By default, the beginning of the list counts as a * snap offset. Set `snapToStart` to false to disable this behavior and allow the list to scroll * freely between its start and the first `snapToOffsets` offset. The default value is true. */ snapToStart?: boolean | undefined /** * Use in conjunction with `snapToOffsets`. By default, the end of the list counts as a snap * offset. Set `snapToEnd` to false to disable this behavior and allow the list to scroll freely * between its end and the last `snapToOffsets` offset. The default value is true. */ snapToEnd?: boolean | undefined /** * An array of child indices determining which children get docked to the * top of the screen when scrolling. For example passing * `stickyHeaderIndices={[0]}` will cause the first child to be fixed to the * top of the scroll view. This property is not supported in conjunction * with `horizontal={true}`. */ stickyHeaderIndices?: number[] | undefined /** * When true, the scroll view stops on the next index (in relation to scroll position at release) * regardless of how fast the gesture is. This can be used for horizontal pagination when the page * is less than the width of the ScrollView. The default value is false. */ disableIntervalMomentum?: boolean | undefined /** * When true, the default JS pan responder on the ScrollView is disabled, and full control over * touches inside the ScrollView is left to its child components. This is particularly useful * if `snapToInterval` is enabled, since it does not follow typical touch patterns. Do not use * this on regular ScrollView use cases without `snapToInterval` as it may cause unexpected * touches to occur while scrolling. The default value is false. */ disableScrollViewPanResponder?: boolean | undefined /** * A React Component that will be used to render sticky headers, should be used together with * stickyHeaderIndices. You may need to set this component if your sticky header uses custom * transforms, for example, when you want your list to have an animated and hidable header. * If component have not been provided, the default ScrollViewStickyHeader component will be used. */ StickyHeaderComponent?: React.ComponentType | undefined } export interface ScrollViewPropsAndroid { /** * Sometimes a scrollview takes up more space than its content fills. * When this is the case, this prop will fill the rest of the * scrollview with a color to avoid setting a background and creating * unnecessary overdraw. This is an advanced optimization that is not * needed in the general case. */ endFillColor?: ColorValue | undefined /** * Tag used to log scroll performance on this scroll view. Will force * momentum events to be turned on (see sendMomentumEvents). This doesn't do * anything out of the box and you need to implement a custom native * FpsListener for it to be useful. * @platform android */ scrollPerfTag?: string | undefined /** * Used to override default value of overScroll mode. * Possible values: * - 'auto' - Default value, allow a user to over-scroll this view only if the content is large enough to meaningfully scroll. * - 'always' - Always allow a user to over-scroll this view. * - 'never' - Never allow a user to over-scroll this view. */ overScrollMode?: 'auto' | 'always' | 'never' | undefined /** * Enables nested scrolling for Android API level 21+. Nested scrolling is supported by default on iOS. */ nestedScrollEnabled?: boolean | undefined /** * Controls the fading effect at the edges of the scroll content. * * A value greater than 0 will apply the fading effect, indicating more content is available * to scroll. * * You can specify a single number to apply the same fading length to both edges. * Alternatively, use an object with `start` and `end` properties to set different * fading lengths for the start and end of the scroll content. * * The default value is 0. * * @platform android */ fadingEdgeLength?: number | { start: number; end: number } | undefined /** * Causes the scrollbars not to turn transparent when they are not in use. The default value is false. */ persistentScrollbar?: boolean | undefined /** * When false, the ScrollView will not automatically scroll to a focused child when * the child requests focus. This can be useful when you want to control the scroll * position programmatically. The default value is true. * * @platform android */ scrollsChildToFocus?: boolean | undefined } export interface ScrollViewPropsIOS { /** * When true the scroll view bounces horizontally when it reaches the end * even if the content is smaller than the scroll view itself. The default * value is true when `horizontal={true}` and false otherwise. */ alwaysBounceHorizontal?: boolean | undefined /** * When true the scroll view bounces vertically when it reaches the end * even if the content is smaller than the scroll view itself. The default * value is false when `horizontal={true}` and true otherwise. */ alwaysBounceVertical?: boolean | undefined /** * Controls whether iOS should automatically adjust the content inset for scroll views that are placed behind a navigation bar or tab bar/ toolbar. * The default value is true. */ automaticallyAdjustContentInsets?: boolean | undefined // true /** * Controls whether the ScrollView should automatically adjust its contentInset and * scrollViewInsets when the Keyboard changes its size. The default value is false. */ automaticallyAdjustKeyboardInsets?: boolean | undefined /** * Controls whether iOS should automatically adjust the scroll indicator * insets. The default value is true. Available on iOS 13 and later. */ automaticallyAdjustsScrollIndicatorInsets?: boolean | undefined /** * When true the scroll view bounces when it reaches the end of the * content if the content is larger than the scroll view along the axis of * the scroll direction. When false it disables all bouncing even if * the `alwaysBounce*` props are true. The default value is true. */ bounces?: boolean | undefined /** * When true gestures can drive zoom past min/max and the zoom will animate * to the min/max value at gesture end otherwise the zoom will not exceed * the limits. */ bouncesZoom?: boolean | undefined /** * When false once tracking starts won't try to drag if the touch moves. * The default value is true. */ canCancelContentTouches?: boolean | undefined /** * When true the scroll view automatically centers the content when the * content is smaller than the scroll view bounds; when the content is * larger than the scroll view this property has no effect. The default * value is false. */ centerContent?: boolean | undefined /** * The amount by which the scroll view content is inset from the edges of the scroll view. * Defaults to {0, 0, 0, 0}. */ contentInset?: Insets | undefined // zeros /** * Used to manually set the starting scroll offset. * The default value is {x: 0, y: 0} */ contentOffset?: PointProp | undefined // zeros /** * This property specifies how the safe area insets are used to modify the content area of the scroll view. * The default value of this property is "never". */ contentInsetAdjustmentBehavior?: | 'automatic' | 'scrollableAxes' | 'never' | 'always' | undefined /** * When true the ScrollView will try to lock to only vertical or horizontal * scrolling while dragging. The default value is false. */ directionalLockEnabled?: boolean | undefined /** * The style of the scroll indicators. * - default (the default), same as black. * - black, scroll indicator is black. This style is good against * a white content background. * - white, scroll indicator is white. This style is good against * a black content background. */ indicatorStyle?: 'default' | 'black' | 'white' | undefined /** * When set, the scroll view will adjust the scroll position so that the first child * that is currently visible and at or beyond minIndexForVisible will not change position. * This is useful for lists that are loading content in both directions, e.g. a chat thread, * where new messages coming in might otherwise cause the scroll position to jump. A value * of 0 is common, but other values such as 1 can be used to skip loading spinners or other * content that should not maintain position. * * The optional autoscrollToTopThreshold can be used to make the content automatically scroll * to the top after making the adjustment if the user was within the threshold of the top * before the adjustment was made. This is also useful for chat-like applications where you * want to see new messages scroll into place, but not if the user has scrolled up a ways and * it would be disruptive to scroll a bunch. * * Caveat 1: Reordering elements in the scrollview with this enabled will probably cause * jumpiness and jank. It can be fixed, but there are currently no plans to do so. For now, * don't re-order the content of any ScrollViews or Lists that use this feature. * * Caveat 2: This uses contentOffset and frame.origin in native code to compute visibility. * Occlusion, transforms, and other complexity won't be taken into account as to whether * content is "visible" or not. */ maintainVisibleContentPosition?: | null | { autoscrollToTopThreshold?: number | null | undefined minIndexForVisible: number } | undefined /** * The maximum allowed zoom scale. The default value is 1.0. */ maximumZoomScale?: number | undefined /** * The minimum allowed zoom scale. The default value is 1.0. */ minimumZoomScale?: number | undefined /** * Called when a scrolling animation ends. */ onScrollAnimationEnd?: (() => void) | undefined /** * When true, ScrollView allows use of pinch gestures to zoom in and out. * The default value is true. */ pinchGestureEnabled?: boolean | undefined /** * Limits how often scroll events will be fired while scrolling, specified as * a time interval in ms. This may be useful when expensive work is performed * in response to scrolling. Values <= `16` will disable throttling, * regardless of the refresh rate of the device. */ scrollEventThrottle?: number | undefined /** * The amount by which the scroll view indicators are inset from the edges of the scroll view. * This should normally be set to the same value as the contentInset. * Defaults to {0, 0, 0, 0}. */ scrollIndicatorInsets?: Insets | undefined //zeroes /** * When true, the scroll view can be programmatically scrolled beyond its * content size. The default value is false. * @platform ios */ scrollToOverflowEnabled?: boolean | undefined /** * When true the scroll view scrolls to top when the status bar is tapped. * The default value is true. */ scrollsToTop?: boolean | undefined /** * When `snapToInterval` is set, `snapToAlignment` will define the relationship of the snapping to the scroll view. * - `start` (the default) will align the snap at the left (horizontal) or top (vertical) * - `center` will align the snap in the center * - `end` will align the snap at the right (horizontal) or bottom (vertical) */ snapToAlignment?: 'start' | 'center' | 'end' | undefined /** * Fires when the scroll view scrolls to top after the status bar has been tapped * @platform ios */ onScrollToTop?: ((event: NativeSyntheticEvent) => void) | undefined /** * The current scale of the scroll view content. The default value is 1.0. */ zoomScale?: number | undefined } export interface ScrollViewScrollToOptions { x?: number | undefined y?: number | undefined animated?: boolean | undefined } export interface ShadowStyleIOS { shadowColor?: ColorValue | undefined shadowOffset?: Readonly<{ width: number; height: number }> | undefined shadowOpacity?: AnimatableNumericValue | undefined shadowRadius?: number | undefined } export interface SkewXTransform { skewX: AnimatableStringValue } export interface SkewYTransform { skewY: AnimatableStringValue } export type StyleProp = T | RecursiveArray | Falsy export type SubmitBehavior = 'submit' | 'blurAndSubmit' | 'newline' export interface SwitchChangeEvent extends NativeSyntheticEvent {} export interface SwitchChangeEventData extends TargetedEvent { value: boolean } export interface SwitchProps extends SwitchPropsIOS { /** * Color of the foreground switch grip. */ thumbColor?: ColorValue | undefined /** * Custom colors for the switch track * * Color when false and color when true */ trackColor?: | { false?: ColorValue | null | undefined true?: ColorValue | null | undefined } | undefined /** * If true the user won't be able to toggle the switch. * Default value is false. */ disabled?: boolean | undefined /** * Invoked with the change event as an argument when the value changes. */ onChange?: ((event: SwitchChangeEvent) => Promise | void) | null | undefined /** * Invoked with the new value when the value changes. */ onValueChange?: ((value: boolean) => Promise | void) | null | undefined /** * Used to locate this view in end-to-end tests. */ testID?: string | undefined /** * The value of the switch. If true the switch will be turned on. * Default value is false. */ value?: boolean | undefined /** * On iOS, custom color for the background. * Can be seen when the switch value is false or when the switch is disabled. */ ios_backgroundColor?: ColorValue | undefined style?: StyleProp | undefined } export interface SwitchPropsIOS extends ViewProps { /** * Background color when the switch is turned on. * * @deprecated use trackColor instead */ onTintColor?: ColorValue | undefined /** * Color of the foreground switch grip. * * @deprecated use thumbColor instead */ thumbTintColor?: ColorValue | undefined /** * Background color when the switch is turned off. * * @deprecated use trackColor instead */ tintColor?: ColorValue | undefined } export interface TargetedEvent { target: number } export declare class Text extends TextBase {} export declare const TextBase: Constructor & typeof TextComponent export declare class TextComponent extends React.Component {} export declare class TextInput extends TextInputBase { /** * Access the current focus state. */ static State: TextInputState /** * Returns if the input is currently focused. */ isFocused: () => boolean /** * Removes all text from the input. */ clear: () => void /** * Sets the start and end positions of text selection. */ setSelection: (start: number, end: number) => void } export interface TextInputAndroidProps { /** * When provided it will set the color of the cursor (or "caret") in the component. * Unlike the behavior of `selectionColor` the cursor color will be set independently * from the color of the text selection box. * @platform android */ cursorColor?: ColorValue | null | undefined /** * When provided it will set the color of the selection handles when highlighting text. * Unlike the behavior of `selectionColor` the handle color will be set independently * from the color of the text selection box. * @platform android */ selectionHandleColor?: ColorValue | null | undefined /** * Determines whether the individual fields in your app should be included in a * view structure for autofill purposes on Android API Level 26+. Defaults to auto. * To disable auto complete, use `off`. * * *Android Only* * * The following values work on Android only: * * - `auto` - let Android decide * - `no` - not important for autofill * - `noExcludeDescendants` - this view and its children aren't important for autofill * - `yes` - is important for autofill * - `yesExcludeDescendants` - this view is important for autofill but its children aren't */ importantForAutofill?: | 'auto' | 'no' | 'noExcludeDescendants' | 'yes' | 'yesExcludeDescendants' | undefined /** * When false, if there is a small amount of space available around a text input (e.g. landscape orientation on a phone), * the OS may choose to have the user edit the text inside of a full screen text input mode. * When true, this feature is disabled and users will always edit the text directly inside of the text input. * Defaults to false. */ disableFullscreenUI?: boolean | undefined /** * If defined, the provided image resource will be rendered on the left. */ inlineImageLeft?: string | undefined /** * Padding between the inline image, if any, and the text input itself. */ inlineImagePadding?: number | undefined /** * Sets the number of lines for a TextInput. * Use it with multiline set to true to be able to fill the lines. */ numberOfLines?: number | undefined /** * Sets the return key to the label. Use it instead of `returnKeyType`. * @platform android */ returnKeyLabel?: string | undefined /** * Set text break strategy on Android API Level 23+, possible values are simple, highQuality, balanced * The default value is simple. */ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined /** * The color of the textInput underline. */ underlineColorAndroid?: ColorValue | undefined /** * Vertically align text when `multiline` is set to true */ textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | undefined /** * When false, it will prevent the soft keyboard from showing when the field is focused. The default value is true */ showSoftInputOnFocus?: boolean | undefined /** * Vertically align text when `multiline` is set to true */ verticalAlign?: 'auto' | 'top' | 'bottom' | 'middle' | undefined } export declare const TextInputBase: Constructor & Constructor & typeof TextInputComponent export type TextInputChangeEvent = NativeSyntheticEvent export interface TextInputChangeEventData extends TargetedEvent { eventCount: number text: string selection?: | { start: number end: number } | undefined } export declare class TextInputComponent extends React.Component {} export type TextInputContentSizeChangeEvent = NativeSyntheticEvent export interface TextInputContentSizeChangeEventData { contentSize: { width: number; height: number } } export type TextInputEndEditingEvent = NativeSyntheticEvent export interface TextInputEndEditingEventData { text: string } export interface TextInputIOSProps { /** * If true, the keyboard shortcuts (undo/redo and copy buttons) are disabled. The default value is false. */ disableKeyboardShortcuts?: boolean | undefined /** * enum('never', 'while-editing', 'unless-editing', 'always') * When the clear button should appear on the right side of the text view */ clearButtonMode?: 'never' | 'while-editing' | 'unless-editing' | 'always' | undefined /** * If true, clears the text field automatically when editing begins */ clearTextOnFocus?: boolean | undefined /** * Determines the types of data converted to clickable URLs in the text input. * Only valid if `multiline={true}` and `editable={false}`. * By default no data types are detected. * * You can provide one type or an array of many types. * * Possible values for `dataDetectorTypes` are: * * - `'phoneNumber'` * - `'link'` * - `'address'` * - `'calendarEvent'` * - `'none'` * - `'all'` */ dataDetectorTypes?: DataDetectorTypes | DataDetectorTypes[] | undefined /** * If true, the keyboard disables the return key when there is no text and automatically enables it when there is text. * The default value is false. */ enablesReturnKeyAutomatically?: boolean | undefined /** * Determines the color of the keyboard. */ keyboardAppearance?: 'default' | 'light' | 'dark' | undefined /** * Provide rules for your password. * For example, say you want to require a password with at least eight characters consisting of a mix of uppercase and lowercase letters, at least one number, and at most two consecutive characters. * "required: upper; required: lower; required: digit; max-consecutive: 2; minlength: 8;" */ passwordRules?: string | null | undefined /** * If `true`, allows TextInput to pass touch events to the parent component. * This allows components to be swipeable from the TextInput on iOS, * as is the case on Android by default. * If `false`, TextInput always asks to handle the input (except when disabled). */ rejectResponderTermination?: boolean | null | undefined /** * See DocumentSelectionState.js, some state that is responsible for maintaining selection information for a document */ selectionState?: DocumentSelectionState | undefined /** * If false, disables spell-check style (i.e. red underlines). The default value is inherited from autoCorrect */ spellCheck?: boolean | undefined /** * Give the keyboard and the system information about the expected * semantic meaning for the content that users enter. * * To disable autofill, set textContentType to `none`. * * Possible values for `textContentType` are: * * - `'none'` * - `'URL'` * - `'addressCity'` * - `'addressCityAndState'` * - `'addressState'` * - `'countryName'` * - `'creditCardNumber'` * - `'creditCardExpiration'` (iOS 17+) * - `'creditCardExpirationMonth'` (iOS 17+) * - `'creditCardExpirationYear'` (iOS 17+) * - `'creditCardSecurityCode'` (iOS 17+) * - `'creditCardType'` (iOS 17+) * - `'creditCardName'` (iOS 17+) * - `'creditCardGivenName'` (iOS 17+) * - `'creditCardMiddleName'` (iOS 17+) * - `'creditCardFamilyName'` (iOS 17+) * - `'emailAddress'` * - `'familyName'` * - `'fullStreetAddress'` * - `'givenName'` * - `'jobTitle'` * - `'location'` * - `'middleName'` * - `'name'` * - `'namePrefix'` * - `'nameSuffix'` * - `'nickname'` * - `'organizationName'` * - `'postalCode'` * - `'streetAddressLine1'` * - `'streetAddressLine2'` * - `'sublocality'` * - `'telephoneNumber'` * - `'username'` * - `'password'` * - `'newPassword'` * - `'oneTimeCode'` * - `'birthdate'` (iOS 17+) * - `'birthdateDay'` (iOS 17+) * - `'birthdateMonth'` (iOS 17+) * - `'birthdateYear'` (iOS 17+) * - `'cellularEID'` (iOS 17.4+) * - `'cellularIMEI'` (iOS 17.4+) * - `'dateTime'` (iOS 15+) * - `'flightNumber'` (iOS 15+) * - `'shipmentTrackingNumber'` (iOS 15+) * */ textContentType?: | 'none' | 'URL' | 'addressCity' | 'addressCityAndState' | 'addressState' | 'countryName' | 'creditCardNumber' | 'creditCardExpiration' | 'creditCardExpirationMonth' | 'creditCardExpirationYear' | 'creditCardSecurityCode' | 'creditCardType' | 'creditCardName' | 'creditCardGivenName' | 'creditCardMiddleName' | 'creditCardFamilyName' | 'emailAddress' | 'familyName' | 'fullStreetAddress' | 'givenName' | 'jobTitle' | 'location' | 'middleName' | 'name' | 'namePrefix' | 'nameSuffix' | 'nickname' | 'organizationName' | 'postalCode' | 'streetAddressLine1' | 'streetAddressLine2' | 'sublocality' | 'telephoneNumber' | 'username' | 'password' | 'newPassword' | 'oneTimeCode' | 'birthdate' | 'birthdateDay' | 'birthdateMonth' | 'birthdateYear' | 'cellularEID' | 'cellularIMEI' | 'dateTime' | 'flightNumber' | 'shipmentTrackingNumber' | undefined /** * If false, scrolling of the text view will be disabled. The default value is true. Only works with multiline={true} */ scrollEnabled?: boolean | undefined /** * Set line break strategy on iOS. */ lineBreakStrategyIOS?: 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined /** * Set line break mode on iOS. * @platform ios */ lineBreakModeIOS?: | 'wordWrapping' | 'char' | 'clip' | 'head' | 'middle' | 'tail' | undefined /** * If `false`, the iOS system will not insert an extra space after a paste operation * neither delete one or two spaces after a cut or delete operation. * * The default value is `true`. */ smartInsertDelete?: boolean | undefined } export type TextInputKeyPressEvent = NativeSyntheticEvent export interface TextInputKeyPressEventData { key: string eventCount: number } export interface TextInputProps extends ViewProps, TextInputIOSProps, TextInputAndroidProps, AccessibilityProps { /** * Specifies whether fonts should scale to respect Text Size accessibility settings. * The default is `true`. */ allowFontScaling?: boolean | undefined /** * Can tell TextInput to automatically capitalize certain characters. * characters: all characters, * words: first letter of each word * sentences: first letter of each sentence (default) * none: don't auto capitalize anything * * https://reactnative.dev/docs/textinput#autocapitalize */ autoCapitalize?: 'none' | 'sentences' | 'words' | 'characters' | undefined /** * Specifies autocomplete hints for the system, so it can provide autofill. * On Android, the system will always attempt to offer autofill by using heuristics to identify the type of content. * To disable autocomplete, set autoComplete to off. * * The following values work across platforms: * * - `additional-name` * - `address-line1` * - `address-line2` * - `cc-number` * - `country` * - `current-password` * - `email` * - `family-name` * - `given-name` * - `honorific-prefix` * - `honorific-suffix` * - `name` * - `new-password` * - `off` * - `one-time-code` * - `postal-code` * - `street-address` * - `tel` * - `username` * * The following values work on iOS only: * * - `nickname` * - `organization` * - `organization-title` * - `url` * * The following values work on Android only: * * - `birthdate-day` * - `birthdate-full` * - `birthdate-month` * - `birthdate-year` * - `cc-csc` * - `cc-exp` * - `cc-exp-day` * - `cc-exp-month` * - `cc-exp-year` * - `2fa-app-otp` * - `email-otp` * - `flight-confirmation-code` * - `flight-number` * - `gender` * - `gift-card-number` * - `gift-card-pin` * - `loyalty-account-number` * - `name-family` * - `name-given` * - `name-middle` * - `name-middle-initial` * - `name-prefix` * - `name-suffix` * - `password` * - `password-new` * - `postal-address` * - `postal-address-country` * - `postal-address-dependent-locality` * - `postal-address-extended` * - `postal-address-extended-postal-code` * - `postal-address-locality` * - `postal-address-region` * - `postal-address-unit` * - `promo-code` * - `sms-otp` * - `tel-country-code` * - `tel-national` * - `tel-device` * - `upi-vpa` * - `wifi-password` * - `username-new` */ autoComplete?: | '2fa-app-otp' | 'additional-name' | 'address-line1' | 'address-line2' | 'birthdate-day' | 'birthdate-full' | 'birthdate-month' | 'birthdate-year' | 'cc-csc' | 'cc-exp' | 'cc-exp-day' | 'cc-exp-month' | 'cc-exp-year' | 'cc-number' | 'cc-name' | 'cc-given-name' | 'cc-middle-name' | 'cc-family-name' | 'cc-type' | 'country' | 'current-password' | 'email' | 'email-otp' | 'flight-confirmation-code' | 'flight-number' | 'family-name' | 'gender' | 'gift-card-number' | 'gift-card-pin' | 'given-name' | 'honorific-prefix' | 'honorific-suffix' | 'loyalty-account-number' | 'name' | 'name-family' | 'name-given' | 'name-middle' | 'name-middle-initial' | 'name-prefix' | 'name-suffix' | 'new-password' | 'nickname' | 'one-time-code' | 'organization' | 'organization-title' | 'password' | 'password-new' | 'postal-address' | 'postal-address-country' | 'postal-address-dependent-locality' | 'postal-address-extended' | 'postal-address-extended-postal-code' | 'postal-address-locality' | 'postal-address-region' | 'postal-address-unit' | 'postal-code' | 'promo-code' | 'street-address' | 'sms-otp' | 'tel' | 'tel-country-code' | 'tel-national' | 'tel-device' | 'upi-vpa' | 'url' | 'wifi-password' | 'username' | 'username-new' | 'off' | undefined /** * If false, disables auto-correct. * The default value is true. */ autoCorrect?: boolean | undefined /** * If true, focuses the input on componentDidMount. * The default value is false. */ autoFocus?: boolean | undefined /** * If `true`, the text field will blur when submitted. * The default value is true for single-line fields and false for * multiline fields. Note that for multiline fields, setting `blurOnSubmit` * to `true` means that pressing return will blur the field and trigger the * `onSubmitEditing` event instead of inserting a newline into the field. * * @deprecated * Note that `submitBehavior` now takes the place of `blurOnSubmit` and will * override any behavior defined by `blurOnSubmit`. * @see submitBehavior */ blurOnSubmit?: boolean | undefined /** * When the return key is pressed, * * For single line inputs: * * - `'newline`' defaults to `'blurAndSubmit'` * - `undefined` defaults to `'blurAndSubmit'` * * For multiline inputs: * * - `'newline'` adds a newline * - `undefined` defaults to `'newline'` * * For both single line and multiline inputs: * * - `'submit'` will only send a submit event and not blur the input * - `'blurAndSubmit`' will both blur the input and send a submit event */ submitBehavior?: SubmitBehavior | undefined /** * If true, caret is hidden. The default value is false. */ caretHidden?: boolean | undefined /** * If true, context menu is hidden. The default value is false. */ contextMenuHidden?: boolean | undefined /** * Provides an initial value that will change when the user starts typing. * Useful for simple use-cases where you don't want to deal with listening to events * and updating the value prop to keep the controlled state in sync. */ defaultValue?: string | undefined /** * If false, text is not editable. The default value is true. */ editable?: boolean | undefined /** * enum("default", 'numeric', 'email-address', "ascii-capable", 'numbers-and-punctuation', 'url', 'number-pad', 'phone-pad', 'name-phone-pad', * 'decimal-pad', 'twitter', 'web-search', 'visible-password') * Determines which keyboard to open, e.g.numeric. * The following values work across platforms: - default - numeric - email-address - phone-pad * The following values work on iOS: - ascii-capable - numbers-and-punctuation - url - number-pad - name-phone-pad - decimal-pad - twitter - web-search * The following values work on Android: - visible-password */ keyboardType?: KeyboardTypeOptions | undefined /** * Works like the inputmode attribute in HTML, it determines which keyboard to open, e.g. numeric and has precedence over keyboardType. */ inputMode?: InputModeOptions | undefined /** * Limits the maximum number of characters that can be entered. * Use this instead of implementing the logic in JS to avoid flicker. */ maxLength?: number | undefined /** * If true, the text input can be multiple lines. The default value is false. */ multiline?: boolean | undefined /** * Callback that is called when the text input is blurred * * Note: If you are trying to find the last value of TextInput, you can use the `onEndEditing` * event, which is fired upon completion of editing. */ onBlur?: ((e: BlurEvent) => void) | undefined /** * Callback that is called when the text input's text changes. */ onChange?: ((e: TextInputChangeEvent) => void) | undefined /** * Callback that is called when the text input's text changes. * Changed text is passed as an argument to the callback handler. */ onChangeText?: ((text: string) => void) | undefined /** * Callback that is called when the text input's content size changes. * This will be called with * `{ nativeEvent: { contentSize: { width, height } } }`. * * Only called for multiline text inputs. */ onContentSizeChange?: ((e: TextInputContentSizeChangeEvent) => void) | undefined /** * Callback that is called when text input ends. */ onEndEditing?: ((e: TextInputEndEditingEvent) => void) | undefined /** * Called when a single tap gesture is detected. */ onPress?: ((e: NativeSyntheticEvent) => void) | undefined /** * Callback that is called when a touch is engaged. */ onPressIn?: ((e: NativeSyntheticEvent) => void) | undefined /** * Callback that is called when a touch is released. */ onPressOut?: ((e: NativeSyntheticEvent) => void) | undefined /** * Callback that is called when the text input is focused */ onFocus?: ((e: FocusEvent) => void) | undefined /** * Callback that is called when the text input selection is changed. */ onSelectionChange?: ((e: TextInputSelectionChangeEvent) => void) | undefined /** * Callback that is called when the text input's submit button is pressed. */ onSubmitEditing?: ((e: TextInputSubmitEditingEvent) => void) | undefined /** * Invoked on content scroll with * `{ nativeEvent: { contentOffset: { x, y } } }`. * * May also contain other properties from ScrollEvent but on Android contentSize is not provided for performance reasons. */ onScroll?: ((e: TextInputScrollEvent) => void) | undefined /** * Callback that is called when a key is pressed. * This will be called with * `{ nativeEvent: { key: keyValue } }` * where keyValue is 'Enter' or 'Backspace' for respective keys and the typed-in character otherwise including ' ' for space. * * Fires before onChange callbacks. * Note: on Android only the inputs from soft keyboard are handled, not the hardware keyboard inputs. */ onKeyPress?: ((e: TextInputKeyPressEvent) => void) | undefined /** * The string that will be rendered before text input has been entered */ placeholder?: string | undefined /** * The text color of the placeholder string */ placeholderTextColor?: ColorValue | undefined /** * If `true`, text is not editable. The default value is `false`. */ readOnly?: boolean | undefined /** * enum('default', 'go', 'google', 'join', 'next', 'route', 'search', 'send', 'yahoo', 'done', 'emergency-call') * Determines how the return key should look. */ returnKeyType?: ReturnKeyTypeOptions | undefined /** * Determines what text should be shown to the return key on virtual keyboards. * Has precedence over the returnKeyType prop. */ enterKeyHint?: EnterKeyHintTypeOptions | undefined /** * If true, the text input obscures the text entered so that sensitive text like passwords stay secure. * The default value is false. */ secureTextEntry?: boolean | undefined /** * If true, all text will automatically be selected on focus */ selectTextOnFocus?: boolean | undefined /** * The start and end of the text input's selection. Set start and end to * the same value to position the cursor. */ selection?: { start: number; end?: number | undefined } | undefined /** * The highlight (and cursor on ios) color of the text input */ selectionColor?: ColorValue | undefined /** * Styles */ style?: StyleProp | undefined /** * Align the input text to the left, center, right, start, or end side of the input field. */ textAlign?: 'left' | 'center' | 'right' | 'start' | 'end' | undefined /** * Used to locate this view in end-to-end tests */ testID?: string | undefined /** * Used to connect to an InputAccessoryView. Not part of react-natives documentation, but present in examples and * code. * See https://reactnative.dev/docs/inputaccessoryview for more information. */ inputAccessoryViewID?: string | undefined /** * An optional label that overrides the default input accessory view button label. * @platform ios */ inputAccessoryViewButtonLabel?: string | undefined /** * The value to show for the text input. TextInput is a controlled component, * which means the native value will be forced to match this value prop if provided. * For most uses this works great, but in some cases this may cause flickering - one common cause is preventing edits by keeping value the same. * In addition to simply setting the same value, either set editable={false}, * or set/update maxLength to prevent unwanted edits without flicker. */ value?: string | undefined /** * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: * - null/undefined (default): inherit from the parent node or the global default (0) * - 0: no max, ignore parent/global default * - >= 1: sets the maxFontSizeMultiplier of this node to this value */ maxFontSizeMultiplier?: number | null | undefined } export type TextInputScrollEvent = NativeSyntheticEvent export interface TextInputScrollEventData { contentOffset: { x: number; y: number } responderIgnoreScroll?: boolean | undefined } export type TextInputSelectionChangeEvent = NativeSyntheticEvent export interface TextInputSelectionChangeEventData extends TargetedEvent { selection: { start: number end: number } } export interface TextInputState { /** * @deprecated Use currentlyFocusedInput * Returns the ID of the currently focused text field, if one exists * If no text field is focused it returns null */ currentlyFocusedField(): number /** * Returns the ref of the currently focused text field, if one exists * If no text field is focused it returns null */ currentlyFocusedInput(): HostInstance /** * @param textField ref of the text field to focus * Focuses the specified text field * noop if the text field was already focused */ focusTextInput(textField?: HostInstance): void /** * @param textField ref of the text field to focus * Unfocuses the specified text field * noop if it wasn't focused */ blurTextInput(textField?: HostInstance): void } export type TextInputSubmitEditingEvent = NativeSyntheticEvent export interface TextInputSubmitEditingEventData { text: string } export type TextLayoutEvent = NativeSyntheticEvent export interface TextLayoutEventData extends TargetedEvent { lines: TextLayoutLine[] } export interface TextLayoutLine { ascender: number capHeight: number descender: number height: number text: string width: number x: number xHeight: number y: number } export interface TextProps extends TextPropsIOS, TextPropsAndroid, AccessibilityProps { /** * Specifies whether fonts should scale to respect Text Size accessibility settings. * The default is `true`. */ allowFontScaling?: boolean | undefined children?: React.ReactNode | undefined /** * This can be one of the following values: * * - `head` - The line is displayed so that the end fits in the container and the missing text * at the beginning of the line is indicated by an ellipsis glyph. e.g., "...wxyz" * - `middle` - The line is displayed so that the beginning and end fit in the container and the * missing text in the middle is indicated by an ellipsis glyph. "ab...yz" * - `tail` - The line is displayed so that the beginning fits in the container and the * missing text at the end of the line is indicated by an ellipsis glyph. e.g., "abcd..." * - `clip` - Lines are not drawn past the edge of the text container. * * The default is `tail`. * * `numberOfLines` must be set in conjunction with this prop. * * > `clip` is working only for iOS */ ellipsizeMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined /** * Used to reference react managed views from native code. */ id?: string | undefined /** * Line Break mode. Works only with numberOfLines. * clip is working only for iOS */ lineBreakMode?: 'head' | 'middle' | 'tail' | 'clip' | undefined /** * Used to truncate the text with an ellipsis after computing the text * layout, including line wrapping, such that the total number of lines * does not exceed this number. * * This prop is commonly used with `ellipsizeMode`. */ numberOfLines?: number | undefined /** * Invoked on mount and layout changes with * * {nativeEvent: { layout: {x, y, width, height}}}. */ onLayout?: ((event: LayoutChangeEvent) => void) | undefined /** * Invoked on Text layout */ onTextLayout?: ((event: TextLayoutEvent) => void) | undefined /** * This function is called on press. * Text intrinsically supports press handling with a default highlight state (which can be disabled with suppressHighlighting). */ onPress?: ((event: GestureResponderEvent) => void) | undefined onPressIn?: ((event: GestureResponderEvent) => void) | undefined onPressOut?: ((event: GestureResponderEvent) => void) | undefined /** * This function is called on long press. * e.g., `onLongPress={this.increaseSize}>` */ onLongPress?: ((event: GestureResponderEvent) => void) | undefined /** * @see https://reactnative.dev/docs/text#style */ style?: StyleProp | undefined /** * Used to locate this view in end-to-end tests. */ testID?: string | undefined /** * Used to reference react managed views from native code. */ nativeID?: string | undefined /** * Specifies largest possible scale a font can reach when allowFontScaling is enabled. Possible values: * - null/undefined (default): inherit from the parent node or the global default (0) * - 0: no max, ignore parent/global default * - >= 1: sets the maxFontSizeMultiplier of this node to this value */ maxFontSizeMultiplier?: number | null | undefined /** * Specifies smallest possible scale a font can reach when adjustsFontSizeToFit is enabled. (values 0.01-1.0). */ minimumFontScale?: number | undefined /** * Controls how touch events are handled. Similar to `View`'s `pointerEvents`. */ pointerEvents?: ViewStyle['pointerEvents'] | undefined /** * Defines how far your touch may move off of the button, before deactivating the button. */ pressRetentionOffset?: | { top: number; left: number; bottom: number; right: number } | undefined } export interface TextPropsAndroid { /** * Specifies the disabled state of the text view for testing purposes. */ disabled?: boolean | undefined /** * Lets the user select text, to use the native copy and paste functionality. */ selectable?: boolean | undefined /** * The highlight color of the text. */ selectionColor?: ColorValue | undefined /** * Set text break strategy on Android API Level 23+ * default is `highQuality`. */ textBreakStrategy?: 'simple' | 'highQuality' | 'balanced' | undefined /** * Determines the types of data converted to clickable URLs in the text element. * By default no data types are detected. */ dataDetectorType?: null | 'phoneNumber' | 'link' | 'email' | 'none' | 'all' | undefined /** * Hyphenation strategy */ android_hyphenationFrequency?: 'normal' | 'none' | 'full' | undefined } export interface TextPropsIOS { /** * Specifies whether font should be scaled down automatically to fit given style constraints. */ adjustsFontSizeToFit?: boolean | undefined /** * The Dynamic Type scale ramp to apply to this element on iOS. */ dynamicTypeRamp?: | 'caption2' | 'caption1' | 'footnote' | 'subheadline' | 'callout' | 'body' | 'headline' | 'title3' | 'title2' | 'title1' | 'largeTitle' | undefined /** * When `true`, no visual change is made when text is pressed down. By * default, a gray oval highlights the text on press down. */ suppressHighlighting?: boolean | undefined /** * Set line break strategy on iOS. */ lineBreakStrategyIOS?: 'none' | 'standard' | 'hangul-word' | 'push-out' | undefined } export interface TextStyle extends TextStyleIOS, TextStyleAndroid, ViewStyle { color?: ColorValue | undefined fontFamily?: string | undefined fontSize?: number | undefined fontStyle?: 'normal' | 'italic' | undefined /** * Specifies font weight. The values 'normal' and 'bold' are supported * for most fonts. Not all fonts have a variant for each of the numeric * values, in that case the closest one is chosen. */ fontWeight?: | 'normal' | 'bold' | '100' | '200' | '300' | '400' | '500' | '600' | '700' | '800' | '900' | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | 'ultralight' | 'thin' | 'light' | 'medium' | 'regular' | 'semibold' | 'condensedBold' | 'condensed' | 'heavy' | 'black' | undefined /** * Specifies OpenType font variation axis values using CSS syntax or an * object keyed by four-character axis tags. An empty string or object resets * inherited variation settings. On Android, this requires API level 26 or * later. */ fontVariationSettings?: FontVariationSettings | undefined letterSpacing?: number | undefined lineHeight?: number | undefined textAlign?: | 'auto' | 'left' | 'right' | 'center' | 'justify' | 'start' | 'end' | undefined textDecorationLine?: | 'none' | 'underline' | 'line-through' | 'underline line-through' | undefined textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy' | undefined textDecorationColor?: ColorValue | undefined textShadowColor?: ColorValue | undefined textShadowOffset?: { width: number; height: number } | undefined textShadowRadius?: number | undefined textTransform?: 'none' | 'capitalize' | 'uppercase' | 'lowercase' | undefined userSelect?: 'auto' | 'none' | 'text' | 'contain' | 'all' | undefined } export interface TextStyleAndroid extends ViewStyle { textAlignVertical?: 'auto' | 'top' | 'bottom' | 'center' | undefined verticalAlign?: 'auto' | 'top' | 'bottom' | 'middle' | undefined includeFontPadding?: boolean | undefined } export interface TextStyleIOS extends ViewStyle { fontVariant?: FontVariant[] | undefined textDecorationColor?: ColorValue | undefined textDecorationStyle?: 'solid' | 'double' | 'dotted' | 'dashed' | 'wavy' | undefined writingDirection?: 'auto' | 'ltr' | 'rtl' | undefined } export interface TimerMixin { setTimeout: typeof setTimeout clearTimeout: typeof clearTimeout setInterval: typeof setInterval clearInterval: typeof clearInterval setImmediate: typeof setImmediate clearImmediate: typeof clearImmediate requestAnimationFrame: typeof requestAnimationFrame cancelAnimationFrame: typeof cancelAnimationFrame } export interface Touchable { onTouchStart?: ((event: GestureResponderEvent) => void) | undefined onTouchMove?: ((event: GestureResponderEvent) => void) | undefined onTouchEnd?: ((event: GestureResponderEvent) => void) | undefined onTouchCancel?: ((event: GestureResponderEvent) => void) | undefined onTouchEndCapture?: ((event: GestureResponderEvent) => void) | undefined } export interface TransformsStyle { transform?: | Readonly< MaximumOneOf< PerspectiveTransform & RotateTransform & RotateXTransform & RotateYTransform & RotateZTransform & ScaleTransform & ScaleXTransform & ScaleYTransform & TranslateXTransform & TranslateYTransform & SkewXTransform & SkewYTransform & MatrixTransform >[] > | string | undefined transformOrigin?: Array | string | undefined /** * @deprecated Use matrix in transform prop instead. */ transformMatrix?: Array | undefined /** * @deprecated Use rotate in transform prop instead. */ rotation?: AnimatableNumericValue | undefined /** * @deprecated Use scaleX in transform prop instead. */ scaleX?: AnimatableNumericValue | undefined /** * @deprecated Use scaleY in transform prop instead. */ scaleY?: AnimatableNumericValue | undefined /** * @deprecated Use translateX in transform prop instead. */ translateX?: AnimatableNumericValue | undefined /** * @deprecated Use translateY in transform prop instead. */ translateY?: AnimatableNumericValue | undefined } export interface TranslateXTransform { translateX: AnimatableNumericValue | `${number}%` } export interface TranslateYTransform { translateY: AnimatableNumericValue | `${number}%` } export interface TVViewPropsIOS { /** * *(Apple TV only)* When set to true, this view will be focusable * and navigable using the Apple TV remote. * * @platform ios */ isTVSelectable?: boolean | undefined /** * *(Apple TV only)* May be set to true to force the Apple TV focus engine to move focus to this view. * * @platform ios * @deprecated Use `focusable` instead */ hasTVPreferredFocus?: boolean | undefined /** * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0. * * @platform ios */ tvParallaxShiftDistanceX?: number | undefined /** * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 2.0. * * @platform ios */ tvParallaxShiftDistanceY?: number | undefined /** * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 0.05. * * @platform ios */ tvParallaxTiltAngle?: number | undefined /** * *(Apple TV only)* May be used to change the appearance of the Apple TV parallax effect when this view goes in or out of focus. Defaults to 1.0. * * @platform ios */ tvParallaxMagnification?: number | undefined } export declare class View extends ViewBase { /** * Is 3D Touch / Force Touch available (i.e. will touch events include `force`) * @platform ios */ static forceTouchAvailable: boolean } export declare const ViewBase: Constructor & typeof ViewComponent export declare class ViewComponent extends React.Component {} export interface ViewProps extends ViewPropsAndroid, ViewPropsIOS, GestureResponderHandlers, Touchable, PointerEvents, AccessibilityProps { children?: React.ReactNode | undefined /** * This defines how far a touch event can start away from the view. * Typical interface guidelines recommend touch targets that are at least * 30 - 40 points/density-independent pixels. If a Touchable view has * a height of 20 the touchable height can be extended to 40 with * hitSlop={{top: 10, bottom: 10, left: 0, right: 0}} * NOTE The touch area never extends past the parent view bounds and * the Z-index of sibling views always takes precedence if a touch * hits two overlapping views. */ hitSlop?: null | Insets | number | undefined /** * Used to reference react managed views from native code. */ id?: string | undefined /** * Whether this view needs to rendered offscreen and composited with an alpha in order to preserve 100% correct colors and blending behavior. * The default (false) falls back to drawing the component and its children * with an alpha applied to the paint used to draw each element instead of rendering the full component offscreen and compositing it back with an alpha value. * This default may be noticeable and undesired in the case where the View you are setting an opacity on * has multiple overlapping elements (e.g. multiple overlapping Views, or text and a background). * * Rendering offscreen to preserve correct alpha behavior is extremely expensive * and hard to debug for non-native developers, which is why it is not turned on by default. * If you do need to enable this property for an animation, * consider combining it with renderToHardwareTextureAndroid if the view contents are static (i.e. it doesn't need to be redrawn each frame). * If that property is enabled, this View will be rendered off-screen once, * saved in a hardware texture, and then composited onto the screen with an alpha each frame without having to switch rendering targets on the GPU. */ needsOffscreenAlphaCompositing?: boolean | undefined /** * Invoked on mount and layout changes with * * {nativeEvent: { layout: {x, y, width, height}}}. */ onLayout?: ((event: LayoutChangeEvent) => void) | undefined /** * * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class: * * .box-none { * pointer-events: none; * } * .box-none * { * pointer-events: all; * } * * box-only is the equivalent of * * .box-only { * pointer-events: all; * } * .box-only * { * pointer-events: none; * } * * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes, * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform. */ pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined /** * * This is a special performance property exposed by RCTView and is useful for scrolling content when there are many subviews, * most of which are offscreen. For this property to be effective, it must be applied to a view that contains many subviews that extend outside its bound. * The subviews must also have overflow: hidden, as should the containing view (or one of its superviews). */ removeClippedSubviews?: boolean | undefined style?: StyleProp | undefined /** * Used to locate this view in end-to-end tests. */ testID?: string | undefined /** * Used to reference react managed views from native code. */ nativeID?: string | undefined /** * Views that are only used to layout their children or otherwise don't draw anything * may be automatically removed from the native hierarchy as an optimization. * Set this property to false to disable this optimization and ensure that this View exists in the native view hierarchy. */ collapsable?: boolean | undefined /** * Setting to false prevents direct children of the view from being removed * from the native view hierarchy, similar to the effect of setting * `collapsable={false}` on each child. */ collapsableChildren?: boolean | undefined } export interface ViewPropsAndroid { /** * Callback that is called when the view is blurred. * * Note: This will only be called if the view is focusable. */ onBlur?: ((e: BlurEvent) => void) | null | undefined /** * Callback that is called when the view is focused. * * Note: This will only be called if the view is focusable. */ onFocus?: ((e: FocusEvent) => void) | null | undefined /** * Whether this view should render itself (and all of its children) into a single hardware texture on the GPU. * * On Android, this is useful for animations and interactions that only modify opacity, rotation, translation, and/or scale: * in those cases, the view doesn't have to be redrawn and display lists don't need to be re-executed. The texture can just be * re-used and re-composited with different parameters. The downside is that this can use up limited video memory, so this prop should be set back to false at the end of the interaction/animation. */ renderToHardwareTextureAndroid?: boolean | undefined /** * Whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. */ focusable?: boolean | undefined /** * Indicates whether this `View` should be focusable with a non-touch input device, eg. receive focus with a hardware keyboard. * See https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex * for more details. * * Supports the following values: * - 0 (View is focusable) * - -1 (View is not focusable) */ tabIndex?: 0 | -1 | undefined } export interface ViewPropsIOS extends TVViewPropsIOS { /** * Whether this view should be rendered as a bitmap before compositing. * * On iOS, this is useful for animations and interactions that do not modify this component's dimensions nor its children; * for example, when translating the position of a static view, rasterization allows the renderer to reuse a cached bitmap of a static view * and quickly composite it during each frame. * * Rasterization incurs an off-screen drawing pass and the bitmap consumes memory. * Test and measure when using this property. */ shouldRasterizeIOS?: boolean | undefined } export interface ViewStyle extends FlexStyle, ShadowStyleIOS, TransformsStyle { backfaceVisibility?: 'visible' | 'hidden' | undefined backgroundColor?: ColorValue | undefined borderBlockColor?: ColorValue | undefined borderBlockEndColor?: ColorValue | undefined borderBlockStartColor?: ColorValue | undefined borderBottomColor?: ColorValue | undefined borderBottomEndRadius?: AnimatableNumericValue | string | undefined borderBottomLeftRadius?: AnimatableNumericValue | string | undefined borderBottomRightRadius?: AnimatableNumericValue | string | undefined borderBottomStartRadius?: AnimatableNumericValue | string | undefined borderColor?: ColorValue | undefined /** * On iOS 13+, it is possible to change the corner curve of borders. * @platform ios */ borderCurve?: 'circular' | 'continuous' | undefined borderEndColor?: ColorValue | undefined borderEndEndRadius?: AnimatableNumericValue | string | undefined borderEndStartRadius?: AnimatableNumericValue | string | undefined borderLeftColor?: ColorValue | undefined borderRadius?: AnimatableNumericValue | string | undefined borderRightColor?: ColorValue | undefined borderStartColor?: ColorValue | undefined borderStartEndRadius?: AnimatableNumericValue | string | undefined borderStartStartRadius?: AnimatableNumericValue | string | undefined borderStyle?: 'solid' | 'dotted' | 'dashed' | undefined borderTopColor?: ColorValue | undefined borderTopEndRadius?: AnimatableNumericValue | string | undefined borderTopLeftRadius?: AnimatableNumericValue | string | undefined borderTopRightRadius?: AnimatableNumericValue | string | undefined borderTopStartRadius?: AnimatableNumericValue | string | undefined outlineColor?: ColorValue | undefined outlineOffset?: AnimatableNumericValue | undefined outlineStyle?: 'solid' | 'dotted' | 'dashed' | undefined outlineWidth?: AnimatableNumericValue | undefined opacity?: AnimatableNumericValue | undefined /** * Sets the elevation of a view, using Android's underlying * [elevation API](https://developer.android.com/training/material/shadows-clipping.html#Elevation). * This adds a drop shadow to the item and affects z-order for overlapping views. * Only supported on Android 5.0+, has no effect on earlier versions. * * @platform android */ elevation?: number | undefined /** * Controls whether the View can be the target of touch events. */ pointerEvents?: 'box-none' | 'none' | 'box-only' | 'auto' | undefined isolation?: 'auto' | 'isolate' | undefined cursor?: CursorValue | undefined boxShadow?: ReadonlyArray | string | undefined filter?: ReadonlyArray | string | undefined mixBlendMode?: BlendMode | undefined backgroundImage?: ReadonlyArray | string | undefined experimental_backgroundImage?: ReadonlyArray | string | undefined backgroundSize?: ReadonlyArray | string | undefined experimental_backgroundSize?: ReadonlyArray | string | undefined backgroundPosition?: ReadonlyArray | string | undefined experimental_backgroundPosition?: | ReadonlyArray | string | undefined backgroundRepeat?: ReadonlyArray | string | undefined experimental_backgroundRepeat?: | ReadonlyArray | string | undefined } export interface ViewInstance extends View {} export interface TextInstance extends Text {} export interface TextInputInstance extends TextInput {}