sergeyksv / tingodb

Embedded Node.js database upward compatible with MongoDB
www.tingodb.com
1.16k stars 105 forks source link

Typescript definitions file #153

Open dyst5422 opened 7 years ago

dyst5422 commented 7 years ago

Should add a Typescript definitions file to DefinitelyTyped. Should be as simple as copying the official MongoDB definition and pruning it.

sualko commented 5 years ago

You can just use the @types/mongodb definition files. For example:

import tingodb from 'tingodb';
import { Db as MongoDb } from 'mongodb';

const Db = tingodb().Db;
const db = <MongoDb> new Db('./database.tingodb', {});
taxilian commented 5 years ago

Yeah, you could do that, but since tingo hasn't been fully updated yet to use the new apis it'd be kinda nice to have files which reflected what actually is there...