From 1cb14bc59fe8747e2687569fe84340ebcb26a1fa Mon Sep 17 00:00:00 2001 From: slawiko Date: Thu, 20 Apr 2017 19:02:30 +0300 Subject: [PATCH] 16023: removes deprecated package --- types/cookie_js/index.d.ts | 12 +++++-- types/cookiejs/cookiejs-tests.ts | 35 -------------------- types/cookiejs/index.d.ts | 55 -------------------------------- types/cookiejs/tsconfig.json | 22 ------------- 4 files changed, 10 insertions(+), 114 deletions(-) delete mode 100644 types/cookiejs/cookiejs-tests.ts delete mode 100644 types/cookiejs/index.d.ts delete mode 100644 types/cookiejs/tsconfig.json diff --git a/types/cookie_js/index.d.ts b/types/cookie_js/index.d.ts index 503557899d..6e5a0813b6 100644 --- a/types/cookie_js/index.d.ts +++ b/types/cookie_js/index.d.ts @@ -3,8 +3,16 @@ // Definitions by: slawiko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -export = cookie; -export as namespace cookie; +declare module 'cookie_js' { + export = cookie; +} + +/** + * https://github.com/DefinitelyTyped/DefinitelyTyped/pull/16025#issuecomment-295784660 + */ +declare module 'cookiejs' { + export = cookie; +} declare function cookie(key : string, fallback?: string) : string; declare function cookie(keys : string[], fallback?: string) : string; diff --git a/types/cookiejs/cookiejs-tests.ts b/types/cookiejs/cookiejs-tests.ts deleted file mode 100644 index 43047f4fb6..0000000000 --- a/types/cookiejs/cookiejs-tests.ts +++ /dev/null @@ -1,35 +0,0 @@ - - -// Based on https://github.com/js-coder/cookie.js/blob/gh-pages/tests/spec.js - -import cookie = require("cookiejs"); - -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.removeSpecific('a', {path: '/search'}); -cookie.removeSpecific(['a', 'b'], {path: '/search'}); - -cookie.empty(); - -cookie.all(); diff --git a/types/cookiejs/index.d.ts b/types/cookiejs/index.d.ts deleted file mode 100644 index ad769bcb0e..0000000000 --- a/types/cookiejs/index.d.ts +++ /dev/null @@ -1,55 +0,0 @@ -// Type definitions for cookie.js v1.2.2 -// Project: https://github.com/florian/cookie.js -// Definitions by: Boltmade -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -/** - * Shortcut for cookie.get() - */ - -export = cookie; -export as namespace cookie; - -declare function cookie(key : string, fallback?: string) : string; -declare function cookie(keys : string[], fallback?: string) : string; - -declare namespace cookie { - /** - * Create a cookie. The value will automatically be escaped. - */ - export function set(key : string, value : string, options? : any) : void; - /** - * Set several cookies at once - */ - export function set(obj : any, options? : any) : void; - /** - * Remove cookies - */ - export function remove(key : string) : void; - export function remove(keys : string[]) : void; - export function remove(...args : string[]) : void; - /** - * Remove cookies that were set with custom options (e.g. specifing domain or path) - */ - export function removeSpecific(key : string, options?: any) : void; - export function removeSpecific(keys : string[], options?: any): void; - /** - * Remove all cookies - */ - export function empty() : void; - /** - * Retrieve the value of the cookie - */ - export function get(key : string, fallback?: string) : string; - /** - * Retrieve values of several cookies - */ - export function get(keys : string[], fallback?: string) : any; - /** - * Get all currently saved cookies - */ - export function all() : any; - /** - * Test if cookies are enabled - */ - export function enabled() : boolean; -} diff --git a/types/cookiejs/tsconfig.json b/types/cookiejs/tsconfig.json deleted file mode 100644 index 310990fba6..0000000000 --- a/types/cookiejs/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "cookiejs-tests.ts" - ] -} \ No newline at end of file