Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add accurate innerRefs to types #496

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,21 @@ import * as React from 'react'
import {
ScrollViewProps,
FlatListProps,
SectionListProps
SectionListProps,
ScrollView,
FlatList,
SectionList
} from 'react-native'

interface KeyboardAwareProps {
interface KeyboardAwareProps<E extends JSX.Element> {
/**
* Catches the reference of the component.
*
*
* @type {function}
* @memberof KeyboardAwareProps
*/
innerRef?: (ref: JSX.Element) => void
innerRef?: (ref: E) => void
/**
* Adds an extra offset that represents the TabBarIOS height.
*
Expand Down Expand Up @@ -144,13 +147,13 @@ interface KeyboardAwareProps {
}

interface KeyboardAwareScrollViewProps
extends KeyboardAwareProps,
extends KeyboardAwareProps<ScrollView>,
ScrollViewProps {}
interface KeyboardAwareFlatListProps<ItemT>
extends KeyboardAwareProps,
extends KeyboardAwareProps<FlatList>,
FlatListProps<ItemT> {}
interface KeyboardAwareSectionListProps<ItemT>
extends KeyboardAwareProps,
extends KeyboardAwareProps<SectionList>,
SectionListProps<ItemT> {}

interface KeyboardAwareState {
Expand Down