-
Notifications
You must be signed in to change notification settings - Fork 37
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
Discrepancies in Typescript declarations #1032
Comments
|
I don't understand this. I'm working with TS in strict mode and I'm not allowing the
That's fair, but how do you suggest working with dates? Should I manually (de)serialize them within my own code? |
PullRequest is not an implementation detail. The thing that was a mistake to "leak" was the type parameter. cookie should always be ReadonlyJSONValue. This has been fixed for the next release. Sorry for the confusion. |
I found what I believe are some discrepancies in the Typescript declaration file (replicache.d.ts).
The
cookie
property in thePullRequest
type in filereplicache.d.ts
(lines 238) should beCookie | null
since this value is expected to be null for the first pull (according to the docs and further discussions on Discord).The
JSONValue
andReadonlyJSONValue
types inreplicache.d.ts
(lines 2 and 12) should also acceptDate
objects since they are JSON serializable. I've tested it myself by just ignoring the ts warning about having a Data object in my pull response, and the data got serialized perfectly well.The text was updated successfully, but these errors were encountered: