Skip to content

Commit

Permalink
fix(TS): improve accuracy of types (#570)
Browse files Browse the repository at this point in the history
<!--
Thanks for your interest in the project. Bugs filed and PRs submitted are appreciated!

Please make sure that you are familiar with and follow the Code of Conduct for
this project (found in the CODE_OF_CONDUCT.md file).

Also, please make sure you're familiar with and follow the instructions in the
contributing guidelines (found in the CONTRIBUTING.md file).

If you're new to contributing to open source projects, you might find this free
video course helpful: http://kcd.im/pull-request

Please fill out the information below to expedite the review and (hopefully)
merge of your pull request!
-->

<!-- What changes are being made? (What feature/bug is being fixed here?) -->

**What**:
Made types more accurate.
<!-- Why are these changes necessary? -->

**Why**:

<!-- How were these changes implemented? -->

**How**:

<!-- Have you done all of these things?  -->

**Checklist**:

<!-- add "N/A" to the end of each line that's irrelevant to your changes -->

<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->

- [ ] Documentation
- [x] Tests
- [x] Ready to be merged
      <!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
- [x] Added myself to contributors table
      <!-- this is optional, see the contributing guidelines for instructions -->

<!-- feel free to add additional comments -->
  • Loading branch information
franklixuefei authored and Kent C. Dodds committed Sep 4, 2018
1 parent 8b26d4a commit 3565ad2
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,20 @@ export interface GetRootPropsOptions {
}

export interface GetInputPropsOptions
extends React.HTMLProps<HTMLInputElement> {}
extends React.HTMLProps<HTMLInputElement> {
disabled?: boolean
}

export interface GetLabelPropsOptions
extends React.HTMLProps<HTMLLabelElement> {}

export interface GetToggleButtonPropsOptions
extends React.HTMLProps<HTMLButtonElement> {}
extends React.HTMLProps<HTMLButtonElement> {
disabled?: boolean
}

export interface GetMenuPropsOptions {
export interface GetMenuPropsOptions
extends React.HTMLProps<HTMLElement> {
refKey?: string
['aria-label']?: string
}
Expand All @@ -122,9 +127,12 @@ export interface GetPropsCommonOptions {
suppressRefError?: boolean
}

export interface GetItemPropsOptions<Item> extends Record<string, any> {
export interface GetItemPropsOptions<Item>
extends React.HTMLProps<HTMLElement> {
index?: number
item: Item
item: Item,
isSelected?: boolean,
disabled?: boolean
}

export interface PropGetters<Item> {
Expand Down

0 comments on commit 3565ad2

Please sign in to comment.