diff --git a/README.md b/README.md index 02fa53fbaf..354839547d 100755 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ List of Definitions * [CKEditor](https://github.com/ckeditor/ckeditor-dev) (by [Ondrej Sevcik](https://github.com/ondrejsevcik)) * [CodeMirror](http://codemirror.net) (by [François de Campredon](https://github.com/fdecampredon)) * [Commander](http://github.com/visionmedia/commander.js) (by [Marcelo Dezem](https://github.com/mdezem)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) * [Crossfilter](https://github.com/square/crossfilter) (by [Schmulik Raskin](https://github.com/schmuli)) * [crypto-js](https://code.google.com/p/crypto-js/) (by [Gia Bảo @ Sân Đình](https://github.com/giabao)). @see [cryptojs.d.ts repo](https://github.com/giabao/cryptojs.d.ts) diff --git a/configstore/configstore-tests.ts b/configstore/configstore-tests.ts new file mode 100644 index 0000000000..e616707af9 --- /dev/null +++ b/configstore/configstore-tests.ts @@ -0,0 +1,18 @@ +/// + +import cs = require('configstore'); + +var value: any; +var key: string; +var num: number; +var bool: any; +var object:Object; + +cs.set(key, value); +value = cs.get(key); +cs.del(key); + +object = cs.all; +cs.all = object; +num = cs.size; +key = cs.path; \ No newline at end of file diff --git a/configstore/configstore.d.ts b/configstore/configstore.d.ts new file mode 100644 index 0000000000..94849d847f --- /dev/null +++ b/configstore/configstore.d.ts @@ -0,0 +1,38 @@ +// Type definitions for configstore 0.3.0 +// Project: https://github.com/yeoman/configstore +// Definitions by: Bart van der Schoor +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module 'configstore' { + /* + Set an item + */ + export function set(key: string, val: any): void; + + /* + Get an item + */ + export function get(key: string): any; + + /* + Delete an item + */ + export function del(key: string): void; + + /* + Get all items as an object or replace the current config with an object: + + conf.all = { + hello: 'world' + }; + */ + export var all: Object; + /* + Get the item count + */ + export var size: number; + /* + Get the path to the config file. Can be used to show the user where the config file is located or even better open it for them. + */ + export var path: string; +}