From be7ee729cf42cd9eb4372ea0dbb159ad294bc024 Mon Sep 17 00:00:00 2001 From: Andy Date: Mon, 20 Mar 2017 15:00:39 -0700 Subject: [PATCH] xmpp-jid: Provides its own types (#15263) --- notNeededPackages.json | 6 +++++ xmpp-jid/index.d.ts | 13 ----------- xmpp-jid/lib/JID.d.ts | 46 -------------------------------------- xmpp-jid/tsconfig.json | 22 ------------------ xmpp-jid/tslint.json | 1 - xmpp-jid/xmpp-jid-tests.ts | 40 --------------------------------- 6 files changed, 6 insertions(+), 122 deletions(-) delete mode 100644 xmpp-jid/index.d.ts delete mode 100644 xmpp-jid/lib/JID.d.ts delete mode 100644 xmpp-jid/tsconfig.json delete mode 100644 xmpp-jid/tslint.json delete mode 100644 xmpp-jid/xmpp-jid-tests.ts diff --git a/notNeededPackages.json b/notNeededPackages.json index f9d50c929f..b49c089d9a 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -341,6 +341,12 @@ "typingsPackageName": "vue-router", "sourceRepoURL": "https://github.com/vuejs/vue-router", "asOfVersion": "2.0.0" + }, + { + "libraryName": "@xmpp/jid", + "typingsPackageName": "xmpp-jid", + "sourceRepoURL": "github.com/node-xmpp/node-xmpp/", + "asOfVersion": "1.2.0" } ] } \ No newline at end of file diff --git a/xmpp-jid/index.d.ts b/xmpp-jid/index.d.ts deleted file mode 100644 index 678e306abc..0000000000 --- a/xmpp-jid/index.d.ts +++ /dev/null @@ -1,13 +0,0 @@ -// Type definitions for @xmpp/jid 0.0 -// Project: github.com/node-xmpp/node-xmpp/ -// Definitions by: PJakcson -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.1 -import {JID} from './lib/JID'; - -export declare function createJID(local: string, domain: string, resource: string): JID; - -export {JID} from './lib/JID'; - -export declare function equal(a: JID, b: JID): boolean; -export declare function is(a: any): boolean; diff --git a/xmpp-jid/lib/JID.d.ts b/xmpp-jid/lib/JID.d.ts deleted file mode 100644 index a1d2558b30..0000000000 --- a/xmpp-jid/lib/JID.d.ts +++ /dev/null @@ -1,46 +0,0 @@ -/** - * Created by marcneumann on 17.02.17. - */ - -export declare class JID { - local: string; - domain: string; - resource: string; - - constructor(local: string, domain?: string, resource?: string); - - parseJID(jid: string): void; - - toString(unescape?: any): string; - - /** - * Convenience method to distinguish users - **/ - bare(): JID; - - /** - * Comparison function - **/ - equals(other: JID): boolean; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-localpart - **/ - setLocal(local: string, escape?: any): void; - - getLocal(unescape?: any): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-domain - */ - setDomain(value: string): void; - - getDomain(): string; - - /** - * http://xmpp.org/rfcs/rfc6122.html#addressing-resourcepart - */ - setResource(value: string): void; - - getResource(): string; -} diff --git a/xmpp-jid/tsconfig.json b/xmpp-jid/tsconfig.json deleted file mode 100644 index f4d02187a2..0000000000 --- a/xmpp-jid/tsconfig.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "xmpp-jid-tests.ts" - ] -} \ No newline at end of file diff --git a/xmpp-jid/tslint.json b/xmpp-jid/tslint.json deleted file mode 100644 index 377cc837d4..0000000000 --- a/xmpp-jid/tslint.json +++ /dev/null @@ -1 +0,0 @@ -{ "extends": "../tslint.json" } diff --git a/xmpp-jid/xmpp-jid-tests.ts b/xmpp-jid/xmpp-jid-tests.ts deleted file mode 100644 index 2514d5fb8a..0000000000 --- a/xmpp-jid/xmpp-jid-tests.ts +++ /dev/null @@ -1,40 +0,0 @@ -import {JID} from './index'; - -/* - * All return an instance of JID.JID, the new operator is optional. - */ -let addr = new JID('alice@wonderland.net/rabbithole'); // OK -addr = new JID('alice', 'wonderland.net', 'rabbithole'); // BEST; see section on escaping below - -/* - * local - */ -addr.local = 'alice'; -addr.local; // alice -// same as -addr.setLocal('alice'); -addr.getLocal(); // alice - -/* - * domain - */ -addr.domain = 'wonderland.net'; -addr.domain; // wonderland.net -// same as -addr.setDomain('wonderland.net'); -addr.getDomain(); // wonderland.net - -/* - * resource - */ -addr.resource = 'rabbithole'; -addr.resource; // rabbithole -// same as -addr.setResource('rabbithole'); -addr.getResource(); // rabbithole - -addr.toString(); // alice@wonderland.net/rabbithole -addr.bare(); // returns a JID without resource - -const some_jid = new JID('is', 'a', 'test'); -addr.equals(some_jid); // returns true if the two JIDs are equal, false otherwise