Skip to content

Commit

Permalink
fix: type defs for hooks file
Browse files Browse the repository at this point in the history
  • Loading branch information
mateusz1913 committed Jul 12, 2021
1 parent e630a06 commit c2e43f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/hooks.ts
@@ -1,6 +1,7 @@
import { useEffect, useReducer } from 'react';

import { AvoidSoftInput } from './AvoidSoftInputModule';
import type { State } from './stateReducer';
import { createHiddenAction, createShownAction, initialState, reducer } from './stateReducer';

export function useSoftInputHidden(callback: ({ softInputHeight }: {
Expand All @@ -27,7 +28,7 @@ export function useSoftInputShown(callback: ({ softInputHeight }: {
}, [ callback ]);
}

export function useSoftInputState() {
export function useSoftInputState(): State {
const [ state, dispatch ] = useReducer(reducer, initialState);

useSoftInputHidden(() => {
Expand Down
2 changes: 1 addition & 1 deletion src/stateReducer.ts
Expand Up @@ -22,7 +22,7 @@ export function createShownAction(height: number): Action {
};
}

interface State {
export interface State {
isSoftInputShown: boolean;
softInputHeight: number;
}
Expand Down

0 comments on commit c2e43f5

Please sign in to comment.