-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #107 : Reactivestack typings (cookies) #124
Conversation
Looking good as far as I can tell. Glad to be of help ;) I am using these atm for a real app and so far no problems. |
httpOnly?: boolean; | ||
} | ||
|
||
export type ReactCookieProps = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my library, react-cookie-banner
, I had a problem with this part as we declared the prop
cookies
as optional with a default to new Cookies()
.
packages/react-cookie/src/index.d.ts
Outdated
export type Cookie = string; | ||
|
||
export class Cookies { | ||
get: (key: string, options?: ReactCookieGetOptions) => Cookie; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, I think this should return Cookie | undefined
as:
new Cookies().get('foo') // => undefined
This is awesome! We might as well publish TS typing for universal-cookie |
Oh I just saw it is included but within |
@eXon I think it's already been implemented: aren't these ones the typings for the |
@Guymestef , @eXon Would be willing to help to. Could use the experience. |
Hi,
I've created a first version of the typings.
Any modification needed? @eXon @PeterKottas