1 Star 0 Fork 1

Sanguine/react-native-keyboard-aware-scroll-view

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
index.d.ts 4.31 KB
一键复制 编辑 原始数据 按行查看 历史
Michael Petretti 提交于 2019-08-14 21:22 . Update index.d.ts (#341)
// Type definitions for react-native-keyboard-aware-scroll-view
// Project: https://github.com/APSL/react-native-keyboard-aware-scroll-view
// Definitions by: Kyle Roach <https://github.com/iRoachie>
// TypeScript Version: 2.3.2
import * as React from 'react'
import {
ScrollViewProps,
FlatListProps,
SectionListProps
} from 'react-native'
interface KeyboardAwareProps {
/**
* Catches the reference of the component.
*
*
* @type {function}
* @memberof KeyboardAwareProps
*/
innerRef?: (ref: JSX.Element) => void
/**
* Adds an extra offset that represents the TabBarIOS height.
*
* Default is false
* @type {boolean}
* @memberof KeyboardAwareProps
*/
viewIsInsideTabBar?: boolean
/**
* Coordinates that will be used to reset the scroll when the keyboard hides.
*
* @type {{
* x: number,
* y: number
* }}
* @memberof KeyboardAwareProps
*/
resetScrollToCoords?: {
x: number
y: number
}
/**
* Lets the user enable or disable automatic resetScrollToCoords
*
* @type {boolean}
* @memberof KeyboardAwareProps
*/
enableResetScrollToCoords?: boolean
/**
* When focus in TextInput will scroll the position
*
* Default is true
*
* @type {boolean}
* @memberof KeyboardAwareProps
*/
enableAutomaticScroll?: boolean
/**
* Enables keyboard aware settings for Android
*
* Default is false
*
* @type {boolean}
* @memberof KeyboardAwareProps
*/
enableOnAndroid?: boolean
/**
* Adds an extra offset when focusing the TextInputs.
*
* Default is 75
* @type {number}
* @memberof KeyboardAwareProps
*/
extraHeight?: number
/**
* Adds an extra offset to the keyboard.
* Useful if you want to stick elements above the keyboard.
*
* Default is 0
*
* @type {number}
* @memberof KeyboardAwareProps
*/
extraScrollHeight?: number
/**
* Sets the delay time before scrolling to new position
*
* Default is 250
*
* @type {number}
* @memberof KeyboardAwareProps
*/
keyboardOpeningTime?: number
/**
* Callback when the keyboard will show.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardWillShow?: (frames: Object) => void
/**
* Callback when the keyboard did show.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardDidShow?: (frames: Object) => void
/**
* Callback when the keyboard will hide.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardWillHide?: (frames: Object) => void
/**
* Callback when the keyboard did hide.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardDidHide?: (frames: Object) => void
/**
* Callback when the keyboard frame will change.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardWillChangeFrame?: (frames: Object) => void
/**
* Callback when the keyboard frame did change.
*
* @param frames Information about the keyboard frame and animation.
*/
onKeyboardDidChangeFrame?: (frames: Object) => void
}
interface KeyboardAwareScrollViewProps
extends KeyboardAwareProps,
ScrollViewProps {}
interface KeyboardAwareFlatListProps<ItemT>
extends KeyboardAwareProps,
FlatListProps<ItemT> {}
interface KeyboardAwareSectionListProps<ItemT>
extends KeyboardAwareProps,
SectionListProps<ItemT> {}
interface KeyboardAwareState {
keyboardSpace: number
}
declare class ScrollableComponent<P, S> extends React.Component<P, S> {
getScrollResponder: () => void
scrollToPosition: (x: number, y: number, animated?: boolean) => void
scrollToEnd: (animated?: boolean) => void
scrollForExtraHeightOnAndroid: (extraHeight: number) => void
scrollToFocusedInput: (
reactNode: Object,
extraHeight?: number,
keyboardOpeningTime?: number
) => void
}
export class KeyboardAwareMixin {}
export class KeyboardAwareScrollView extends ScrollableComponent<
KeyboardAwareScrollViewProps,
KeyboardAwareState
> {}
export class KeyboardAwareFlatList extends ScrollableComponent<
KeyboardAwareFlatListProps<any>,
KeyboardAwareState
> {}
export class KeyboardAwareSectionList extends ScrollableComponent<
KeyboardAwareSectionListProps<any>,
KeyboardAwareState
> {}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sxw_sxw/react-native-keyboard-aware-scroll-view.git
git@gitee.com:sxw_sxw/react-native-keyboard-aware-scroll-view.git
sxw_sxw
react-native-keyboard-aware-scroll-view
react-native-keyboard-aware-scroll-view
master

搜索帮助