mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2025-12-05 20:39:59 -08:00
refactor imports (#5058)
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { AdminCommands } from 'websocket';
|
import { AdminCommands } from 'websocket';
|
||||||
|
|
||||||
export default class AdminService {
|
export class AdminService {
|
||||||
static adjustMod(userName: string, shouldBeMod?: boolean, shouldBeJudge?: boolean): void {
|
static adjustMod(userName: string, shouldBeMod?: boolean, shouldBeJudge?: boolean): void {
|
||||||
AdminCommands.adjustMod(userName, shouldBeMod, shouldBeJudge);
|
AdminCommands.adjustMod(userName, shouldBeMod, shouldBeJudge);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { StatusEnum, User, WebSocketConnectReason, WebSocketConnectOptions } from 'types';
|
import { StatusEnum, User, WebSocketConnectReason, WebSocketConnectOptions } from 'types';
|
||||||
import { SessionCommands, webClient } from 'websocket';
|
import { SessionCommands, webClient } from 'websocket';
|
||||||
|
|
||||||
export default class AuthenticationService {
|
export class AuthenticationService {
|
||||||
static login(options: WebSocketConnectOptions): void {
|
static login(options: WebSocketConnectOptions): void {
|
||||||
SessionCommands.connect(options, WebSocketConnectReason.LOGIN);
|
SessionCommands.connect(options, WebSocketConnectReason.LOGIN);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { ModeratorCommands } from 'websocket';
|
import { ModeratorCommands } from 'websocket';
|
||||||
import { LogFilters } from 'types';
|
import { LogFilters } from 'types';
|
||||||
|
|
||||||
export default class ModeratorService {
|
export class ModeratorService {
|
||||||
static banFromServer(minutes: number, userName?: string, address?: string, reason?: string,
|
static banFromServer(minutes: number, userName?: string, address?: string, reason?: string,
|
||||||
visibleReason?: string, clientid?: string, removeMessages?: number): void {
|
visibleReason?: string, clientid?: string, removeMessages?: number): void {
|
||||||
ModeratorCommands.banFromServer(minutes, userName, address, reason, visibleReason, clientid, removeMessages);
|
ModeratorCommands.banFromServer(minutes, userName, address, reason, visibleReason, clientid, removeMessages);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { RoomCommands, SessionCommands } from 'websocket';
|
import { RoomCommands, SessionCommands } from 'websocket';
|
||||||
|
|
||||||
export default class RoomsService {
|
export class RoomsService {
|
||||||
static joinRoom(roomId: number): void {
|
static joinRoom(roomId: number): void {
|
||||||
SessionCommands.joinRoom(roomId);
|
SessionCommands.joinRoom(roomId);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
import { RouteEnum } from 'types';
|
|
||||||
|
|
||||||
export class RouterService {
|
|
||||||
resolveUrl(path, params) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2,7 +2,7 @@ import { SessionCommands } from 'websocket';
|
|||||||
import { common } from 'protobufjs';
|
import { common } from 'protobufjs';
|
||||||
import IBytesValue = common.IBytesValue;
|
import IBytesValue = common.IBytesValue;
|
||||||
|
|
||||||
export default class SessionService {
|
export class SessionService {
|
||||||
static addToBuddyList(userName: string) {
|
static addToBuddyList(userName: string) {
|
||||||
SessionCommands.addToBuddyList(userName);
|
SessionCommands.addToBuddyList(userName);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
export { default as AdminService } from './AdminService';
|
export { AdminService } from './AdminService';
|
||||||
export { default as AuthenticationService } from './AuthenticationService';
|
export { AuthenticationService } from './AuthenticationService';
|
||||||
export { default as ModeratorService } from './ModeratorService';
|
export { ModeratorService } from './ModeratorService';
|
||||||
export { default as RoomsService } from './RoomsService';
|
export { RoomsService } from './RoomsService';
|
||||||
export { default as SessionService } from './SessionService';
|
export { SessionService } from './SessionService';
|
||||||
|
|||||||
@@ -1,2 +1,3 @@
|
|||||||
export { default as webClient } from './WebClient';
|
|
||||||
export * from './commands';
|
export * from './commands';
|
||||||
|
|
||||||
|
export { default as webClient } from './WebClient';
|
||||||
|
|||||||
Reference in New Issue
Block a user