types/rethinkdb

Implement subtraction and rest type once TS 2.1 lands

niieani opened this issue · 3 comments

Some nice new features are coming soon to TS which will help with typing of certain rethinkdb commands: microsoft/TypeScript#10727

@niieani Can you elaborate on the features it would enable?

Here's two other upcoming features that'll be super awesome:

  1. Use keyof for bracket APIs to ensure the selection is valid (microsoft/TypeScript#10425)
  2. Use partial types for update calls to allow partial updates to a document (microsoft/TypeScript#11233)
  3. Use dynamic keys to get type information of child properties (microsoft/TypeScript#11929)

Can't remember about rest type right now, but I'll write back here when I dig back into it (once the feature ships).
Subtraction might be good for example when using .without().

The most important feature that will ease the typing will be microsoft/TypeScript#1295.
Having that it will be easier to infer types via rethinkdb's operators, especially in cases like .getField() or .pluck. Right now we need to re-supply the generics for each such operation.

Another useful thing for inference with .group().ungroup() : microsoft/TypeScript#6223

This is going to be very useful too: microsoft/TypeScript#12114