我正在尝试使用开玩笑来模拟Typescript类中的导入类,以下代码用于主程序(我从函数内部删除了一些代码,但仍应清楚我要做什么)
import * as SocketIO from "socket.io";
import {AuthenticatedDao} from "../../dao/authenticated.dao";
export default class AuthenticationService {
private readonly _authenticatedDao: AuthenticatedDao = AuthenticatedDao.Instance;
private readonly _io;
constructor(socketIo: SocketIO.Server) {
this._io = socketIo;
}
public authenticateUser(username: string, password: string, clientSocketId: string): void {
this._authenticatedDao.authenticateUser(username, password).then((authenticatedUser) => {
}).catch(rejected => {
});
}
}
import {createServer, Server} from 'http';
import * as express from 'express';
import * as socketIo from 'socket.io';
import {LogincredentialsDto} from "./models/dto/logincredentials.dto";
import {config} from './config/config';
import AuthenticationService from "./services/implementation/authentication.service"; …
Run Code Online (Sandbox Code Playgroud)