Skip to content

Commit

Permalink
add missing 'suppressRefError' option typings
Browse files Browse the repository at this point in the history
  • Loading branch information
rifler committed Aug 20, 2018
1 parent 8da833f commit a2233a7
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
10 changes: 10 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -926,6 +926,16 @@
"contributions": [
"example"
]
},
{
"login": "rifler",
"name": "Dmitrii Kanatnikov",
"avatar_url": "https://avatars3.githubusercontent.com/u/871583",
"profile": "https://github.com/rifler",
"contributions": [
"code",
"doc"
]
}
]
}
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ harder to contribute to.
- [environment](#environment)
- [onOuterClick](#onouterclick)
- [scrollIntoView](#scrollintoview)
- [suppressRefError](#suppressRefError)
- [stateChangeTypes](#statechangetypes)
- [Control Props](#control-props)
- [Children Function](#children-function)
Expand Down Expand Up @@ -495,6 +496,12 @@ node you render in downshift). Internally we use
so if you use that package then you wont be adding any additional bytes to your
bundle :)

### suppressRefError

> `boolean` | defaults false
See [`getRootProps`](#getrootprops) for details

## stateChangeTypes

There are a few props that expose changes to state
Expand Down
14 changes: 12 additions & 2 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export interface DownshiftProps<Item> {
options: StateChangeOptions<Item>,
stateAndHelpers: ControllerStateAndHelpers<Item>,
) => void
suppressRefError?: boolean
}

export interface Environment {
Expand Down Expand Up @@ -105,6 +106,11 @@ export interface GetInputPropsOptions
export interface GetLabelPropsOptions
extends React.HTMLProps<HTMLLabelElement> {}

export interface GetMenuPropsOptions {
refKey?: string
'aria-label'?: string
}

export interface getToggleButtonPropsOptions
extends React.HTMLProps<HTMLButtonElement> {}

Expand All @@ -118,11 +124,15 @@ export interface GetItemPropsOptions<Item>
item: Item
}

export interface SuppressRefErrorOptions {
suppressRefError?: boolean
}

export interface PropGetters<Item> {
getRootProps: (options: GetRootPropsOptions) => any
getRootProps: (options: GetRootPropsOptions, suppressOptions?: SuppressRefErrorOptions) => any
getToggleButtonProps: (options?: getToggleButtonPropsOptions) => any
getLabelProps: (options?: GetLabelPropsOptions) => any
getMenuProps: (options?: {}) => any
getMenuProps: (options?: GetMenuPropsOptions, suppressOptions?: SuppressRefErrorOptions) => any
getInputProps: (options?: GetInputPropsOptions) => any
getItemProps: (options: GetItemPropsOptions<Item>) => any
}
Expand Down

0 comments on commit a2233a7

Please sign in to comment.