import ACSocket from './cube-socket';
import ACProject from './cube-project';
import ACPack from './cube-pack';
import ACInspect from './cube-inspect';
import ACServer from './cube-server';
import ACLint from './cube-lint';

export class AntEngine {
    constructor() {
        AntCube.socket.on('connection', ({client}) => {
            const ftp = AntCube.server.connectInfo();
            AntCube.socket.send({
                token: client.session.token,
                data: JSON.stringify({
                    status: 200,
                    key: 'ide_information',
                    payload: {
                        ftp_host: ftp.ip,
                        ftp_port: ftp.port
                    }
                })
            });
        });
    }
}

export namespace AntCube {
    export const project: ACProject = new ACProject();
    export const socket: ACSocket = new ACSocket();
    export const pack: ACPack = new ACPack();
    export const inspect: ACInspect = new ACInspect();
    export const server: ACServer = new ACServer();
    export const engine: AntEngine = new AntEngine();
    export const lint: ACLint = new ACLint();
}

export default AntCube;