diff --git a/.gitignore b/.gitignore index 38ecde0..4758cd3 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,6 @@ updater/postzip/TeaClient-linux.tar.gz .deploy_secret **/*.d.ts -!modules/renderer/imports/copy_*.d.ts +!modules/renderer/imports/.copy_*.d.ts package-lock.json diff --git a/modules/renderer/imports/.copy_imports_shared.d.ts b/modules/renderer/imports/.copy_imports_shared.d.ts new file mode 100644 index 0000000..f88b6f9 --- /dev/null +++ b/modules/renderer/imports/.copy_imports_shared.d.ts @@ -0,0 +1,3536 @@ + +/* File: shared/js/audio/audio.ts */ +declare namespace audio { + export namespace player { + export interface Device { + device_id: string; + name: string; + } + } +} + +/* File: shared/js/bookmarks.ts */ +declare namespace bookmarks { + export interface ServerProperties { + server_address: string; + server_port: number; + server_password_hash?: string; + server_password?: string; + } + export enum BookmarkType { + ENTRY, + DIRECTORY + } + export interface Bookmark { + type: BookmarkType; + server_properties: ServerProperties; + display_name: string; + unique_id: string; + nickname: string; + default_channel?: number | string; + default_channel_password_hash?: string; + default_channel_password?: string; + connect_profile: string; + } + export interface DirectoryBookmark { + type: BookmarkType; + readonly content: (Bookmark | DirectoryBookmark)[]; + unique_id: string; + display_name: string; + } + export function bookmarks(): DirectoryBookmark; + export function find_bookmark(uuid: string): Bookmark | DirectoryBookmark | undefined; + export function parent_bookmark(bookmark: Bookmark): DirectoryBookmark; + export function create_bookmark(display_name: string, directory: DirectoryBookmark, server_properties: ServerProperties, nickname: string): Bookmark; + export function create_bookmark_directory(parent: DirectoryBookmark, name: string): DirectoryBookmark; + export function change_directory(parent: DirectoryBookmark, bookmark: Bookmark | DirectoryBookmark); + export function save_bookmark(bookmark?: Bookmark | DirectoryBookmark); + export function delete_bookmark(bookmark: Bookmark | DirectoryBookmark); +} + +/* File: shared/js/BrowserIPC.ts */ +declare interface Window { + BroadcastChannel: BroadcastChannel; +} +declare namespace bipc { + export interface BroadcastMessage { + timestamp: number; + receiver: string; + sender: string; + type: string; + data: any; + } + export interface ChannelMessage { + channel_id: string; + key: string; + message: any; + } + export interface ProcessQueryResponse { + request_timestamp: number; + request_query_id: string; + device_id: string; + protocol: number; + } + export interface CertificateAcceptCallback { + request_id: string; + } + export interface CertificateAcceptSucceeded { + } + export abstract class BasicIPCHandler { + protected static readonly BROADCAST_UNIQUE_ID; + protected static readonly PROTOCOL_VERSION; + protected _channels: Channel[]; + protected unique_id; + protected constructor(); + setup(); + get_local_address(); + abstract send_message(type: string, data: any, target?: string); + protected handle_message(message: BroadcastMessage); + create_channel(target_id?: string, channel_id?: string); + channels(): Channel[]; + delete_channel(channel: Channel); + private _query_results: { + [key: string]: ProcessQueryResponse[]; + }; + query_processes(timeout?: number): Promise; + private _cert_accept_callbacks: { + [key: string]: (() => any); + }; + register_certificate_accept_callback(callback: () => any): string; + private _cert_accept_succeeded: { + [sender: string]: (() => any); + }; + post_certificate_accpected(id: string, timeout?: number): Promise; + } + export interface Channel { + readonly channel_id: string; + target_id?: string; + message_handler: (remote_id: string, message: ChannelMessage) => any; + send_message(key: string, message: any); + } + export class BroadcastChannelIPC extends BasicIPCHandler { + private static readonly CHANNEL_NAME; + private channel: BroadcastChannel; + constructor(); + setup(); + private on_message(event: MessageEvent); + private on_error(event: MessageEvent); + send_message(type: string, data: any, target?: string); + } + export interface MethodProxyInvokeData { + method_name: string; + arguments: any[]; + promise_id: string; + } + export interface MethodProxyResultData { + promise_id: string; + result: any; + success: boolean; + } + export interface MethodProxyCallback { + promise: Promise; + promise_id: string; + resolve: (object: any) => any; + reject: (object: any) => any; + } + export type MethodProxyConnectParameters = { + channel_id: string; + client_id: string; + }; + export abstract class MethodProxy { + readonly ipc_handler: BasicIPCHandler; + private _ipc_channel: Channel; + private _ipc_parameters: MethodProxyConnectParameters; + private readonly _local: boolean; + private readonly _slave: boolean; + private _connected: boolean; + private _proxied_methods: { + [key: string]: () => Promise; + }; + private _proxied_callbacks: { + [key: string]: MethodProxyCallback; + }; + protected constructor(ipc_handler: BasicIPCHandler, connect_params?: MethodProxyConnectParameters); + protected setup(); + protected finalize(); + protected register_method(method: (...args: any[]) => Promise | string); + private _handle_message(remote_id: string, message: ChannelMessage); + private _handle_finalize(); + private _handle_remote_callback(remote_id: string); + private _send_result(promise_id: string, success: boolean, message: any); + private _handle_invoke(data: MethodProxyInvokeData); + private _handle_result(data: MethodProxyResultData); + generate_connect_parameters(): MethodProxyConnectParameters; + is_slave(); + is_master(); + protected abstract on_connected(); + protected abstract on_disconnected(); + } + export function setup(); + export function get_handler(); + export function supported(); +} + +/* File: shared/js/connection/CommandHandler.ts */ +declare namespace connection { + export class ServerConnectionCommandBoss extends AbstractCommandHandlerBoss { + constructor(connection: AbstractServerConnection); + } + export class ConnectionCommandHandler extends AbstractCommandHandler { + readonly connection: AbstractServerConnection; + readonly connection_handler: ConnectionHandler; + constructor(connection: AbstractServerConnection); + proxy_command_promise(promise: Promise, options: connection.CommandOptions); + handle_command(command: ServerCommand): boolean; + set_handler(command: string, handler: any); + unset_handler(command: string, handler?: any); + handleCommandResult(json); + handleCommandServerInit(json); + private createChannelFromJson(json, ignoreOrder?: boolean); + handleCommandChannelList(json); + handleCommandChannelListFinished(json); + handleCommandChannelCreate(json); + handleCommandChannelShow(json); + handleCommandChannelDelete(json); + handleCommandChannelHide(json); + handleCommandClientEnterView(json); + handleCommandClientLeftView(json); + handleNotifyClientMoved(json); + handleNotifyChannelMoved(json); + handleNotifyChannelEdited(json); + handleNotifyTextMessage(json); + handleNotifyClientChatClosed(json); + handleNotifyClientUpdated(json); + handleNotifyServerEdited(json); + handleNotifyServerUpdated(json); + handleNotifyMusicPlayerInfo(json); + handleNotifyClientPoke(json); + handleNotifyServerGroupClientAdd(json); + handleNotifyServerGroupClientRemove(json); + handleNotifyClientChannelGroupChanged(json); + handleNotifyChannelSubscribed(json); + handleNotifyChannelUnsubscribed(json); + } +} + +/* File: shared/js/connection/CommandHelper.ts */ +declare namespace connection { + export class CommandHelper extends AbstractCommandHandler { + private _who_am_i: any; + private _awaiters_unique_ids: { + [unique_id: string]: ((resolved: ClientNameInfo) => any)[]; + }; + constructor(connection); + initialize(); + handle_command(command: connection.ServerCommand): boolean; + joinChannel(channel: ChannelEntry, password?: string): Promise; + sendMessage(message: string, type: ChatType, target?: ChannelEntry | ClientEntry): Promise; + updateClient(key: string, value: string): Promise; + info_from_uid(..._unique_ids: string[]): Promise; + private handle_notifyclientnamefromuid(json: any[]); + request_query_list(server_id?: number): Promise; + request_playlist_list(): Promise; + request_playlist_songs(playlist_id: number): Promise; + request_clients_by_server_group(group_id: number): Promise; + request_playlist_info(playlist_id: number): Promise; + current_virtual_server_id(): Promise; + } +} + +/* File: shared/js/connection/ConnectionBase.ts */ +declare namespace connection { + export interface CommandOptions { + flagset?: string[]; + process_result?: boolean; + timeout?: number; + } + export const CommandOptionDefaults: CommandOptions; + export type ConnectionStateListener = (old_state: ConnectionState, new_state: ConnectionState) => any; + export abstract class AbstractServerConnection { + readonly client: ConnectionHandler; + readonly command_helper: CommandHelper; + protected constructor(client: ConnectionHandler); + abstract connect(address: ServerAddress, handshake: HandshakeHandler, timeout?: number): Promise; + abstract connected(): boolean; + abstract disconnect(reason?: string): Promise; + abstract support_voice(): boolean; + abstract voice_connection(): voice.AbstractVoiceConnection | undefined; + abstract command_handler_boss(): AbstractCommandHandlerBoss; + abstract send_command(command: string, data?: any | any[], options?: CommandOptions): Promise; + // @ts-ignore + abstract get onconnectionstatechanged(): ConnectionStateListener; + // @ts-ignore + abstract set onconnectionstatechanged(listener: ConnectionStateListener); + abstract remote_address(): ServerAddress; + abstract handshake_handler(): HandshakeHandler; + } + export namespace voice { + export enum PlayerState { + PREBUFFERING, + PLAYING, + BUFFERING, + STOPPING, + STOPPED + } + export interface VoiceClient { + client_id: number; + callback_playback: () => any; + callback_stopped: () => any; + callback_state_changed: (new_state: PlayerState) => any; + get_state(): PlayerState; + get_volume(): number; + set_volume(volume: number): void; + abort_replay(); + } + export abstract class AbstractVoiceConnection { + readonly connection: AbstractServerConnection; + protected constructor(connection: AbstractServerConnection); + abstract connected(): boolean; + abstract encoding_supported(codec: number): boolean; + abstract decoding_supported(codec: number): boolean; + abstract register_client(client_id: number): VoiceClient; + abstract available_clients(): VoiceClient[]; + abstract unregister_client(client: VoiceClient): Promise; + abstract voice_recorder(): RecorderProfile; + abstract acquire_voice_recorder(recorder: RecorderProfile | undefined): Promise; + } + } + export class ServerCommand { + command: string; + arguments: any[]; + } + export abstract class AbstractCommandHandler { + readonly connection: AbstractServerConnection; + handler_boss: AbstractCommandHandlerBoss | undefined; + volatile_handler_boss: boolean; + ignore_consumed: boolean; + protected constructor(connection: AbstractServerConnection); + abstract handle_command(command: ServerCommand): boolean; + } + export interface SingleCommandHandler { + name?: string; + command?: string; + timeout?: number; + function: (command: ServerCommand) => boolean; + } + export abstract class AbstractCommandHandlerBoss { + readonly connection: AbstractServerConnection; + protected command_handlers: AbstractCommandHandler[]; + protected single_command_handler: SingleCommandHandler[]; + protected constructor(connection: AbstractServerConnection); + register_handler(handler: AbstractCommandHandler); + unregister_handler(handler: AbstractCommandHandler); + register_single_handler(handler: SingleCommandHandler); + remove_single_handler(handler: SingleCommandHandler); + handlers(): AbstractCommandHandler[]; + invoke_handle(command: ServerCommand): boolean; + } +} + +/* File: shared/js/connection/HandshakeHandler.ts */ +declare namespace connection { + export interface HandshakeIdentityHandler { + connection: AbstractServerConnection; + start_handshake(); + register_callback(callback: (success: boolean, message?: string) => any); + } + export class HandshakeHandler { + private connection: AbstractServerConnection; + private handshake_handler: HandshakeIdentityHandler; + private failed; + readonly profile: profiles.ConnectionProfile; + readonly parameters: ConnectParameters; + constructor(profile: profiles.ConnectionProfile, parameters: ConnectParameters); + setConnection(con: AbstractServerConnection); + initialize(); + get_identity_handler(): HandshakeIdentityHandler; + startHandshake(); + on_teamspeak(); + private handshake_failed(message: string); + private handshake_finished(version?: string); + } +} + +/* File: shared/js/connection/ServerConnectionDeclaration.ts */ +declare enum ErrorID { + PERMISSION_ERROR, + EMPTY_RESULT, + PLAYLIST_IS_IN_USE, + FILE_ALREADY_EXISTS +} +declare class CommandResult { + success: boolean; + id: number; + message: string; + extra_message: string; + json: any; + constructor(json); +} +declare interface ClientNameInfo { + client_unique_id: string; + client_nickname: string; + client_database_id: number; +} +declare interface ClientNameFromUid { + promise: LaterPromise; + keys: string[]; + response: ClientNameInfo[]; +} +declare interface ServerGroupClient { + client_nickname: string; + client_unique_identifier: string; + client_database_id: number; +} +declare interface QueryListEntry { + username: string; + unique_id: string; + bounded_server: number; +} +declare interface QueryList { + flag_own: boolean; + flag_all: boolean; + queries: QueryListEntry[]; +} +declare interface Playlist { + playlist_id: number; + playlist_bot_id: number; + playlist_title: string; + playlist_type: number; + playlist_owner_dbid: number; + playlist_owner_name: string; + needed_power_modify: number; + needed_power_permission_modify: number; + needed_power_delete: number; + needed_power_song_add: number; + needed_power_song_move: number; + needed_power_song_remove: number; +} +declare interface PlaylistInfo { + playlist_id: number; + playlist_title: string; + playlist_description: string; + playlist_type: number; + playlist_owner_dbid: number; + playlist_owner_name: string; + playlist_flag_delete_played: boolean; + playlist_flag_finished: boolean; + playlist_replay_mode: number; + playlist_current_song_id: number; +} +declare interface PlaylistSong { + song_id: number; + song_previous_song_id: number; + song_invoker: string; + song_url: string; + song_url_loader: string; + song_loaded: boolean; + song_metadata: string; +} + +/* File: shared/js/ConnectionHandler.ts */ +declare enum DisconnectReason { + HANDLER_DESTROYED, + REQUESTED, + DNS_FAILED, + CONNECT_FAILURE, + CONNECTION_CLOSED, + CONNECTION_FATAL_ERROR, + CONNECTION_PING_TIMEOUT, + CLIENT_KICKED, + CLIENT_BANNED, + HANDSHAKE_FAILED, + HANDSHAKE_TEAMSPEAK_REQUIRED, + HANDSHAKE_BANNED, + SERVER_CLOSED, + SERVER_REQUIRES_PASSWORD, + IDENTITY_TOO_LOW, + UNKNOWN +} +declare enum ConnectionState { + UNCONNECTED, + CONNECTING, + INITIALISING, + CONNECTED, + DISCONNECTING +} +declare enum ViewReasonId { + VREASON_USER_ACTION, + VREASON_MOVED, + VREASON_SYSTEM, + VREASON_TIMEOUT, + VREASON_CHANNEL_KICK, + VREASON_SERVER_KICK, + VREASON_BAN, + VREASON_SERVER_STOPPED, + VREASON_SERVER_LEFT, + VREASON_CHANNEL_UPDATED, + VREASON_EDITED, + VREASON_SERVER_SHUTDOWN +} +declare interface VoiceStatus { + input_hardware: boolean; + input_muted: boolean; + output_muted: boolean; + channel_codec_encoding_supported: boolean; + channel_codec_decoding_supported: boolean; + sound_playback_supported: boolean; + sound_record_supported; + away: boolean | string; + channel_subscribe_all: boolean; + queries_visible: boolean; +} +declare interface ConnectParameters { + nickname?: string; + channel?: { + target: string | number; + password?: string; + }; + token?: string; + password?: { + password: string; + hashed: boolean; + }; +} +declare class ConnectionHandler { + channelTree: ChannelTree; + serverConnection: connection.AbstractServerConnection; + fileManager: FileManager; + permissions: PermissionManager; + groups: GroupManager; + select_info: InfoBar; + chat: ChatBox; + settings: ServerSettings; + sound: sound.SoundManager; + readonly tag_connection_handler: JQuery; + private _clientId: number; + private _local_client: LocalClientEntry; + private _reconnect_timer: NodeJS.Timer; + private _reconnect_attempt: boolean; + private _connect_initialize_id: number; + client_status: VoiceStatus; + invoke_resized_on_activate: boolean; + constructor(); + setup(); + startConnection(addr: string, profile: profiles.ConnectionProfile, parameters: ConnectParameters); + getClient(): LocalClientEntry; + getClientId(); + // @ts-ignore + set clientId(id: number); + // @ts-ignore + get clientId(); + getServerConnection(): connection.AbstractServerConnection; + onConnected(); + private initialize_server_settings(); + // @ts-ignore + get connected(): boolean; + private generate_ssl_certificate_accept(): JQuery; + private _certificate_modal: Modal; + handleDisconnect(type: DisconnectReason, data?: any); + cancel_reconnect(); + private on_connection_state_changed(); + update_voice_status(targetChannel?: ChannelEntry); + sync_status_with_server(); + set_away_status(state: boolean | string); + resize_elements(); + acquire_recorder(voice_recoder: RecorderProfile, update_control_bar: boolean); + reconnect_properties(profile?: profiles.ConnectionProfile): ConnectParameters; +} + +/* File: shared/js/crypto/asn1.ts */ +declare namespace asn1 { + export class Int10 { + constructor(value?: any); + sub(sub: number); + mulAdd(mul: number, add: number); + simplify(); + } + export class Stream { + private static HEX_DIGITS; + private static reTimeS; + private static reTimeL; + position: number; + data: string | ArrayBuffer; + constructor(data: string | Stream | ArrayBuffer, position: number); + length(): number; + get(position?: number); + hexByte(byte: number); + parseStringISO(start, end); + parseStringUTF(start, end); + parseStringBMP(start, end); + parseTime(start, end, shortYear); + parseInteger(start, end); + isASCII(start: number, end: number); + parseBitString(start, end, maxLength); + parseOctetString(start, end, maxLength); + parseOID(start, end, maxLength); + } + export enum TagClass { + UNIVERSAL, + APPLICATION, + CONTEXT, + PRIVATE + } + export enum TagType { + EOC, + BOOLEAN, + INTEGER, + BIT_STRING, + OCTET_STRING, + NULL, + OBJECT_IDENTIFIER, + ObjectDescriptor, + EXTERNAL, + REAL, + ENUMERATED, + EMBEDDED_PDV, + UTF8String, + SEQUENCE, + SET, + NumericString, + PrintableString, + TeletextString, + VideotexString, + IA5String, + UTCTime, + GeneralizedTime, + GraphicString, + VisibleString, + GeneralString, + UniversalString, + BMPString + } + export class ASN1Tag { + tagClass: TagClass; + type: TagType; + tagConstructed: boolean; + tagNumber: number; + constructor(stream: Stream); + isUniversal(); + isEOC(); + } + export class ASN1 { + stream: Stream; + header: number; + length: number; + tag: ASN1Tag; + children: ASN1[]; + constructor(stream: Stream, header: number, length: number, tag: ASN1Tag, children: ASN1[]); + content(max_length?: number, type?: TagType); + typeName(): string; + toString(); + toPrettyString(indent); + posStart(); + posContent(); + posEnd(); + static decodeLength(stream: Stream); + static encodeLength(buffer: Uint8Array, offset: number, length: number); + } + export function decode(stream: string | ArrayBuffer); +} + +/* File: shared/js/crypto/crc32.ts */ +declare class Crc32 { + private static readonly lookup; + private crc: number; + constructor(); + update(data: ArrayBufferLike); + digest(radix: number); +} + +/* File: shared/js/crypto/hex.ts */ +declare namespace hex { + export function encode(buffer); +} + +/* File: shared/js/crypto/sha.ts */ +declare function define($); +declare function unescape(string: string): string; +declare class _sha1 { + static arrayBuffer($: ArrayBuffer): ArrayBuffer; +} +declare namespace sha { + export function encode_text(buffer: string): ArrayBuffer; + export function sha1(message: string | ArrayBuffer): PromiseLike; +} + +/* File: shared/js/dns.ts */ +declare namespace dns { + export interface AddressTarget { + target_ip: string; + target_port?: number; + } + export interface ResolveOptions { + timeout?: number; + allow_cache?: boolean; + max_depth?: number; + allow_srv?: boolean; + allow_cname?: boolean; + allow_any?: boolean; + allow_a?: boolean; + allow_aaaa?: boolean; + } + export const default_options: ResolveOptions; + export function supported(); + export function resolve_address(address: string, options?: ResolveOptions): Promise; +} + +/* File: shared/js/FileManager.ts */ +declare class FileEntry { + name: string; + datetime: number; + type: number; + size: number; +} +declare class FileListRequest { + path: string; + entries: FileEntry[]; + callback: (entries: FileEntry[]) => void; +} +declare namespace transfer { + export interface TransferKey { + client_transfer_id: number; + server_transfer_id: number; + key: string; + file_path: string; + file_name: string; + peer: { + hosts: string[]; + port: number; + }; + total_size: number; + } + export interface UploadOptions { + name: string; + path: string; + channel?: ChannelEntry; + channel_password?: string; + size: number; + overwrite: boolean; + } + export interface DownloadTransfer { + get_key(): DownloadKey; + request_file(): Promise; + } + export type DownloadKey = TransferKey; + export type UploadKey = TransferKey; + export function spawn_download_transfer(key: DownloadKey): DownloadTransfer; + export function spawn_upload_transfer(key: UploadKey): RequestFileUpload; +} +declare class RequestFileDownload implements transfer.DownloadTransfer { + readonly transfer_key: transfer.DownloadKey; + constructor(key: transfer.DownloadKey); + request_file(): Promise; + private try_fetch(url: string): Promise; + get_key(): transfer.DownloadKey; +} +declare class RequestFileUpload { + readonly transfer_key: transfer.UploadKey; + constructor(key: transfer.DownloadKey); + put_data(data: BufferSource | File); + try_put(data: FormData, url: string): Promise; +} +declare class FileManager extends connection.AbstractCommandHandler { + handle: ConnectionHandler; + icons: IconManager; + avatars: AvatarManager; + private listRequests: FileListRequest[]; + private pending_download_requests: transfer.DownloadKey[]; + private pending_upload_requests: transfer.UploadKey[]; + private transfer_counter: number; + constructor(client: ConnectionHandler); + handle_command(command: connection.ServerCommand): boolean; + requestFileList(path: string, channel?: ChannelEntry, password?: string): Promise; + private notifyFileList(json); + private notifyFileListFinished(json); + download_file(path: string, file: string, channel?: ChannelEntry, password?: string): Promise; + upload_file(options: transfer.UploadOptions): Promise; + private notifyStartDownload(json); + private notifyStartUpload(json); + delete_file(props: { + name: string; + path?: string; + cid?: number; + cpw?: string; + }): Promise; +} +declare class Icon { + id: number; + url: string; +} +declare enum ImageType { + UNKNOWN, + BITMAP, + PNG, + GIF, + SVG, + JPEG +} +declare function media_image_type(type: ImageType, file?: boolean); +declare function image_type(base64: string | ArrayBuffer); +declare class CacheManager { + readonly cache_name: string; + private _cache_category: Cache; + constructor(name: string); + setupped(): boolean; + reset(); + setup(); + cleanup(max_age: number); + resolve_cached(key: string, max_age?: number): Promise; + put_cache(key: string, value: Response, type?: string, headers?: { + [key: string]: string; + }); +} +declare class IconManager { + private static cache: CacheManager; + handle: FileManager; + private _id_urls: { + [id: number]: string; + }; + private _loading_promises: { + [id: number]: Promise; + }; + constructor(handle: FileManager); + clear_cache(); + delete_icon(id: number): Promise; + iconList(): Promise; + create_icon_download(id: number): Promise; + private _response_url(response: Response); + resolved_cached?(id: number): Promise; + private _load_icon(id: number): Promise; + download_icon(id: number): Promise; + resolve_icon(id: number): Promise; + generateTag(id: number, options?: { + animate?: boolean; + }): JQuery; +} +declare class Avatar { + client_avatar_id: string; + avatar_id: string; + url: string; + type: ImageType; +} +declare class AvatarManager { + handle: FileManager; + private static cache: CacheManager; + private _cached_avatars: { + [response_avatar_id: number]: Avatar; + }; + private _loading_promises: { + [response_avatar_id: number]: Promise; + }; + constructor(handle: FileManager); + private _response_url(response: Response, type: ImageType): Promise; + resolved_cached?(client_avatar_id: string, avatar_id?: string): Promise; + create_avatar_download(client_avatar_id: string): Promise; + private _load_avatar(client_avatar_id: string, avatar_id: string); + loadAvatar(client_avatar_id: string, avatar_id: string): Promise; + generate_client_tag(client: ClientEntry): JQuery; + generate_tag(client_avatar_id: string, avatar_id?: string, options?: { + callback_image?: (tag: JQuery) => any; + callback_avatar?: (avatar: Avatar) => any; + }): JQuery; +} + +/* File: shared/js/i18n/country.ts */ +declare namespace i18n { + export function country_name(alpha_code: string, fallback?: string); +} + +/* File: shared/js/i18n/localize.ts */ +declare function guid(); +declare namespace i18n { + export interface TranslationKey { + message: string; + line?: number; + character?: number; + filename?: string; + } + export interface Translation { + key: TranslationKey; + translated: string; + flags?: string[]; + } + export interface Contributor { + name: string; + email: string; + } + export interface TranslationFile { + path: string; + full_url: string; + translations: Translation[]; + } + export interface RepositoryTranslation { + key: string; + path: string; + country_code: string; + name: string; + contributors: Contributor[]; + } + export interface TranslationRepository { + unique_id: string; + url: string; + name?: string; + contact?: string; + translations?: RepositoryTranslation[]; + load_timestamp?: number; + } + export function tr(message: string, key?: string); + export function tra(message: string, ...args: any[]); + export function load_file(url: string, path: string): Promise; + export function load_repository(url: string): Promise; + export namespace config { + export interface TranslationConfig { + current_repository_url?: string; + current_language?: string; + current_translation_url: string; + current_translation_path: string; + } + export interface RepositoryConfig { + repositories?: { + url?: string; + repository?: TranslationRepository; + }[]; + } + export function repository_config(); + export function save_repository_config(); + export function translation_config(): TranslationConfig; + export function save_translation_config(); + } + export function register_repository(repository: TranslationRepository); + export function registered_repositories(): TranslationRepository[]; + export function delete_repository(repository: TranslationRepository); + export function iterate_repositories(callback_entry: (repository: TranslationRepository) => any): Promise; + export function select_translation(repository: TranslationRepository, entry: RepositoryTranslation); + export function initialize(): Promise; +} +declare const tr: typeof i18n.tr; +declare const tra: typeof i18n.tra; + +/* File: shared/js/load.ts */ +declare namespace app { + export enum Type { + UNKNOWN, + CLIENT_RELEASE, + CLIENT_DEBUG, + WEB_DEBUG, + WEB_RELEASE + } + export let type: Type; + export function is_web(); +} +declare namespace loader { + export type Task = { + name: string; + priority: number; + function: () => Promise; + }; + export enum Stage { + INITIALIZING, + SETUP, + STYLE, + JAVASCRIPT, + TEMPLATES, + JAVASCRIPT_INITIALIZING, + FINALIZING, + LOADED, + DONE + } + export let cache_tag: string | undefined; + export function finished(); + export function register_task(stage: Stage, task: Task); + export function execute(): Promise; + type SourcePath = string | string[]; + export class SyntaxError { + source: any; + constructor(source: any); + } + export function load_script(path: SourcePath): Promise; + export function load_scripts(paths: SourcePath[]): Promise; + export function load_style(path: SourcePath): Promise; + export function load_styles(paths: SourcePath[]): Promise; +} +declare let _critical_triggered; +declare const display_critical_load; +declare const loader_impl_display_critical_error; +declare interface Window { + impl_display_critical_error: (_: string) => any; +} +declare function displayCriticalError(message: string); +declare const loader_javascript; +declare const loader_webassembly; +declare const loader_style; +declare function load_templates(): Promise; +declare function check_updates(): Promise; +declare interface Window { + $: JQuery; +} +declare let _fadeout_warned; +declare function fadeoutLoader(duration?, minAge?, ignoreAge?); + +/* File: shared/js/log.ts */ +declare enum LogCategory { + CHANNEL, + CHANNEL_PROPERTIES, + CLIENT, + SERVER, + PERMISSIONS, + GENERAL, + NETWORKING, + VOICE, + I18N, + IPC, + IDENTITIES +} +declare namespace log { + export enum LogType { + TRACE, + DEBUG, + INFO, + WARNING, + ERROR + } + export let enabled_mapping; + export enum GroupMode { + NATIVE, + PREFIX + } + export function initialize(); + export function log(type: LogType, category: LogCategory, message: string, ...optionalParams: any[]); + export function trace(category: LogCategory, message: string, ...optionalParams: any[]); + export function debug(category: LogCategory, message: string, ...optionalParams: any[]); + export function info(category: LogCategory, message: string, ...optionalParams: any[]); + export function warn(category: LogCategory, message: string, ...optionalParams: any[]); + export function error(category: LogCategory, message: string, ...optionalParams: any[]); + export function group(level: LogType, category: LogCategory, name: string, ...optionalParams: any[]): Group; + export function table(title: string, arguments: any); + export class Group { + readonly mode: GroupMode; + readonly level: LogType; + readonly category: LogCategory; + readonly enabled: boolean; + owner: Group; + private readonly name: string; + private readonly optionalParams: any[][]; + private _collapsed: boolean; + private initialized; + private _log_prefix: string; + constructor(mode: GroupMode, level: LogType, category: LogCategory, name: string, optionalParams: any[][], owner?: Group); + group(level: LogType, name: string, ...optionalParams: any[]): Group; + collapsed(flag?: boolean): this; + log(message: string, ...optionalParams: any[]): this; + end(); + // @ts-ignore + get prefix(): string; + // @ts-ignore + set prefix(prefix: string); + } +} + +/* File: shared/js/main.ts */ +declare let settings: Settings; +declare const js_render; +declare const native_client; +declare function getUserMediaFunction(): (constraints: MediaStreamConstraints, success: (stream: MediaStream) => any, fail: (error: any) => any) => any; +declare interface Window { + open_connected_question: () => Promise; +} +declare function setup_close(); +declare function moment(...arguments): any; +declare function setup_jsrender(): boolean; +declare function initialize(): Promise; +declare function initialize_app(): Promise; +declare function ab2str(buf); +declare function str2ab8(str); +declare function arrayBufferBase64(base64: string); +declare function base64ArrayBuffer(arrayBuffer); +declare function Base64EncodeUrl(str); +declare function Base64DecodeUrl(str: string, pad?: boolean); +declare function main(); +declare const task_teaweb_starter: loader.Task; +declare const task_certificate_callback: loader.Task; + +/* File: shared/js/permission/GroupManager.ts */ +declare enum GroupType { + QUERY, + TEMPLATE, + NORMAL +} +declare enum GroupTarget { + SERVER, + CHANNEL +} +declare class GroupProperties { + iconid: number; + sortid: number; + savedb: boolean; + namemode: number; +} +declare class GroupPermissionRequest { + group_id: number; + promise: LaterPromise; +} +declare class Group { + properties: GroupProperties; + readonly handle: GroupManager; + readonly id: number; + readonly target: GroupTarget; + readonly type: GroupType; + name: string; + requiredModifyPower: number; + requiredMemberAddPower: number; + requiredMemberRemovePower: number; + constructor(handle: GroupManager, id: number, target: GroupTarget, type: GroupType, name: string); + updateProperty(key, value); +} +declare class GroupManager extends connection.AbstractCommandHandler { + readonly handle: ConnectionHandler; + serverGroups: Group[]; + channelGroups: Group[]; + private requests_group_permissions: GroupPermissionRequest[]; + constructor(client: ConnectionHandler); + handle_command(command: connection.ServerCommand): boolean; + requestGroups(); + static sorter(): (a: Group, b: Group) => number; + serverGroup?(id: number): Group; + channelGroup?(id: number): Group; + private handle_grouplist(json); + request_permissions(group: Group): Promise; + private handle_group_permission_list(json: any[]); +} + +/* File: shared/js/permission/PermissionManager.ts */ +declare enum PermissionType { + B_SERVERINSTANCE_HELP_VIEW, + B_SERVERINSTANCE_VERSION_VIEW, + B_SERVERINSTANCE_INFO_VIEW, + B_SERVERINSTANCE_VIRTUALSERVER_LIST, + B_SERVERINSTANCE_BINDING_LIST, + B_SERVERINSTANCE_PERMISSION_LIST, + B_SERVERINSTANCE_PERMISSION_FIND, + B_VIRTUALSERVER_CREATE, + B_VIRTUALSERVER_DELETE, + B_VIRTUALSERVER_START_ANY, + B_VIRTUALSERVER_STOP_ANY, + B_VIRTUALSERVER_CHANGE_MACHINE_ID, + B_VIRTUALSERVER_CHANGE_TEMPLATE, + B_SERVERQUERY_LOGIN, + B_SERVERINSTANCE_TEXTMESSAGE_SEND, + B_SERVERINSTANCE_LOG_VIEW, + B_SERVERINSTANCE_LOG_ADD, + B_SERVERINSTANCE_STOP, + B_SERVERINSTANCE_MODIFY_SETTINGS, + B_SERVERINSTANCE_MODIFY_QUERYGROUP, + B_SERVERINSTANCE_MODIFY_TEMPLATES, + B_VIRTUALSERVER_SELECT, + B_VIRTUALSERVER_SELECT_GODMODE, + B_VIRTUALSERVER_INFO_VIEW, + B_VIRTUALSERVER_CONNECTIONINFO_VIEW, + B_VIRTUALSERVER_CHANNEL_LIST, + B_VIRTUALSERVER_CHANNEL_SEARCH, + B_VIRTUALSERVER_CLIENT_LIST, + B_VIRTUALSERVER_CLIENT_SEARCH, + B_VIRTUALSERVER_CLIENT_DBLIST, + B_VIRTUALSERVER_CLIENT_DBSEARCH, + B_VIRTUALSERVER_CLIENT_DBINFO, + B_VIRTUALSERVER_PERMISSION_FIND, + B_VIRTUALSERVER_CUSTOM_SEARCH, + B_VIRTUALSERVER_START, + B_VIRTUALSERVER_STOP, + B_VIRTUALSERVER_TOKEN_LIST, + B_VIRTUALSERVER_TOKEN_ADD, + B_VIRTUALSERVER_TOKEN_USE, + B_VIRTUALSERVER_TOKEN_DELETE, + B_VIRTUALSERVER_LOG_VIEW, + B_VIRTUALSERVER_LOG_ADD, + B_VIRTUALSERVER_JOIN_IGNORE_PASSWORD, + B_VIRTUALSERVER_NOTIFY_REGISTER, + B_VIRTUALSERVER_NOTIFY_UNREGISTER, + B_VIRTUALSERVER_SNAPSHOT_CREATE, + B_VIRTUALSERVER_SNAPSHOT_DEPLOY, + B_VIRTUALSERVER_PERMISSION_RESET, + B_VIRTUALSERVER_MODIFY_NAME, + B_VIRTUALSERVER_MODIFY_WELCOMEMESSAGE, + B_VIRTUALSERVER_MODIFY_MAXCLIENTS, + B_VIRTUALSERVER_MODIFY_RESERVED_SLOTS, + B_VIRTUALSERVER_MODIFY_PASSWORD, + B_VIRTUALSERVER_MODIFY_DEFAULT_SERVERGROUP, + B_VIRTUALSERVER_MODIFY_DEFAULT_MUSICGROUP, + B_VIRTUALSERVER_MODIFY_DEFAULT_CHANNELGROUP, + B_VIRTUALSERVER_MODIFY_DEFAULT_CHANNELADMINGROUP, + B_VIRTUALSERVER_MODIFY_CHANNEL_FORCED_SILENCE, + B_VIRTUALSERVER_MODIFY_COMPLAIN, + B_VIRTUALSERVER_MODIFY_ANTIFLOOD, + B_VIRTUALSERVER_MODIFY_FT_SETTINGS, + B_VIRTUALSERVER_MODIFY_FT_QUOTAS, + B_VIRTUALSERVER_MODIFY_HOSTMESSAGE, + B_VIRTUALSERVER_MODIFY_HOSTBANNER, + B_VIRTUALSERVER_MODIFY_HOSTBUTTON, + B_VIRTUALSERVER_MODIFY_PORT, + B_VIRTUALSERVER_MODIFY_HOST, + B_VIRTUALSERVER_MODIFY_DEFAULT_MESSAGES, + B_VIRTUALSERVER_MODIFY_AUTOSTART, + B_VIRTUALSERVER_MODIFY_NEEDED_IDENTITY_SECURITY_LEVEL, + B_VIRTUALSERVER_MODIFY_PRIORITY_SPEAKER_DIMM_MODIFICATOR, + B_VIRTUALSERVER_MODIFY_LOG_SETTINGS, + B_VIRTUALSERVER_MODIFY_MIN_CLIENT_VERSION, + B_VIRTUALSERVER_MODIFY_ICON_ID, + B_VIRTUALSERVER_MODIFY_WEBLIST, + B_VIRTUALSERVER_MODIFY_CODEC_ENCRYPTION_MODE, + B_VIRTUALSERVER_MODIFY_TEMPORARY_PASSWORDS, + B_VIRTUALSERVER_MODIFY_TEMPORARY_PASSWORDS_OWN, + B_VIRTUALSERVER_MODIFY_CHANNEL_TEMP_DELETE_DELAY_DEFAULT, + B_VIRTUALSERVER_MODIFY_MUSIC_BOT_LIMIT, + I_CHANNEL_MIN_DEPTH, + I_CHANNEL_MAX_DEPTH, + B_CHANNEL_GROUP_INHERITANCE_END, + I_CHANNEL_PERMISSION_MODIFY_POWER, + I_CHANNEL_NEEDED_PERMISSION_MODIFY_POWER, + B_CHANNEL_INFO_VIEW, + B_CHANNEL_CREATE_CHILD, + B_CHANNEL_CREATE_PERMANENT, + B_CHANNEL_CREATE_SEMI_PERMANENT, + B_CHANNEL_CREATE_TEMPORARY, + B_CHANNEL_CREATE_PRIVATE, + B_CHANNEL_CREATE_WITH_TOPIC, + B_CHANNEL_CREATE_WITH_DESCRIPTION, + B_CHANNEL_CREATE_WITH_PASSWORD, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_SPEEX8, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_SPEEX16, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_SPEEX32, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_CELTMONO48, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_OPUSVOICE, + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_OPUSMUSIC, + I_CHANNEL_CREATE_MODIFY_WITH_CODEC_MAXQUALITY, + I_CHANNEL_CREATE_MODIFY_WITH_CODEC_LATENCY_FACTOR_MIN, + B_CHANNEL_CREATE_WITH_MAXCLIENTS, + B_CHANNEL_CREATE_WITH_MAXFAMILYCLIENTS, + B_CHANNEL_CREATE_WITH_SORTORDER, + B_CHANNEL_CREATE_WITH_DEFAULT, + B_CHANNEL_CREATE_WITH_NEEDED_TALK_POWER, + B_CHANNEL_CREATE_MODIFY_WITH_FORCE_PASSWORD, + I_CHANNEL_CREATE_MODIFY_WITH_TEMP_DELETE_DELAY, + B_CHANNEL_MODIFY_PARENT, + B_CHANNEL_MODIFY_MAKE_DEFAULT, + B_CHANNEL_MODIFY_MAKE_PERMANENT, + B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT, + B_CHANNEL_MODIFY_MAKE_TEMPORARY, + B_CHANNEL_MODIFY_NAME, + B_CHANNEL_MODIFY_TOPIC, + B_CHANNEL_MODIFY_DESCRIPTION, + B_CHANNEL_MODIFY_PASSWORD, + B_CHANNEL_MODIFY_CODEC, + B_CHANNEL_MODIFY_CODEC_QUALITY, + B_CHANNEL_MODIFY_CODEC_LATENCY_FACTOR, + B_CHANNEL_MODIFY_MAXCLIENTS, + B_CHANNEL_MODIFY_MAXFAMILYCLIENTS, + B_CHANNEL_MODIFY_SORTORDER, + B_CHANNEL_MODIFY_NEEDED_TALK_POWER, + I_CHANNEL_MODIFY_POWER, + I_CHANNEL_NEEDED_MODIFY_POWER, + B_CHANNEL_MODIFY_MAKE_CODEC_ENCRYPTED, + B_CHANNEL_MODIFY_TEMP_DELETE_DELAY, + B_CHANNEL_DELETE_PERMANENT, + B_CHANNEL_DELETE_SEMI_PERMANENT, + B_CHANNEL_DELETE_TEMPORARY, + B_CHANNEL_DELETE_FLAG_FORCE, + I_CHANNEL_DELETE_POWER, + I_CHANNEL_NEEDED_DELETE_POWER, + B_CHANNEL_JOIN_PERMANENT, + B_CHANNEL_JOIN_SEMI_PERMANENT, + B_CHANNEL_JOIN_TEMPORARY, + B_CHANNEL_JOIN_IGNORE_PASSWORD, + B_CHANNEL_JOIN_IGNORE_MAXCLIENTS, + B_CHANNEL_IGNORE_VIEW_POWER, + I_CHANNEL_JOIN_POWER, + I_CHANNEL_NEEDED_JOIN_POWER, + B_CHANNEL_IGNORE_JOIN_POWER, + I_CHANNEL_VIEW_POWER, + I_CHANNEL_NEEDED_VIEW_POWER, + I_CHANNEL_SUBSCRIBE_POWER, + I_CHANNEL_NEEDED_SUBSCRIBE_POWER, + I_CHANNEL_DESCRIPTION_VIEW_POWER, + I_CHANNEL_NEEDED_DESCRIPTION_VIEW_POWER, + I_ICON_ID, + I_MAX_ICON_FILESIZE, + B_ICON_MANAGE, + B_GROUP_IS_PERMANENT, + I_GROUP_AUTO_UPDATE_TYPE, + I_GROUP_AUTO_UPDATE_MAX_VALUE, + I_GROUP_SORT_ID, + I_GROUP_SHOW_NAME_IN_TREE, + B_VIRTUALSERVER_SERVERGROUP_CREATE, + B_VIRTUALSERVER_SERVERGROUP_LIST, + B_VIRTUALSERVER_SERVERGROUP_PERMISSION_LIST, + B_VIRTUALSERVER_SERVERGROUP_CLIENT_LIST, + B_VIRTUALSERVER_CHANNELGROUP_CREATE, + B_VIRTUALSERVER_CHANNELGROUP_LIST, + B_VIRTUALSERVER_CHANNELGROUP_PERMISSION_LIST, + B_VIRTUALSERVER_CHANNELGROUP_CLIENT_LIST, + B_VIRTUALSERVER_CLIENT_PERMISSION_LIST, + B_VIRTUALSERVER_CHANNEL_PERMISSION_LIST, + B_VIRTUALSERVER_CHANNELCLIENT_PERMISSION_LIST, + B_VIRTUALSERVER_PLAYLIST_PERMISSION_LIST, + I_SERVER_GROUP_MODIFY_POWER, + I_SERVER_GROUP_NEEDED_MODIFY_POWER, + I_SERVER_GROUP_MEMBER_ADD_POWER, + I_SERVER_GROUP_SELF_ADD_POWER, + I_SERVER_GROUP_NEEDED_MEMBER_ADD_POWER, + I_SERVER_GROUP_MEMBER_REMOVE_POWER, + I_SERVER_GROUP_SELF_REMOVE_POWER, + I_SERVER_GROUP_NEEDED_MEMBER_REMOVE_POWER, + I_CHANNEL_GROUP_MODIFY_POWER, + I_CHANNEL_GROUP_NEEDED_MODIFY_POWER, + I_CHANNEL_GROUP_MEMBER_ADD_POWER, + I_CHANNEL_GROUP_SELF_ADD_POWER, + I_CHANNEL_GROUP_NEEDED_MEMBER_ADD_POWER, + I_CHANNEL_GROUP_MEMBER_REMOVE_POWER, + I_CHANNEL_GROUP_SELF_REMOVE_POWER, + I_CHANNEL_GROUP_NEEDED_MEMBER_REMOVE_POWER, + I_GROUP_MEMBER_ADD_POWER, + I_GROUP_NEEDED_MEMBER_ADD_POWER, + I_GROUP_MEMBER_REMOVE_POWER, + I_GROUP_NEEDED_MEMBER_REMOVE_POWER, + I_GROUP_MODIFY_POWER, + I_GROUP_NEEDED_MODIFY_POWER, + I_PERMISSION_MODIFY_POWER, + B_PERMISSION_MODIFY_POWER_IGNORE, + B_VIRTUALSERVER_SERVERGROUP_DELETE, + B_VIRTUALSERVER_CHANNELGROUP_DELETE, + I_CLIENT_PERMISSION_MODIFY_POWER, + I_CLIENT_NEEDED_PERMISSION_MODIFY_POWER, + I_CLIENT_MAX_CLONES_UID, + I_CLIENT_MAX_CLONES_IP, + I_CLIENT_MAX_CLONES_HWID, + I_CLIENT_MAX_IDLETIME, + I_CLIENT_MAX_AVATAR_FILESIZE, + I_CLIENT_MAX_CHANNEL_SUBSCRIPTIONS, + I_CLIENT_MAX_CHANNELS, + I_CLIENT_MAX_TEMPORARY_CHANNELS, + I_CLIENT_MAX_SEMI_CHANNELS, + I_CLIENT_MAX_PERMANENT_CHANNELS, + B_CLIENT_USE_PRIORITY_SPEAKER, + B_CLIENT_SKIP_CHANNELGROUP_PERMISSIONS, + B_CLIENT_FORCE_PUSH_TO_TALK, + B_CLIENT_IGNORE_BANS, + B_CLIENT_IGNORE_VPN, + B_CLIENT_IGNORE_ANTIFLOOD, + B_CLIENT_ENFORCE_VALID_HWID, + B_CLIENT_ALLOW_INVALID_PACKET, + B_CLIENT_ALLOW_INVALID_BADGES, + B_CLIENT_ISSUE_CLIENT_QUERY_COMMAND, + B_CLIENT_USE_RESERVED_SLOT, + B_CLIENT_USE_CHANNEL_COMMANDER, + B_CLIENT_REQUEST_TALKER, + B_CLIENT_AVATAR_DELETE_OTHER, + B_CLIENT_IS_STICKY, + B_CLIENT_IGNORE_STICKY, + B_CLIENT_MUSIC_CREATE_PERMANENT, + B_CLIENT_MUSIC_CREATE_SEMI_PERMANENT, + B_CLIENT_MUSIC_CREATE_TEMPORARY, + B_CLIENT_MUSIC_MODIFY_PERMANENT, + B_CLIENT_MUSIC_MODIFY_SEMI_PERMANENT, + B_CLIENT_MUSIC_MODIFY_TEMPORARY, + I_CLIENT_MUSIC_CREATE_MODIFY_MAX_VOLUME, + I_CLIENT_MUSIC_LIMIT, + I_CLIENT_MUSIC_NEEDED_DELETE_POWER, + I_CLIENT_MUSIC_DELETE_POWER, + I_CLIENT_MUSIC_PLAY_POWER, + I_CLIENT_MUSIC_NEEDED_PLAY_POWER, + I_CLIENT_MUSIC_MODIFY_POWER, + I_CLIENT_MUSIC_NEEDED_MODIFY_POWER, + I_CLIENT_MUSIC_RENAME_POWER, + I_CLIENT_MUSIC_NEEDED_RENAME_POWER, + B_PLAYLIST_CREATE, + I_PLAYLIST_VIEW_POWER, + I_PLAYLIST_NEEDED_VIEW_POWER, + I_PLAYLIST_MODIFY_POWER, + I_PLAYLIST_NEEDED_MODIFY_POWER, + I_PLAYLIST_PERMISSION_MODIFY_POWER, + I_PLAYLIST_NEEDED_PERMISSION_MODIFY_POWER, + I_PLAYLIST_DELETE_POWER, + I_PLAYLIST_NEEDED_DELETE_POWER, + I_PLAYLIST_SONG_ADD_POWER, + I_PLAYLIST_SONG_NEEDED_ADD_POWER, + I_PLAYLIST_SONG_REMOVE_POWER, + I_PLAYLIST_SONG_NEEDED_REMOVE_POWER, + B_CLIENT_INFO_VIEW, + B_CLIENT_PERMISSIONOVERVIEW_VIEW, + B_CLIENT_PERMISSIONOVERVIEW_OWN, + B_CLIENT_REMOTEADDRESS_VIEW, + I_CLIENT_SERVERQUERY_VIEW_POWER, + I_CLIENT_NEEDED_SERVERQUERY_VIEW_POWER, + B_CLIENT_CUSTOM_INFO_VIEW, + B_CLIENT_MUSIC_CHANNEL_LIST, + B_CLIENT_MUSIC_SERVER_LIST, + I_CLIENT_MUSIC_INFO, + I_CLIENT_MUSIC_NEEDED_INFO, + I_CLIENT_KICK_FROM_SERVER_POWER, + I_CLIENT_NEEDED_KICK_FROM_SERVER_POWER, + I_CLIENT_KICK_FROM_CHANNEL_POWER, + I_CLIENT_NEEDED_KICK_FROM_CHANNEL_POWER, + I_CLIENT_BAN_POWER, + I_CLIENT_NEEDED_BAN_POWER, + I_CLIENT_MOVE_POWER, + I_CLIENT_NEEDED_MOVE_POWER, + I_CLIENT_COMPLAIN_POWER, + I_CLIENT_NEEDED_COMPLAIN_POWER, + B_CLIENT_COMPLAIN_LIST, + B_CLIENT_COMPLAIN_DELETE_OWN, + B_CLIENT_COMPLAIN_DELETE, + B_CLIENT_BAN_LIST, + B_CLIENT_BAN_LIST_GLOBAL, + B_CLIENT_BAN_TRIGGER_LIST, + B_CLIENT_BAN_CREATE, + B_CLIENT_BAN_CREATE_GLOBAL, + B_CLIENT_BAN_NAME, + B_CLIENT_BAN_IP, + B_CLIENT_BAN_HWID, + B_CLIENT_BAN_EDIT, + B_CLIENT_BAN_EDIT_GLOBAL, + B_CLIENT_BAN_DELETE_OWN, + B_CLIENT_BAN_DELETE, + B_CLIENT_BAN_DELETE_OWN_GLOBAL, + B_CLIENT_BAN_DELETE_GLOBAL, + I_CLIENT_BAN_MAX_BANTIME, + I_CLIENT_PRIVATE_TEXTMESSAGE_POWER, + I_CLIENT_NEEDED_PRIVATE_TEXTMESSAGE_POWER, + B_CLIENT_EVEN_TEXTMESSAGE_SEND, + B_CLIENT_SERVER_TEXTMESSAGE_SEND, + B_CLIENT_CHANNEL_TEXTMESSAGE_SEND, + B_CLIENT_OFFLINE_TEXTMESSAGE_SEND, + I_CLIENT_TALK_POWER, + I_CLIENT_NEEDED_TALK_POWER, + I_CLIENT_POKE_POWER, + I_CLIENT_NEEDED_POKE_POWER, + B_CLIENT_SET_FLAG_TALKER, + I_CLIENT_WHISPER_POWER, + I_CLIENT_NEEDED_WHISPER_POWER, + B_CLIENT_MODIFY_DESCRIPTION, + B_CLIENT_MODIFY_OWN_DESCRIPTION, + B_CLIENT_USE_BBCODE_ANY, + B_CLIENT_USE_BBCODE_URL, + B_CLIENT_USE_BBCODE_IMAGE, + B_CLIENT_MODIFY_DBPROPERTIES, + B_CLIENT_DELETE_DBPROPERTIES, + B_CLIENT_CREATE_MODIFY_SERVERQUERY_LOGIN, + B_CLIENT_QUERY_CREATE, + B_CLIENT_QUERY_LIST, + B_CLIENT_QUERY_LIST_OWN, + B_CLIENT_QUERY_RENAME, + B_CLIENT_QUERY_RENAME_OWN, + B_CLIENT_QUERY_CHANGE_PASSWORD, + B_CLIENT_QUERY_CHANGE_OWN_PASSWORD, + B_CLIENT_QUERY_CHANGE_PASSWORD_GLOBAL, + B_CLIENT_QUERY_DELETE, + B_CLIENT_QUERY_DELETE_OWN, + B_FT_IGNORE_PASSWORD, + B_FT_TRANSFER_LIST, + I_FT_FILE_UPLOAD_POWER, + I_FT_NEEDED_FILE_UPLOAD_POWER, + I_FT_FILE_DOWNLOAD_POWER, + I_FT_NEEDED_FILE_DOWNLOAD_POWER, + I_FT_FILE_DELETE_POWER, + I_FT_NEEDED_FILE_DELETE_POWER, + I_FT_FILE_RENAME_POWER, + I_FT_NEEDED_FILE_RENAME_POWER, + I_FT_FILE_BROWSE_POWER, + I_FT_NEEDED_FILE_BROWSE_POWER, + I_FT_DIRECTORY_CREATE_POWER, + I_FT_NEEDED_DIRECTORY_CREATE_POWER, + I_FT_QUOTA_MB_DOWNLOAD_PER_CLIENT, + I_FT_QUOTA_MB_UPLOAD_PER_CLIENT +} +declare class PermissionInfo { + name: string; + id: number; + description: string; + is_boolean(); + id_grant(): number; +} +declare class PermissionGroup { + begin: number; + end: number; + deep: number; + name: string; +} +declare class GroupedPermissions { + group: PermissionGroup; + permissions: PermissionInfo[]; + children: GroupedPermissions[]; + parent: GroupedPermissions; +} +declare class PermissionValue { + readonly type: PermissionInfo; + value: number; + flag_skip: boolean; + flag_negate: boolean; + granted_value: number; + constructor(type, value?); + granted(requiredValue: number, required?: boolean): boolean; + hasValue(): boolean; + hasGrant(): boolean; +} +declare class NeededPermissionValue extends PermissionValue { + changeListener: ((newValue: number) => void)[]; + constructor(type, value); +} +declare class ChannelPermissionRequest { + requested: number; + channel_id: number; + callback_success: ((_: PermissionValue[]) => any)[]; + callback_error: ((_: any) => any)[]; +} +declare class TeaPermissionRequest { + client_id?: number; + channel_id?: number; + playlist_id?: number; + promise: LaterPromise; +} +declare class PermissionManager extends connection.AbstractCommandHandler { + readonly handle: ConnectionHandler; + permissionList: PermissionInfo[]; + permissionGroups: PermissionGroup[]; + neededPermissions: NeededPermissionValue[]; + requests_channel_permissions: ChannelPermissionRequest[]; + requests_client_permissions: TeaPermissionRequest[]; + requests_client_channel_permissions: TeaPermissionRequest[]; + requests_playlist_permissions: TeaPermissionRequest[]; + initializedListener: ((initialized: boolean) => void)[]; + private _cacheNeededPermissions: any; + static readonly group_mapping: { + name: string; + deep: number; + }[]; + private _group_mapping; + public static parse_permission_bulk(json: any[], manager: PermissionManager): PermissionValue[]; + constructor(client: ConnectionHandler); + handle_command(command: connection.ServerCommand): boolean; + initialized(): boolean; + public requestPermissionList(); + private onPermissionList(json); + private onNeededPermissions(json); + private onChannelPermList(json); + resolveInfo?(key: number | string | PermissionType): PermissionInfo; + requestChannelPermissions(channelId: number): Promise; + private onClientPermList(json: any[]); + requestClientPermissions(client_id: number): Promise; + requestClientChannelPermissions(client_id: number, channel_id: number): Promise; + private onPlaylistPermList(json: any[]); + requestPlaylistPermissions(playlist_id: number): Promise; + neededPermission(key: number | string | PermissionType | PermissionInfo): PermissionValue; + groupedPermissions(): GroupedPermissions[]; + export_permission_types(); +} + +/* File: shared/js/PPTListener.ts */ +declare enum KeyCode { + KEY_CANCEL, + KEY_HELP, + KEY_BACK_SPACE, + KEY_TAB, + KEY_CLEAR, + KEY_RETURN, + KEY_ENTER, + KEY_SHIFT, + KEY_CONTROL, + KEY_ALT, + KEY_PAUSE, + KEY_CAPS_LOCK, + KEY_ESCAPE, + KEY_SPACE, + KEY_PAGE_UP, + KEY_PAGE_DOWN, + KEY_END, + KEY_HOME, + KEY_LEFT, + KEY_UP, + KEY_RIGHT, + KEY_DOWN, + KEY_PRINTSCREEN, + KEY_INSERT, + KEY_DELETE, + KEY_0, + KEY_1, + KEY_2, + KEY_3, + KEY_4, + KEY_5, + KEY_6, + KEY_7, + KEY_8, + KEY_9, + KEY_SEMICOLON, + KEY_EQUALS, + KEY_A, + KEY_B, + KEY_C, + KEY_D, + KEY_E, + KEY_F, + KEY_G, + KEY_H, + KEY_I, + KEY_J, + KEY_K, + KEY_L, + KEY_M, + KEY_N, + KEY_O, + KEY_P, + KEY_Q, + KEY_R, + KEY_S, + KEY_T, + KEY_U, + KEY_V, + KEY_W, + KEY_X, + KEY_Y, + KEY_Z, + KEY_LEFT_CMD, + KEY_RIGHT_CMD, + KEY_CONTEXT_MENU, + KEY_NUMPAD0, + KEY_NUMPAD1, + KEY_NUMPAD2, + KEY_NUMPAD3, + KEY_NUMPAD4, + KEY_NUMPAD5, + KEY_NUMPAD6, + KEY_NUMPAD7, + KEY_NUMPAD8, + KEY_NUMPAD9, + KEY_MULTIPLY, + KEY_ADD, + KEY_SEPARATOR, + KEY_SUBTRACT, + KEY_DECIMAL, + KEY_DIVIDE, + KEY_F1, + KEY_F2, + KEY_F3, + KEY_F4, + KEY_F5, + KEY_F6, + KEY_F7, + KEY_F8, + KEY_F9, + KEY_F10, + KEY_F11, + KEY_F12, + KEY_F13, + KEY_F14, + KEY_F15, + KEY_F16, + KEY_F17, + KEY_F18, + KEY_F19, + KEY_F20, + KEY_F21, + KEY_F22, + KEY_F23, + KEY_F24, + KEY_NUM_LOCK, + KEY_SCROLL_LOCK, + KEY_COMMA, + KEY_PERIOD, + KEY_SLASH, + KEY_BACK_QUOTE, + KEY_OPEN_BRACKET, + KEY_BACK_SLASH, + KEY_CLOSE_BRACKET, + KEY_QUOTE, + KEY_META +} +declare namespace ppt { + export enum EventType { + KEY_PRESS, + KEY_RELEASE, + KEY_TYPED + } + export enum SpecialKey { + CTRL, + WINDOWS, + SHIFT, + ALT + } + export interface KeyDescriptor { + key_code: string; + key_ctrl: boolean; + key_windows: boolean; + key_shift: boolean; + key_alt: boolean; + } + export interface KeyEvent extends KeyDescriptor { + readonly type: EventType; + readonly key: string; + } + export interface KeyHook extends KeyDescriptor { + cancel: boolean; + callback_press: () => any; + callback_release: () => any; + } + export function key_description(key: KeyDescriptor); +} + +/* File: shared/js/profiles/ConnectionProfile.ts */ +declare namespace profiles { + export class ConnectionProfile { + id: string; + profile_name: string; + default_username: string; + default_password: string; + selected_identity_type: string; + identities: { + [key: string]: identities.Identity; + }; + constructor(id: string); + selected_identity(current_type?: identities.IdentitifyType): identities.Identity; + selected_type?(): identities.IdentitifyType; + set_identity(type: identities.IdentitifyType, identity: identities.Identity); + spawn_identity_handshake_handler?(connection: connection.AbstractServerConnection): connection.HandshakeIdentityHandler; + encode?(): string; + valid(): boolean; + } + export function load(): Promise; + export function create_new_profile(name: string, id?: string): ConnectionProfile; + export function save(); + export function mark_need_save(); + export function requires_save(): boolean; + export function profiles(): ConnectionProfile[]; + export function find_profile(id: string): ConnectionProfile | undefined; + export function find_profile_by_name(name: string): ConnectionProfile | undefined; + export function default_profile(): ConnectionProfile; + export function set_default_profile(profile: ConnectionProfile); + export function delete_profile(profile: ConnectionProfile); +} + +/* File: shared/js/profiles/identities/NameIdentity.ts */ +declare namespace profiles.identities { + export class NameHandshakeHandler extends AbstractHandshakeIdentityHandler { + readonly identity: NameIdentity; + handler: HandshakeCommandHandler; + constructor(connection: connection.AbstractServerConnection, identity: profiles.identities.NameIdentity); + start_handshake(); + protected trigger_fail(message: string); + protected trigger_success(); + } + export class NameIdentity implements Identity { + private _name: string; + constructor(name?: string); + set_name(name: string); + name(): string; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + decode(data): Promise; + encode?(): string; + spawn_identity_handshake_handler(connection: connection.AbstractServerConnection): connection.HandshakeIdentityHandler; + } +} + +/* File: shared/js/profiles/identities/TeaForumIdentity.ts */ +declare namespace profiles.identities { + export class TeaForumHandshakeHandler extends AbstractHandshakeIdentityHandler { + readonly identity: TeaForumIdentity; + handler: HandshakeCommandHandler; + constructor(connection: connection.AbstractServerConnection, identity: profiles.identities.TeaForumIdentity); + start_handshake(); + private handle_proof(json); + protected trigger_fail(message: string); + protected trigger_success(); + } + export class TeaForumIdentity implements Identity { + private identity_data: string; + private identity_data_raw: string; + private identity_data_sign: string; + valid(): boolean; + constructor(data: string, sign: string); + data_json(): string; + data_sign(): string; + name(): string; + uid(): string; + type(): IdentitifyType; + forum_user_id(); + forum_user_group(); + is_stuff(): boolean; + is_premium(): boolean; + data_age(): Date; + decode(data): Promise; + encode?(): string; + spawn_identity_handshake_handler(connection: connection.AbstractServerConnection): connection.HandshakeIdentityHandler; + } + export function set_static_identity(identity: TeaForumIdentity); + export function setup_forum(); + export function valid_static_forum_identity(): boolean; + export function static_forum_identity(): TeaForumIdentity | undefined; +} + +/* File: shared/js/profiles/identities/TeamSpeakIdentity.ts */ +declare namespace profiles.identities { + export namespace CryptoHelper { + export function export_ecc_key(crypto_key: CryptoKey, public_key: boolean): Promise; + export function decrypt_ts_identity(buffer: Uint8Array): Promise; + export function encrypt_ts_identity(buffer: Uint8Array): Promise; + export function decode_tomcrypt_key(buffer: string); + } + export class TeaSpeakHandshakeHandler extends AbstractHandshakeIdentityHandler { + identity: TeaSpeakIdentity; + handler: HandshakeCommandHandler; + constructor(connection: connection.AbstractServerConnection, identity: TeaSpeakIdentity); + start_handshake(); + private handle_proof(json); + protected trigger_fail(message: string); + protected trigger_success(); + } + export class IdentityPOWWorker { + private _worker: Worker; + private _current_hash: string; + private _best_level: number; + initialize(key: string); + mine(hash: string, iterations: number, target: number, timeout?: number): Promise; + current_hash(): string; + current_level(): number; + finalize(timeout?: number); + private handle_message(message: any); + } + export class TeaSpeakIdentity implements Identity { + static generate_new(): Promise; + static import_ts(ts_string: string, ini?: boolean): Promise; + hash_number: string; + private_key: string; + _name: string; + public_key: string; + private _initialized: boolean; + private _crypto_key: CryptoKey; + private _crypto_key_sign: CryptoKey; + private _unique_id: string; + constructor(private_key?: string, hash?: string, name?: string, initialize?: boolean); + name(): string; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + decode(data: string): Promise; + encode?(): string; + level(): Promise; + private string_add(a: string, b: string); + improve_level_for(time: number, threads: number): Promise; + improve_level(target: number, threads: number, active_callback: () => boolean, callback_level?: (current: number) => any, callback_status?: (hash_rate: number) => any): Promise; + private initialize(); + export_ts(ini?: boolean): Promise; + sign_message(message: string, hash?: string): Promise; + spawn_identity_handshake_handler(connection: connection.AbstractServerConnection): connection.HandshakeIdentityHandler; + } +} + +/* File: shared/js/profiles/Identity.ts */ +declare namespace profiles.identities { + export enum IdentitifyType { + TEAFORO, + TEAMSPEAK, + NICKNAME + } + export interface Identity { + name(): string; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + encode?(): string; + decode(data: string): Promise; + spawn_identity_handshake_handler(connection: connection.AbstractServerConnection): connection.HandshakeIdentityHandler; + } + export function decode_identity(type: IdentitifyType, data: string): Promise; + export function create_identity(type: IdentitifyType); + export class HandshakeCommandHandler extends connection.AbstractCommandHandler { + readonly handle: T; + constructor(connection: connection.AbstractServerConnection, handle: T); + handle_command(command: connection.ServerCommand): boolean; + } + export abstract class AbstractHandshakeIdentityHandler implements connection.HandshakeIdentityHandler { + connection: connection.AbstractServerConnection; + protected callbacks: ((success: boolean, message?: string) => any)[]; + protected constructor(connection: connection.AbstractServerConnection); + register_callback(callback: (success: boolean, message?: string) => any); + abstract start_handshake(); + protected trigger_success(); + protected trigger_fail(message: string); + } +} + +/* File: shared/js/proto.ts */ +declare interface Array { + remove(elem?: T): boolean; + last?(): T; + pop_front(): T | undefined; +} +declare interface JSON { + map_to(object: T, json: any, variables?: string | string[], validator?: (map_field: string, map_value: string) => boolean, variable_direction?: number): T; + map_field_to(object: T, value: any, field: string): T; +} +type JQueryScrollType = "height" | "width"; +declare interface JQuery { + render(values?: any): string; + renderTag(values?: any): JQuery; + hasScrollBar(direction?: JQueryScrollType): boolean; + visible_height(): number; + visible_width(): number; + alert(): JQuery; + modal(properties: any): this; + bootstrapMaterialDesign(): this; +} +declare interface JQueryStatic { + spawn(tagName: K): JQuery; + views: any; +} +declare interface String { + format(...fmt): string; + format(arguments: string[]): string; +} +declare function concatenate(resultConstructor, ...arrays); +declare function formatDate(secs: number): string; +declare function calculate_width(text: string): number; +declare class webkitAudioContext extends AudioContext { +} +declare class webkitOfflineAudioContext extends OfflineAudioContext { +} +declare interface Window { + readonly webkitAudioContext: typeof webkitAudioContext; + readonly AudioContext: typeof webkitAudioContext; + readonly OfflineAudioContext: typeof OfflineAudioContext; + readonly webkitOfflineAudioContext: typeof webkitOfflineAudioContext; + readonly RTCPeerConnection: typeof RTCPeerConnection; + readonly Pointer_stringify: any; + readonly jsrender: any; + require(id: string): any; +} +declare interface Navigator { + browserSpecs: { + name: string; + version: string; + }; +} + +/* File: shared/js/settings.ts */ +declare interface SettingsKey { + key: string; + fallback_keys?: string | string[]; + fallback_imports?: { + [key: string]: (value: string) => T; + }; + description?: string; + default_value?: T; +} +declare class SettingsBase { + protected static readonly UPDATE_DIRECT: boolean; + protected static transformStO?(input?: string, _default?: T, default_type?: string): T; + protected static transformOtS?(input: T): string; + protected static resolveKey(key: SettingsKey, _default: T, resolver: (key: string) => string | boolean, default_type?: string): T; + protected static keyify(key: string | SettingsKey): SettingsKey; +} +declare class StaticSettings extends SettingsBase { + private static _instance: StaticSettings; + // @ts-ignore + static get instance(): StaticSettings; + protected _handle: StaticSettings; + protected _staticPropsTag: JQuery; + protected constructor(_reserved?); + private initializeStatic(); + static?(key: string | SettingsKey, _default?: T, default_type?: string): T; + deleteStatic(key: string | SettingsKey); +} +declare class Settings extends StaticSettings { + static readonly KEY_DISABLE_COSMETIC_SLOWDOWN: SettingsKey; + static readonly KEY_DISABLE_CONTEXT_MENU: SettingsKey; + static readonly KEY_DISABLE_UNLOAD_DIALOG: SettingsKey; + static readonly KEY_DISABLE_VOICE: SettingsKey; + static readonly KEY_DISABLE_MULTI_SESSION: SettingsKey; + static readonly KEY_LOAD_DUMMY_ERROR: SettingsKey; + static readonly KEY_CONTROL_MUTE_INPUT: SettingsKey; + static readonly KEY_CONTROL_MUTE_OUTPUT: SettingsKey; + static readonly KEY_CONTROL_SHOW_QUERIES: SettingsKey; + static readonly KEY_CONTROL_CHANNEL_SUBSCRIBE_ALL: SettingsKey; + static readonly KEY_FLAG_CONNECT_DEFAULT: SettingsKey; + static readonly KEY_CONNECT_ADDRESS: SettingsKey; + static readonly KEY_CONNECT_PROFILE: SettingsKey; + static readonly KEY_CONNECT_USERNAME: SettingsKey; + static readonly KEY_CONNECT_PASSWORD: SettingsKey; + static readonly KEY_FLAG_CONNECT_PASSWORD: SettingsKey; + static readonly KEY_CERTIFICATE_CALLBACK: SettingsKey; + static readonly KEY_SOUND_MASTER: SettingsKey; + static readonly KEY_SOUND_MASTER_SOUNDS: SettingsKey; + static readonly FN_SERVER_CHANNEL_SUBSCRIBE_MODE: (channel: ChannelEntry) => SettingsKey; + static readonly FN_PROFILE_RECORD: (name: string) => SettingsKey; + static readonly KEYS; + private cacheGlobal; + private saveWorker: NodeJS.Timer; + private updated: boolean; + constructor(); + static_global?(key: string | SettingsKey, _default?: T): T; + global?(key: string | SettingsKey, _default?: T): T; + changeGlobal(key: string | SettingsKey, value?: T); + save(); +} +declare class ServerSettings extends SettingsBase { + private cacheServer; + private currentServer: ServerEntry; + private _server_save_worker: NodeJS.Timer; + private _server_settings_updated: boolean; + constructor(); + server?(key: string | SettingsKey, _default?: T): T; + changeServer(key: string | SettingsKey, value?: T); + setServer(server: ServerEntry); + save(); +} + +/* File: shared/js/sound/Sounds.ts */ +declare enum Sound { + SOUND_TEST, + SOUND_EGG, + AWAY_ACTIVATED, + AWAY_DEACTIVATED, + CONNECTION_CONNECTED, + CONNECTION_DISCONNECTED, + CONNECTION_BANNED, + CONNECTION_DISCONNECTED_TIMEOUT, + CONNECTION_REFUSED, + SERVER_EDITED, + SERVER_EDITED_SELF, + SERVER_KICKED, + CHANNEL_CREATED, + CHANNEL_MOVED, + CHANNEL_EDITED, + CHANNEL_EDITED_SELF, + CHANNEL_DELETED, + CHANNEL_JOINED, + CHANNEL_KICKED, + USER_MOVED, + USER_MOVED_SELF, + USER_POKED_SELF, + USER_BANNED, + USER_ENTERED, + USER_ENTERED_MOVED, + USER_ENTERED_KICKED, + USER_ENTERED_CONNECT, + USER_LEFT, + USER_LEFT_MOVED, + USER_LEFT_KICKED_CHANNEL, + USER_LEFT_KICKED_SERVER, + USER_LEFT_DISCONNECT, + USER_LEFT_BANNED, + USER_LEFT_TIMEOUT, + ERROR_INSUFFICIENT_PERMISSIONS, + MESSAGE_SEND, + MESSAGE_RECEIVED, + GROUP_SERVER_ASSIGNED, + GROUP_SERVER_REVOKED, + GROUP_CHANNEL_CHANGED, + GROUP_SERVER_ASSIGNED_SELF, + GROUP_SERVER_REVOKED_SELF, + GROUP_CHANNEL_CHANGED_SELF +} +declare namespace sound { + export interface SoundHandle { + key: string; + filename: string; + not_supported?: boolean; + not_supported_timeout?: number; + cached?: AudioBuffer; + node?: HTMLAudioElement; + replaying: boolean; + } + export function get_sound_volume(sound: Sound, default_volume?: number): number; + export function set_sound_volume(sound: Sound, volume: number); + export function get_master_volume(): number; + export function set_master_volume(volume: number); + export function overlap_activated(): boolean; + export function set_overlap_activated(flag: boolean); + export function ignore_output_muted(): boolean; + export function set_ignore_output_muted(flag: boolean); + export function reinitialisize_audio(); + export function save(); + export function initialize(): Promise; + export interface PlaybackOptions { + ignore_muted?: boolean; + ignore_overlap?: boolean; + default_volume?: number; + } + export function resolve_sound(sound: Sound): Promise; + export let manager: SoundManager; + export class SoundManager { + private _handle: ConnectionHandler; + private _playing_sounds: { + [key: string]: number; + }; + constructor(handle: ConnectionHandler); + play(_sound: Sound, options?: PlaybackOptions); + } +} + +/* File: shared/js/stats.ts */ +declare namespace stats { + export enum CloseCodes { + UNSET, + RECONNECT, + INTERNAL_ERROR, + BANNED + } + export enum ConnectionState { + CONNECTING, + INITIALIZING, + CONNECTED, + UNSET + } + export class SessionConfig { + volatile_collection_only?: boolean; + anonymize_ip_addresses?: boolean; + } + export class Config extends SessionConfig { + verbose?: boolean; + reconnect_interval?: number; + } + export interface UserCountData { + online_users: number; + unique_online_users: number; + } + export type UserCountListener = (data: UserCountData) => any; + export function initialize(config: Config); + export function register_user_count_listener(listener: UserCountListener); + export function all_user_count_listener(): UserCountListener[]; + export function deregister_user_count_listener(listener: UserCountListener); + namespace connection { + export let connection_state: ConnectionState; + export function start_connection(); + export function close_connection(); + export function cancel_reconnect(); + namespace handler { } + } +} + +/* File: shared/js/ui/channel.ts */ +declare enum ChannelType { + PERMANENT, + SEMI_PERMANENT, + TEMPORARY +} +declare namespace ChannelType { + export function normalize(mode: ChannelType); +} +declare enum ChannelSubscribeMode { + SUBSCRIBED, + UNSUBSCRIBED, + INHERITED +} +declare class ChannelProperties { + channel_order: number; + channel_name: string; + channel_name_phonetic: string; + channel_topic: string; + channel_password: string; + channel_codec: number; + channel_codec_quality: number; + channel_codec_is_unencrypted: boolean; + channel_maxclients: number; + channel_maxfamilyclients: number; + channel_needed_talk_power: number; + channel_flag_permanent: boolean; + channel_flag_semi_permanent: boolean; + channel_flag_default: boolean; + channel_flag_password: boolean; + channel_flag_maxclients_unlimited: boolean; + channel_flag_maxfamilyclients_inherited: boolean; + channel_flag_maxfamilyclients_unlimited: boolean; + channel_icon_id: number; + channel_delete_delay: number; + channel_description: string; +} +declare class ChannelEntry { + channelTree: ChannelTree; + channelId: number; + parent?: ChannelEntry; + properties: ChannelProperties; + channel_previous?: ChannelEntry; + channel_next?: ChannelEntry; + private _channel_name_alignment: string; + private _channel_name_formatted: string; + private _family_index: number; + private _tag_root: JQuery; + private _tag_siblings: JQuery; + private _tag_clients: JQuery; + private _tag_channel: JQuery; + private _cachedPassword: string; + private _cached_channel_description: string; + private _cached_channel_description_promise: Promise; + private _cached_channel_description_promise_resolve: any; + private _cached_channel_description_promise_reject: any; + private _flag_subscribed: boolean; + private _subscribe_mode: ChannelSubscribeMode; + constructor(channelId, channelName, parent?); + channelName(); + formattedChannelName(); + getChannelDescription(): Promise; + parent_channel(); + hasParent(); + getChannelId(); + children(deep?): ChannelEntry[]; + clients(deep?): ClientEntry[]; + clients_ordered(): ClientEntry[]; + update_family_index(enforce?: boolean); + calculate_family_index(enforce_recalculate?: boolean): number; + private initializeTag(); + rootTag(): JQuery; + channelTag(): JQuery; + siblingTag(): JQuery; + clientTag(): JQuery; + reorderClients(); + initializeListener(); + showContextMenu(x: number, y: number, on_close?: () => void); + handle_frame_resized(); + private static NAME_ALIGNMENTS: string[]; + private __updateChannelName(); + recalculate_repetitive_name(); + updateVariables(...variables: { + key: string; + value: string; + }[]); + updateChannelTypeIcon(); + generate_bbcode(); + generate_tag(braces?: boolean): JQuery; + channelType(): ChannelType; + joinChannel(); + cached_password(); + subscribe(): Promise; + unsubscribe(inherited_subscription_mode?: boolean): Promise; + // @ts-ignore + get flag_subscribed(): boolean; + // @ts-ignore + set flag_subscribed(flag: boolean); + // @ts-ignore + get subscribe_mode(): ChannelSubscribeMode; + // @ts-ignore + set subscribe_mode(mode: ChannelSubscribeMode); +} + +/* File: shared/js/ui/client_move.ts */ +declare class ClientMover { + static readonly listener_root; + static readonly move_element; + readonly channel_tree: ChannelTree; + selected_client: ClientEntry | ClientEntry[]; + hovered_channel: HTMLDivElement; + callback: (channel?: ChannelEntry) => any; + enabled: boolean; + private _bound_finish; + private _bound_move; + private _active: boolean; + private origin_point: { + x: number; + y: number; + }; + constructor(tree: ChannelTree); + is_active(); + private hover_text(); + private bbcode_text(); + activate(client: ClientEntry | ClientEntry[], callback: (channel?: ChannelEntry) => any, event: any); + private move_listener(event); + private finish_listener(event); + deactivate(); +} + +/* File: shared/js/ui/client.ts */ +declare enum ClientType { + CLIENT_VOICE, + CLIENT_QUERY, + CLIENT_INTERNAL, + CLIENT_WEB, + CLIENT_MUSIC, + CLIENT_UNDEFINED +} +declare class ClientProperties { + client_type: ClientType; + client_type_exact: ClientType; + client_database_id: number; + client_version: string; + client_platform: string; + client_nickname: string; + client_unique_identifier: string; + client_description: string; + client_servergroups: string; + client_channel_group_id: number; + client_lastconnected: number; + client_flag_avatar: string; + client_icon_id: number; + client_away_message: string; + client_away: boolean; + client_input_hardware: boolean; + client_output_hardware: boolean; + client_input_muted: boolean; + client_output_muted: boolean; + client_is_channel_commander: boolean; + client_teaforum_id: number; + client_teaforum_name: string; + client_talk_power: number; +} +declare class ClientEntry { + protected _clientId: number; + protected _channel: ChannelEntry; + protected _tag: JQuery; + protected _properties: ClientProperties; + protected lastVariableUpdate: number; + protected _speaking: boolean; + protected _listener_initialized: boolean; + protected _audio_handle: connection.voice.VoiceClient; + channelTree: ChannelTree; + constructor(clientId: number, clientName, properties?: ClientProperties); + set_audio_handle(handle: connection.voice.VoiceClient); + get_audio_handle(): connection.voice.VoiceClient; + // @ts-ignore + get properties(): ClientProperties; + currentChannel(): ChannelEntry; + clientNickName(); + clientUid(); + clientId(); + protected initializeListener(); + protected assignment_context(): contextmenu.MenuEntry[]; + showContextMenu(x: number, y: number, on_close?: () => void); + // @ts-ignore + get tag(): JQuery; + static bbcodeTag(id: number, name: string, uid: string): string; + static chatTag(id: number, name: string, uid: string, braces?: boolean): JQuery; + create_bbcode(): string; + createChatTag(braces?: boolean): JQuery; + // @ts-ignore + set speaking(flag); + updateClientStatusIcons(); + updateClientSpeakIcon(); + updateAwayMessage(); + updateVariables(...variables: { + key: string; + value: string; + }[]); + update_displayed_client_groups(); + updateClientVariables(); + private chat_name(); + chat(create?: boolean): ChatEntry; + initialize_chat(handle?: ChatEntry); + updateClientIcon(); + updateGroupIcon(group: Group); + assignedServerGroupIds(): number[]; + assignedChannelGroup(): number; + groupAssigned(group: Group): boolean; + onDelete(); + calculateOnlineTime(): number; + avatarId?(): string; + update_family_index(); +} +declare class LocalClientEntry extends ClientEntry { + handle: ConnectionHandler; + private renaming: boolean; + constructor(handle: ConnectionHandler); + showContextMenu(x: number, y: number, on_close?: () => void): void; + initializeListener(): void; + openRename(): void; +} +declare class MusicClientProperties extends ClientProperties { + player_state: number; + player_volume: number; + client_playlist_id: number; + client_disabled: boolean; +} +declare class MusicClientPlayerInfo { + bot_id: number; + player_state: number; + player_buffered_index: number; + player_replay_index: number; + player_max_index: number; + player_seekable: boolean; + player_title: string; + player_description: string; + song_id: number; + song_url: string; + song_invoker: number; + song_loaded: boolean; + song_title: string; + song_thumbnail: string; + song_length: number; +} +declare class MusicClientEntry extends ClientEntry { + private _info_promise: Promise; + private _info_promise_age: number; + private _info_promise_resolve: any; + private _info_promise_reject: any; + constructor(clientId, clientName); + // @ts-ignore + get properties(): MusicClientProperties; + showContextMenu(x: number, y: number, on_close?: () => void): void; + initializeListener(): void; + handlePlayerInfo(json); + requestPlayerInfo(max_age?: number): Promise; +} + +/* File: shared/js/ui/elements/context_divider.ts */ +declare interface JQuery { + dividerfy(): this; +} + +/* File: shared/js/ui/elements/context_menu.ts */ +declare namespace contextmenu { + export interface MenuEntry { + callback?: () => void; + type: MenuEntryType; + name: (() => string) | string; + icon_class?: string; + icon_path?: string; + disabled?: boolean; + visible?: boolean; + checkbox_checked?: boolean; + invalidPermission?: boolean; + sub_menu?: MenuEntry[]; + } + export enum MenuEntryType { + CLOSE, + ENTRY, + CHECKBOX, + HR, + SUB_MENU + } + export class Entry { + static HR(); + static CLOSE(callback: () => void); + } + export interface ContextMenuProvider { + despawn_context_menu(); + spawn_context_menu(x: number, y: number, ...entries: MenuEntry[]); + initialize(); + finalize(); + html_format_enabled(): boolean; + } + export function spawn_context_menu(x: number, y: number, ...entries: MenuEntry[]); + export function despawn_context_menu(); + export function get_provider(): ContextMenuProvider; + export function set_provider(_provider: ContextMenuProvider); +} +declare class HTMLContextMenuProvider implements contextmenu.ContextMenuProvider { + private _global_click_listener: (event) => any; + private _context_menu: JQuery; + private _close_callbacks: (() => any)[]; + despawn_context_menu(); + finalize(); + initialize(); + private on_global_click(event); + private generate_tag(entry: contextmenu.MenuEntry): JQuery; + spawn_context_menu(x: number, y: number, ...entries: contextmenu.MenuEntry[]); + html_format_enabled(): boolean; +} + +/* File: shared/js/ui/elements/modal.ts */ +declare enum ElementType { + HEADER, + BODY, + FOOTER +} +type BodyCreator = (() => JQuery | JQuery[] | string) | string | JQuery | JQuery[]; +declare const ModalFunctions; +declare class ModalProperties { + template?: string; + header: BodyCreator; + body: BodyCreator; + footer: BodyCreator; + closeListener: (() => void) | (() => void)[]; + registerCloseListener(listener: () => void): this; + width: number | string; + height: number | string; + closeable: boolean; + triggerClose(); + template_properties?: any; + trigger_tab: boolean; + full_size?: boolean; +} +declare class Modal { + private _htmlTag: JQuery; + properties: ModalProperties; + shown: boolean; + open_listener: (() => any)[]; + close_listener: (() => any)[]; + close_elements: JQuery; + constructor(props: ModalProperties); + // @ts-ignore + get htmlTag(): JQuery; + private _create(); + open(); + close(); + set_closeable(flag: boolean); +} +declare function createModal(data: ModalProperties | any): Modal; +declare class InputModalProperties extends ModalProperties { + maxLength?: number; + field_title?: string; + field_label?: string; + field_placeholder?: string; + error_message?: string; +} +declare function createInputModal(headMessage: BodyCreator, question: BodyCreator, validator: (input: string) => boolean, callback: (flag: boolean | string) => void, props?: InputModalProperties | any): Modal; +declare function createErrorModal(header: BodyCreator, message: BodyCreator, props?: ModalProperties | any); +declare function createInfoModal(header: BodyCreator, message: BodyCreator, props?: ModalProperties | any); +declare interface ModalElements { + header?: BodyCreator; + body?: BodyCreator; + footer?: BodyCreator; +} +declare interface JQuery { + modalize(entry_callback?: (header: JQuery, body: JQuery, footer: JQuery) => ModalElements | void, properties?: ModalProperties | any): Modal; +} + +/* File: shared/js/ui/elements/tab.ts */ +declare interface JQuery { + asTabWidget(copy?: boolean): JQuery; + tabify(copy?: boolean): this; + changeElementType(type: string): JQuery; +} +declare var TabFunctions; + +/* File: shared/js/ui/frames/chat.ts */ +declare enum ChatType { + GENERAL, + SERVER, + CHANNEL, + CLIENT +} +declare namespace MessageHelper { + export function htmlEscape(message: string): string[]; + export function formatElement(object: any, escape_html?: boolean): JQuery[]; + export function formatMessage(pattern: string, ...objects: any[]): JQuery[]; + export function bbcode_chat(message: string): JQuery[]; +} +declare class ChatMessage { + date: Date; + message: JQuery[]; + private _html_tag: JQuery; + constructor(message: JQuery[]); + private num(num: number): string; + // @ts-ignore + get html_tag(); +} +declare class ChatEntry { + readonly handle: ChatBox; + type: ChatType; + key: string; + history: ChatMessage[]; + send_history: string[]; + owner_unique_id?: string; + private _name: string; + private _html_tag: any; + private _flag_closeable: boolean; + private _flag_unread: boolean; + private _flag_offline: boolean; + onMessageSend: (text: string) => void; + onClose: () => boolean; + constructor(handle, type: ChatType, key); + appendError(message: string, ...args); + appendMessage(message: string, fmt?: boolean, ...args); + private pushChatMessage(entry: ChatMessage); + displayHistory(); + // @ts-ignore + get html_tag(); + focus(); + // @ts-ignore + set name(newName: string); + // @ts-ignore + set flag_closeable(flag: boolean); + // @ts-ignore + set flag_unread(flag: boolean); + // @ts-ignore + get flag_offline(); + // @ts-ignore + set flag_offline(flag: boolean); + private chat_icon(): string; +} +declare class ChatBox { + static readonly URL_REGEX; + readonly connection_handler: ConnectionHandler; + htmlTag: JQuery; + chats: ChatEntry[]; + private _activeChat: ChatEntry; + private _history_index: number; + private _button_send: JQuery; + private _input_message: JQuery; + constructor(connection_handler: ConnectionHandler); + initialize(); + createChat(key, type?: ChatType): ChatEntry; + open_chats(): ChatEntry[]; + findChat(key: string): ChatEntry; + deleteChat(chat: ChatEntry); + onSend(); + // @ts-ignore + set activeChat(chat: ChatEntry); + private activeChat0(chat: ChatEntry); + // @ts-ignore + get activeChat(): ChatEntry; + channelChat(): ChatEntry; + serverChat(); + focus(); + private testMessage(message: string): boolean; +} + +/* File: shared/js/ui/frames/connection_handlers.ts */ +declare let server_connections: ServerConnectionManager; +declare class ServerConnectionManager { + private connection_handlers: ConnectionHandler[]; + private active_handler: ConnectionHandler | undefined; + private _container_channel_tree: JQuery; + private _container_select_info: JQuery; + private _container_chat_box: JQuery; + private _tag: JQuery; + private _tag_connection_entries: JQuery; + private _tag_buttons_scoll: JQuery; + private _tag_button_scoll_right: JQuery; + private _tag_button_scoll_left: JQuery; + constructor(tag: JQuery); + spawn_server_connection_handler(): ConnectionHandler; + destroy_server_connection_handler(handler: ConnectionHandler); + set_active_connection_handler(handler: ConnectionHandler); + active_connection_handler(): ConnectionHandler | undefined; + server_connection_handlers(): ConnectionHandler[]; + update_ui(); + private _update_scroll(); + private _button_scroll_right_clicked(); + private _button_scroll_left_clicked(); + private _update_scroll_buttons(); +} + +/* File: shared/js/ui/frames/ControlBar.ts */ +declare let control_bar: ControlBar; +type MicrophoneState = "disabled" | "muted" | "enabled"; +type HeadphoneState = "muted" | "enabled"; +type AwayState = "away-global" | "away" | "online"; +declare class ControlBar { + private _button_away_active: AwayState; + private _button_microphone: MicrophoneState; + private _button_speakers: HeadphoneState; + private _button_subscribe_all: boolean; + private _button_query_visible: boolean; + private connection_handler: ConnectionHandler | undefined; + htmlTag: JQuery; + constructor(htmlTag: JQuery); + initialize_connection_handler_state(handler?: ConnectionHandler); + set_connection_handler(handler?: ConnectionHandler); + apply_server_state(); + apply_server_voice_state(); + current_connection_handler(); + initialise(); + // @ts-ignore + set button_away_active(flag: AwayState); + update_button_away(); + // @ts-ignore + set button_microphone(state: MicrophoneState); + // @ts-ignore + set button_speaker(state: HeadphoneState); + // @ts-ignore + set button_subscribe_all(state: boolean); + // @ts-ignore + set button_query_visible(state: boolean); + private on_away_toggle(); + private on_away_enable(); + private on_away_disable(); + private on_away_set_message(); + private on_away_enable_global(); + private on_away_disable_global(); + private on_away_set_message_global(); + private on_toggle_microphone(); + private on_toggle_sound(); + private on_toggle_channel_subscribe(); + private on_toggle_query_view(); + private on_open_settings(); + private on_open_connect(); + update_connection_state(); + private on_execute_disconnect(); + private on_token_use(); + private on_token_list(); + private on_open_permissions(); + private on_open_banslist(); + private on_bookmark_server_add(); + update_bookmark_status(); + update_bookmarks(); + private on_bookmark_manage(); + private on_open_query_create(); + private on_open_query_manage(); + private on_open_playlist_manage(); +} + +/* File: shared/js/ui/frames/SelectedItemInfo.ts */ +declare abstract class InfoManagerBase { + private timers: NodeJS.Timer[]; + private intervals: number[]; + protected resetTimers(); + protected resetIntervals(); + protected registerTimer(timer: NodeJS.Timer); + protected registerInterval(interval: T); + abstract available(object: V): boolean; +} +declare abstract class InfoManager extends InfoManagerBase { + protected handle?: InfoBar; + createFrame<_>(handle: InfoBar<_>, object: T, html_tag: JQuery); + abstract updateFrame(object: T, html_tag: JQuery); + finalizeFrame(object: T, frame: JQuery); + protected triggerUpdate(); +} +declare class InfoBar { + readonly handle: ConnectionHandler; + private current_selected?: AvailableTypes; + private _tag: JQuery; + private readonly _tag_info: JQuery; + private readonly _tag_banner: JQuery; + private _current_manager: InfoManagerBase; + private managers: InfoManagerBase[]; + private banner_manager: Hostbanner; + constructor(client: ConnectionHandler); + get_tag(): JQuery; + handle_resize(); + setCurrentSelected(entry: AvailableTypes); + // @ts-ignore + get currentSelected(); + update(); + update_banner(); + current_manager(); + is_popover(): boolean; + open_popover(); + close_popover(); + rendered_tag(); +} +declare interface Window { + Image: typeof HTMLImageElement; + HTMLImageElement: typeof HTMLImageElement; +} +declare class Hostbanner { + readonly html_tag: JQuery; + readonly client: ConnectionHandler; + private updater: NodeJS.Timer; + private _hostbanner_url: string; + constructor(client: ConnectionHandler, htmlTag: JQuery); + update(); + handle_resize(); + private generate_tag?(): Promise>; +} +declare class ClientInfoManager extends InfoManager { + available(object: V): boolean; + createFrame<_>(handle: InfoBar<_>, client: ClientEntry, html_tag: JQuery); + updateFrame(client: ClientEntry, html_tag: JQuery); + buildProperties(client: ClientEntry): any; +} +declare class ServerInfoManager extends InfoManager { + createFrame<_>(handle: InfoBar<_>, server: ServerEntry, html_tag: JQuery); + updateFrame(server: ServerEntry, html_tag: JQuery); + available(object: V): boolean; +} +declare class ChannelInfoManager extends InfoManager { + createFrame<_>(handle: InfoBar<_>, channel: ChannelEntry, html_tag: JQuery); + updateFrame(channel: ChannelEntry, html_tag: JQuery); + available(object: V): boolean; +} +declare function format_time(time: number); +declare enum MusicPlayerState { + SLEEPING, + LOADING, + PLAYING, + PAUSED, + STOPPED +} +declare class MusicInfoManager extends ClientInfoManager { + single_handler: connection.SingleCommandHandler; + createFrame<_>(handle: InfoBar<_>, channel: MusicClientEntry, html_tag: JQuery); + updateFrame(bot: MusicClientEntry, html_tag: JQuery); + update_local_volume(volume: number); + update_remote_volume(volume: number); + available(object: V): boolean; + finalizeFrame(object: ClientEntry, frame: JQuery); +} + +/* File: shared/js/ui/htmltags.ts */ +declare namespace htmltags { + export interface ClientProperties { + client_id: number; + client_unique_id: string; + client_name: string; + add_braces?: boolean; + } + export interface ChannelProperties { + channel_id: number; + channel_name: string; + channel_display_name?: string; + add_braces?: boolean; + } + export function generate_client(properties: ClientProperties): string; + export function generate_channel(properties: ChannelProperties): string; + export namespace callbacks { + export function callback_context_client(element: JQuery); + export function callback_context_channel(element: JQuery); + } + namespace bbcodes { } +} + +/* File: shared/js/ui/modal/ModalAvatarList.ts */ +declare namespace Modals { + export const human_file_size; + export function spawnAvatarList(client: ConnectionHandler); +} + +/* File: shared/js/ui/modal/ModalBanClient.ts */ +declare namespace Modals { + export function spawnBanClient(name: string | string[], callback: (data: { + length: number; + reason: string; + no_name: boolean; + no_ip: boolean; + no_hwid: boolean; + }) => void); +} + +/* File: shared/js/ui/modal/ModalBanCreate.ts */ +declare namespace Modals { + export function spawnBanCreate(connection: ConnectionHandler, base?: BanEntry, callback?: (entry?: BanEntry) => any); +} + +/* File: shared/js/ui/modal/ModalBanList.ts */ +declare namespace Modals { + export interface BanEntry { + server_id: number; + banid: number; + name?: string; + name_type?: number; + unique_id?: string; + ip?: string; + hardware_id?: string; + reason: string; + invoker_name: string; + invoker_unique_id?: string; + invoker_database_id?: number; + timestamp_created: Date; + timestamp_expire: Date; + enforcements: number; + flag_own?: boolean; + } + export interface BanListManager { + addbans: (ban: BanEntry[]) => void; + clear: (ban?: any) => void; + modal: Modal; + } + export function openBanList(client: ConnectionHandler); + export function spawnBanListModal(callback_update: () => any, callback_add: () => any, callback_edit: (entry: BanEntry) => any, callback_delete: (entry: BanEntry) => any): BanListManager; +} + +/* File: shared/js/ui/modal/ModalBookmarks.ts */ +declare namespace Modals { + export function spawnBookmarkModal(); +} + +/* File: shared/js/ui/modal/ModalBotMenue.ts */ + +/* File: shared/js/ui/modal/ModalChangeVolume.ts */ +declare namespace Modals { + export function spawnChangeVolume(current: number, callback: (number) => void); + export function spawnChangeRemoteVolume(current: number, max_value: number, callback: (value: number) => void); +} + +/* File: shared/js/ui/modal/ModalConnect.ts */ +declare namespace Modals { + export function spawnConnectModal(defaultHost?: { + url: string; + enforce: boolean; + }, connect_profile?: { + profile: profiles.ConnectionProfile; + enforce: boolean; + }); + export const Regex; +} + +/* File: shared/js/ui/modal/ModalCreateChannel.ts */ +declare namespace Modals { + export function createChannelModal(connection: ConnectionHandler, channel: ChannelEntry | undefined, parent: ChannelEntry | undefined, permissions: PermissionManager, callback: (properties?: ChannelProperties, permissions?: PermissionValue[]) => any); +} + +/* File: shared/js/ui/modal/ModalIconSelect.ts */ +declare namespace Modals { + export function spawnIconSelect(client: ConnectionHandler, callback_icon?: (id: number) => any, selected_icon?: number); + export function spawnIconUpload(client: ConnectionHandler); +} + +/* File: shared/js/ui/modal/ModalInvite.ts */ +declare namespace Modals { + export function spawnInviteEditor(connection: ConnectionHandler); +} + +/* File: shared/js/ui/modal/ModalPlaylistEdit.ts */ +declare namespace Modals { + export function spawnPlaylistSongInfo(song: PlaylistSong); + export function spawnSongAdd(playlist: Playlist, callback_add: (url: string, loader: string) => any); + export function spawnPlaylistEdit(client: ConnectionHandler, playlist: Playlist); +} + +/* File: shared/js/ui/modal/ModalPlaylistList.ts */ +declare namespace Modals { + export function spawnPlaylistManage(client: ConnectionHandler); +} + +/* File: shared/js/ui/modal/ModalPoke.ts */ +declare namespace Modals { + export class PokeModal { + private _handle: Modal; + private source_map: ServerEntry[]; + constructor(); + modal(); + add_poke(source: ConnectionHandler, invoker: PokeInvoker, message: string); + private _handle_close(); + } + type PokeInvoker = { + name: string; + id: number; + unique_id: string; + }; + export function spawnPoke(source: ConnectionHandler, invoker: PokeInvoker, message: string); +} + +/* File: shared/js/ui/modal/ModalQuery.ts */ +declare namespace Modals { + export function spawnQueryCreate(connection: ConnectionHandler, callback_created?: (user, pass) => any); + export function spawnQueryCreated(credentials: { + username: string; + password: string; + }, just_created: boolean); +} + +/* File: shared/js/ui/modal/ModalQueryManage.ts */ +declare namespace Modals { + export function spawnQueryManage(client: ConnectionHandler); +} + +/* File: shared/js/ui/modal/ModalServerEdit.ts */ +declare namespace Modals { + export function createServerModal(server: ServerEntry, callback: (properties?: ServerProperties) => any); +} + +/* File: shared/js/ui/modal/ModalServerGroupDialog.ts */ +declare namespace Modals { + export function createServerGroupAssignmentModal(client: ClientEntry, callback: (group: Group, flag: boolean) => Promise); +} + +/* File: shared/js/ui/modal/ModalSettings.ts */ +declare namespace Modals { + export function spawnSettingsModal(): Modal; +} + +/* File: shared/js/ui/modal/ModalYesNo.ts */ +declare namespace Modals { + export function spawnYesNo(header: BodyCreator, body: BodyCreator, callback: (_: boolean) => any, properties?: { + text_yes?: string; + text_no?: string; + }); +} + +/* File: shared/js/ui/modal/permission/HTMLPermissionEditor.ts */ +declare namespace unused { + namespace PermissionEditor { + export interface PermissionEntry { + tag: JQuery; + tag_value: JQuery; + tag_grant: JQuery; + tag_flag_negate: JQuery; + tag_flag_skip: JQuery; + id: number; + filter: string; + is_bool: boolean; + } + export interface PermissionValue { + remove: boolean; + granted?: number; + value?: number; + flag_skip?: boolean; + flag_negate?: boolean; + } + export type change_listener_t = (permission: PermissionInfo, value?: PermissionEditor.PermissionValue) => Promise; + } + export enum PermissionEditorMode { + VISIBLE, + NO_PERMISSION, + UNSET + } + export class PermissionEditor { + readonly permissions: GroupedPermissions[]; + container: JQuery; + private mode_container_permissions: JQuery; + private mode_container_error_permission: JQuery; + private mode_container_unset: JQuery; + private permission_value_map: { + [key: number]: PermissionValue; + }; + private permission_map: { + [key: number]: PermissionEditor.PermissionEntry; + }; + private listener_change: PermissionEditor.change_listener_t; + private listener_update: () => any; + constructor(permissions: GroupedPermissions[]); + build_tag(); + set_permissions(permissions?: PermissionValue[]); + set_listener(listener?: PermissionEditor.change_listener_t); + set_listener_update(listener?: () => any); + trigger_update(); + set_mode(mode: PermissionEditorMode); + } +} + +/* File: shared/js/ui/modal/permission/ModalPermissionEdit.ts */ +declare interface JQuery { + dropdown: any; +} +declare namespace Modals { + namespace PermissionEditor { + export interface PermissionEntry { + tag: JQuery; + tag_value: JQuery; + tag_grant: JQuery; + tag_flag_negate: JQuery; + tag_flag_skip: JQuery; + id: number; + filter: string; + is_bool: boolean; + } + export interface PermissionValue { + remove: boolean; + granted?: number; + value?: number; + flag_skip?: boolean; + flag_negate?: boolean; + } + export type change_listener_t = (permission: PermissionInfo, value?: PermissionEditor.PermissionValue) => Promise; + } + export enum PermissionEditorMode { + VISIBLE, + NO_PERMISSION, + UNSET + } + export class PermissionEditor { + readonly permissions: GroupedPermissions[]; + container: JQuery; + private mode_container_permissions: JQuery; + private mode_container_error_permission: JQuery; + private mode_container_unset: JQuery; + private permission_value_map: { + [key: number]: PermissionValue; + }; + private listener_change: PermissionEditor.change_listener_t; + private listener_update: () => any; + private entry_editor: ui.PermissionEditor; + icon_resolver: (id: number) => Promise; + icon_selector: (current_id: number) => Promise; + constructor(permissions: GroupedPermissions[]); + build_tag(); + set_permissions(permissions?: PermissionValue[]); + set_listener(listener?: PermissionEditor.change_listener_t); + set_listener_update(listener?: () => any); + trigger_update(); + set_mode(mode: PermissionEditorMode); + update_ui(); + } + export function spawnPermissionEdit(connection: ConnectionHandler): Modal; +} + +/* File: shared/js/ui/modal/permission/PermissionEditor.ts */ +declare namespace ui { + export namespace scheme { + export interface CheckBox { + border: string; + checkmark: string; + checkmark_font: string; + background_checked: string; + background_checked_hovered: string; + background: string; + background_hovered: string; + } + export interface TextField { + color: string; + font: string; + background: string; + background_hovered: string; + } + export interface ColorScheme { + permission: { + background: string; + background_selected: string; + name: string; + name_unset: string; + name_font: string; + value: TextField; + value_b: CheckBox; + granted: TextField; + negate: CheckBox; + skip: CheckBox; + }; + group: { + name: string; + name_font: string; + }; + } + } + export enum RepaintMode { + NONE, + REPAINT, + REPAINT_OBJECT_FULL, + REPAINT_FULL + } + export interface AxisAlignedBoundingBox { + x: number; + y: number; + width: number; + height: number; + } + export enum ClickEventType { + SIGNLE, + DOUBLE, + CONTEXT_MENU + } + export interface InteractionClickEvent { + type: ClickEventType; + consumed: boolean; + offset_x: number; + offset_y: number; + } + export interface InteractionListener { + region: AxisAlignedBoundingBox; + region_weight: number; + on_mouse_enter?: () => RepaintMode; + on_mouse_leave?: () => RepaintMode; + on_click?: (event: InteractionClickEvent) => RepaintMode; + mouse_cursor?: string; + set_full_draw?: () => any; + disabled?: boolean; + } + export abstract class DrawableObject { + abstract draw(context: CanvasRenderingContext2D, full: boolean); + private _object_full_draw; + private _width: number; + set_width(value: number); + request_full_draw(); + pop_full_draw(); + width(); + abstract height(); + private _transforms: DOMMatrix[]; + protected push_transform(context: CanvasRenderingContext2D); + protected pop_transform(context: CanvasRenderingContext2D); + protected original_x(context: CanvasRenderingContext2D, x: number); + protected original_y(context: CanvasRenderingContext2D, y: number); + protected colors: scheme.ColorScheme; + set_color_scheme(scheme: scheme.ColorScheme); + protected manager: PermissionEditor; + set_manager(manager: PermissionEditor); + abstract initialize(); + abstract finalize(); + } + export class PermissionGroup extends DrawableObject { + public static readonly HEIGHT; + public static readonly ARROW_SIZE; + group: GroupedPermissions; + _sub_elements: PermissionGroup[]; + _element_permissions: PermissionList; + collapsed; + private _listener_colaps: InteractionListener; + constructor(group: GroupedPermissions); + draw(context: CanvasRenderingContext2D, full: boolean); + set_width(value: number); + set_color_scheme(scheme: scheme.ColorScheme); + set_manager(manager: PermissionEditor); + height(); + initialize(); + finalize(); + collapse_group(); + expend_group(); + } + export class PermissionList extends DrawableObject { + permissions: PermissionEntry[]; + constructor(permissions: PermissionInfo[]); + set_width(value: number); + draw(context: CanvasRenderingContext2D, full: boolean); + height(); + set_color_scheme(scheme: scheme.ColorScheme); + set_manager(manager: PermissionEditor); + initialize(); + finalize(); + handle_hide(); + } + export class PermissionEntry extends DrawableObject { + public static readonly HEIGHT; + public static readonly HALF_HEIGHT; + public static readonly CHECKBOX_HEIGHT; + public static readonly COLUMN_PADDING; + public static readonly COLUMN_VALUE; + public static readonly COLUMN_GRANTED; + public static readonly COLUMN_NEGATE; + public static readonly COLUMN_SKIP; + private _permission: PermissionInfo; + hidden: boolean; + granted: number; + value: number; + flag_skip: boolean; + flag_negate: boolean; + private _prev_selected; + selected: boolean; + flag_skip_hovered; + flag_negate_hovered; + flag_value_hovered; + flag_grant_hovered; + private _listener_checkbox_skip: InteractionListener; + private _listener_checkbox_negate: InteractionListener; + private _listener_value: InteractionListener; + private _listener_grant: InteractionListener; + private _listener_general: InteractionListener; + private _icon_image: HTMLImageElement | undefined; + on_icon_select?: (current_id: number) => Promise; + on_context_menu?: (x: number, y: number) => any; + on_grant_change?: () => any; + on_change?: () => any; + constructor(permission: PermissionInfo); + set_icon_id_image(image: HTMLImageElement | undefined); + permission(); + draw(ctx: CanvasRenderingContext2D, full: boolean); + handle_hide(); + private _draw_icon_field(ctx: CanvasRenderingContext2D, scheme: scheme.CheckBox, x: number, y: number, width: number, hovered: boolean, image: HTMLImageElement); + private _draw_number_field(ctx: CanvasRenderingContext2D, scheme: scheme.TextField, x: number, y: number, width: number, value: number, hovered: boolean); + private _draw_checkbox_field(ctx: CanvasRenderingContext2D, scheme: scheme.CheckBox, x: number, y: number, height: number, checked: boolean, hovered: boolean); + height(); + set_width(value: number); + initialize(); + finalize(); + private _spawn_number_edit(x: number, y: number, width: number, height: number, color: scheme.TextField, value: number, callback: (new_value?: number) => any); + trigger_value_assign(); + trigger_grant_assign(); + } + export class InteractionManager { + private _listeners: InteractionListener[]; + private _entered_listeners: InteractionListener[]; + register_listener(listener: InteractionListener); + remove_listener(listener: InteractionListener); + process_mouse_move(new_x: number, new_y: number): { + repaint: RepaintMode; + cursor: string; + }; + private process_click_event(x: number, y: number, event: InteractionClickEvent): RepaintMode; + process_click(x: number, y: number): RepaintMode; + process_dblclick(x: number, y: number): RepaintMode; + process_context_menu(js_event: MouseEvent, x: number, y: number): RepaintMode; + } + export class PermissionEditor { + private static readonly PERMISSION_HEIGHT; + private static readonly PERMISSION_GROUP_HEIGHT; + readonly grouped_permissions: GroupedPermissions[]; + readonly canvas: HTMLCanvasElement; + readonly canvas_container: HTMLDivElement; + private _max_height: number; + private _permission_count: number; + private _permission_group_count: number; + private _canvas_context: CanvasRenderingContext2D; + private _selected_entry: PermissionEntry; + private _draw_requested: boolean; + private _draw_requested_full: boolean; + private _elements: PermissionGroup[]; + private _intersect_manager: InteractionManager; + private _permission_entry_map: { + [key: number]: PermissionEntry; + }; + mouse: { + x: number; + y: number; + }; + constructor(permissions: GroupedPermissions[]); + private _handle_repaint(mode: RepaintMode); + request_draw(full?: boolean); + draw(full?: boolean); + private initialize(); + intercept_manager(); + set_selected_entry(entry?: PermissionEntry); + permission_entries(): PermissionEntry[]; + collapse_all(); + expend_all(); + } +} + +/* File: shared/js/ui/server.ts */ +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_maxclients: number; + virtualserver_reserved_slots: number; + virtualserver_password: string; + virtualserver_flag_password: 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_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_max_upload_total_bandwidth: number; + virtualserver_upload_quota: number; + virtualserver_max_download_total_bandwidth: number; + virtualserver_download_quota: number; +} +declare interface ServerAddress { + host: string; + port: number; +} +declare class ServerEntry { + remote_address: ServerAddress; + channelTree: ChannelTree; + properties: ServerProperties; + private info_request_promise: Promise; + private info_request_promise_resolve: any; + private info_request_promise_reject: any; + lastInfoRequest: number; + nextInfoRequest: number; + private _htmlTag: JQuery; + constructor(tree, name, address: ServerAddress); + // @ts-ignore + get htmlTag(); + initializeListener(); + spawnContextMenu(x: number, y: number, on_close?: () => void); + updateVariables(is_self_notify: boolean, ...variables: { + key: string; + value: string; + }[]); + updateProperties(): Promise; + shouldUpdateProperties(): boolean; + calculateUptime(): number; +} + +/* File: shared/js/ui/view.ts */ +declare class ChannelTree { + client: ConnectionHandler; + server: ServerEntry; + channels: ChannelEntry[]; + clients: ClientEntry[]; + currently_selected: ClientEntry | ServerEntry | ChannelEntry | (ClientEntry | ServerEntry)[]; + currently_selected_context_callback: (event) => any; + readonly client_mover: ClientMover; + private _tag_container: JQuery; + private _tag_entries: JQuery; + private _tree_detached: boolean; + private _show_queries: boolean; + private channel_last?: ChannelEntry; + private channel_first?: ChannelEntry; + private selected_event?: Event; + constructor(client); + tag_tree(): JQuery; + hide_channel_tree(); + show_channel_tree(); + showContextMenu(x: number, y: number, on_close?: () => void); + initialiseHead(serverName: string, address: ServerAddress); + private __deleteAnimation(element: ChannelEntry | ClientEntry); + rootChannel(): ChannelEntry[]; + deleteChannel(channel: ChannelEntry); + insertChannel(channel: ChannelEntry); + findChannel(channelId: number): ChannelEntry | undefined; + find_channel_by_name(name: string, parent?: ChannelEntry, force_parent?: boolean): ChannelEntry | undefined; + moveChannel(channel: ChannelEntry, channel_previous: ChannelEntry, parent: ChannelEntry); + deleteClient(client: ClientEntry, animate_tag?: boolean); + registerClient(client: ClientEntry); + insertClient(client: ClientEntry, channel: ChannelEntry): ClientEntry; + moveClient(client: ClientEntry, channel: ChannelEntry); + findClient?(clientId: number): ClientEntry; + find_client_by_dbid?(client_dbid: number): ClientEntry; + find_client_by_unique_id?(unique_id: string): ClientEntry; + private static same_selected_type(a, b); + onSelect(entry?: ChannelEntry | ClientEntry | ServerEntry, enforce_single?: boolean, flag_shift?: boolean); + private callback_multiselect_channel(event); + private callback_multiselect_client(event); + clientsByGroup(group: Group): ClientEntry[]; + clientsByChannel(channel: ChannelEntry): ClientEntry[]; + reset(); + spawnCreateChannel(parent?: ChannelEntry); + handle_resized(); + private select_next_channel(channel: ChannelEntry, select_client: boolean); + handle_key_press(event: KeyboardEvent); + toggle_server_queries(flag: boolean); + get_first_channel?(): ChannelEntry; + unsubscribe_all_channels(subscribe_specified?: boolean); + subscribe_all_channels(); +} + +/* File: shared/js/utils/helpers.ts */ +declare namespace helpers { + export function hashPassword(password: string): Promise; +} +declare class LaterPromise extends Promise { + private _handle: Promise; + private _resolve: ($: T) => any; + private _reject: ($: any) => any; + private _time: number; + constructor(); + resolved(object: T); + rejected(reason); + function_rejected(); + time(); + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} +declare const copy_to_clipboard; + +/* File: shared/js/voice/RecorderBase.ts */ +declare namespace audio { + export namespace recorder { + export interface InputDevice { + unique_id: string; + name: string; + default_input: boolean; + supported: boolean; + sample_rate: number; + channels: number; + } + export enum InputConsumerType { + CALLBACK, + NODE, + NATIVE + } + export interface InputConsumer { + type: InputConsumerType; + } + export interface CallbackInputConsumer extends InputConsumer { + callback_audio?: (buffer: AudioBuffer) => any; + callback_buffer?: (buffer: Float32Array, samples: number, channels: number) => any; + } + export interface NodeInputConsumer extends InputConsumer { + callback_node: (source_node: AudioNode) => any; + callback_disconnect: (source_node: AudioNode) => any; + } + export namespace filter { + export enum Type { + THRESHOLD, + VOICE_LEVEL, + STATE + } + export interface Filter { + type: Type; + is_enabled(): boolean; + } + export interface MarginedFilter { + get_margin_frames(): number; + set_margin_frames(value: number); + } + export interface ThresholdFilter extends Filter, MarginedFilter { + get_threshold(): number; + set_threshold(value: number): Promise; + get_attack_smooth(): number; + get_release_smooth(): number; + set_attack_smooth(value: number); + set_release_smooth(value: number); + callback_level?: (value: number) => any; + } + export interface VoiceLevelFilter extends Filter, MarginedFilter { + get_level(): number; + } + export interface StateFilter extends Filter { + set_state(state: boolean): Promise; + is_active(): boolean; + } + } + export enum InputState { + PAUSED, + INITIALIZING, + RECORDING, + DRY + } + export interface AbstractInput { + callback_begin: () => any; + callback_end: () => any; + current_state(): InputState; + start(): Promise; + stop(): Promise; + current_device(): InputDevice | undefined; + set_device(device: InputDevice | undefined): Promise; + current_consumer(): InputConsumer | undefined; + set_consumer(consumer: InputConsumer): Promise; + get_filter(type: filter.Type): filter.Filter | undefined; + supports_filter(type: audio.recorder.filter.Type): boolean; + clear_filter(); + disable_filter(type: filter.Type); + enable_filter(type: filter.Type); + } + } +} + +/* File: shared/js/voice/RecorderProfile.ts */ +type VadType = "threshold" | "push_to_talk" | "active"; +declare interface RecorderProfileConfig { + version: number; + device_id: string | undefined; + vad_type: VadType; + vad_threshold: { + threshold: number; + }; + vad_push_to_talk: { + delay: number; + key_code: string; + key_ctrl: boolean; + key_windows: boolean; + key_shift: boolean; + key_alt: boolean; + }; +} +declare let default_recorder: RecorderProfile; +declare class RecorderProfile { + readonly name; + readonly volatile; + config: RecorderProfileConfig; + input: audio.recorder.AbstractInput; + current_handler: ConnectionHandler; + callback_support_change: () => any; + callback_start: () => any; + callback_stop: () => any; + callback_unmount: () => any; + record_supported: boolean; + private _ppt_hook: ppt.KeyHook; + private _ppt_timeout: NodeJS.Timer; + private _ppt_hook_registered: boolean; + constructor(name: string, volatile?: boolean); + initialize(): Promise; + private initialize_input(); + private load(); + private save(enforce?: boolean); + private reinitialize_filter(); + unmount(): Promise; + get_vad_type(); + set_vad_type(type: VadType); + get_vad_threshold(); + set_vad_threshold(value: number); + get_vad_ppt_key(): ppt.KeyDescriptor; + set_vad_ppt_key(key: ppt.KeyDescriptor); + get_vad_ppt_delay(); + set_vad_ppt_delay(value: number); + current_device(): audio.recorder.InputDevice | undefined; + set_device(device: audio.recorder.InputDevice | undefined): Promise; +} diff --git a/modules/tsconfig_renderer.json b/modules/tsconfig_renderer.json index fde629d..28ecbf9 100644 --- a/modules/tsconfig_renderer.json +++ b/modules/tsconfig_renderer.json @@ -8,10 +8,10 @@ "include": [ "./renderer", "./crash_handler", - "./shared", + "./shared/*.ts", "../native/*/exports/" ], "exclude": [ - "**/.copy_*.d.ts" + "./renderer/imports/.copy_*.d.ts" ] } \ No newline at end of file