mikudos-socketio-app
Version:
mikudos-socketio-app for connection and call methods and sync events on mikudos-socketio-app server, which is provided only for socket.io connection.
43 lines (37 loc) • 899 B
text/typescript
import { Application } from './app';
import { DUPLEX_HANDLER } from './common';
export declare namespace mikudos {
interface duplexHooks {
[key: string]: ((
eventName: string,
data: any,
socket: mikudos.Socket,
) => Promise<any>)[];
}
interface ConfigFunc {
(app: Application): void;
}
interface Socket extends SocketIO.Socket {
mikudos: {
app: Application;
provider: string;
headers: any;
remoteAddress: any;
user: any;
};
}
interface DuplexService {
serviceClass: any;
before: { [key: string]: DuplexHandle[] };
[key: string]: any;
}
interface DuplexServiceConstructor {
serviceKey: string;
new (handler: DUPLEX_HANDLER, app: Application): DuplexService;
}
interface DuplexHandle {
(eventName: string, data: any, socket: mikudos.Socket): Promise<
void
> | void;
}
}