diff --git a/dookie/dookie-tests.ts b/dookie/dookie-tests.ts new file mode 100644 index 0000000000..d2fa907669 --- /dev/null +++ b/dookie/dookie-tests.ts @@ -0,0 +1,8 @@ + +import {push, pull} from './index'; + +(async ()=>{ + + await push('mongodb://localhost:27017/test', {test:[{ok:1},{ok:2}]}); + +})(); diff --git a/dookie/index.d.ts b/dookie/index.d.ts new file mode 100644 index 0000000000..bd3f6ea06b --- /dev/null +++ b/dookie/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for dookie 0.1 +// Project: https://github.com/vkarpov15/dookie#readme +// Definitions by: Swanest +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +interface PushOpts { + filename?: string; + dropDatabase: boolean; +} + +// Our exports: +export function push(uri: string, data: any, opts?: PushOpts): Promise; + +export function pull(uri: string): Promise; + +export function pullToStream(uri: string, stream: any): Promise; + +// Make this available as a global for non-module code. +export as namespace dookie; diff --git a/dookie/tsconfig.json b/dookie/tsconfig.json new file mode 100644 index 0000000000..d795a39145 --- /dev/null +++ b/dookie/tsconfig.json @@ -0,0 +1,20 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "dookie-tests.ts" + ] +} diff --git a/dookie/tslint.json b/dookie/tslint.json new file mode 100644 index 0000000000..377cc837d4 --- /dev/null +++ b/dookie/tslint.json @@ -0,0 +1 @@ +{ "extends": "../tslint.json" }