diff --git a/types/socket.io-p2p/index.d.ts b/types/socket.io-p2p/index.d.ts index fbeaa07c94..e0f461111c 100644 --- a/types/socket.io-p2p/index.d.ts +++ b/types/socket.io-p2p/index.d.ts @@ -2,6 +2,7 @@ // Project: https://github.com/socketio/socket.io-p2p // Definitions by: Sascha Englert // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.2 export as namespace Socketiop2p; @@ -14,7 +15,7 @@ declare function SocketioP2PStatic( ): SocketioP2PStatic.Socketiop2p; declare namespace SocketioP2PStatic { - export interface PeerOpts { + interface PeerOpts { initiator?: boolean; // false channelConfig?: object; // {} channelName?: string; // random string @@ -30,13 +31,13 @@ declare namespace SocketioP2PStatic { objectMode?: boolean; // false } - export interface P2POptions { + interface P2POptions { numClients?: number; // 5 autoUpgrade?: boolean; // true peerOpts?: PeerOpts; } - export interface Socketiop2p { + interface Socketiop2p { (socket: any, opts: P2POptions, cb?: () => void): Socketiop2p; on(event: string, callback: (data: any) => void): void; emit(data: any, cb: () => void): void; diff --git a/types/socket.io-p2p/tsconfig.json b/types/socket.io-p2p/tsconfig.json index cbaab55544..75c4112267 100644 --- a/types/socket.io-p2p/tsconfig.json +++ b/types/socket.io-p2p/tsconfig.json @@ -5,6 +5,7 @@ "noImplicitAny": true, "noImplicitThis": true, "strictNullChecks": true, + "strictFunctionTypes": true, "baseUrl": "../", "typeRoots": ["../"], "types": [],