Skip to content

Commit

Permalink
TS cleanup, export modal types
Browse files Browse the repository at this point in the history
  • Loading branch information
Suzanne Rozier committed Feb 25, 2020
1 parent d37d26a commit 4a02b8f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Empty file added .npmignore
Empty file.
4 changes: 2 additions & 2 deletions src/components/Modal/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ export const ModalContainer = ({
)

/** connectModal and useModal package the logic & state of opening/closing a modal */
export interface ModalContainerProps {
export interface ConnectedModalProps {
isOpen: boolean
onClose: () => void
}

export const connectModal = function<P extends ModalContainerProps>(
export const connectModal = function<P extends ConnectedModalProps>(
Component: React.FunctionComponent<P> | React.ComponentType<P>
): React.FunctionComponent<P> {
const ConnectedModal = ({
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ export {
Overlay,
ModalContainer,
connectModal,
ConnectedModalProps,
useModal,
ModalHook,
} from './components/Modal/Modal'
8 changes: 7 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@
"declaration": true,
"outDir": "./lib"
},
"files": ["custom.d.ts", "src/index.ts"]
"include": ["src/**/*", "custom.d.ts"],
"exclude": [
"node_modules",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.stories.tsx"
]
}

0 comments on commit 4a02b8f

Please sign in to comment.