diff --git a/notNeededPackages.json b/notNeededPackages.json index b1b2a4907d..66a4b63019 100644 --- a/notNeededPackages.json +++ b/notNeededPackages.json @@ -3132,6 +3132,12 @@ "sourceRepoURL": "https://github.com/sindresorhus/path-type", "asOfVersion": "4.0.0" }, + { + "libraryName": "peerjs", + "typingsPackageName": "peerjs", + "sourceRepoURL": "http://peerjs.com/", + "asOfVersion": "1.1.0" + }, { "libraryName": "perfect-scrollbar", "typingsPackageName": "perfect-scrollbar", diff --git a/types/peerjs/index.d.ts b/types/peerjs/index.d.ts deleted file mode 100644 index f3ec14c796..0000000000 --- a/types/peerjs/index.d.ts +++ /dev/null @@ -1,197 +0,0 @@ -// Type definitions for PeerJS -// Project: http://peerjs.com/ -// Definitions by: Toshiya Nakakura -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 3.0 - -/// - -declare namespace PeerJs{ - interface PeerJSOption{ - key?: string; - host?: string; - port?: number; - path?: string; - secure?: boolean; - config?: RTCPeerConnectionConfig; - debug?: number; - } - - interface PeerConnectOption{ - label?: string; - metadata?: any; - serialization?: string; - reliable?: boolean; - - } - - interface DataConnection{ - send(data: any): void; - close(): void; - on(event: string, cb: ()=>void): void; - on(event: 'data', cb: (data: any)=>void): void; - on(event: 'open', cb: ()=>void): void; - on(event: 'close', cb: ()=>void): void; - on(event: 'error', cb: (err: any)=>void): void; - off(event: string, fn: Function, once?: boolean): void; - dataChannel: RTCDataChannel; - label: string; - metadata: any; - open: boolean; - peerConnection: any; - peer: string; - reliable: boolean; - serialization: string; - type: string; - buffSize: number; - } - - interface MediaConnection{ - answer(stream?: any): void; - close(): void; - on(event: string, cb: ()=>void): void; - on(event: 'stream', cb: (stream: any)=>void): void; - on(event: 'close', cb: ()=>void): void; - on(event: 'error', cb: (err: any)=>void): void; - off(event: string, fn: Function, once?: boolean): void; - open: boolean; - metadata: any; - peer: string; - type: string; - } - - interface utilSupportsObj { - audioVideo: boolean; - data: boolean; - binary: boolean; - reliable: boolean; - } - - interface util{ - browser: string; - supports: utilSupportsObj; - } - - export interface Peer{ - /** - * - * @param id The brokering ID of the remote peer (their peer.id). - * @param options for specifying details about Peer Connection - */ - connect(id: string, options?: PeerJs.PeerConnectOption): PeerJs.DataConnection; - /** - * Connects to the remote peer specified by id and returns a data connection. - * @param id The brokering ID of the remote peer (their peer.id). - * @param stream The caller's media stream - * @param options Metadata associated with the connection, passed in by whoever initiated the connection. - */ - call(id: string, stream: any, options?: any): PeerJs.MediaConnection; - /** - * Calls the remote peer specified by id and returns a media connection. - * @param event Event name - * @param cb Callback Function - */ - on(event: string, cb: ()=>void): void; - /** - * Emitted when a connection to the PeerServer is established. - * @param event Event name - * @param cb id is the brokering ID of the peer - */ - on(event: 'open', cb: (id: string)=>void): void; - /** - * Emitted when a new data connection is established from a remote peer. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'connection', cb: (dataConnection: PeerJs.DataConnection)=>void): void; - /** - * Emitted when a remote peer attempts to call you. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'call', cb: (mediaConnection: PeerJs.MediaConnection)=>void): void; - /** - * Emitted when the peer is destroyed and can no longer accept or create any new connections. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'close', cb: ()=>void): void; - /** - * Emitted when the peer is disconnected from the signalling server - * @param event Event name - * @param cb Callback Function - */ - on(event: 'disconnected', cb: ()=>void): void; - /** - * Errors on the peer are almost always fatal and will destroy the peer. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'error', cb: (err: any)=>void): void; - /** - * Remove event listeners.(EventEmitter3) - * @param {String} event The event we want to remove. - * @param {Function} fn The listener that we need to find. - * @param {Boolean} once Only remove once listeners. - */ - off(event: string, fn: Function, once?: boolean): void; - /** - * Close the connection to the server, leaving all existing data and media connections intact. - */ - disconnect(): void; - /** - * Attempt to reconnect to the server with the peer's old ID - */ - reconnect(): void; - /** - * Close the connection to the server and terminate all existing connections. - */ - destroy(): void; - - /** - * Retrieve a data/media connection for this peer. - * @param peer - * @param id - */ - getConnection(peer: Peer, id: string): any; - - /** - * Get a list of available peer IDs - * @param callback - */ - listAllPeers(callback: (peerIds: Array)=>void): void; - /** - * The brokering ID of this peer - */ - id: string; - /** - * A hash of all connections associated with this peer, keyed by the remote peer's ID. - */ - connections: any; - /** - * false if there is an active connection to the PeerServer. - */ - disconnected: boolean; - /** - * true if this peer and all of its connections can no longer be used. - */ - destroyed: boolean; - } -} - -declare var Peer: { - prototype: RTCIceServer; - /** - * A peer can connect to other peers and listen for connections. - * @param id Other peers can connect to this peer using the provided ID. - * If no ID is given, one will be generated by the brokering server. - * @param options for specifying details about PeerServer - */ - new (id: string, options?: PeerJs.PeerJSOption): PeerJs.Peer; - - /** - * A peer can connect to other peers and listen for connections. - * @param options for specifying details about PeerServer - */ - new (options: PeerJs.PeerJSOption): PeerJs.Peer; -}; diff --git a/types/peerjs/package.json b/types/peerjs/package.json deleted file mode 100644 index d27d838dc6..0000000000 --- a/types/peerjs/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "types": "index", - "typesVersions": { - ">=3.2.0-0": { "*": ["ts3.2/*"] } - } -} diff --git a/types/peerjs/peerjs-tests.ts b/types/peerjs/peerjs-tests.ts deleted file mode 100644 index eef24bf001..0000000000 --- a/types/peerjs/peerjs-tests.ts +++ /dev/null @@ -1,54 +0,0 @@ -var peerByOption: PeerJs.Peer = new Peer({ - key: 'peerKey', - debug: 3, -}); - -peerByOption.on("connection", dataConnection => { - var type: string = dataConnection.type; -}); - -peerByOption.listAllPeers(function(items){ - for(var i in items){ - console.log(decodeURI(items[i])); - } -}); - -var peerById: PeerJs.Peer = new Peer("peerid"); - -var peerByIdAndOption: PeerJs.Peer = new Peer( - "peerId", - { - key: 'peerKey', - debug: 3, - }); -peerByIdAndOption.on("call", mediaConnection => { - var isOpen: boolean = mediaConnection.open; -}); - -var id = peerByOption.id; -var connections = peerByOption.connections; -var flag = peerByOption.disconnected; -flag = peerByOption.destroyed; - -peerByOption.disconnect(); -peerByOption.reconnect(); -peerByOption.destroy(); - -var connection = peerById.connect("id", { - label: 'chat', - serialization: 'none', - metadata: {message: 'hi i want to chat with you!'} -}); - -var call = peerById.call('callto-id', (window as any).localStream); - -var openHandler=()=> console.log("open"); -peerById.on("open", openHandler); -peerById.on("connection", (c)=> console.log("connection")); -peerById.on("call", (media)=> console.log("call")); -peerById.on("close", ()=> console.log("close")); -peerById.on("disconnected", ()=> console.log("disconnected")); -peerById.on("error", (err)=> console.log(err)); -peerById.off("open", openHandler); - -var connection2 = peerById.getConnection(peerByOption, "callto-id"); diff --git a/types/peerjs/ts3.2/index.d.ts b/types/peerjs/ts3.2/index.d.ts deleted file mode 100644 index 71a6cc3c26..0000000000 --- a/types/peerjs/ts3.2/index.d.ts +++ /dev/null @@ -1,194 +0,0 @@ -// Type definitions for PeerJS -// Project: http://peerjs.com/ -// Definitions by: Toshiya Nakakura -// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped - -declare namespace PeerJs{ - interface PeerJSOption{ - key?: string; - host?: string; - port?: number; - path?: string; - secure?: boolean; - config?: RTCConfiguration; - debug?: number; - } - - interface PeerConnectOption{ - label?: string; - metadata?: any; - serialization?: string; - reliable?: boolean; - - } - - interface DataConnection{ - send(data: any): void; - close(): void; - on(event: string, cb: ()=>void): void; - on(event: 'data', cb: (data: any)=>void): void; - on(event: 'open', cb: ()=>void): void; - on(event: 'close', cb: ()=>void): void; - on(event: 'error', cb: (err: any)=>void): void; - off(event: string, fn: Function, once?: boolean): void; - dataChannel: RTCDataChannel; - label: string; - metadata: any; - open: boolean; - peerConnection: any; - peer: string; - reliable: boolean; - serialization: string; - type: string; - buffSize: number; - } - - interface MediaConnection{ - answer(stream?: any): void; - close(): void; - on(event: string, cb: ()=>void): void; - on(event: 'stream', cb: (stream: any)=>void): void; - on(event: 'close', cb: ()=>void): void; - on(event: 'error', cb: (err: any)=>void): void; - off(event: string, fn: Function, once?: boolean): void; - open: boolean; - metadata: any; - peer: string; - type: string; - } - - interface utilSupportsObj { - audioVideo: boolean; - data: boolean; - binary: boolean; - reliable: boolean; - } - - interface util{ - browser: string; - supports: utilSupportsObj; - } - - export interface Peer{ - /** - * - * @param id The brokering ID of the remote peer (their peer.id). - * @param options for specifying details about Peer Connection - */ - connect(id: string, options?: PeerJs.PeerConnectOption): PeerJs.DataConnection; - /** - * Connects to the remote peer specified by id and returns a data connection. - * @param id The brokering ID of the remote peer (their peer.id). - * @param stream The caller's media stream - * @param options Metadata associated with the connection, passed in by whoever initiated the connection. - */ - call(id: string, stream: any, options?: any): PeerJs.MediaConnection; - /** - * Calls the remote peer specified by id and returns a media connection. - * @param event Event name - * @param cb Callback Function - */ - on(event: string, cb: ()=>void): void; - /** - * Emitted when a connection to the PeerServer is established. - * @param event Event name - * @param cb id is the brokering ID of the peer - */ - on(event: 'open', cb: (id: string)=>void): void; - /** - * Emitted when a new data connection is established from a remote peer. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'connection', cb: (dataConnection: PeerJs.DataConnection)=>void): void; - /** - * Emitted when a remote peer attempts to call you. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'call', cb: (mediaConnection: PeerJs.MediaConnection)=>void): void; - /** - * Emitted when the peer is destroyed and can no longer accept or create any new connections. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'close', cb: ()=>void): void; - /** - * Emitted when the peer is disconnected from the signalling server - * @param event Event name - * @param cb Callback Function - */ - on(event: 'disconnected', cb: ()=>void): void; - /** - * Errors on the peer are almost always fatal and will destroy the peer. - * @param event Event name - * @param cb Callback Function - */ - on(event: 'error', cb: (err: any)=>void): void; - /** - * Remove event listeners.(EventEmitter3) - * @param {String} event The event we want to remove. - * @param {Function} fn The listener that we need to find. - * @param {Boolean} once Only remove once listeners. - */ - off(event: string, fn: Function, once?: boolean): void; - /** - * Close the connection to the server, leaving all existing data and media connections intact. - */ - disconnect(): void; - /** - * Attempt to reconnect to the server with the peer's old ID - */ - reconnect(): void; - /** - * Close the connection to the server and terminate all existing connections. - */ - destroy(): void; - - /** - * Retrieve a data/media connection for this peer. - * @param peer - * @param id - */ - getConnection(peer: Peer, id: string): any; - - /** - * Get a list of available peer IDs - * @param callback - */ - listAllPeers(callback: (peerIds: Array)=>void): void; - /** - * The brokering ID of this peer - */ - id: string; - /** - * A hash of all connections associated with this peer, keyed by the remote peer's ID. - */ - connections: any; - /** - * false if there is an active connection to the PeerServer. - */ - disconnected: boolean; - /** - * true if this peer and all of its connections can no longer be used. - */ - destroyed: boolean; - } -} - -declare var Peer: { - prototype: RTCIceServer; - /** - * A peer can connect to other peers and listen for connections. - * @param id Other peers can connect to this peer using the provided ID. - * If no ID is given, one will be generated by the brokering server. - * @param options for specifying details about PeerServer - */ - new (id: string, options?: PeerJs.PeerJSOption): PeerJs.Peer; - - /** - * A peer can connect to other peers and listen for connections. - * @param options for specifying details about PeerServer - */ - new (options: PeerJs.PeerJSOption): PeerJs.Peer; -}; diff --git a/types/peerjs/ts3.2/peerjs-tests.ts b/types/peerjs/ts3.2/peerjs-tests.ts deleted file mode 100644 index eef24bf001..0000000000 --- a/types/peerjs/ts3.2/peerjs-tests.ts +++ /dev/null @@ -1,54 +0,0 @@ -var peerByOption: PeerJs.Peer = new Peer({ - key: 'peerKey', - debug: 3, -}); - -peerByOption.on("connection", dataConnection => { - var type: string = dataConnection.type; -}); - -peerByOption.listAllPeers(function(items){ - for(var i in items){ - console.log(decodeURI(items[i])); - } -}); - -var peerById: PeerJs.Peer = new Peer("peerid"); - -var peerByIdAndOption: PeerJs.Peer = new Peer( - "peerId", - { - key: 'peerKey', - debug: 3, - }); -peerByIdAndOption.on("call", mediaConnection => { - var isOpen: boolean = mediaConnection.open; -}); - -var id = peerByOption.id; -var connections = peerByOption.connections; -var flag = peerByOption.disconnected; -flag = peerByOption.destroyed; - -peerByOption.disconnect(); -peerByOption.reconnect(); -peerByOption.destroy(); - -var connection = peerById.connect("id", { - label: 'chat', - serialization: 'none', - metadata: {message: 'hi i want to chat with you!'} -}); - -var call = peerById.call('callto-id', (window as any).localStream); - -var openHandler=()=> console.log("open"); -peerById.on("open", openHandler); -peerById.on("connection", (c)=> console.log("connection")); -peerById.on("call", (media)=> console.log("call")); -peerById.on("close", ()=> console.log("close")); -peerById.on("disconnected", ()=> console.log("disconnected")); -peerById.on("error", (err)=> console.log(err)); -peerById.off("open", openHandler); - -var connection2 = peerById.getConnection(peerByOption, "callto-id"); diff --git a/types/peerjs/ts3.2/tsconfig.json b/types/peerjs/ts3.2/tsconfig.json deleted file mode 100644 index eaa819fc0c..0000000000 --- a/types/peerjs/ts3.2/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../../", - "typeRoots": [ - "../../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "peerjs-tests.ts" - ] -} diff --git a/types/peerjs/ts3.2/tslint.json b/types/peerjs/ts3.2/tslint.json deleted file mode 100644 index a41bf5d19a..0000000000 --- a/types/peerjs/ts3.2/tslint.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -} diff --git a/types/peerjs/tsconfig.json b/types/peerjs/tsconfig.json deleted file mode 100644 index 41e815c2c3..0000000000 --- a/types/peerjs/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "lib": [ - "es6", - "dom" - ], - "noImplicitAny": true, - "noImplicitThis": true, - "strictNullChecks": false, - "strictFunctionTypes": true, - "baseUrl": "../", - "typeRoots": [ - "../" - ], - "types": [], - "noEmit": true, - "forceConsistentCasingInFileNames": true - }, - "files": [ - "index.d.ts", - "peerjs-tests.ts" - ] -} \ No newline at end of file diff --git a/types/peerjs/tslint.json b/types/peerjs/tslint.json deleted file mode 100644 index 3d59f55fda..0000000000 --- a/types/peerjs/tslint.json +++ /dev/null @@ -1,80 +0,0 @@ -{ - "extends": "dtslint/dt.json", - "rules": { - "adjacent-overload-signatures": false, - "array-type": false, - "arrow-return-shorthand": false, - "ban-types": false, - "callable-types": false, - "comment-format": false, - "dt-header": false, - "npm-naming": false, - "eofline": false, - "export-just-namespace": false, - "import-spacing": false, - "interface-name": false, - "interface-over-type-literal": false, - "jsdoc-format": false, - "max-line-length": false, - "member-access": false, - "new-parens": false, - "no-any-union": false, - "no-boolean-literal-compare": false, - "no-conditional-assignment": false, - "no-consecutive-blank-lines": false, - "no-construct": false, - "no-declare-current-package": false, - "no-duplicate-imports": false, - "no-duplicate-variable": false, - "no-empty-interface": false, - "no-for-in-array": false, - "no-inferrable-types": false, - "no-internal-module": false, - "no-irregular-whitespace": false, - "no-mergeable-namespace": false, - "no-misused-new": false, - "no-namespace": false, - "no-object-literal-type-assertion": false, - "no-padding": false, - "no-redundant-jsdoc": false, - "no-redundant-jsdoc-2": false, - "no-redundant-undefined": false, - "no-reference-import": false, - "no-relative-import-in-test": false, - "no-self-import": false, - "no-single-declare-module": false, - "no-string-throw": false, - "no-unnecessary-callback-wrapper": false, - "no-unnecessary-class": false, - "no-unnecessary-generics": false, - "no-unnecessary-qualifier": false, - "no-unnecessary-type-assertion": false, - "no-useless-files": false, - "no-var-keyword": false, - "no-var-requires": false, - "no-void-expression": false, - "no-trailing-whitespace": false, - "object-literal-key-quotes": false, - "object-literal-shorthand": false, - "one-line": false, - "one-variable-per-declaration": false, - "only-arrow-functions": false, - "prefer-conditional-expression": false, - "prefer-const": false, - "prefer-declare-function": false, - "prefer-for-of": false, - "prefer-method-signature": false, - "prefer-template": false, - "radix": false, - "semicolon": false, - "space-before-function-paren": false, - "space-within-parens": false, - "strict-export-declare-modifiers": false, - "trim-file": false, - "triple-equals": false, - "typedef-whitespace": false, - "unified-signatures": false, - "void-return": false, - "whitespace": false - } -}