// Type definitions for RethinkDB 2.3 // Project: http://rethinkdb.com/ // Definitions by: Alex Gorbatchev // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 // Reference: https://rethinkdb.com/api/javascript/ // // Notes: // - Currently missing control structures and geospatial commands. Please help out! // // Testing: // $ tsc --noImplicitAny --module commonjs -p rethinkdb/ /// import { ConnectionOptions as TLSConnectionOptions } from "tls"; /** * https://rethinkdb.com/api/javascript/ */ declare module "rethinkdb" { /** * Create a new connection to the database server. * * See: https://rethinkdb.com/api/javascript/connect/ */ export function connect(opts: ConnectionOptions, cb: (err: ReqlDriverError, conn: Connection) => void): void; export function connect(host: string, cb: (err: ReqlDriverError, conn: Connection) => void): void; export function connect(opts: ConnectionOptions): Promise; export function connect(host: string): Promise; export function dbCreate(name: string): Operation; export function dbDrop(name: string): Operation; export function dbList(): Operation; export function db(name: string): Db; export function table(name: string, options?: { useOutdated: boolean }): Table; export function asc(property: string): Sort; export function desc(property: string): Sort; export var count: Aggregator; export function sum(prop: string): Aggregator; export function avg(prop: string): Aggregator; export const row: Row; export function expr(stuff: any): Expression; export function now(): Expression