Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 7 additions & 1 deletion src/index.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,13 @@ type FocusManagerChange = (focused: boolean) => void
type FocusManagerRender = ({|
focused: boolean,
blur: () => void,
bind: {| tabIndex: number, onFocus: () => void, onBlur: () => void |},
bind: {|
tabIndex: number,
onFocus: () => void,
onBlur: () => void,
onMouseDown: () => void,
onMouseUp: () => void,
|},
|}) => React.Node

declare export var FocusManager: React.ComponentType<
Expand Down
6 changes: 6 additions & 0 deletions tests/test_flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,18 @@ const noop = () => null
;(blur: Function)
;(bind.onFocus: Function)
;(bind.onBlur: Function)
;(bind.onMouseDown: Function)
;(bind.onMouseUp: Function)
// $FlowFixMe
;(focused: number)
// $FlowFixMe
;(bind.onFocus: number)
// $FlowFixMe
;(bind.onBlur: number)
// $FlowFixMe
;(bind.onMouseDown: number)
// $FlowFixMe
;(bind.onMouseUp: number)
return null
}
const onChange = focused => {
Expand Down
8 changes: 7 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,13 @@ export type FocusManagerChange = Callback<boolean>
export type FocusManagerRender = RenderFn<{
focused: boolean
blur: () => void
bind: { tabIndex: number; onFocus: () => void; onBlur: () => void }
bind: {
tabIndex: number
onFocus: () => void
onBlur: () => void
onMouseDown: () => void
onMouseUp: () => void
}
}>

export const FocusManager: React.ComponentType<
Expand Down