mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #1953 from Bartvds/def/configstore
added definitions for configstore
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
Vendored
+38
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user