Typescript definitions
virzak opened this issue · 7 comments
virzak commented
Hello,
Are typescript definitions available for this project?
bmealhouse commented
No they aren't. Are you interested in making a PR to add them?
richbai90 commented
Here is a very simple typing that seems to do the job at least for the basic setup. I'm using it in my app with no problems.
declare module 'next-redux-saga' {
function withReduxSaga<T extends React.Component>(arg: function | Partial<{[index : string] : any; async: boolean; }>) : T
export default withReduxSaga;
}
bmealhouse commented
Thanks for sharing @richbai90.
leocavalcante commented
Thanks @richbai90
I slightly modified to:
declare module "next-redux-saga" {
function withReduxSaga<P = any>(arg: function | Partial<{ [index: string]: any; async: boolean; }>): ComponentType<P>
export default withReduxSaga;
}
Because of next-redux-wrapper
expecting a ComponentType<P = {}>
.
bmealhouse commented
If either of you are interested, feel free to submit a PR to definitely typed.
leocavalcante commented
I think you can close this now ;)
bmealhouse commented
Much appreciated @leocavalcante!