Merge pull request #1953 from Bartvds/def/configstore

added definitions for configstore
This commit is contained in:
Bart van der Schoor
2014-04-01 01:56:35 +02:00
3 changed files with 57 additions and 0 deletions
+1
View File
@@ -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)
+18
View File
@@ -0,0 +1,18 @@
/// <reference path="configstore.d.ts" />
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;
+38
View File
@@ -0,0 +1,38 @@
// Type definitions for configstore 0.3.0
// Project: https://github.com/yeoman/configstore
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// 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;
}