Updates
This commit is contained in:
parent
9573cd5380
commit
48b53e9de5
|
@ -1,9 +1,7 @@
|
|||
import { AbstractServerConnection } from "./connection/ConnectionBase";
|
||||
import { PermissionManager } from "./permission/PermissionManager";
|
||||
import { GroupManager } from "./permission/GroupManager";
|
||||
import { ServerSettings } from "./settings";
|
||||
import { SoundManager } from "./audio/Sounds";
|
||||
import { ConnectionProfile } from "./profiles/ConnectionProfile";
|
||||
import { RecorderProfile } from "./voice/RecorderProfile";
|
||||
import { Registry } from "./events";
|
||||
import { FileManager } from "./file/FileManager";
|
||||
|
@ -19,6 +17,7 @@ import { SideBarManager } from "tc-shared/SideBarManager";
|
|||
import { ServerEventLog } from "tc-shared/connectionlog/ServerEventLog";
|
||||
import { PlaylistManager } from "tc-shared/music/PlaylistManager";
|
||||
import { ConnectParameters } from "tc-shared/ui/modal/connect/Controller";
|
||||
import { ServerSettings } from "tc-shared/ServerSettings";
|
||||
export declare enum InputHardwareState {
|
||||
MISSING = 0,
|
||||
START_FAILED = 1,
|
||||
|
@ -113,7 +112,7 @@ export declare class ConnectionHandler {
|
|||
private localClientId;
|
||||
private localClient;
|
||||
private autoReconnectTimer;
|
||||
private autoReconnectAttempt;
|
||||
private isReconnectAttempt;
|
||||
private connectAttemptId;
|
||||
private echoTestRunning;
|
||||
private pluginCmdRegistry;
|
||||
|
@ -124,8 +123,7 @@ export declare class ConnectionHandler {
|
|||
constructor();
|
||||
initializeHandlerState(source?: ConnectionHandler): void;
|
||||
events(): Registry<ConnectionEvents>;
|
||||
startConnectionNew(parameters: ConnectParameters, autoReconnectAttempt: boolean): Promise<void>;
|
||||
startConnection(addr: string, profile: ConnectionProfile, user_action: boolean, parameters: ConnectParametersOld): Promise<void>;
|
||||
startConnectionNew(parameters: ConnectParameters, isReconnectAttempt: boolean): Promise<void>;
|
||||
disconnectFromServer(reason?: string): Promise<void>;
|
||||
getClient(): LocalClientEntry;
|
||||
getClientId(): number;
|
||||
|
@ -154,7 +152,7 @@ export declare class ConnectionHandler {
|
|||
message: string;
|
||||
}>;
|
||||
getVoiceRecorder(): RecorderProfile | undefined;
|
||||
reconnect_properties(profile?: ConnectionProfile): ConnectParametersOld;
|
||||
generateReconnectParameters(): ConnectParameters | undefined;
|
||||
private initializeWhisperSession;
|
||||
destroy(): void;
|
||||
setMicrophoneMuted(muted: boolean, dontPlaySound?: boolean): void;
|
||||
|
|
|
@ -10,22 +10,22 @@ export declare abstract class AbstractCommandHandler {
|
|||
*/
|
||||
abstract handle_command(command: ServerCommand): boolean;
|
||||
}
|
||||
export declare type ExplicitCommandHandler = (command: ServerCommand, consumed: boolean) => void | boolean;
|
||||
export declare type CommandHandlerCallback = (command: ServerCommand, consumed: boolean) => void | boolean;
|
||||
export declare abstract class AbstractCommandHandlerBoss {
|
||||
readonly connection: AbstractServerConnection;
|
||||
protected command_handlers: AbstractCommandHandler[];
|
||||
protected single_command_handler: SingleCommandHandler[];
|
||||
protected explicitHandlers: {
|
||||
[key: string]: ExplicitCommandHandler[];
|
||||
[key: string]: CommandHandlerCallback[];
|
||||
};
|
||||
protected constructor(connection: AbstractServerConnection);
|
||||
destroy(): void;
|
||||
register_explicit_handler(command: string, callback: ExplicitCommandHandler): () => void;
|
||||
unregister_explicit_handler(command: string, callback: ExplicitCommandHandler): boolean;
|
||||
register_handler(handler: AbstractCommandHandler): void;
|
||||
unregister_handler(handler: AbstractCommandHandler): void;
|
||||
register_single_handler(handler: SingleCommandHandler): void;
|
||||
remove_single_handler(handler: SingleCommandHandler): void;
|
||||
registerCommandHandler(command: string, callback: CommandHandlerCallback): () => void;
|
||||
unregisterCommandHandler(command: string, callback: CommandHandlerCallback): boolean;
|
||||
registerHandler(handler: AbstractCommandHandler): void;
|
||||
unregisterHandler(handler: AbstractCommandHandler): void;
|
||||
registerSingleHandler(handler: SingleCommandHandler): void;
|
||||
removeSingleHandler(handler: SingleCommandHandler): void;
|
||||
handlers(): AbstractCommandHandler[];
|
||||
invoke_handle(command: ServerCommand): boolean;
|
||||
invokeCommand(command: ServerCommand): boolean;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ export declare abstract class AbstractServerConnection {
|
|||
abstract getServerType(): "teaspeak" | "teamspeak" | "unknown";
|
||||
abstract getVoiceConnection(): AbstractVoiceConnection;
|
||||
abstract getVideoConnection(): VideoConnection;
|
||||
abstract command_handler_boss(): AbstractCommandHandlerBoss;
|
||||
abstract getCommandHandler(): AbstractCommandHandlerBoss;
|
||||
abstract send_command(command: string, data?: any | any[], options?: CommandOptions): Promise<CommandResult>;
|
||||
abstract remote_address(): ServerAddress;
|
||||
connectionProxyAddress(): ServerAddress | undefined;
|
||||
|
@ -56,6 +56,11 @@ export declare abstract class AbstractServerConnection {
|
|||
export declare class ServerCommand {
|
||||
command: string;
|
||||
arguments: any[];
|
||||
switches: string[];
|
||||
constructor(command: string, payload: any[], switches: string[]);
|
||||
getString(key: string, index?: number): string;
|
||||
getInt(key: string, index?: number): number;
|
||||
getUInt(key: string, index?: number): number;
|
||||
}
|
||||
export interface SingleCommandHandler {
|
||||
name?: string;
|
||||
|
|
|
@ -73,11 +73,23 @@ export interface VideoClient {
|
|||
isBroadcastDismissed(broadcastType: VideoBroadcastType): boolean;
|
||||
showPip(broadcastType: VideoBroadcastType): Promise<void>;
|
||||
}
|
||||
export declare type VideoBroadcastViewer = {
|
||||
clientId: number;
|
||||
clientName: string;
|
||||
clientUniqueId: string;
|
||||
clientDatabaseId: number;
|
||||
};
|
||||
export interface LocalVideoBroadcastEvents {
|
||||
notify_state_changed: {
|
||||
oldState: LocalVideoBroadcastState;
|
||||
newState: LocalVideoBroadcastState;
|
||||
};
|
||||
notify_clients_joined: {
|
||||
clients: VideoBroadcastViewer[];
|
||||
};
|
||||
notify_clients_left: {
|
||||
clientIds: number[];
|
||||
};
|
||||
}
|
||||
export declare type LocalVideoBroadcastState = {
|
||||
state: "stopped";
|
||||
|
@ -139,6 +151,7 @@ export interface LocalVideoBroadcast {
|
|||
changeSource(source: VideoSource, constraints: VideoBroadcastConfig): Promise<void>;
|
||||
getConstraints(): VideoBroadcastConfig | undefined;
|
||||
stopBroadcasting(): any;
|
||||
getViewer(): VideoBroadcastViewer[];
|
||||
}
|
||||
export interface VideoConnection {
|
||||
getEvents(): Registry<VideoConnectionEvent>;
|
||||
|
|
|
@ -98,6 +98,7 @@ export declare class RTCConnection {
|
|||
reset(updateConnectionState: boolean): void;
|
||||
setTrackSource(type: RTCSourceTrackType, source: MediaStreamTrack | null): Promise<MediaStreamTrack>;
|
||||
clearTrackSources(types: RTCSourceTrackType[]): Promise<MediaStreamTrack[]>;
|
||||
getTrackTypeFromSsrc(ssrc: number): RTCSourceTrackType | undefined;
|
||||
startVideoBroadcast(type: VideoBroadcastType, config: VideoBroadcastConfig): Promise<void>;
|
||||
changeVideoBroadcastConfig(type: VideoBroadcastType, config: VideoBroadcastConfig): Promise<void>;
|
||||
startAudioBroadcast(): Promise<void>;
|
||||
|
|
|
@ -7,6 +7,7 @@ export declare class SdpProcessor {
|
|||
reset(): void;
|
||||
getRemoteSsrcFromFromMediaId(mediaId: string): number | undefined;
|
||||
getLocalSsrcFromFromMediaId(mediaId: string): number | undefined;
|
||||
getLocalMediaIdFromSsrc(ssrc: number): string | undefined;
|
||||
processIncomingSdp(sdpString: string, _mode: "offer" | "answer"): string;
|
||||
processOutgoingSdp(sdpString: string, _mode: "offer" | "answer"): string;
|
||||
private static generateRtpSSrcMapping;
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
import { CountryFlag } from "svg-sprites/country-flags";
|
||||
import { AbstractTranslationResolver } from "tc-shared/i18n/Translation";
|
||||
export declare type I18NContributor = {
|
||||
name: string;
|
||||
email: string;
|
||||
};
|
||||
export declare type TranslationResolverCreateResult = {
|
||||
status: "success";
|
||||
resolver: AbstractTranslationResolver;
|
||||
} | {
|
||||
status: "error";
|
||||
message: string;
|
||||
};
|
||||
export declare abstract class I18NTranslation {
|
||||
abstract getId(): string;
|
||||
abstract getName(): string;
|
||||
abstract getCountry(): CountryFlag;
|
||||
abstract getDescription(): string;
|
||||
abstract getContributors(): I18NContributor[];
|
||||
abstract createTranslationResolver(): Promise<TranslationResolverCreateResult>;
|
||||
}
|
||||
export declare abstract class I18NRepository {
|
||||
abstract getName(): string;
|
||||
abstract getDescription(): string;
|
||||
abstract getTranslations(): Promise<I18NTranslation[]>;
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
export declare abstract class AbstractTranslationResolver {
|
||||
private translationCache;
|
||||
protected constructor();
|
||||
/**
|
||||
* Translate the target message.
|
||||
* @param message
|
||||
*/
|
||||
translateMessage(message: string): any;
|
||||
protected invalidateCache(): void;
|
||||
/**
|
||||
* Register a translation into the cache.
|
||||
* @param message
|
||||
* @param translation
|
||||
* @protected
|
||||
*/
|
||||
protected registerTranslation(message: string, translation: string): void;
|
||||
protected abstract resolveTranslation(message: string): string;
|
||||
}
|
|
@ -34,9 +34,8 @@ export interface TranslationRepository {
|
|||
load_timestamp?: number;
|
||||
}
|
||||
export declare function tr(message: string, key?: string): string;
|
||||
export declare function trJQuery(message: string, ...args: any[]): JQuery[];
|
||||
export declare function tra(message: string, ...args: (string | number | boolean)[]): string;
|
||||
export declare function tra(message: string, ...args: any[]): JQuery[];
|
||||
export declare function traj(message: string, ...args: any[]): JQuery[];
|
||||
export declare function load_file(url: string, path: string): Promise<void>;
|
||||
export declare function load_repository(url: string): Promise<TranslationRepository>;
|
||||
export declare namespace config {
|
||||
|
@ -66,11 +65,8 @@ export declare function initializeI18N(): Promise<void>;
|
|||
declare global {
|
||||
interface Window {
|
||||
tr(message: string): string;
|
||||
tra(message: string, ...args: (string | number | boolean | null | undefined)[]): string;
|
||||
tra(message: string, ...args: any[]): JQuery[];
|
||||
log: any;
|
||||
StaticSettings: any;
|
||||
}
|
||||
const tr: typeof window.tr;
|
||||
const tra: typeof window.tra;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from "react";
|
||||
export declare const isYoutubeLink: (text: string) => boolean;
|
||||
export declare const YoutubeRenderer: (props: {
|
||||
children?: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[];
|
||||
children?: React.ReactElement | React.ReactElement[];
|
||||
url: string;
|
||||
}) => JSX.Element;
|
||||
|
|
|
@ -4,7 +4,7 @@ import ReactRenderer from "vendor/xbbcode/renderer/react";
|
|||
import HTMLRenderer from "vendor/xbbcode/renderer/html";
|
||||
import "./emoji";
|
||||
import "./highlight";
|
||||
import "./YoutubeController";
|
||||
import "./YoutubeRenderer";
|
||||
import "./url";
|
||||
import "./image";
|
||||
export declare let BBCodeHandlerContext: Context<string>;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="react" />
|
||||
export declare const SimpleUrlRenderer: (props: {
|
||||
target: string;
|
||||
children: any;
|
||||
children;
|
||||
}) => JSX.Element;
|
||||
export declare function fixupJQueryUrlTags(container: JQuery): void;
|
||||
|
|
|
@ -5,6 +5,7 @@ import { Registry } from "../events";
|
|||
import { ChannelTreeEntry, ChannelTreeEntryEvents } from "./ChannelTreeEntry";
|
||||
import { ClientIcon } from "svg-sprites/client-icons";
|
||||
import { EventChannelData } from "tc-shared/connectionlog/Definitions";
|
||||
import { ChannelDescriptionResult } from "tc-shared/tree/ChannelDefinitions";
|
||||
export declare enum ChannelType {
|
||||
PERMANENT = 0,
|
||||
SEMI_PERMANENT = 1,
|
||||
|
@ -96,22 +97,23 @@ export declare class ChannelEntry extends ChannelTreeEntry<ChannelEvents> {
|
|||
private _family_index;
|
||||
private _destroyed;
|
||||
private cachedPasswordHash;
|
||||
private channelDescriptionCached;
|
||||
private channelDescriptionCacheTimestamp;
|
||||
private channelDescriptionCallback;
|
||||
private channelDescriptionPromise;
|
||||
private collapsed;
|
||||
private subscribed;
|
||||
private subscriptionMode;
|
||||
private client_list;
|
||||
private clientList;
|
||||
private readonly clientPropertyChangedListener;
|
||||
constructor(channelTree: ChannelTree, channelId: number, channelName: string);
|
||||
destroy(): void;
|
||||
channelName(): string;
|
||||
channelDepth(): number;
|
||||
formattedChannelName(): string;
|
||||
getChannelDescription(): Promise<string>;
|
||||
clearDescriptionCache(): void;
|
||||
getChannelDescription(ignoreCache: boolean): Promise<ChannelDescriptionResult>;
|
||||
private doGetChannelDescriptionNew;
|
||||
isDescriptionCached(): boolean;
|
||||
private doGetChannelDescription;
|
||||
registerClient(client: ClientEntry): void;
|
||||
unregisterClient(client: ClientEntry, noEvent?: boolean): void;
|
||||
private reorderClientList;
|
||||
|
@ -128,7 +130,7 @@ export declare class ChannelEntry extends ChannelTreeEntry<ChannelEvents> {
|
|||
value: string;
|
||||
}[]): void;
|
||||
generateBBCode(): string;
|
||||
channelType(): ChannelType;
|
||||
getChannelType(): ChannelType;
|
||||
joinChannel(ignorePasswordFlag?: boolean): Promise<boolean>;
|
||||
requestChannelPassword(ignorePermission: PermissionType): Promise<{
|
||||
hash: string;
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
export declare type ChannelDescriptionResult = {
|
||||
status: "success";
|
||||
description: string;
|
||||
handlerId: string;
|
||||
} | {
|
||||
status: "empty";
|
||||
} | {
|
||||
status: "no-permissions";
|
||||
failedPermission: string;
|
||||
} | {
|
||||
status: "error";
|
||||
message: string;
|
||||
};
|
|
@ -13,9 +13,9 @@ import { EventClient } from "tc-shared/connectionlog/Definitions";
|
|||
export declare enum ClientType {
|
||||
CLIENT_VOICE = 0,
|
||||
CLIENT_QUERY = 1,
|
||||
CLIENT_INTERNAL = 2,
|
||||
CLIENT_WEB = 3,
|
||||
CLIENT_MUSIC = 4,
|
||||
CLIENT_TEASPEAK = 5,
|
||||
CLIENT_UNDEFINED = 5
|
||||
}
|
||||
export declare class ClientProperties {
|
||||
|
@ -184,6 +184,7 @@ export declare class ClientEntry<Events extends ClientEvents = ClientEvents> ext
|
|||
set_connection_info(info: ClientConnectionInfo): void;
|
||||
setAudioVolume(value: number): void;
|
||||
getAudioVolume(): number;
|
||||
getClientType(): ClientType;
|
||||
}
|
||||
export declare class LocalClientEntry extends ClientEntry {
|
||||
handle: ConnectionHandler;
|
||||
|
|
|
@ -2,83 +2,9 @@ import { ChannelTree } from "./ChannelTree";
|
|||
import * as contextmenu from "../ui/elements/ContextMenu";
|
||||
import { Registry } from "../events";
|
||||
import { ChannelTreeEntry, ChannelTreeEntryEvents } from "./ChannelTreeEntry";
|
||||
export declare class ServerProperties {
|
||||
virtualserver_host: string;
|
||||
virtualserver_port: number;
|
||||
virtualserver_name: string;
|
||||
virtualserver_name_phonetic: string;
|
||||
virtualserver_icon_id: number;
|
||||
virtualserver_version: string;
|
||||
virtualserver_platform: string;
|
||||
virtualserver_unique_identifier: string;
|
||||
virtualserver_clientsonline: number;
|
||||
virtualserver_queryclientsonline: number;
|
||||
virtualserver_channelsonline: number;
|
||||
virtualserver_uptime: number;
|
||||
virtualserver_created: number;
|
||||
virtualserver_maxclients: number;
|
||||
virtualserver_reserved_slots: number;
|
||||
virtualserver_password: string;
|
||||
virtualserver_flag_password: boolean;
|
||||
virtualserver_ask_for_privilegekey: boolean;
|
||||
virtualserver_welcomemessage: string;
|
||||
virtualserver_hostmessage: string;
|
||||
virtualserver_hostmessage_mode: number;
|
||||
virtualserver_hostbanner_url: string;
|
||||
virtualserver_hostbanner_gfx_url: string;
|
||||
virtualserver_hostbanner_gfx_interval: number;
|
||||
virtualserver_hostbanner_mode: number;
|
||||
virtualserver_hostbutton_tooltip: string;
|
||||
virtualserver_hostbutton_url: string;
|
||||
virtualserver_hostbutton_gfx_url: string;
|
||||
virtualserver_codec_encryption_mode: number;
|
||||
virtualserver_default_music_group: number;
|
||||
virtualserver_default_server_group: number;
|
||||
virtualserver_default_channel_group: number;
|
||||
virtualserver_default_channel_admin_group: number;
|
||||
virtualserver_default_client_description: string;
|
||||
virtualserver_default_channel_description: string;
|
||||
virtualserver_default_channel_topic: string;
|
||||
virtualserver_antiflood_points_tick_reduce: number;
|
||||
virtualserver_antiflood_points_needed_command_block: number;
|
||||
virtualserver_antiflood_points_needed_ip_block: number;
|
||||
virtualserver_country_code: string;
|
||||
virtualserver_complain_autoban_count: number;
|
||||
virtualserver_complain_autoban_time: number;
|
||||
virtualserver_complain_remove_time: number;
|
||||
virtualserver_needed_identity_security_level: number;
|
||||
virtualserver_weblist_enabled: boolean;
|
||||
virtualserver_min_clients_in_channel_before_forced_silence: number;
|
||||
virtualserver_channel_temp_delete_delay_default: number;
|
||||
virtualserver_priority_speaker_dimm_modificator: number;
|
||||
virtualserver_max_upload_total_bandwidth: number;
|
||||
virtualserver_upload_quota: number;
|
||||
virtualserver_max_download_total_bandwidth: number;
|
||||
virtualserver_download_quota: number;
|
||||
virtualserver_month_bytes_downloaded: number;
|
||||
virtualserver_month_bytes_uploaded: number;
|
||||
virtualserver_total_bytes_downloaded: number;
|
||||
virtualserver_total_bytes_uploaded: number;
|
||||
}
|
||||
export interface ServerConnectionInfo {
|
||||
connection_filetransfer_bandwidth_sent: number;
|
||||
connection_filetransfer_bandwidth_received: number;
|
||||
connection_filetransfer_bytes_sent_total: number;
|
||||
connection_filetransfer_bytes_received_total: number;
|
||||
connection_filetransfer_bytes_sent_month: number;
|
||||
connection_filetransfer_bytes_received_month: number;
|
||||
connection_packets_sent_total: number;
|
||||
connection_bytes_sent_total: number;
|
||||
connection_packets_received_total: number;
|
||||
connection_bytes_received_total: number;
|
||||
connection_bandwidth_sent_last_second_total: number;
|
||||
connection_bandwidth_sent_last_minute_total: number;
|
||||
connection_bandwidth_received_last_second_total: number;
|
||||
connection_bandwidth_received_last_minute_total: number;
|
||||
connection_connected_time: number;
|
||||
connection_packetloss_total: number;
|
||||
connection_ping: number;
|
||||
}
|
||||
import { HostBannerInfo } from "tc-shared/ui/frames/HostBannerDefinitions";
|
||||
import { ServerAudioEncryptionMode, ServerConnectionInfo, ServerConnectionInfoResult, ServerProperties } from "tc-shared/tree/ServerDefinitions";
|
||||
export * from "./ServerDefinitions";
|
||||
export interface ServerAddress {
|
||||
host: string;
|
||||
port: number;
|
||||
|
@ -90,6 +16,7 @@ export interface ServerEvents extends ChannelTreeEntryEvents {
|
|||
updated_properties: Partial<ServerProperties>;
|
||||
server_properties: ServerProperties;
|
||||
};
|
||||
notify_host_banner_updated: {};
|
||||
}
|
||||
export declare class ServerEntry extends ChannelTreeEntry<ServerEvents> {
|
||||
remote_address: ServerAddress;
|
||||
|
@ -99,6 +26,8 @@ export declare class ServerEntry extends ChannelTreeEntry<ServerEvents> {
|
|||
private info_request_promise;
|
||||
private info_request_promise_resolve;
|
||||
private info_request_promise_reject;
|
||||
private requestInfoPromise;
|
||||
private requestInfoPromiseTimestamp;
|
||||
private _info_connection_promise;
|
||||
private _info_connection_promise_timestamp;
|
||||
private _info_connection_promise_resolve;
|
||||
|
@ -116,8 +45,12 @@ export declare class ServerEntry extends ChannelTreeEntry<ServerEvents> {
|
|||
}[]): void;
|
||||
updateProperties(): Promise<void>;
|
||||
request_connection_info(): Promise<ServerConnectionInfo>;
|
||||
requestConnectionInfo(): Promise<ServerConnectionInfoResult>;
|
||||
private doRequestConnectionInfo;
|
||||
set_connection_info(info: ServerConnectionInfo): void;
|
||||
shouldUpdateProperties(): boolean;
|
||||
calculateUptime(): number;
|
||||
reset(): void;
|
||||
generateHostBannerInfo(): HostBannerInfo;
|
||||
getAudioEncryptionMode(): ServerAudioEncryptionMode;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,108 @@
|
|||
export declare type ServerAudioEncryptionMode = "globally-on" | "globally-off" | "individual";
|
||||
export declare class ServerProperties {
|
||||
virtualserver_host: string;
|
||||
virtualserver_port: number;
|
||||
virtualserver_name: string;
|
||||
virtualserver_name_phonetic: string;
|
||||
virtualserver_icon_id: number;
|
||||
virtualserver_version: string;
|
||||
virtualserver_platform: string;
|
||||
virtualserver_unique_identifier: string;
|
||||
virtualserver_clientsonline: number;
|
||||
virtualserver_queryclientsonline: number;
|
||||
virtualserver_channelsonline: number;
|
||||
virtualserver_uptime: number;
|
||||
virtualserver_created: number;
|
||||
virtualserver_maxclients: number;
|
||||
virtualserver_reserved_slots: number;
|
||||
virtualserver_password: string;
|
||||
virtualserver_flag_password: boolean;
|
||||
virtualserver_ask_for_privilegekey: boolean;
|
||||
virtualserver_welcomemessage: string;
|
||||
virtualserver_hostmessage: string;
|
||||
virtualserver_hostmessage_mode: number;
|
||||
virtualserver_hostbanner_url: string;
|
||||
virtualserver_hostbanner_gfx_url: string;
|
||||
virtualserver_hostbanner_gfx_interval: number;
|
||||
virtualserver_hostbanner_mode: number;
|
||||
virtualserver_hostbutton_tooltip: string;
|
||||
virtualserver_hostbutton_url: string;
|
||||
virtualserver_hostbutton_gfx_url: string;
|
||||
virtualserver_codec_encryption_mode: number;
|
||||
virtualserver_default_music_group: number;
|
||||
virtualserver_default_server_group: number;
|
||||
virtualserver_default_channel_group: number;
|
||||
virtualserver_default_channel_admin_group: number;
|
||||
virtualserver_default_client_description: string;
|
||||
virtualserver_default_channel_description: string;
|
||||
virtualserver_default_channel_topic: string;
|
||||
virtualserver_antiflood_points_tick_reduce: number;
|
||||
virtualserver_antiflood_points_needed_command_block: number;
|
||||
virtualserver_antiflood_points_needed_ip_block: number;
|
||||
virtualserver_country_code: string;
|
||||
virtualserver_complain_autoban_count: number;
|
||||
virtualserver_complain_autoban_time: number;
|
||||
virtualserver_complain_remove_time: number;
|
||||
virtualserver_needed_identity_security_level: number;
|
||||
virtualserver_weblist_enabled: boolean;
|
||||
virtualserver_min_clients_in_channel_before_forced_silence: number;
|
||||
virtualserver_channel_temp_delete_delay_default: number;
|
||||
virtualserver_priority_speaker_dimm_modificator: number;
|
||||
virtualserver_max_upload_total_bandwidth: number;
|
||||
virtualserver_upload_quota: number;
|
||||
virtualserver_max_download_total_bandwidth: number;
|
||||
virtualserver_download_quota: number;
|
||||
virtualserver_month_bytes_downloaded: number;
|
||||
virtualserver_month_bytes_uploaded: number;
|
||||
virtualserver_total_bytes_downloaded: number;
|
||||
virtualserver_total_bytes_uploaded: number;
|
||||
}
|
||||
export declare const kServerConnectionInfoFields: {
|
||||
connection_filetransfer_bandwidth_sent: string;
|
||||
connection_filetransfer_bandwidth_received: string;
|
||||
connection_filetransfer_bytes_sent_total: string;
|
||||
connection_filetransfer_bytes_received_total: string;
|
||||
connection_filetransfer_bytes_sent_month: string;
|
||||
connection_filetransfer_bytes_received_month: string;
|
||||
connection_packets_sent_total: string;
|
||||
connection_bytes_sent_total: string;
|
||||
connection_packets_received_total: string;
|
||||
connection_bytes_received_total: string;
|
||||
connection_bandwidth_sent_last_second_total: string;
|
||||
connection_bandwidth_sent_last_minute_total: string;
|
||||
connection_bandwidth_received_last_second_total: string;
|
||||
connection_bandwidth_received_last_minute_total: string;
|
||||
connection_connected_time: string;
|
||||
connection_packetloss_total: string;
|
||||
connection_ping: string;
|
||||
};
|
||||
export interface ServerConnectionInfo {
|
||||
connection_filetransfer_bandwidth_sent: number;
|
||||
connection_filetransfer_bandwidth_received: number;
|
||||
connection_filetransfer_bytes_sent_total: number;
|
||||
connection_filetransfer_bytes_received_total: number;
|
||||
connection_filetransfer_bytes_sent_month: number;
|
||||
connection_filetransfer_bytes_received_month: number;
|
||||
connection_packets_sent_total: number;
|
||||
connection_bytes_sent_total: number;
|
||||
connection_packets_received_total: number;
|
||||
connection_bytes_received_total: number;
|
||||
connection_bandwidth_sent_last_second_total: number;
|
||||
connection_bandwidth_sent_last_minute_total: number;
|
||||
connection_bandwidth_received_last_second_total: number;
|
||||
connection_bandwidth_received_last_minute_total: number;
|
||||
connection_connected_time: number;
|
||||
connection_packetloss_total: number;
|
||||
connection_ping: number;
|
||||
}
|
||||
export declare type ServerConnectionInfoResult = {
|
||||
status: "success";
|
||||
result: ServerConnectionInfo;
|
||||
resultCached: boolean;
|
||||
} | {
|
||||
status: "no-permission";
|
||||
failedPermission: string;
|
||||
} | {
|
||||
status: "error";
|
||||
message: string;
|
||||
};
|
|
@ -5,9 +5,9 @@ export declare enum ElementType {
|
|||
}
|
||||
export declare type BodyCreator = (() => JQuery | JQuery[] | string) | string | JQuery | JQuery[];
|
||||
export declare const ModalFunctions: {
|
||||
divify: (val: JQuery<HTMLElement>) => JQuery<HTMLElement>;
|
||||
jqueriefy: (val: BodyCreator, type?: ElementType) => JQuery<HTMLElement> | JQuery<HTMLElement>[];
|
||||
warpProperties(data: any): ModalProperties;
|
||||
divify: (val: JQuery) => JQuery<HTMLElement>;
|
||||
jqueriefy: (val: BodyCreator, type?: ElementType) => JQuery[] | JQuery | undefined;
|
||||
warpProperties(data: ModalProperties | any): ModalProperties;
|
||||
};
|
||||
export declare class ModalProperties {
|
||||
template?: string;
|
||||
|
|
|
@ -5,19 +5,19 @@ export declare type Entry = {
|
|||
highlight?: boolean;
|
||||
};
|
||||
export declare type Style = {
|
||||
background_color: string;
|
||||
separator_color: string;
|
||||
separator_count: number;
|
||||
separator_width: number;
|
||||
backgroundColor: string;
|
||||
separatorColor: string;
|
||||
separatorCount: number;
|
||||
separatorWidth: number;
|
||||
upload: {
|
||||
fill: string;
|
||||
stroke: string;
|
||||
strike_width: number;
|
||||
strokeWidth: number;
|
||||
};
|
||||
download: {
|
||||
fill: string;
|
||||
stroke: string;
|
||||
strike_width: number;
|
||||
strokeWidth: number;
|
||||
};
|
||||
};
|
||||
export declare type TimeSpan = {
|
||||
|
@ -33,33 +33,37 @@ export declare type TimeSpan = {
|
|||
};
|
||||
};
|
||||
export declare class Graph {
|
||||
private static _loops;
|
||||
readonly canvas: HTMLCanvasElement;
|
||||
private static animateCallbacks;
|
||||
private static registerAnimateCallback;
|
||||
private static removerAnimateCallback;
|
||||
style: Style;
|
||||
private _canvas_context;
|
||||
private _entries;
|
||||
private _entry_max;
|
||||
private _max_space;
|
||||
private _max_gap;
|
||||
private _animate_loop;
|
||||
_time_span: TimeSpan;
|
||||
private _detailed_shown;
|
||||
callback_detailed_info: (upload: number, download: number, timestamp: number, event: MouseEvent) => any;
|
||||
callback_detailed_hide: () => any;
|
||||
constructor(canvas: HTMLCanvasElement);
|
||||
private canvas;
|
||||
private canvasContext;
|
||||
private entries;
|
||||
private entriesMax;
|
||||
private maxSpace;
|
||||
private maxGap;
|
||||
private animateLoop;
|
||||
timeSpan: TimeSpan;
|
||||
private detailShown;
|
||||
callbackDetailedInfo: (upload: number, download: number, timestamp: number, event: MouseEvent) => any;
|
||||
callbackDetailedHide: () => any;
|
||||
constructor();
|
||||
initialize(): void;
|
||||
terminate(): void;
|
||||
max_gap_size(value?: number): number;
|
||||
private recalculate_cache;
|
||||
insert_entry(entry: Entry): void;
|
||||
insert_entries(entries: Entry[]): void;
|
||||
finalize(): void;
|
||||
initializeCanvas(canvas: HTMLCanvasElement | undefined): void;
|
||||
maxGapSize(value?: number): number;
|
||||
private recalculateCache;
|
||||
entryCount(): number;
|
||||
pushEntry(entry: Entry): void;
|
||||
insertEntries(entries: Entry[]): void;
|
||||
resize(): void;
|
||||
cleanup(): void;
|
||||
calculate_time_span(): {
|
||||
calculateTimespan(): {
|
||||
begin: number;
|
||||
end: number;
|
||||
};
|
||||
draw(): void;
|
||||
private on_mouse_move;
|
||||
private on_mouse_leave;
|
||||
private draw;
|
||||
private onMouseMove;
|
||||
private onMouseLeave;
|
||||
}
|
||||
|
|
|
@ -6,5 +6,5 @@ declare global {
|
|||
}
|
||||
}
|
||||
export declare const TabFunctions: {
|
||||
tabify(template: JQuery<HTMLElement>, copy?: boolean): JQuery<HTMLElement>;
|
||||
tabify(template: JQuery, copy?: boolean): JQuery;
|
||||
};
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ConnectionHandler } from "tc-shared/ConnectionHandler";
|
||||
import { Registry } from "tc-shared/events";
|
||||
import { HostBannerUiEvents } from "tc-shared/ui/frames/HostBannerDefinitions";
|
||||
import { Registry } from "tc-shared/events";
|
||||
export declare class HostBannerController {
|
||||
readonly uiEvents: Registry<HostBannerUiEvents>;
|
||||
private currentConnection;
|
||||
|
|
|
@ -3,6 +3,7 @@ import { HostBannerInfoSet, HostBannerUiEvents } from "tc-shared/ui/frames/HostB
|
|||
import * as React from "react";
|
||||
export declare const HostBannerRenderer: React.MemoExoticComponent<(props: {
|
||||
banner: HostBannerInfoSet;
|
||||
clickable: boolean;
|
||||
className?: string;
|
||||
}) => JSX.Element>;
|
||||
export declare const HostBanner: React.MemoExoticComponent<(props: {
|
||||
|
|
|
@ -7,14 +7,19 @@ export declare enum ChatType {
|
|||
export declare function htmlEscape(message: string): string[];
|
||||
export declare function formatElement(object: any, escape_html?: boolean): JQuery[];
|
||||
export declare function formatMessage(pattern: string, ...objects: any[]): JQuery[];
|
||||
export declare function formatMessageString(pattern: string, ...args: string[]): string;
|
||||
export declare function formatMessageString(pattern: string, ...args: (string | number | boolean)[]): string;
|
||||
export declare function parseMessageWithArguments(pattern: string, argumentCount: number): (string | number)[];
|
||||
export declare namespace network {
|
||||
const KB = 1024;
|
||||
const KiB = 1024;
|
||||
const MiB: number;
|
||||
const GiB: number;
|
||||
const TiB: number;
|
||||
const kB = 1000;
|
||||
const MB: number;
|
||||
const GB: number;
|
||||
const TB: number;
|
||||
function byteSizeToString(value: number): string;
|
||||
function binarySizeToString(value: number): string;
|
||||
function decimalSizeToString(value: number): string;
|
||||
function format_bytes(value: number, options?: {
|
||||
time?: string;
|
||||
unit?: string;
|
||||
|
|
|
@ -102,6 +102,7 @@ export interface ChannelVideoEvents {
|
|||
videoId: string;
|
||||
broadcastType: VideoBroadcastType;
|
||||
};
|
||||
action_show_viewers: {};
|
||||
query_expended: {};
|
||||
query_videos: {};
|
||||
query_video: {
|
||||
|
@ -120,6 +121,7 @@ export interface ChannelVideoEvents {
|
|||
broadcastType: VideoBroadcastType;
|
||||
};
|
||||
query_subscribe_info: {};
|
||||
query_viewer_count: {};
|
||||
notify_expended: {
|
||||
expended: boolean;
|
||||
};
|
||||
|
@ -139,10 +141,6 @@ export interface ChannelVideoEvents {
|
|||
videoId: string;
|
||||
statusIcon: ClientIcon;
|
||||
};
|
||||
notify_video_arrows: {
|
||||
left: boolean;
|
||||
right: boolean;
|
||||
};
|
||||
notify_spotlight: {
|
||||
videoId: string[];
|
||||
};
|
||||
|
@ -159,5 +157,9 @@ export interface ChannelVideoEvents {
|
|||
notify_subscribe_info: {
|
||||
info: VideoSubscribeInfo;
|
||||
};
|
||||
notify_viewer_count: {
|
||||
camera: number | undefined;
|
||||
screen: number | undefined;
|
||||
};
|
||||
}
|
||||
export declare function makeVideoAutoplay(video: HTMLVideoElement): () => void;
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import * as React from "react";
|
||||
import { Registry } from "tc-shared/events";
|
||||
import { ChannelVideoEvents } from "./Definitions";
|
||||
export declare const VideoIdContext: React.Context<string>;
|
||||
export declare const RendererVideoEventContext: React.Context<Registry<ChannelVideoEvents>>;
|
||||
export declare const VideoContainer: React.MemoExoticComponent<(props: {
|
||||
videoId: string;
|
||||
isSpotlight: boolean;
|
||||
}) => JSX.Element>;
|
||||
export declare const ChannelVideoRenderer: (props: {
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
export declare function spawnAbout(): void;
|
|
@ -18,5 +18,5 @@ export interface VolumeChangeEvents {
|
|||
};
|
||||
"close-modal": {};
|
||||
}
|
||||
export declare function spawnClientVolumeChange(client: ClientEntry): import("../react-elements/modal/Definitions").ModalController;
|
||||
export declare function spawnMusicBotVolumeChange(client: MusicClientEntry, maxValue: number): import("../react-elements/modal/Definitions").ModalController;
|
||||
export declare function spawnClientVolumeChange(client: ClientEntry): import("tc-shared/ui/react-elements/modal/Definitions").ModalController;
|
||||
export declare function spawnMusicBotVolumeChange(client: MusicClientEntry, maxValue: number): import("tc-shared/ui/react-elements/modal/Definitions").ModalController;
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
import { ChannelEntry } from "../../tree/Channel";
|
||||
export declare function openChannelInfo(channel: ChannelEntry): void;
|
|
@ -1,2 +0,0 @@
|
|||
import { ServerEntry } from "../../tree/Server";
|
||||
export declare function openServerInfo(server: ServerEntry): void;
|
|
@ -1,9 +0,0 @@
|
|||
import { ServerConnectionInfo, ServerEntry } from "../../tree/Server";
|
||||
import { Modal } from "../../ui/elements/Modal";
|
||||
export declare enum RequestInfoStatus {
|
||||
SUCCESS = 0,
|
||||
UNKNOWN = 1,
|
||||
NO_PERMISSION = 2
|
||||
}
|
||||
export declare type ServerBandwidthInfoUpdateCallback = (status: RequestInfoStatus, info?: ServerConnectionInfo) => any;
|
||||
export declare function openServerInfoBandwidth(server: ServerEntry, update_callbacks?: ServerBandwidthInfoUpdateCallback[]): Modal;
|
|
@ -1,6 +0,0 @@
|
|||
import { BodyCreator } from "../../ui/elements/Modal";
|
||||
export declare function spawnYesNo(header: BodyCreator, body: BodyCreator, callback: (_: boolean) => any, properties?: {
|
||||
text_yes?: string;
|
||||
text_no?: string;
|
||||
closeable?: boolean;
|
||||
}): import("../elements/Modal").Modal;
|
|
@ -6,4 +6,4 @@ export declare type ChannelEditChangedPermission = {
|
|||
permission: PermissionType;
|
||||
value: number;
|
||||
};
|
||||
export declare const spawnChannelEditNew: (connection: ConnectionHandler, channel: ChannelEntry, parent: ChannelEntry, callback: ChannelEditCallback) => void;
|
||||
export declare const spawnChannelEditNew: (connection: ConnectionHandler, channel: ChannelEntry | undefined, parent: ChannelEntry | undefined, callback: ChannelEditCallback) => void;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import { ChannelEntry } from "tc-shared/tree/Channel";
|
||||
export declare function spawnChannelInfo(channel: ChannelEntry): void;
|
|
@ -0,0 +1,33 @@
|
|||
import { ServerAudioEncryptionMode } from "tc-shared/tree/ServerDefinitions";
|
||||
import { ChannelDescriptionResult } from "tc-shared/tree/ChannelDefinitions";
|
||||
export interface ModalChannelInfoVariables {
|
||||
readonly name: string;
|
||||
readonly type: "default" | "permanent" | "semi-permanent" | "temporary" | "unknown";
|
||||
readonly chatMode: {
|
||||
mode: "private" | "none";
|
||||
} | {
|
||||
mode: "public";
|
||||
history: number | 0 | -1;
|
||||
};
|
||||
readonly currentClients: {
|
||||
status: "subscribed";
|
||||
online: number;
|
||||
limit: number | "unlimited" | "inherited";
|
||||
} | {
|
||||
status: "unsubscribed";
|
||||
};
|
||||
readonly audioCodec: {
|
||||
codec: number;
|
||||
quality: number;
|
||||
};
|
||||
readonly audioEncrypted: {
|
||||
channel: boolean;
|
||||
server: ServerAudioEncryptionMode;
|
||||
};
|
||||
readonly password: boolean;
|
||||
readonly topic: string;
|
||||
readonly description: ChannelDescriptionResult;
|
||||
}
|
||||
export interface ModalChannelInfoEvents {
|
||||
action_reload_description: {};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions";
|
||||
import React from "react";
|
||||
import { IpcRegistryDescription } from "tc-events";
|
||||
import { ModalChannelInfoEvents, ModalChannelInfoVariables } from "tc-shared/ui/modal/channel-info/Definitions";
|
||||
import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable";
|
||||
declare class Modal extends AbstractModal {
|
||||
private readonly events;
|
||||
private readonly variables;
|
||||
constructor(events: IpcRegistryDescription<ModalChannelInfoEvents>, variables: IpcVariableDescriptor<ModalChannelInfoVariables>);
|
||||
protected onDestroy(): void;
|
||||
renderBody(): React.ReactElement;
|
||||
renderTitle(): string | React.ReactElement;
|
||||
}
|
||||
export default Modal;
|
|
@ -0,0 +1,2 @@
|
|||
import { ConnectionHandler } from "tc-shared/ConnectionHandler";
|
||||
export declare function spawnServerBandwidth(handler: ConnectionHandler): void;
|
|
@ -0,0 +1,6 @@
|
|||
import { ServerConnectionInfoResult } from "tc-shared/tree/ServerDefinitions";
|
||||
export interface ModalServerBandwidthEvents {
|
||||
notify_connection_info: {
|
||||
info: ServerConnectionInfoResult;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions";
|
||||
import React from "react";
|
||||
import { IpcRegistryDescription } from "tc-events";
|
||||
import { ModalServerBandwidthEvents } from "tc-shared/ui/modal/server-bandwidth/Definitions";
|
||||
declare class Modal extends AbstractModal {
|
||||
private readonly events;
|
||||
constructor(events: IpcRegistryDescription<ModalServerBandwidthEvents>);
|
||||
protected onDestroy(): void;
|
||||
renderBody(): React.ReactElement;
|
||||
renderTitle(): string | React.ReactElement;
|
||||
}
|
||||
export default Modal;
|
|
@ -0,0 +1,2 @@
|
|||
import { ConnectionHandler } from "tc-shared/ConnectionHandler";
|
||||
export declare function spawnServerInfoNew(handler: ConnectionHandler): void;
|
|
@ -0,0 +1,32 @@
|
|||
import { HostBannerInfo } from "tc-shared/ui/frames/HostBannerDefinitions";
|
||||
import { ServerConnectionInfoResult } from "tc-shared/tree/ServerDefinitions";
|
||||
export interface ModalServerInfoVariables {
|
||||
readonly name: string;
|
||||
readonly region: string;
|
||||
readonly slots: {
|
||||
max: number;
|
||||
used: number;
|
||||
reserved: number;
|
||||
queries: number;
|
||||
};
|
||||
readonly firstRun: number;
|
||||
readonly uptime: number;
|
||||
readonly ipAddress: string;
|
||||
readonly version: string;
|
||||
readonly platform: string;
|
||||
readonly connectionInfo: ServerConnectionInfoResult | {
|
||||
status: "loading";
|
||||
};
|
||||
readonly uniqueId: string;
|
||||
readonly channelCount: number;
|
||||
readonly voiceDataEncryption: "global-on" | "global-off" | "channel-individual" | "unknown";
|
||||
readonly securityLevel: number;
|
||||
readonly complainsUntilBan: number;
|
||||
readonly hostBanner: HostBannerInfo;
|
||||
readonly refreshAllowed: number;
|
||||
}
|
||||
export interface ModalServerInfoEvents {
|
||||
action_show_bandwidth: {};
|
||||
action_refresh: {};
|
||||
action_close: {};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions";
|
||||
import React from "react";
|
||||
import { IpcRegistryDescription } from "tc-events";
|
||||
import { ModalServerInfoEvents, ModalServerInfoVariables } from "tc-shared/ui/modal/server-info/Definitions";
|
||||
import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable";
|
||||
declare class Modal extends AbstractModal {
|
||||
private readonly events;
|
||||
private readonly variables;
|
||||
constructor(events: IpcRegistryDescription<ModalServerInfoEvents>, variables: IpcVariableDescriptor<ModalServerInfoVariables>);
|
||||
protected onDestroy(): void;
|
||||
renderBody(): React.ReactElement;
|
||||
renderTitle(): string | React.ReactElement;
|
||||
}
|
||||
export default Modal;
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from "react";
|
||||
export declare const HighlightContainer: (props: {
|
||||
children: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[];
|
||||
children: React.ReactNode | React.ReactNode[];
|
||||
classList?: string;
|
||||
highlightedId?: string;
|
||||
onClick?: () => void;
|
||||
|
@ -13,5 +13,5 @@ export declare const HighlightRegion: (props: React.HTMLProps<HTMLDivElement> &
|
|||
export declare const HighlightText: (props: {
|
||||
highlightId: string;
|
||||
className?: string;
|
||||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[];
|
||||
children?: React.ReactNode | React.ReactNode[];
|
||||
}) => JSX.Element;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import { ConnectionHandler } from "tc-shared/ConnectionHandler";
|
||||
export declare function spawnVideoViewerInfo(handler: ConnectionHandler): void;
|
|
@ -0,0 +1,19 @@
|
|||
import { ClientIcon } from "svg-sprites/client-icons";
|
||||
import { VideoBroadcastType } from "tc-shared/connection/VideoConnection";
|
||||
export declare type VideoViewerInfo = {
|
||||
handlerId: string;
|
||||
clientName: string;
|
||||
clientUniqueId: string;
|
||||
clientStatus: ClientIcon | undefined;
|
||||
};
|
||||
export declare type VideoViewerList = {
|
||||
[T in VideoBroadcastType]?: number[];
|
||||
} & {
|
||||
__internal_client_order: number[];
|
||||
};
|
||||
export interface ModalVideoViewersVariables {
|
||||
viewerInfo: VideoViewerInfo | undefined;
|
||||
videoViewers: VideoViewerList;
|
||||
}
|
||||
export interface ModalVideoViewersEvents {
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions";
|
||||
import React from "react";
|
||||
import { IpcRegistryDescription } from "tc-events";
|
||||
import { ModalVideoViewersEvents, ModalVideoViewersVariables } from "tc-shared/ui/modal/video-viewers/Definitions";
|
||||
import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable";
|
||||
declare class Modal extends AbstractModal {
|
||||
private readonly events;
|
||||
private readonly variables;
|
||||
constructor(events: IpcRegistryDescription<ModalVideoViewersEvents>, variables: IpcVariableDescriptor<ModalVideoViewersVariables>);
|
||||
protected onDestroy(): void;
|
||||
renderBody(): React.ReactElement;
|
||||
renderTitle(): string | React.ReactElement;
|
||||
}
|
||||
export default Modal;
|
|
@ -0,0 +1,8 @@
|
|||
export interface YesNoParameters {
|
||||
title: string;
|
||||
question: string;
|
||||
textYes?: string;
|
||||
textNo?: string;
|
||||
closeable?: boolean;
|
||||
}
|
||||
export declare function promptYesNo(properties: YesNoParameters): Promise<boolean | undefined>;
|
|
@ -0,0 +1,11 @@
|
|||
export interface ModalYesNoVariables {
|
||||
readonly title: string;
|
||||
readonly question: string;
|
||||
readonly textYes: string | undefined;
|
||||
readonly textNo: string | undefined;
|
||||
}
|
||||
export interface ModalYesNoEvents {
|
||||
action_submit: {
|
||||
status: boolean;
|
||||
};
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions";
|
||||
import { IpcRegistryDescription } from "tc-events";
|
||||
import { ModalYesNoEvents, ModalYesNoVariables } from "tc-shared/ui/modal/yes-no/Definitions";
|
||||
import React from "react";
|
||||
declare class Modal extends AbstractModal {
|
||||
private readonly events;
|
||||
private readonly variables;
|
||||
constructor(events: IpcRegistryDescription<ModalYesNoEvents>, variables: IpcRegistryDescription<ModalYesNoVariables>);
|
||||
protected onDestroy(): void;
|
||||
color(): "none" | "blue" | "red";
|
||||
renderBody(): React.ReactElement;
|
||||
renderTitle(): string | React.ReactElement;
|
||||
}
|
||||
export default Modal;
|
|
@ -1,6 +1,6 @@
|
|||
/// <reference types="react" />
|
||||
export declare const Arrow: (props: {
|
||||
direction: NavigationReason;
|
||||
direction: "up" | "down" | "left" | "right";
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
}) => JSX.Element;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import * as React from "react";
|
||||
import { ClientAvatar } from "tc-shared/file/Avatars";
|
||||
export declare const AvatarRenderer: React.MemoExoticComponent<(props: {
|
||||
avatar: "default" | "loading" | ClientAvatar;
|
||||
avatar: ClientAvatar | "loading" | "default";
|
||||
className?: string;
|
||||
alt?: string;
|
||||
}) => JSX.Element>;
|
||||
|
|
|
@ -4,7 +4,7 @@ interface ErrorBoundaryState {
|
|||
}
|
||||
export declare class ErrorBoundary extends React.PureComponent<{}, ErrorBoundaryState> {
|
||||
constructor(props: any);
|
||||
render(): {};
|
||||
render(): React.ReactNode;
|
||||
componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
|
||||
static getDerivedStateFromError(): Partial<ErrorBoundaryState>;
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import * as React from "react";
|
||||
export declare const FontSizeObserver: React.MemoExoticComponent<(props: {
|
||||
children: (fontSize: number) => string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[];
|
||||
children: (fontSize: number) => React.ReactNode | React.ReactNode[];
|
||||
}) => JSX.Element>;
|
||||
|
|
|
@ -6,12 +6,12 @@ export declare const IconRenderer: (props: {
|
|||
className?: string;
|
||||
}) => JSX.Element;
|
||||
export declare const RemoteIconRenderer: (props: {
|
||||
icon: RemoteIcon;
|
||||
icon: RemoteIcon | undefined;
|
||||
className?: string;
|
||||
title?: string;
|
||||
}) => JSX.Element;
|
||||
export declare const RemoteIconInfoRenderer: React.MemoExoticComponent<(props: {
|
||||
icon: RemoteIconInfo;
|
||||
icon: RemoteIconInfo | undefined;
|
||||
className?: string;
|
||||
title?: string;
|
||||
}) => JSX.Element>;
|
||||
|
|
|
@ -7,14 +7,14 @@ export declare const ControlledBoxedInputField: (props: {
|
|||
disabled?: boolean;
|
||||
editable?: boolean;
|
||||
value?: string;
|
||||
rightIcon?: () => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
|
||||
leftIcon?: () => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
|
||||
inputBox?: () => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>;
|
||||
rightIcon?: () => ReactElement;
|
||||
leftIcon?: () => ReactElement;
|
||||
inputBox?: () => ReactElement;
|
||||
isInvalid?: boolean;
|
||||
className?: string;
|
||||
maxLength?: number;
|
||||
size?: "small" | "normal" | "large";
|
||||
type?: "number" | "password" | "text";
|
||||
size?: "normal" | "large" | "small";
|
||||
type?: "text" | "password" | "number";
|
||||
onChange: (newValue?: string) => void;
|
||||
onEnter?: () => void;
|
||||
onFocus?: () => void;
|
||||
|
@ -60,7 +60,7 @@ export declare class BoxedInputField extends React.Component<BoxedInputFieldProp
|
|||
private onInputBlur;
|
||||
}
|
||||
export declare const ControlledFlatInputField: (props: {
|
||||
type?: "number" | "password" | "text";
|
||||
type?: "text" | "password" | "number";
|
||||
value: string;
|
||||
placeholder?: string;
|
||||
className?: string;
|
||||
|
@ -136,7 +136,7 @@ export declare const ControlledSelect: (props: {
|
|||
onFocus?: () => void;
|
||||
onBlur?: () => void;
|
||||
onChange?: (event?: React.ChangeEvent<HTMLSelectElement>) => void;
|
||||
children: React.ReactElement<HTMLOptGroupElement | HTMLOptionElement, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<HTMLOptGroupElement | HTMLOptionElement, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[];
|
||||
children: React.ReactElement<HTMLOptionElement | HTMLOptGroupElement> | React.ReactElement<HTMLOptionElement | HTMLOptGroupElement>[];
|
||||
}) => JSX.Element;
|
||||
export interface SelectProperties {
|
||||
type?: "flat" | "boxed";
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import * as React from "react";
|
||||
export declare const RadioButton: (props: {
|
||||
children?: string | number | boolean | {} | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[];
|
||||
children?: React.ReactNode | string | React.ReactNode[];
|
||||
name: string;
|
||||
selected: boolean;
|
||||
disabled?: boolean;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import * as React from "react";
|
||||
import { ReactElement } from "react";
|
||||
import { ReactNode } from "react";
|
||||
export interface TooltipState {
|
||||
forceShow: boolean;
|
||||
hovered: boolean;
|
||||
|
@ -7,10 +7,14 @@ export interface TooltipState {
|
|||
pageY: number;
|
||||
}
|
||||
export interface TooltipProperties {
|
||||
tooltip: () => ReactElement | ReactElement[] | string;
|
||||
tooltip: () => ReactNode | ReactNode[] | string;
|
||||
className?: string;
|
||||
/**
|
||||
* Enable the tooltip already when the span is hovered
|
||||
*/
|
||||
spawnHover?: boolean;
|
||||
}
|
||||
export declare class Tooltip extends React.Component<TooltipProperties, TooltipState> {
|
||||
export declare class Tooltip extends React.PureComponent<TooltipProperties, TooltipState> {
|
||||
readonly tooltipId: string;
|
||||
private refContainer;
|
||||
private currentContainer;
|
||||
|
@ -22,7 +26,7 @@ export declare class Tooltip extends React.Component<TooltipProperties, TooltipS
|
|||
updatePosition(): void;
|
||||
}
|
||||
export declare const IconTooltip: (props: {
|
||||
children?: React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>[];
|
||||
children?: React.ReactNode | React.ReactNode[];
|
||||
className?: string;
|
||||
outerClassName?: string;
|
||||
}) => JSX.Element;
|
||||
|
|
|
@ -14,7 +14,7 @@ export declare class Translatable extends React.Component<{
|
|||
export declare type VariadicTranslatableChild = React.ReactElement | string | number;
|
||||
export declare const VariadicTranslatable: (props: {
|
||||
text: string;
|
||||
children?: string | number | React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)> | VariadicTranslatableChild[];
|
||||
children?: VariadicTranslatableChild[] | VariadicTranslatableChild;
|
||||
}) => JSX.Element;
|
||||
declare global {
|
||||
interface Window {
|
||||
|
|
|
@ -15,7 +15,12 @@ import { PermissionEditorEvents } from "tc-shared/ui/modal/permission/EditorDefi
|
|||
import { PermissionEditorServerInfo } from "tc-shared/ui/modal/permission/ModalRenderer";
|
||||
import { ModalAvatarUploadEvents, ModalAvatarUploadVariables } from "tc-shared/ui/modal/avatar-upload/Definitions";
|
||||
import { ModalInputProcessorEvents, ModalInputProcessorVariables } from "tc-shared/ui/modal/input-processor/Definitios";
|
||||
import { ModalServerInfoEvents, ModalServerInfoVariables } from "tc-shared/ui/modal/server-info/Definitions";
|
||||
import { ModalAboutVariables } from "tc-shared/ui/modal/about/Definitions";
|
||||
import { ModalServerBandwidthEvents } from "tc-shared/ui/modal/server-bandwidth/Definitions";
|
||||
import { ModalYesNoEvents, ModalYesNoVariables } from "tc-shared/ui/modal/yes-no/Definitions";
|
||||
import { ModalChannelInfoEvents, ModalChannelInfoVariables } from "tc-shared/ui/modal/channel-info/Definitions";
|
||||
import { ModalVideoViewersEvents, ModalVideoViewersVariables } from "tc-shared/ui/modal/video-viewers/Definitions";
|
||||
export declare type ModalType = "error" | "warning" | "info" | "none";
|
||||
export declare type ModalRenderType = "page" | "dialog";
|
||||
export interface ModalOptions {
|
||||
|
@ -99,7 +104,7 @@ export declare abstract class AbstractModal {
|
|||
abstract renderBody(): ReactElement;
|
||||
abstract renderTitle(): string | React.ReactElement;
|
||||
type(): ModalType;
|
||||
color(): "none" | "blue";
|
||||
color(): "none" | "blue" | "red";
|
||||
verticalAlignment(): "top" | "center" | "bottom";
|
||||
/** @deprecated */
|
||||
protected onInitialize(): void;
|
||||
|
@ -112,21 +117,80 @@ export declare abstract class InternalModal extends AbstractModal {
|
|||
export declare function constructAbstractModalClass<T extends keyof ModalConstructorArguments>(klass: new (...args: ModalConstructorArguments[T]) => AbstractModal, properties: ModalInstanceProperties, args: ModalConstructorArguments[T]): AbstractModal;
|
||||
export interface ModalConstructorArguments {
|
||||
"__internal__modal__": any[];
|
||||
"video-viewer": [IpcRegistryDescription<VideoViewerEvents>, string];
|
||||
"channel-edit": [IpcRegistryDescription<ChannelEditEvents>, boolean];
|
||||
"echo-test": [IpcRegistryDescription<EchoTestEvents>];
|
||||
"global-settings-editor": [IpcRegistryDescription<ModalGlobalSettingsEditorEvents>];
|
||||
"modal-yes-no": [
|
||||
IpcRegistryDescription<ModalYesNoEvents>,
|
||||
IpcVariableDescriptor<ModalYesNoVariables>
|
||||
];
|
||||
"video-viewer": [
|
||||
IpcRegistryDescription<VideoViewerEvents>,
|
||||
string
|
||||
];
|
||||
"channel-edit": [
|
||||
IpcRegistryDescription<ChannelEditEvents>,
|
||||
boolean
|
||||
];
|
||||
"channel-info": [
|
||||
IpcRegistryDescription<ModalChannelInfoEvents>,
|
||||
IpcVariableDescriptor<ModalChannelInfoVariables>
|
||||
];
|
||||
"echo-test": [
|
||||
IpcRegistryDescription<EchoTestEvents>
|
||||
];
|
||||
"global-settings-editor": [
|
||||
IpcRegistryDescription<ModalGlobalSettingsEditorEvents>
|
||||
];
|
||||
"conversation": any;
|
||||
"css-editor": any;
|
||||
"channel-tree": any;
|
||||
"modal-connect": any;
|
||||
"modal-invite": [IpcRegistryDescription<InviteUiEvents>, IpcVariableDescriptor<InviteUiVariables>, string];
|
||||
"modal-bookmarks": [IpcRegistryDescription<ModalBookmarkEvents>, IpcVariableDescriptor<ModalBookmarkVariables>];
|
||||
"modal-bookmark-add-server": [IpcRegistryDescription<ModalBookmarksAddServerEvents>, IpcVariableDescriptor<ModalBookmarksAddServerVariables>];
|
||||
"modal-poked": [IpcRegistryDescription<ModalPokeEvents>, IpcVariableDescriptor<ModalPokeVariables>];
|
||||
"modal-assign-server-groups": [IpcRegistryDescription<ModalClientGroupAssignmentEvents>, IpcVariableDescriptor<ModalClientGroupAssignmentVariables>];
|
||||
"modal-permission-edit": [PermissionEditorServerInfo, IpcRegistryDescription<PermissionModalEvents>, IpcRegistryDescription<PermissionEditorEvents>];
|
||||
"modal-avatar-upload": [IpcRegistryDescription<ModalAvatarUploadEvents>, IpcVariableDescriptor<ModalAvatarUploadVariables>, string];
|
||||
"modal-input-processor": [IpcRegistryDescription<ModalInputProcessorEvents>, IpcVariableDescriptor<ModalInputProcessorVariables>];
|
||||
"modal-about": [IpcRegistryDescription, IpcVariableDescriptor<ModalAboutVariables>];
|
||||
"modal-invite": [
|
||||
IpcRegistryDescription<InviteUiEvents>,
|
||||
IpcVariableDescriptor<InviteUiVariables>,
|
||||
string
|
||||
];
|
||||
"modal-bookmarks": [
|
||||
IpcRegistryDescription<ModalBookmarkEvents>,
|
||||
IpcVariableDescriptor<ModalBookmarkVariables>
|
||||
];
|
||||
"modal-bookmark-add-server": [
|
||||
IpcRegistryDescription<ModalBookmarksAddServerEvents>,
|
||||
IpcVariableDescriptor<ModalBookmarksAddServerVariables>
|
||||
];
|
||||
"modal-poked": [
|
||||
IpcRegistryDescription<ModalPokeEvents>,
|
||||
IpcVariableDescriptor<ModalPokeVariables>
|
||||
];
|
||||
"modal-assign-server-groups": [
|
||||
IpcRegistryDescription<ModalClientGroupAssignmentEvents>,
|
||||
IpcVariableDescriptor<ModalClientGroupAssignmentVariables>
|
||||
];
|
||||
"modal-permission-edit": [
|
||||
PermissionEditorServerInfo,
|
||||
IpcRegistryDescription<PermissionModalEvents>,
|
||||
IpcRegistryDescription<PermissionEditorEvents>
|
||||
];
|
||||
"modal-avatar-upload": [
|
||||
IpcRegistryDescription<ModalAvatarUploadEvents>,
|
||||
IpcVariableDescriptor<ModalAvatarUploadVariables>,
|
||||
string
|
||||
];
|
||||
"modal-input-processor": [
|
||||
IpcRegistryDescription<ModalInputProcessorEvents>,
|
||||
IpcVariableDescriptor<ModalInputProcessorVariables>
|
||||
];
|
||||
"modal-about": [
|
||||
IpcRegistryDescription,
|
||||
IpcVariableDescriptor<ModalAboutVariables>
|
||||
];
|
||||
"modal-server-info": [
|
||||
IpcRegistryDescription<ModalServerInfoEvents>,
|
||||
IpcVariableDescriptor<ModalServerInfoVariables>
|
||||
];
|
||||
"modal-server-bandwidth": [
|
||||
IpcRegistryDescription<ModalServerBandwidthEvents>
|
||||
];
|
||||
"modal-video-viewers": [
|
||||
IpcRegistryDescription<ModalVideoViewersEvents>,
|
||||
IpcVariableDescriptor<ModalVideoViewersVariables>
|
||||
];
|
||||
}
|
||||
|
|
|
@ -39,5 +39,5 @@ export declare class PageModalRenderer extends React.PureComponent<{
|
|||
render(): JSX.Element;
|
||||
}
|
||||
export declare const WindowModalRenderer: (props: {
|
||||
children: [React.ReactElement<ModalFrameTopRenderer, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>, React.ReactElement<ModalBodyRenderer, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)>) | (new (props: any) => React.Component<any, any, any>)>];
|
||||
children: [React.ReactElement<ModalFrameTopRenderer>, React.ReactElement<ModalBodyRenderer>];
|
||||
}) => JSX.Element;
|
||||
|
|
|
@ -67,10 +67,8 @@ export declare abstract class RDPEntry {
|
|||
selected: boolean;
|
||||
unread: boolean;
|
||||
private renderedInstance;
|
||||
private destroyed;
|
||||
protected constructor(handle: RDPChannelTree, entryId: number);
|
||||
destroy(): void;
|
||||
isDestroyed(): boolean;
|
||||
getEvents(): Registry<ChannelTreeUIEvents>;
|
||||
getHandlerId(): string;
|
||||
queryState(): void;
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase";
|
||||
import * as React from "react";
|
||||
import { RDPEntry } from "tc-shared/ui/tree/RendererDataProvider";
|
||||
export declare class UnreadMarkerRenderer extends React.Component<{
|
||||
|
@ -6,5 +5,3 @@ export declare class UnreadMarkerRenderer extends React.Component<{
|
|||
}, {}> {
|
||||
render(): JSX.Element;
|
||||
}
|
||||
export declare class RendererTreeEntry<Props, State> extends ReactComponentBase<Props, State> {
|
||||
}
|
||||
|
|
|
@ -38,6 +38,8 @@ export declare abstract class UiVariableProvider<Variables extends UiVariableMap
|
|||
getVariableSync<T extends keyof Variables>(variable: T, customData?: any, ignoreCache?: boolean): Variables[T];
|
||||
protected resolveVariable(variable: string, customData: any): Promise<any> | any;
|
||||
protected doEditVariable(variable: string, customData: any, newValue: any): Promise<void> | void;
|
||||
private handleEditResult;
|
||||
private handleEditError;
|
||||
protected abstract doSendVariable(variable: string, customData: any, value: any): any;
|
||||
}
|
||||
export declare type UiVariableStatus<Variables extends UiVariableMap, T extends keyof Variables> = {
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,5 +1,5 @@
|
|||
import {Options} from "electron-packager";
|
||||
import * as packager from "electron-packager"
|
||||
import packager from "electron-packager"
|
||||
const pkg = require('../package.json');
|
||||
|
||||
if(pkg.name !== "TeaClient") {
|
||||
|
@ -344,7 +344,7 @@ async function downloadBundledUiPack(channel: string, targetDirectory: string) {
|
|||
}
|
||||
|
||||
let path;
|
||||
new Promise((resolve, reject) => packager(options, (err, appPaths) => err ? reject(err) : resolve(appPaths))).then(async app_paths => {
|
||||
new Promise<string[]>((resolve, reject) => packager(options, (err, appPaths) => err ? reject(err) : resolve(appPaths))).then(async app_paths => {
|
||||
console.log("Copying changelog file!");
|
||||
/* We dont have promisify in our build system */
|
||||
await fs.copy(path_helper.join(options.dir, "github", "ChangeLog.txt"), path_helper.join(app_paths[0], "ChangeLog.txt"));
|
||||
|
|
|
@ -116,15 +116,21 @@ async function handleAppReady() {
|
|||
callback: async () => true
|
||||
});
|
||||
|
||||
const result = await electron.dialog.showMessageBox(null, {
|
||||
type: type,
|
||||
message: message,
|
||||
title: title,
|
||||
buttons: buttons.map(e => e.key)
|
||||
} as MessageBoxOptions);
|
||||
if(buttons[result.response].callback) {
|
||||
if(await buttons[result.response].callback())
|
||||
return;
|
||||
referenceApp();
|
||||
try {
|
||||
const result = await electron.dialog.showMessageBox(null, {
|
||||
type: type,
|
||||
message: message,
|
||||
title: title,
|
||||
buttons: buttons.map(e => e.key)
|
||||
} as MessageBoxOptions);
|
||||
if(buttons[result.response].callback) {
|
||||
if(await buttons[result.response].callback()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
dereferenceApp();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -135,13 +141,14 @@ async function handleAppReady() {
|
|||
}
|
||||
}
|
||||
|
||||
referenceApp();
|
||||
try {
|
||||
const main = require("./main-window");
|
||||
|
||||
referenceApp();
|
||||
await main.execute();
|
||||
dereferenceApp();
|
||||
} catch (error) {
|
||||
/* Reference will leak but we call exit manually */
|
||||
referenceApp();
|
||||
|
||||
console.error(error);
|
||||
await electron.dialog.showMessageBox({
|
||||
type: "error",
|
||||
|
@ -150,6 +157,8 @@ async function handleAppReady() {
|
|||
buttons: ["close"]
|
||||
} as MessageBoxOptions);
|
||||
electron.app.exit(1);
|
||||
} finally {
|
||||
dereferenceApp();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {is_debug} from "../main-window";
|
||||
import * as moment from "moment";
|
||||
import moment from "moment";
|
||||
import * as fs from "fs-extra";
|
||||
import * as os from "os";
|
||||
|
||||
|
|
|
@ -206,8 +206,8 @@ export class ServerConnection extends AbstractServerConnection {
|
|||
this.rtcConnection = new RTCConnection(this, false);
|
||||
this.videoConnection = new RtpVideoConnection(this.rtcConnection);
|
||||
|
||||
this.commandHandler.register_handler(this.commandErrorHandler);
|
||||
this.commandHandler.register_handler(this.defaultCommandHandler);
|
||||
this.commandHandler.registerHandler(this.commandErrorHandler);
|
||||
this.commandHandler.registerHandler(this.defaultCommandHandler);
|
||||
|
||||
this.nativeHandle = spawn_native_server_connection();
|
||||
this.nativeHandle.callback_disconnect = reason => {
|
||||
|
@ -233,10 +233,7 @@ export class ServerConnection extends AbstractServerConnection {
|
|||
console.log("Received: %o %o %o", command, args, switches);
|
||||
//FIXME catch error
|
||||
|
||||
this.commandHandler.invoke_handle({
|
||||
command: command,
|
||||
arguments: args
|
||||
});
|
||||
this.commandHandler.invokeCommand(new ServerCommand(command, args, switches));
|
||||
};
|
||||
|
||||
this.voiceConnection = new NativeVoiceConnectionWrapper(this, this.nativeHandle._voice_connection);
|
||||
|
@ -333,7 +330,7 @@ export class ServerConnection extends AbstractServerConnection {
|
|||
return this.voiceConnection;
|
||||
}
|
||||
|
||||
command_handler_boss(): AbstractCommandHandlerBoss {
|
||||
getCommandHandler(): AbstractCommandHandlerBoss {
|
||||
return this.commandHandler;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,8 @@
|
|||
"module": "commonjs",
|
||||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"moduleResolution": "node"
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"include": [
|
||||
"./core",
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
"target": "es6",
|
||||
"sourceMap": true,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
|
||||
"baseUrl": "..",
|
||||
"paths": {
|
||||
|
|
|
@ -27,7 +27,7 @@ function printDevices() {
|
|||
}
|
||||
|
||||
async function levelMeterDevice(deviceId: string) {
|
||||
const levelMeter = record.create_level_meter(deviceId);
|
||||
const levelMeter = record.create_device_level_meter(deviceId);
|
||||
await new Promise((resolve, reject) => {
|
||||
levelMeter.start(error => {
|
||||
if(typeof error !== "undefined") {
|
||||
|
|
|
@ -21,8 +21,10 @@ std::unique_ptr<std::ofstream> file_stream;
|
|||
|
||||
std::string logging_session;
|
||||
void logger::log_raw(logger::level::value level, const char* format, ...) {
|
||||
if(!log_buffer)
|
||||
if(!log_buffer) {
|
||||
log_buffer = std::unique_ptr<char, decltype(free)*>((char*) malloc(LOG_BUFFER_SIZE), ::free);
|
||||
}
|
||||
|
||||
if(logging_session.empty()) {
|
||||
std::ostringstream os;
|
||||
os << std::uppercase << std::setfill('0') << std::setw(4) << std::hex << (uint32_t) rand();
|
||||
|
@ -66,8 +68,9 @@ void logger::flush() {
|
|||
|
||||
bool logger::pipe_file(const std::string_view &target) {
|
||||
auto handle = std::make_unique<std::ofstream>(std::string(target.data(), target.size()), std::ofstream::app | std::ofstream::out);
|
||||
if(!handle->good())
|
||||
if(!handle->good()) {
|
||||
return false;
|
||||
}
|
||||
file_stream = std::move(handle);
|
||||
return true;
|
||||
}
|
|
@ -17,27 +17,29 @@ using namespace std;
|
|||
|
||||
void execute_app(LPCTSTR lpApplicationName,LPSTR arguments)
|
||||
{
|
||||
// additional information
|
||||
STARTUPINFO si;
|
||||
PROCESS_INFORMATION pi;
|
||||
memset(&si, 0, sizeof(si));
|
||||
|
||||
PROCESS_INFORMATION pi;
|
||||
memset(&pi, 0, sizeof(pi));
|
||||
|
||||
// set the size of the structures
|
||||
ZeroMemory( &si, sizeof(si) );
|
||||
si.cb = sizeof(si);
|
||||
ZeroMemory( &pi, sizeof(pi) );
|
||||
|
||||
// start the program up
|
||||
auto result = CreateProcess( lpApplicationName, // the path
|
||||
arguments, // Command line
|
||||
nullptr, // Process handle not inheritable
|
||||
nullptr, // Thread handle not inheritable
|
||||
FALSE, // Set handle inheritance to FALSE
|
||||
CREATE_DEFAULT_ERROR_MODE | CREATE_NEW_CONSOLE , // No creation flags
|
||||
nullptr, // Use parent's environment block
|
||||
nullptr, // Use parent's starting directory
|
||||
&si, // Pointer to STARTUPINFO structure
|
||||
&pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses)
|
||||
auto result = CreateProcessA(
|
||||
lpApplicationName, // the path
|
||||
arguments, // Command line
|
||||
nullptr, // Process handle not inheritable
|
||||
nullptr, // Thread handle not inheritable
|
||||
false, // Set handle inheritance to FALSE
|
||||
0, // No creation flags
|
||||
nullptr, // Use parent's environment block
|
||||
nullptr, // Use parent's starting directory
|
||||
&si, // Pointer to STARTUPINFO structure
|
||||
&pi // Pointer to PROCESS_INFORMATION structure (removed extra parentheses)
|
||||
);
|
||||
(void) result;
|
||||
|
||||
// Close process and thread handles.
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
|
@ -130,7 +132,7 @@ bool is_administrator() {
|
|||
|
||||
extern bool request_administrator(int argc, char** argv) {
|
||||
char szPath[MAX_PATH];
|
||||
if (GetModuleFileName(nullptr, szPath, ARRAYSIZE(szPath))) {
|
||||
if (GetModuleFileName(nullptr, szPath, MAX_PATH)) {
|
||||
SHELLEXECUTEINFO sei = { sizeof(sei) };
|
||||
|
||||
sei.lpVerb = "runas";
|
||||
|
@ -140,10 +142,13 @@ extern bool request_administrator(int argc, char** argv) {
|
|||
|
||||
if(argc > 1) {
|
||||
size_t param_size = 0;
|
||||
for(int i = 1; i < argc; i++)
|
||||
for(int i = 1; i < argc; i++) {
|
||||
param_size += strlen(argv[i]) + 1;
|
||||
}
|
||||
sei.lpParameters = (char*) malloc(param_size);
|
||||
if(!sei.lpParameters) return false;
|
||||
if(!sei.lpParameters) {
|
||||
return false;
|
||||
}
|
||||
|
||||
auto buf = (char*) sei.lpParameters;
|
||||
for(int i = 1; i < argc; i++) {
|
||||
|
@ -152,11 +157,13 @@ extern bool request_administrator(int argc, char** argv) {
|
|||
buf += length;
|
||||
*buf++ = ' ';
|
||||
}
|
||||
*(--buf) = 0;
|
||||
*buf = 0;
|
||||
}
|
||||
|
||||
bool success = ShellExecuteEx(&sei);
|
||||
if(sei.lpParameters) ::free((void*) sei.lpParameters);
|
||||
bool success = ShellExecuteExA(&sei);
|
||||
if(sei.lpParameters) {
|
||||
::free((void*) sei.lpParameters);
|
||||
}
|
||||
return success;
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "teaspeak_client",
|
||||
"version": "1.5.0-9",
|
||||
"name": "TeaClient",
|
||||
"version": "1.5.3-1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -4159,9 +4159,9 @@
|
|||
"integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo="
|
||||
},
|
||||
"jquery": {
|
||||
"version": "3.5.1",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.5.1.tgz",
|
||||
"integrity": "sha512-XwIBPqcMn57FxfT+Go5pzySnm4KWkT1Tv7gjrpT1srtf8Weynl6R273VJ5GjkRb51IzMp5nbaPjJXMWeju2MKg=="
|
||||
"version": "3.6.0",
|
||||
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz",
|
||||
"integrity": "sha512-JVzAR/AjBvVt2BmYhxRCSYysDsPcssdmTFnzyLEts9qNwmjmu4JTAMYubEfwVOSwpQ1I1sKKFcxhZCI2buerfw=="
|
||||
},
|
||||
"jsbn": {
|
||||
"version": "0.1.1",
|
||||
|
@ -4242,25 +4242,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"jsrender": {
|
||||
"version": "1.0.11",
|
||||
"resolved": "https://registry.npmjs.org/jsrender/-/jsrender-1.0.11.tgz",
|
||||
"integrity": "sha512-1BFRSKCgO8T1o3QB16/CYqnxLVxgIdXnXBmZcyLQOlEwxVfktCHXcC7n2o9lziI//pKEc5QzI92vglvBnoddRw==",
|
||||
"requires": {
|
||||
"through2": "^3.0.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"through2": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz",
|
||||
"integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==",
|
||||
"requires": {
|
||||
"inherits": "^2.0.4",
|
||||
"readable-stream": "2 || 3"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"keyv": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "TeaClient",
|
||||
"version": "1.5.3-1",
|
||||
"version": "1.5.3-2",
|
||||
"description": "",
|
||||
"main": "main.js",
|
||||
"scripts": {
|
||||
|
|
Loading…
Reference in New Issue