Created
March 24, 2014 08:46
-
-
Save PyYoshi/9736538 to your computer and use it in GitHub Desktop.
オレオレ定義ファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Type definitions for socket.io | |
// Project: http://socket.io/ | |
// Definitions by: William Orr <https://github.com/worr> | |
// Definitions: https://github.com/borisyankov/DefinitelyTyped | |
// Modified by PyYoshi <myoshi321go@gmail.com> | |
///<reference path='../node/node.d.ts' /> | |
declare module "socket.io" { | |
import http = require('http'); | |
export function listen(server: http.Server, options: any, fn: Function): SocketIOManager; | |
export function listen(server: http.Server, fn?: Function): SocketIOManager; | |
export function listen(port: Number): SocketIOManager; | |
} | |
interface SocketIO { | |
id: string; | |
json:any; | |
log: any; | |
volatile: any; | |
broadcast: any; | |
in(room: string): SocketIO; | |
to(room: string): SocketIO; | |
join(name: string, fn: Function): SocketIO; | |
leave(name: string, fn: Function): SocketIO; | |
set(key: string, value: any, fn: Function): SocketIO; | |
get(key: string, fn: Function): SocketIO; | |
has(key: string, fn: Function): SocketIO; | |
del(key: string, fn: Function): SocketIO; | |
disconnect(): SocketIO; | |
send(data: any, fn: Function): SocketIO; | |
emit(ev: any, ...data:any[]): SocketIO; | |
on(ns: string, fn: Function): SocketIO; | |
} | |
interface SocketIONamespace { | |
clients(room: string): SocketIO[]; | |
log: any; | |
store: any; | |
json: any; | |
volatile: any; | |
in(room: string): SocketIONamespace; | |
on(evt: string, fn: (socket: SocketIO) => void): SocketIONamespace; | |
to(room: string): SocketIONamespace; | |
except(id: any): SocketIONamespace; | |
send(data: any): any; | |
emit(ev: any, ...data:any[]): SocketIO; | |
socket(sid: any, readable: boolean): SocketIO; | |
authorization(fn: Function): SocketIONamespace; | |
} | |
interface SocketIOManager { | |
get(key: any): any; | |
set(key: any, value: any): SocketIOManager; | |
enable(key: any): SocketIOManager; | |
disable(key: any): SocketIOManager; | |
enabled(key: any): boolean; | |
disabled(key: any): boolean; | |
configure(env: string, fn: Function): SocketIOManager; | |
configure(fn: Function): SocketIOManager; | |
of(nsp: string): SocketIONamespace; | |
on(ns: string, fn: Function): SocketIOManager; | |
sockets: SocketIONamespace; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment