Skip to content

Commit

Permalink
Merge pull request #56 from Stanley-Jovel/feature/add-typscript-support
Browse files Browse the repository at this point in the history
Add Typescript support
  • Loading branch information
karltaylor authored Jul 27, 2018
2 parents 4ac687d + e84d500 commit 6ebb7fb
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
42 changes: 42 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
declare class Collapsible extends React.Component<CollapsibleProps> {}
declare namespace Collapsible {}

interface CollapsibleProps extends React.HTMLProps<Collapsible> {
transitionTime?: number
transitionCloseTime?: number | null
triggerTagName?: string
easing?: string
open?: boolean
classParentString?: string
openedClassName?: string
triggerStyle?: null | Object
triggerClassName?: string
triggerOpenedClassName?: string
contentOuterClassName?: string
contentInnerClassName?: string
accordionPosition?: string | number
handleTriggerClick?: (accordionPosition?: string | number) => void
onOpen?: () => void
onClose?: () => void
onOpening?: () => void
onClosing?: () => void
trigger: string | React.ReactElement<any>
triggerWhenOpen?: string | React.ReactElement<any>
triggerDisabled?: false
lazyRender?: boolean
overflowWhenOpen?:
| 'hidden'
| 'visible'
| 'auto'
| 'scroll'
| 'inherit'
| 'initial'
| 'unset'
triggerSibling?: React.ReactElement<any>
className?: string
tabIndex?: null | number
}

declare module 'react-collapsible' {
export default Collapsible
}
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"accordion"
],
"main": "dist/Collapsible.js",
"types": "./index.d.ts",
"author": "Glenn Flanagan <[email protected]>",
"contributors": [
"Karl Taylor <[email protected]",
Expand Down

0 comments on commit 6ebb7fb

Please sign in to comment.