diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 9d27a0d1d4..2535ecd3ec 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,8 +63,9 @@ All definitions files include a header with the author and editors, so at some p * [Clone](https://github.com/pvorb/node-clone) (by [Kieran Simpson](https://github.com/kierans)) * [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) and [vvakame](https://github.com/vvakame)) -* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) +* [configstore](http://github.com/yeoman/configstore) (by [Bart van der Schoor](https://github.com/Bartvds)) * [cookie](https://github.com/jshttp/cookie) (by [Pine Mizune](https://github.com/jshttp/cookie)) +* [cookie.js](https://github.com/js-coder/cookie.js) (by [Boltmade](https://github.com/Boltmade)) * [Cordova](http://cordova.apache.org) (by [Microsoft Open Technologies, Inc.](http://msopentech.com/)) * [Cordovarduino](https://github.com/stereolux/cordovarduino) (by [Hendrik Maus](https://github.com/hendrikmaus)) * [Couchbase / Couchnode](https://github.com/couchbase/couchnode) (by [Basarat Ali Syed](https://github.com/basarat)) diff --git a/cookiejs/cookiejs-tests.ts b/cookiejs/cookiejs-tests.ts new file mode 100644 index 0000000000..b4dd6927b6 --- /dev/null +++ b/cookiejs/cookiejs-tests.ts @@ -0,0 +1,30 @@ +/// + +// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js + +cookie.set({a: '1', b: '2', c: '3'}); + +cookie; +cookie.enabled(); + +cookie.set('n', '5'); + +cookie.get('a'); +cookie.get('__undef__'); +cookie.get('__undef__', 'fallback'); +cookie.get(['a', 'b']); +cookie.get(['a', '__undef__'], 'fallback'); + +cookie('a'); +cookie('__undef__'); +cookie('__undef__', 'fallback'); +cookie(['a', 'b']); +cookie(['a', '__undef__'], 'fallback'); + +cookie.remove('a'); +cookie.remove('a', 'b'); +cookie.remove(['a', 'b']); + +cookie.empty(); + +cookie.all(); diff --git a/cookiejs/cookiejs.d.ts b/cookiejs/cookiejs.d.ts new file mode 100644 index 0000000000..bdd71f0219 --- /dev/null +++ b/cookiejs/cookiejs.d.ts @@ -0,0 +1,24 @@ +// Type definitions for cookie.js v1.0.0 +// Project: https://github.com/js-coder/cookie.js +// Definitions by: Boltmade +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare function cookie(key : string, fallback?: string) : string; +declare function cookie(keys : string[], fallback?: string) : string; + +declare module cookie { + export function set(key : string, value : string, options? : any) : void; + export function set(obj : any, options? : any) : void; + export function remove(key : string) : void; + export function remove(keys : string[]) : void; + export function remove(...args : string[]) : void; + export function empty() : void; + export function get(key : string, fallback?: string) : string; + export function get(keys : string[], fallback?: string) : string; + export function all() : any; + export function enabled() : boolean; +} + +declare module "cookiejs" { + export = cookie; +}