import Application from './application'; import { I_connectorConstructor } from './util/interfaceDefine'; import { ConnectorTcp } from './connector/connectorProxyTcp'; import { ConnectorWs } from './connector/connectorProxyWs'; interface I_omelot { version: string; createApp: () => Application; app: Application; connector: { Tcp: I_connectorConstructor; Ws: I_connectorConstructor; }; } let hasCreated = false; const omelot: I_omelot = {} as any; omelot.version = require('../package.json').version; omelot.createApp = function () { if (hasCreated) { console.error('the app has already been created'); return omelot.app; } hasCreated = true; omelot.app = new Application(); return omelot.app; }; omelot.connector = { Tcp: ConnectorTcp, Ws: ConnectorWs }; export = omelot