From d575281a22aca4d1e3b8e23910acf65a302d626c Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sat, 20 Feb 2021 18:55:36 +0100 Subject: [PATCH] Added accedentally deleted imports --- .gitignore | 4 +- imports/shared-app/ConnectionHandler.d.ts | 199 ++++++++++ imports/shared-app/ConnectionManager.d.ts | 35 ++ imports/shared-app/KeyControl.d.ts | 18 + imports/shared-app/MessageFormatter.d.ts | 1 + imports/shared-app/PPTListener.d.ts | 147 +++++++ imports/shared-app/SelectedClientInfo.d.ts | 56 +++ imports/shared-app/SideBarManager.d.ts | 24 ++ imports/shared-app/audio/player.d.ts | 5 + imports/shared-app/audio/recorder.d.ts | 67 ++++ imports/shared-app/backend/NativeClient.d.ts | 15 + imports/shared-app/backend/WebClient.d.ts | 2 + imports/shared-app/backend/index.d.ts | 5 + imports/shared-app/bookmarks.d.ts | 48 +++ imports/shared-app/clientservice/index.d.ts | 3 + .../connection/AbstractCommandHandler.d.ts | 31 ++ .../shared-app/connection/CommandHandler.d.ts | 50 +++ .../shared-app/connection/CommandHelper.d.ts | 28 ++ .../shared-app/connection/ConnectionBase.d.ts | 65 ++++ .../connection/ConnectionFactory.d.ts | 8 + .../connection/DummyVoiceConnection.d.ts | 32 ++ imports/shared-app/connection/ErrorCode.d.ts | 161 ++++++++ .../connection/HandshakeHandler.d.ts | 22 ++ .../connection/PluginCmdHandler.d.ts | 29 ++ .../ServerConnectionDeclaration.d.ts | 73 ++++ .../shared-app/connection/ServerFeatures.d.ts | 35 ++ .../connection/VideoConnection.d.ts | 153 ++++++++ .../connection/VoiceConnection.d.ts | 71 ++++ .../shared-app/connection/rtc/Connection.d.ts | 130 +++++++ .../connection/rtc/Negotiation.d.ts | 58 +++ .../connection/rtc/RemoteTrack.d.ts | 68 ++++ .../shared-app/connection/rtc/SdpUtils.d.ts | 18 + .../connection/rtc/video/Connection.d.ts | 28 ++ .../connection/rtc/video/VideoClient.d.ts | 36 ++ .../shared-app/connectionlog/Definitions.d.ts | 266 +++++++++++++ .../connectionlog/DispatcherFocus.d.ts | 3 + .../DispatcherNotifications.d.ts | 5 + imports/shared-app/connectionlog/History.d.ts | 72 ++++ .../connectionlog/ServerEventLog.d.ts | 18 + .../conversations/AbstractConversion.d.ts | 128 ++++++ .../ChannelConversationManager.d.ts | 57 +++ .../PrivateConversationHistory.d.ts | 13 + .../PrivateConversationManager.d.ts | 67 ++++ imports/shared-app/crypto/asn1.d.ts | 83 ++++ imports/shared-app/crypto/crc32.d.ts | 7 + imports/shared-app/crypto/hex.d.ts | 1 + imports/shared-app/crypto/md5.d.ts | 1 + imports/shared-app/crypto/sha.d.ts | 2 + imports/shared-app/crypto/uid.d.ts | 1 + imports/shared-app/devel_main.d.ts | 1 + imports/shared-app/dns.d.ts | 15 + imports/shared-app/events.d.ts | 1 + .../events/ClientGlobalControlHandler.d.ts | 3 + imports/shared-app/events/GlobalEvents.d.ts | 39 ++ imports/shared-app/file/Avatars.d.ts | 64 +++ imports/shared-app/file/FileManager.d.ts | 70 ++++ imports/shared-app/file/Icons.d.ts | 61 +++ imports/shared-app/file/ImageCache.d.ts | 35 ++ imports/shared-app/file/LocalAvatars.d.ts | 25 ++ imports/shared-app/file/LocalIcons.d.ts | 2 + imports/shared-app/file/RemoteAvatars.d.ts | 1 + imports/shared-app/file/RemoteIcons.d.ts | 1 + imports/shared-app/file/Transfer.d.ts | 199 ++++++++++ imports/shared-app/i18n/country.d.ts | 1 + imports/shared-app/i18n/localize.d.ts | 76 ++++ imports/shared-app/ipc/BrowserIPC.d.ts | 49 +++ imports/shared-app/ipc/ConnectHandler.d.ts | 39 ++ imports/shared-app/log.d.ts | 64 +++ imports/shared-app/main.d.ts | 26 ++ imports/shared-app/media/Stream.d.ts | 11 + imports/shared-app/media/Video.d.ts | 39 ++ imports/shared-app/music/PlaylistManager.d.ts | 95 +++++ .../shared-app/permission/GroupManager.d.ts | 88 +++++ .../permission/PermissionManager.d.ts | 150 ++++++++ .../shared-app/permission/PermissionType.d.ts | 363 ++++++++++++++++++ .../profiles/ConnectionProfile.d.ts | 31 ++ imports/shared-app/profiles/Identity.d.ts | 34 ++ .../profiles/identities/NameIdentity.d.ts | 16 + .../profiles/identities/TeaForumIdentity.d.ts | 21 + .../identities/TeamSpeakIdentity.d.ts | 67 ++++ .../profiles/identities/teaspeak-forum.d.ts | 59 +++ imports/shared-app/proto.d.ts | 51 +++ imports/shared-app/settings.d.ts | 184 +++++++++ imports/shared-app/sound/Sounds.d.ts | 82 ++++ imports/shared-app/text/bbcode.d.ts | 14 + imports/shared-app/text/bbcode/EmojiUtil.d.ts | 1 + .../text/bbcode/InviteController.d.ts | 1 + .../text/bbcode/InviteDefinitions.d.ts | 18 + .../text/bbcode/InviteRenderer.d.ts | 6 + imports/shared-app/text/bbcode/emoji.d.ts | 1 + imports/shared-app/text/bbcode/highlight.d.ts | 1 + imports/shared-app/text/bbcode/image.d.ts | 2 + imports/shared-app/text/bbcode/renderer.d.ts | 13 + imports/shared-app/text/bbcode/url.d.ts | 6 + imports/shared-app/text/bbcode/youtube.d.ts | 6 + imports/shared-app/text/chat.d.ts | 1 + imports/shared-app/text/markdown.d.ts | 11 + imports/shared-app/tree/Channel.d.ts | 152 ++++++++ imports/shared-app/tree/ChannelTree.d.ts | 123 ++++++ imports/shared-app/tree/ChannelTreeEntry.d.ts | 16 + imports/shared-app/tree/Client.d.ts | 259 +++++++++++++ imports/shared-app/tree/EntryTagsHandler.d.ts | 1 + imports/shared-app/tree/Server.d.ts | 122 ++++++ imports/shared-app/ui/AppController.d.ts | 21 + imports/shared-app/ui/AppDefinitions.d.ts | 13 + imports/shared-app/ui/AppRenderer.d.ts | 18 + imports/shared-app/ui/ContextMenu.d.ts | 41 ++ .../ui/elements/ContextDivider.d.ts | 6 + .../shared-app/ui/elements/ContextMenu.d.ts | 44 +++ imports/shared-app/ui/elements/Modal.d.ts | 52 +++ imports/shared-app/ui/elements/NetGraph.d.ts | 65 ++++ imports/shared-app/ui/elements/Slider.d.ts | 12 + imports/shared-app/ui/elements/Tab.d.ts | 10 + imports/shared-app/ui/elements/Tooltip.d.ts | 10 + .../ui/frames/HostBannerController.d.ts | 13 + .../ui/frames/HostBannerDefinitions.d.ts | 18 + .../ui/frames/HostBannerRenderer.d.ts | 6 + .../ui/frames/SideBarController.d.ts | 23 ++ .../ui/frames/SideBarDefinitions.d.ts | 48 +++ .../shared-app/ui/frames/SideBarRenderer.d.ts | 9 + imports/shared-app/ui/frames/chat.d.ts | 38 ++ .../connection-handler-list/Controller.d.ts | 3 + .../connection-handler-list/Definitions.d.ts | 56 +++ .../connection-handler-list/Renderer.d.ts | 6 + .../ui/frames/control-bar/Button.d.ts | 25 ++ .../ui/frames/control-bar/Controller.d.ts | 39 ++ .../ui/frames/control-bar/Definitions.d.ts | 130 +++++++ .../ui/frames/control-bar/DropDown.d.ts | 18 + .../ui/frames/control-bar/Renderer.d.ts | 7 + .../shared-app/ui/frames/footer/Renderer.d.ts | 2 + .../ui/frames/footer/StatusController.d.ts | 23 ++ .../ui/frames/footer/StatusDefinitions.d.ts | 42 ++ .../ui/frames/footer/StatusRenderer.d.ts | 6 + .../shared-app/ui/frames/image_preview.d.ts | 4 + .../shared-app/ui/frames/log/Controller.d.ts | 12 + .../shared-app/ui/frames/log/Definitions.d.ts | 14 + .../shared-app/ui/frames/log/Renderer.d.ts | 6 + .../ui/frames/log/RendererEvent.d.ts | 5 + .../ui/frames/menu-bar/MainMenu.d.ts | 1 + .../shared-app/ui/frames/menu-bar/index.d.ts | 30 ++ .../side/AbstractConversationController.d.ts | 29 ++ .../side/AbstractConversationDefinitions.d.ts | 158 ++++++++ .../side/AbstractConversationRenderer.d.ts | 9 + .../ui/frames/side/ChannelBarController.d.ts | 22 ++ .../ui/frames/side/ChannelBarDefinitions.d.ts | 36 ++ .../ui/frames/side/ChannelBarRenderer.d.ts | 6 + .../side/ChannelConversationController.d.ts | 14 + .../side/ChannelConversationDefinitions.d.ts | 3 + .../side/ChannelDescriptionController.d.ts | 16 + .../side/ChannelDescriptionDefinitions.d.ts | 17 + .../side/ChannelDescriptionRenderer.d.ts | 6 + .../side/ChannelFileBrowserController.d.ts | 15 + .../side/ChannelFileBrowserDefinitions.d.ts | 9 + .../side/ChannelFileBrowserRenderer.d.ts | 6 + .../ui/frames/side/ClientInfoController.d.ts | 22 ++ .../ui/frames/side/ClientInfoDefinitions.d.ts | 96 +++++ .../ui/frames/side/ClientInfoRenderer.d.ts | 6 + .../ui/frames/side/HeaderController.d.ts | 26 ++ .../ui/frames/side/HeaderDefinitions.d.ts | 65 ++++ .../ui/frames/side/HeaderRenderer.d.ts | 7 + .../ui/frames/side/MusicBotController.d.ts | 29 ++ .../ui/frames/side/MusicBotDefinitions.d.ts | 56 +++ .../ui/frames/side/MusicBotRenderer.d.ts | 8 + .../frames/side/MusicPlaylistController.d.ts | 18 + .../frames/side/MusicPlaylistDefinitions.d.ts | 58 +++ .../ui/frames/side/MusicPlaylistRenderer.d.ts | 11 + .../side/PopoutConversationRenderer.d.ts | 12 + .../side/PrivateConversationController.d.ts | 25 ++ .../side/PrivateConversationDefinitions.d.ts | 32 ++ .../side/PrivateConversationRenderer.d.ts | 7 + .../ui/frames/video/Controller.d.ts | 10 + .../ui/frames/video/Definitions.d.ts | 162 ++++++++ .../shared-app/ui/frames/video/Renderer.d.ts | 7 + imports/shared-app/ui/htmltags.d.ts | 21 + imports/shared-app/ui/jsrender.d.ts | 1 + imports/shared-app/ui/modal/ModalAbout.d.ts | 1 + imports/shared-app/ui/modal/ModalAvatar.d.ts | 1 + .../shared-app/ui/modal/ModalAvatarList.d.ts | 3 + .../shared-app/ui/modal/ModalBanClient.d.ts | 12 + imports/shared-app/ui/modal/ModalBanList.d.ts | 24 ++ .../shared-app/ui/modal/ModalBookmarks.d.ts | 1 + .../ui/modal/ModalChangeLatency.d.ts | 3 + .../ui/modal/ModalChangeVolumeNew.d.ts | 22 ++ .../shared-app/ui/modal/ModalChannelInfo.d.ts | 2 + .../shared-app/ui/modal/ModalClientInfo.d.ts | 2 + imports/shared-app/ui/modal/ModalConnect.d.ts | 6 + .../ui/modal/ModalGroupAssignment.d.ts | 2 + .../shared-app/ui/modal/ModalGroupCreate.d.ts | 34 ++ .../ui/modal/ModalGroupPermissionCopy.d.ts | 30 ++ .../shared-app/ui/modal/ModalIconSelect.d.ts | 3 + .../shared-app/ui/modal/ModalIdentity.d.ts | 4 + imports/shared-app/ui/modal/ModalInvite.d.ts | 2 + .../shared-app/ui/modal/ModalKeySelect.d.ts | 2 + .../shared-app/ui/modal/ModalMusicManage.d.ts | 3 + .../shared-app/ui/modal/ModalNewcomer.d.ts | 16 + imports/shared-app/ui/modal/ModalPoke.d.ts | 11 + imports/shared-app/ui/modal/ModalQuery.d.ts | 6 + .../shared-app/ui/modal/ModalQueryManage.d.ts | 2 + .../shared-app/ui/modal/ModalServerEdit.d.ts | 2 + .../shared-app/ui/modal/ModalServerInfo.d.ts | 2 + .../ui/modal/ModalServerInfoBandwidth.d.ts | 9 + .../shared-app/ui/modal/ModalSettings.d.ts | 158 ++++++++ imports/shared-app/ui/modal/ModalYesNo.d.ts | 6 + .../ui/modal/channel-edit/Controller.d.ts | 9 + .../channel-edit/ControllerPermissions.d.ts | 11 + .../channel-edit/ControllerProperties.d.ts | 10 + .../channel-edit/ControllerValidation.d.ts | 7 + .../ui/modal/channel-edit/Definitions.d.ts | 146 +++++++ .../ui/modal/channel-edit/Renderer.d.ts | 13 + .../ui/modal/connect/Controller.d.ts | 19 + .../ui/modal/connect/Definitions.d.ts | 61 +++ .../shared-app/ui/modal/connect/Renderer.d.ts | 17 + .../ui/modal/css-editor/Controller.d.ts | 1 + .../ui/modal/css-editor/Definitions.d.ts | 41 ++ .../ui/modal/css-editor/Renderer.d.ts | 11 + .../ui/modal/echo-test/Controller.d.ts | 2 + .../ui/modal/echo-test/Definitions.d.ts | 45 +++ .../ui/modal/echo-test/Renderer.d.ts | 12 + .../global-settings-editor/Controller.d.ts | 1 + .../global-settings-editor/Definitions.d.ts | 40 ++ .../global-settings-editor/Renderer.d.ts | 12 + .../ui/modal/invite/Controller.d.ts | 3 + .../ui/modal/invite/Definitions.d.ts | 35 ++ .../shared-app/ui/modal/invite/Renderer.d.ts | 14 + .../permission/ModalPermissionEditor.d.ts | 192 +++++++++ .../ui/modal/permission/PermissionEditor.d.ts | 118 ++++++ .../permission/SenselessPermissions.d.ts | 6 + .../ui/modal/permission/TabHandler.d.ts | 12 + .../ui/modal/settings/Heighlight.d.ts | 17 + .../shared-app/ui/modal/settings/Keymap.d.ts | 28 ++ .../ui/modal/settings/Microphone.d.ts | 78 ++++ .../ui/modal/settings/MicrophoneRenderer.d.ts | 6 + .../ui/modal/settings/Notifications.d.ts | 2 + .../transfer/FileBrowserControllerRemote.d.ts | 4 + .../modal/transfer/FileBrowserRenderer.d.ts | 76 ++++ .../ui/modal/transfer/FileDefinitions.d.ts | 140 +++++++ .../ui/modal/transfer/FileTransferInfo.d.ts | 6 + .../transfer/FileTransferInfoController.d.ts | 4 + .../transfer/FileTransferInfoDefinitions.d.ts | 45 +++ .../ui/modal/transfer/ModalFileTransfer.d.ts | 1 + .../ui/modal/video-source/Controller.d.ts | 24 ++ .../ui/modal/video-source/Definitions.d.ts | 127 ++++++ .../ui/modal/video-source/Renderer.d.ts | 14 + .../ui/modal/whats-new/Controller.d.ts | 5 + .../ui/modal/whats-new/Renderer.d.ts | 11 + .../shared-app/ui/react-elements/Avatar.d.ts | 7 + .../shared-app/ui/react-elements/Button.d.ts | 19 + .../shared-app/ui/react-elements/ChatBox.d.ts | 36 ++ .../ui/react-elements/Checkbox.d.ts | 19 + .../ui/react-elements/ContextDivider.d.ts | 25 ++ .../ui/react-elements/Countdown.d.ts | 6 + .../ui/react-elements/ErrorBoundary.d.ts | 11 + .../ui/react-elements/HTMLRenderer.d.ts | 13 + .../shared-app/ui/react-elements/Helper.d.ts | 7 + .../shared-app/ui/react-elements/Icon.d.ts | 12 + .../shared-app/ui/react-elements/Icons.d.ts | 8 + .../ui/react-elements/InputField.d.ts | 169 ++++++++ .../ui/react-elements/LoadingDots.d.ts | 7 + .../ui/react-elements/ModalDefinitions.d.ts | 2 + .../ui/react-elements/ProgressBar.d.ts | 17 + .../ui/react-elements/RadioButton.d.ts | 8 + .../ui/react-elements/ReactComponentBase.d.ts | 21 + .../shared-app/ui/react-elements/Slider.d.ts | 39 ++ .../shared-app/ui/react-elements/Switch.d.ts | 21 + imports/shared-app/ui/react-elements/Tab.d.ts | 20 + .../shared-app/ui/react-elements/Table.d.ts | 56 +++ .../ui/react-elements/TimestampRenderer.d.ts | 4 + .../shared-app/ui/react-elements/Tooltip.d.ts | 26 ++ .../external-modal/Controller.d.ts | 26 ++ .../external-modal/IPCMessage.d.ts | 35 ++ .../external-modal/PopoutController.d.ts | 13 + .../external-modal/PopoutEntrypoint.d.ts | 2 + .../external-modal/PopoutRendererClient.d.ts | 16 + .../external-modal/PopoutRendererWeb.d.ts | 8 + .../react-elements/external-modal/index.d.ts | 7 + .../ui/react-elements/i18n/index.d.ts | 26 ++ .../internal-modal/Controller.d.ts | 23 ++ .../internal-modal/Renderer.d.ts | 23 ++ .../ui/react-elements/modal/Definitions.d.ts | 98 +++++ .../ui/react-elements/modal/Registry.d.ts | 8 + .../ui/react-elements/modal/index.d.ts | 11 + imports/shared-app/ui/tree/Controller.d.ts | 8 + imports/shared-app/ui/tree/Definitions.d.ts | 239 ++++++++++++ imports/shared-app/ui/tree/DragHelper.d.ts | 13 + imports/shared-app/ui/tree/EntryTags.d.ts | 15 + imports/shared-app/ui/tree/Renderer.d.ts | 7 + .../shared-app/ui/tree/RendererChannel.d.ts | 22 ++ .../shared-app/ui/tree/RendererClient.d.ts | 32 ++ .../ui/tree/RendererDataProvider.d.ts | 145 +++++++ .../shared-app/ui/tree/RendererServer.d.ts | 7 + .../shared-app/ui/tree/RendererTreeEntry.d.ts | 10 + imports/shared-app/ui/tree/RendererView.d.ts | 41 ++ .../shared-app/ui/tree/popout/Controller.d.ts | 15 + .../ui/tree/popout/Definitions.d.ts | 15 + .../ui/tree/popout/RendererModal.d.ts | 17 + imports/shared-app/ui/utils.d.ts | 5 + imports/shared-app/ui/utils/IpcVariable.d.ts | 26 ++ .../shared-app/ui/utils/LocalVariable.d.ts | 2 + imports/shared-app/ui/utils/Variable.d.ts | 80 ++++ imports/shared-app/update/ChangeLog.d.ts | 12 + imports/shared-app/update/Updater.d.ts | 8 + imports/shared-app/update/UpdaterWeb.d.ts | 1 + imports/shared-app/update/index.d.ts | 4 + imports/shared-app/utils/DateUtils.d.ts | 17 + imports/shared-app/utils/LaterPromise.d.ts | 24 ++ imports/shared-app/utils/TimeUtils.d.ts | 1 + imports/shared-app/utils/buffers.d.ts | 3 + imports/shared-app/utils/helpers.d.ts | 2 + .../shared-app/video-viewer/Controller.d.ts | 1 + .../shared-app/video-viewer/Definitions.d.ts | 75 ++++ imports/shared-app/video-viewer/Renderer.d.ts | 13 + .../shared-app/video-viewer/W2GPlugin.d.ts | 95 +++++ imports/shared-app/video/VideoSource.d.ts | 75 ++++ imports/shared-app/voice/Filter.d.ts | 36 ++ imports/shared-app/voice/RecorderBase.d.ts | 97 +++++ imports/shared-app/voice/RecorderProfile.d.ts | 68 ++++ imports/shared-app/voice/VoiceClient.d.ts | 4 + imports/shared-app/voice/VoicePlayer.d.ts | 57 +++ imports/shared-app/voice/VoiceWhisper.d.ts | 51 +++ .../vendor/TeaClientServices/src/Action.d.ts | 13 + .../TeaClientServices/src/ClientService.d.ts | 50 +++ .../src/ClientServiceInvite.d.ts | 39 ++ .../TeaClientServices/src/Connection.d.ts | 49 +++ .../TeaClientServices/src/GeoLocation.d.ts | 19 + .../vendor/TeaClientServices/src/Logging.d.ts | 10 + .../TeaClientServices/src/Messages.d.ts | 178 +++++++++ .../vendor/TeaClientServices/src/index.d.ts | 7 + imports/vendor/TeaEventBus/src/Events.d.ts | 38 ++ imports/vendor/TeaEventBus/src/Helper.d.ts | 8 + imports/vendor/TeaEventBus/src/Hook.d.ts | 7 + imports/vendor/TeaEventBus/src/Ipc.d.ts | 15 + imports/vendor/TeaEventBus/src/Registry.d.ts | 54 +++ imports/vendor/TeaEventBus/src/index.d.ts | 4 + imports/vendor/xbbcode/src/elements.d.ts | 27 ++ imports/vendor/xbbcode/src/parser.d.ts | 12 + imports/vendor/xbbcode/src/react.d.ts | 14 + imports/vendor/xbbcode/src/registry.d.ts | 22 ++ imports/vendor/xbbcode/src/renderer/base.d.ts | 22 ++ imports/vendor/xbbcode/src/renderer/html.d.ts | 8 + .../vendor/xbbcode/src/renderer/react.d.ts | 13 + imports/vendor/xbbcode/src/renderer/text.d.ts | 5 + 341 files changed, 11766 insertions(+), 2 deletions(-) create mode 100644 imports/shared-app/ConnectionHandler.d.ts create mode 100644 imports/shared-app/ConnectionManager.d.ts create mode 100644 imports/shared-app/KeyControl.d.ts create mode 100644 imports/shared-app/MessageFormatter.d.ts create mode 100644 imports/shared-app/PPTListener.d.ts create mode 100644 imports/shared-app/SelectedClientInfo.d.ts create mode 100644 imports/shared-app/SideBarManager.d.ts create mode 100644 imports/shared-app/audio/player.d.ts create mode 100644 imports/shared-app/audio/recorder.d.ts create mode 100644 imports/shared-app/backend/NativeClient.d.ts create mode 100644 imports/shared-app/backend/WebClient.d.ts create mode 100644 imports/shared-app/backend/index.d.ts create mode 100644 imports/shared-app/bookmarks.d.ts create mode 100644 imports/shared-app/clientservice/index.d.ts create mode 100644 imports/shared-app/connection/AbstractCommandHandler.d.ts create mode 100644 imports/shared-app/connection/CommandHandler.d.ts create mode 100644 imports/shared-app/connection/CommandHelper.d.ts create mode 100644 imports/shared-app/connection/ConnectionBase.d.ts create mode 100644 imports/shared-app/connection/ConnectionFactory.d.ts create mode 100644 imports/shared-app/connection/DummyVoiceConnection.d.ts create mode 100644 imports/shared-app/connection/ErrorCode.d.ts create mode 100644 imports/shared-app/connection/HandshakeHandler.d.ts create mode 100644 imports/shared-app/connection/PluginCmdHandler.d.ts create mode 100644 imports/shared-app/connection/ServerConnectionDeclaration.d.ts create mode 100644 imports/shared-app/connection/ServerFeatures.d.ts create mode 100644 imports/shared-app/connection/VideoConnection.d.ts create mode 100644 imports/shared-app/connection/VoiceConnection.d.ts create mode 100644 imports/shared-app/connection/rtc/Connection.d.ts create mode 100644 imports/shared-app/connection/rtc/Negotiation.d.ts create mode 100644 imports/shared-app/connection/rtc/RemoteTrack.d.ts create mode 100644 imports/shared-app/connection/rtc/SdpUtils.d.ts create mode 100644 imports/shared-app/connection/rtc/video/Connection.d.ts create mode 100644 imports/shared-app/connection/rtc/video/VideoClient.d.ts create mode 100644 imports/shared-app/connectionlog/Definitions.d.ts create mode 100644 imports/shared-app/connectionlog/DispatcherFocus.d.ts create mode 100644 imports/shared-app/connectionlog/DispatcherNotifications.d.ts create mode 100644 imports/shared-app/connectionlog/History.d.ts create mode 100644 imports/shared-app/connectionlog/ServerEventLog.d.ts create mode 100644 imports/shared-app/conversations/AbstractConversion.d.ts create mode 100644 imports/shared-app/conversations/ChannelConversationManager.d.ts create mode 100644 imports/shared-app/conversations/PrivateConversationHistory.d.ts create mode 100644 imports/shared-app/conversations/PrivateConversationManager.d.ts create mode 100644 imports/shared-app/crypto/asn1.d.ts create mode 100644 imports/shared-app/crypto/crc32.d.ts create mode 100644 imports/shared-app/crypto/hex.d.ts create mode 100644 imports/shared-app/crypto/md5.d.ts create mode 100644 imports/shared-app/crypto/sha.d.ts create mode 100644 imports/shared-app/crypto/uid.d.ts create mode 100644 imports/shared-app/devel_main.d.ts create mode 100644 imports/shared-app/dns.d.ts create mode 100644 imports/shared-app/events.d.ts create mode 100644 imports/shared-app/events/ClientGlobalControlHandler.d.ts create mode 100644 imports/shared-app/events/GlobalEvents.d.ts create mode 100644 imports/shared-app/file/Avatars.d.ts create mode 100644 imports/shared-app/file/FileManager.d.ts create mode 100644 imports/shared-app/file/Icons.d.ts create mode 100644 imports/shared-app/file/ImageCache.d.ts create mode 100644 imports/shared-app/file/LocalAvatars.d.ts create mode 100644 imports/shared-app/file/LocalIcons.d.ts create mode 100644 imports/shared-app/file/RemoteAvatars.d.ts create mode 100644 imports/shared-app/file/RemoteIcons.d.ts create mode 100644 imports/shared-app/file/Transfer.d.ts create mode 100644 imports/shared-app/i18n/country.d.ts create mode 100644 imports/shared-app/i18n/localize.d.ts create mode 100644 imports/shared-app/ipc/BrowserIPC.d.ts create mode 100644 imports/shared-app/ipc/ConnectHandler.d.ts create mode 100644 imports/shared-app/log.d.ts create mode 100644 imports/shared-app/main.d.ts create mode 100644 imports/shared-app/media/Stream.d.ts create mode 100644 imports/shared-app/media/Video.d.ts create mode 100644 imports/shared-app/music/PlaylistManager.d.ts create mode 100644 imports/shared-app/permission/GroupManager.d.ts create mode 100644 imports/shared-app/permission/PermissionManager.d.ts create mode 100644 imports/shared-app/permission/PermissionType.d.ts create mode 100644 imports/shared-app/profiles/ConnectionProfile.d.ts create mode 100644 imports/shared-app/profiles/Identity.d.ts create mode 100644 imports/shared-app/profiles/identities/NameIdentity.d.ts create mode 100644 imports/shared-app/profiles/identities/TeaForumIdentity.d.ts create mode 100644 imports/shared-app/profiles/identities/TeamSpeakIdentity.d.ts create mode 100644 imports/shared-app/profiles/identities/teaspeak-forum.d.ts create mode 100644 imports/shared-app/proto.d.ts create mode 100644 imports/shared-app/settings.d.ts create mode 100644 imports/shared-app/sound/Sounds.d.ts create mode 100644 imports/shared-app/text/bbcode.d.ts create mode 100644 imports/shared-app/text/bbcode/EmojiUtil.d.ts create mode 100644 imports/shared-app/text/bbcode/InviteController.d.ts create mode 100644 imports/shared-app/text/bbcode/InviteDefinitions.d.ts create mode 100644 imports/shared-app/text/bbcode/InviteRenderer.d.ts create mode 100644 imports/shared-app/text/bbcode/emoji.d.ts create mode 100644 imports/shared-app/text/bbcode/highlight.d.ts create mode 100644 imports/shared-app/text/bbcode/image.d.ts create mode 100644 imports/shared-app/text/bbcode/renderer.d.ts create mode 100644 imports/shared-app/text/bbcode/url.d.ts create mode 100644 imports/shared-app/text/bbcode/youtube.d.ts create mode 100644 imports/shared-app/text/chat.d.ts create mode 100644 imports/shared-app/text/markdown.d.ts create mode 100644 imports/shared-app/tree/Channel.d.ts create mode 100644 imports/shared-app/tree/ChannelTree.d.ts create mode 100644 imports/shared-app/tree/ChannelTreeEntry.d.ts create mode 100644 imports/shared-app/tree/Client.d.ts create mode 100644 imports/shared-app/tree/EntryTagsHandler.d.ts create mode 100644 imports/shared-app/tree/Server.d.ts create mode 100644 imports/shared-app/ui/AppController.d.ts create mode 100644 imports/shared-app/ui/AppDefinitions.d.ts create mode 100644 imports/shared-app/ui/AppRenderer.d.ts create mode 100644 imports/shared-app/ui/ContextMenu.d.ts create mode 100644 imports/shared-app/ui/elements/ContextDivider.d.ts create mode 100644 imports/shared-app/ui/elements/ContextMenu.d.ts create mode 100644 imports/shared-app/ui/elements/Modal.d.ts create mode 100644 imports/shared-app/ui/elements/NetGraph.d.ts create mode 100644 imports/shared-app/ui/elements/Slider.d.ts create mode 100644 imports/shared-app/ui/elements/Tab.d.ts create mode 100644 imports/shared-app/ui/elements/Tooltip.d.ts create mode 100644 imports/shared-app/ui/frames/HostBannerController.d.ts create mode 100644 imports/shared-app/ui/frames/HostBannerDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/HostBannerRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/SideBarController.d.ts create mode 100644 imports/shared-app/ui/frames/SideBarDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/SideBarRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/chat.d.ts create mode 100644 imports/shared-app/ui/frames/connection-handler-list/Controller.d.ts create mode 100644 imports/shared-app/ui/frames/connection-handler-list/Definitions.d.ts create mode 100644 imports/shared-app/ui/frames/connection-handler-list/Renderer.d.ts create mode 100644 imports/shared-app/ui/frames/control-bar/Button.d.ts create mode 100644 imports/shared-app/ui/frames/control-bar/Controller.d.ts create mode 100644 imports/shared-app/ui/frames/control-bar/Definitions.d.ts create mode 100644 imports/shared-app/ui/frames/control-bar/DropDown.d.ts create mode 100644 imports/shared-app/ui/frames/control-bar/Renderer.d.ts create mode 100644 imports/shared-app/ui/frames/footer/Renderer.d.ts create mode 100644 imports/shared-app/ui/frames/footer/StatusController.d.ts create mode 100644 imports/shared-app/ui/frames/footer/StatusDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/footer/StatusRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/image_preview.d.ts create mode 100644 imports/shared-app/ui/frames/log/Controller.d.ts create mode 100644 imports/shared-app/ui/frames/log/Definitions.d.ts create mode 100644 imports/shared-app/ui/frames/log/Renderer.d.ts create mode 100644 imports/shared-app/ui/frames/log/RendererEvent.d.ts create mode 100644 imports/shared-app/ui/frames/menu-bar/MainMenu.d.ts create mode 100644 imports/shared-app/ui/frames/menu-bar/index.d.ts create mode 100644 imports/shared-app/ui/frames/side/AbstractConversationController.d.ts create mode 100644 imports/shared-app/ui/frames/side/AbstractConversationDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/AbstractConversationRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelBarController.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelBarDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelBarRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelConversationController.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelConversationDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelDescriptionController.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelDescriptionDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelDescriptionRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelFileBrowserController.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelFileBrowserDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/ChannelFileBrowserRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/ClientInfoController.d.ts create mode 100644 imports/shared-app/ui/frames/side/ClientInfoDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/ClientInfoRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/HeaderController.d.ts create mode 100644 imports/shared-app/ui/frames/side/HeaderDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/HeaderRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicBotController.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicBotDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicBotRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicPlaylistController.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicPlaylistDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/MusicPlaylistRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/PopoutConversationRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/side/PrivateConversationController.d.ts create mode 100644 imports/shared-app/ui/frames/side/PrivateConversationDefinitions.d.ts create mode 100644 imports/shared-app/ui/frames/side/PrivateConversationRenderer.d.ts create mode 100644 imports/shared-app/ui/frames/video/Controller.d.ts create mode 100644 imports/shared-app/ui/frames/video/Definitions.d.ts create mode 100644 imports/shared-app/ui/frames/video/Renderer.d.ts create mode 100644 imports/shared-app/ui/htmltags.d.ts create mode 100644 imports/shared-app/ui/jsrender.d.ts create mode 100644 imports/shared-app/ui/modal/ModalAbout.d.ts create mode 100644 imports/shared-app/ui/modal/ModalAvatar.d.ts create mode 100644 imports/shared-app/ui/modal/ModalAvatarList.d.ts create mode 100644 imports/shared-app/ui/modal/ModalBanClient.d.ts create mode 100644 imports/shared-app/ui/modal/ModalBanList.d.ts create mode 100644 imports/shared-app/ui/modal/ModalBookmarks.d.ts create mode 100644 imports/shared-app/ui/modal/ModalChangeLatency.d.ts create mode 100644 imports/shared-app/ui/modal/ModalChangeVolumeNew.d.ts create mode 100644 imports/shared-app/ui/modal/ModalChannelInfo.d.ts create mode 100644 imports/shared-app/ui/modal/ModalClientInfo.d.ts create mode 100644 imports/shared-app/ui/modal/ModalConnect.d.ts create mode 100644 imports/shared-app/ui/modal/ModalGroupAssignment.d.ts create mode 100644 imports/shared-app/ui/modal/ModalGroupCreate.d.ts create mode 100644 imports/shared-app/ui/modal/ModalGroupPermissionCopy.d.ts create mode 100644 imports/shared-app/ui/modal/ModalIconSelect.d.ts create mode 100644 imports/shared-app/ui/modal/ModalIdentity.d.ts create mode 100644 imports/shared-app/ui/modal/ModalInvite.d.ts create mode 100644 imports/shared-app/ui/modal/ModalKeySelect.d.ts create mode 100644 imports/shared-app/ui/modal/ModalMusicManage.d.ts create mode 100644 imports/shared-app/ui/modal/ModalNewcomer.d.ts create mode 100644 imports/shared-app/ui/modal/ModalPoke.d.ts create mode 100644 imports/shared-app/ui/modal/ModalQuery.d.ts create mode 100644 imports/shared-app/ui/modal/ModalQueryManage.d.ts create mode 100644 imports/shared-app/ui/modal/ModalServerEdit.d.ts create mode 100644 imports/shared-app/ui/modal/ModalServerInfo.d.ts create mode 100644 imports/shared-app/ui/modal/ModalServerInfoBandwidth.d.ts create mode 100644 imports/shared-app/ui/modal/ModalSettings.d.ts create mode 100644 imports/shared-app/ui/modal/ModalYesNo.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/ControllerPermissions.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/ControllerProperties.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/ControllerValidation.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/channel-edit/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/connect/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/connect/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/connect/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/css-editor/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/css-editor/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/css-editor/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/echo-test/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/echo-test/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/echo-test/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/global-settings-editor/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/global-settings-editor/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/global-settings-editor/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/invite/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/invite/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/invite/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/permission/ModalPermissionEditor.d.ts create mode 100644 imports/shared-app/ui/modal/permission/PermissionEditor.d.ts create mode 100644 imports/shared-app/ui/modal/permission/SenselessPermissions.d.ts create mode 100644 imports/shared-app/ui/modal/permission/TabHandler.d.ts create mode 100644 imports/shared-app/ui/modal/settings/Heighlight.d.ts create mode 100644 imports/shared-app/ui/modal/settings/Keymap.d.ts create mode 100644 imports/shared-app/ui/modal/settings/Microphone.d.ts create mode 100644 imports/shared-app/ui/modal/settings/MicrophoneRenderer.d.ts create mode 100644 imports/shared-app/ui/modal/settings/Notifications.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileBrowserControllerRemote.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileBrowserRenderer.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileDefinitions.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileTransferInfo.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileTransferInfoController.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/FileTransferInfoDefinitions.d.ts create mode 100644 imports/shared-app/ui/modal/transfer/ModalFileTransfer.d.ts create mode 100644 imports/shared-app/ui/modal/video-source/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/video-source/Definitions.d.ts create mode 100644 imports/shared-app/ui/modal/video-source/Renderer.d.ts create mode 100644 imports/shared-app/ui/modal/whats-new/Controller.d.ts create mode 100644 imports/shared-app/ui/modal/whats-new/Renderer.d.ts create mode 100644 imports/shared-app/ui/react-elements/Avatar.d.ts create mode 100644 imports/shared-app/ui/react-elements/Button.d.ts create mode 100644 imports/shared-app/ui/react-elements/ChatBox.d.ts create mode 100644 imports/shared-app/ui/react-elements/Checkbox.d.ts create mode 100644 imports/shared-app/ui/react-elements/ContextDivider.d.ts create mode 100644 imports/shared-app/ui/react-elements/Countdown.d.ts create mode 100644 imports/shared-app/ui/react-elements/ErrorBoundary.d.ts create mode 100644 imports/shared-app/ui/react-elements/HTMLRenderer.d.ts create mode 100644 imports/shared-app/ui/react-elements/Helper.d.ts create mode 100644 imports/shared-app/ui/react-elements/Icon.d.ts create mode 100644 imports/shared-app/ui/react-elements/Icons.d.ts create mode 100644 imports/shared-app/ui/react-elements/InputField.d.ts create mode 100644 imports/shared-app/ui/react-elements/LoadingDots.d.ts create mode 100644 imports/shared-app/ui/react-elements/ModalDefinitions.d.ts create mode 100644 imports/shared-app/ui/react-elements/ProgressBar.d.ts create mode 100644 imports/shared-app/ui/react-elements/RadioButton.d.ts create mode 100644 imports/shared-app/ui/react-elements/ReactComponentBase.d.ts create mode 100644 imports/shared-app/ui/react-elements/Slider.d.ts create mode 100644 imports/shared-app/ui/react-elements/Switch.d.ts create mode 100644 imports/shared-app/ui/react-elements/Tab.d.ts create mode 100644 imports/shared-app/ui/react-elements/Table.d.ts create mode 100644 imports/shared-app/ui/react-elements/TimestampRenderer.d.ts create mode 100644 imports/shared-app/ui/react-elements/Tooltip.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/Controller.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/IPCMessage.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/PopoutController.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/PopoutEntrypoint.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/PopoutRendererClient.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/PopoutRendererWeb.d.ts create mode 100644 imports/shared-app/ui/react-elements/external-modal/index.d.ts create mode 100644 imports/shared-app/ui/react-elements/i18n/index.d.ts create mode 100644 imports/shared-app/ui/react-elements/internal-modal/Controller.d.ts create mode 100644 imports/shared-app/ui/react-elements/internal-modal/Renderer.d.ts create mode 100644 imports/shared-app/ui/react-elements/modal/Definitions.d.ts create mode 100644 imports/shared-app/ui/react-elements/modal/Registry.d.ts create mode 100644 imports/shared-app/ui/react-elements/modal/index.d.ts create mode 100644 imports/shared-app/ui/tree/Controller.d.ts create mode 100644 imports/shared-app/ui/tree/Definitions.d.ts create mode 100644 imports/shared-app/ui/tree/DragHelper.d.ts create mode 100644 imports/shared-app/ui/tree/EntryTags.d.ts create mode 100644 imports/shared-app/ui/tree/Renderer.d.ts create mode 100644 imports/shared-app/ui/tree/RendererChannel.d.ts create mode 100644 imports/shared-app/ui/tree/RendererClient.d.ts create mode 100644 imports/shared-app/ui/tree/RendererDataProvider.d.ts create mode 100644 imports/shared-app/ui/tree/RendererServer.d.ts create mode 100644 imports/shared-app/ui/tree/RendererTreeEntry.d.ts create mode 100644 imports/shared-app/ui/tree/RendererView.d.ts create mode 100644 imports/shared-app/ui/tree/popout/Controller.d.ts create mode 100644 imports/shared-app/ui/tree/popout/Definitions.d.ts create mode 100644 imports/shared-app/ui/tree/popout/RendererModal.d.ts create mode 100644 imports/shared-app/ui/utils.d.ts create mode 100644 imports/shared-app/ui/utils/IpcVariable.d.ts create mode 100644 imports/shared-app/ui/utils/LocalVariable.d.ts create mode 100644 imports/shared-app/ui/utils/Variable.d.ts create mode 100644 imports/shared-app/update/ChangeLog.d.ts create mode 100644 imports/shared-app/update/Updater.d.ts create mode 100644 imports/shared-app/update/UpdaterWeb.d.ts create mode 100644 imports/shared-app/update/index.d.ts create mode 100644 imports/shared-app/utils/DateUtils.d.ts create mode 100644 imports/shared-app/utils/LaterPromise.d.ts create mode 100644 imports/shared-app/utils/TimeUtils.d.ts create mode 100644 imports/shared-app/utils/buffers.d.ts create mode 100644 imports/shared-app/utils/helpers.d.ts create mode 100644 imports/shared-app/video-viewer/Controller.d.ts create mode 100644 imports/shared-app/video-viewer/Definitions.d.ts create mode 100644 imports/shared-app/video-viewer/Renderer.d.ts create mode 100644 imports/shared-app/video-viewer/W2GPlugin.d.ts create mode 100644 imports/shared-app/video/VideoSource.d.ts create mode 100644 imports/shared-app/voice/Filter.d.ts create mode 100644 imports/shared-app/voice/RecorderBase.d.ts create mode 100644 imports/shared-app/voice/RecorderProfile.d.ts create mode 100644 imports/shared-app/voice/VoiceClient.d.ts create mode 100644 imports/shared-app/voice/VoicePlayer.d.ts create mode 100644 imports/shared-app/voice/VoiceWhisper.d.ts create mode 100644 imports/vendor/TeaClientServices/src/Action.d.ts create mode 100644 imports/vendor/TeaClientServices/src/ClientService.d.ts create mode 100644 imports/vendor/TeaClientServices/src/ClientServiceInvite.d.ts create mode 100644 imports/vendor/TeaClientServices/src/Connection.d.ts create mode 100644 imports/vendor/TeaClientServices/src/GeoLocation.d.ts create mode 100644 imports/vendor/TeaClientServices/src/Logging.d.ts create mode 100644 imports/vendor/TeaClientServices/src/Messages.d.ts create mode 100644 imports/vendor/TeaClientServices/src/index.d.ts create mode 100644 imports/vendor/TeaEventBus/src/Events.d.ts create mode 100644 imports/vendor/TeaEventBus/src/Helper.d.ts create mode 100644 imports/vendor/TeaEventBus/src/Hook.d.ts create mode 100644 imports/vendor/TeaEventBus/src/Ipc.d.ts create mode 100644 imports/vendor/TeaEventBus/src/Registry.d.ts create mode 100644 imports/vendor/TeaEventBus/src/index.d.ts create mode 100644 imports/vendor/xbbcode/src/elements.d.ts create mode 100644 imports/vendor/xbbcode/src/parser.d.ts create mode 100644 imports/vendor/xbbcode/src/react.d.ts create mode 100644 imports/vendor/xbbcode/src/registry.d.ts create mode 100644 imports/vendor/xbbcode/src/renderer/base.d.ts create mode 100644 imports/vendor/xbbcode/src/renderer/html.d.ts create mode 100644 imports/vendor/xbbcode/src/renderer/react.d.ts create mode 100644 imports/vendor/xbbcode/src/renderer/text.d.ts diff --git a/.gitignore b/.gitignore index f7016d5..1751076 100644 --- a/.gitignore +++ b/.gitignore @@ -14,8 +14,8 @@ updater/postzip/TeaClient-linux.tar.gz .deploy_secret -**/*.d.ts +modules/**/*.d.ts !/imports/ !/modules/renderer/imports/.copy_*.d.ts -npm-debug.log \ No newline at end of file +npm-debug.log diff --git a/imports/shared-app/ConnectionHandler.d.ts b/imports/shared-app/ConnectionHandler.d.ts new file mode 100644 index 0000000..d869b51 --- /dev/null +++ b/imports/shared-app/ConnectionHandler.d.ts @@ -0,0 +1,199 @@ +import { AbstractServerConnection } from "./connection/ConnectionBase"; +import { PermissionManager } from "./permission/PermissionManager"; +import { GroupManager } from "./permission/GroupManager"; +import { ServerSettings } from "./settings"; +import { SoundManager } from "./sound/Sounds"; +import { ConnectionProfile } from "./profiles/ConnectionProfile"; +import { RecorderProfile } from "./voice/RecorderProfile"; +import { Registry } from "./events"; +import { FileManager } from "./file/FileManager"; +import { PluginCmdRegistry } from "./connection/PluginCmdHandler"; +import { ServerFeatures } from "./connection/ServerFeatures"; +import { ChannelTree } from "./tree/ChannelTree"; +import { LocalClientEntry } from "./tree/Client"; +import { ChannelVideoFrame } from "tc-shared/ui/frames/video/Controller"; +import { ChannelConversationManager } from "./conversations/ChannelConversationManager"; +import { PrivateConversationManager } from "tc-shared/conversations/PrivateConversationManager"; +import { SelectedClientInfo } from "./SelectedClientInfo"; +import { SideBarManager } from "tc-shared/SideBarManager"; +import { ServerEventLog } from "tc-shared/connectionlog/ServerEventLog"; +import { PlaylistManager } from "tc-shared/music/PlaylistManager"; +import { ConnectParameters } from "tc-shared/ui/modal/connect/Controller"; +export declare enum InputHardwareState { + MISSING = 0, + START_FAILED = 1, + VALID = 2 +} +export declare enum DisconnectReason { + HANDLER_DESTROYED = 0, + REQUESTED = 1, + DNS_FAILED = 2, + CONNECT_FAILURE = 3, + CONNECTION_CLOSED = 4, + CONNECTION_FATAL_ERROR = 5, + CONNECTION_PING_TIMEOUT = 6, + CLIENT_KICKED = 7, + CLIENT_BANNED = 8, + HANDSHAKE_FAILED = 9, + HANDSHAKE_TEAMSPEAK_REQUIRED = 10, + HANDSHAKE_BANNED = 11, + SERVER_CLOSED = 12, + SERVER_REQUIRES_PASSWORD = 13, + SERVER_HOSTMESSAGE = 14, + IDENTITY_TOO_LOW = 15, + UNKNOWN = 16 +} +export declare enum ConnectionState { + UNCONNECTED = 0, + CONNECTING = 1, + INITIALISING = 2, + AUTHENTICATING = 3, + CONNECTED = 4, + DISCONNECTING = 5 +} +export declare namespace ConnectionState { + function socketConnected(state: ConnectionState): boolean; + function fullyConnected(state: ConnectionState): boolean; +} +export declare enum ViewReasonId { + VREASON_USER_ACTION = 0, + VREASON_MOVED = 1, + VREASON_SYSTEM = 2, + VREASON_TIMEOUT = 3, + VREASON_CHANNEL_KICK = 4, + VREASON_SERVER_KICK = 5, + VREASON_BAN = 6, + VREASON_SERVER_STOPPED = 7, + VREASON_SERVER_LEFT = 8, + VREASON_CHANNEL_UPDATED = 9, + VREASON_EDITED = 10, + VREASON_SERVER_SHUTDOWN = 11 +} +export interface LocalClientStatus { + input_muted: boolean; + output_muted: boolean; + lastChannelCodecWarned: number; + away: boolean | string; + channel_subscribe_all: boolean; + queries_visible: boolean; +} +export interface ConnectParametersOld { + nickname?: string; + channel?: { + target: string | number; + password?: string; + }; + token?: string; + password?: { + password: string; + hashed: boolean; + }; + auto_reconnect_attempt?: boolean; +} +export declare class ConnectionHandler { + readonly handlerId: string; + private readonly events_; + channelTree: ChannelTree; + connection_state: ConnectionState; + serverConnection: AbstractServerConnection; + currentConnectId: number; + fileManager: FileManager; + permissions: PermissionManager; + groups: GroupManager; + video_frame: ChannelVideoFrame; + settings: ServerSettings; + sound: SoundManager; + serverFeatures: ServerFeatures; + private sideBar; + private playlistManager; + private channelConversations; + private privateConversations; + private clientInfoManager; + private localClientId; + private localClient; + private autoReconnectTimer; + private autoReconnectAttempt; + private connectAttemptId; + private echoTestRunning; + private pluginCmdRegistry; + private client_status; + private clientStatusSync; + private inputHardwareState; + private listenerRecorderInputDeviceChanged; + log: ServerEventLog; + constructor(); + initialize_client_state(source?: ConnectionHandler): void; + events(): Registry; + startConnectionNew(parameters: ConnectParameters, autoReconnectAttempt: boolean): Promise; + startConnection(addr: string, profile: ConnectionProfile, user_action: boolean, parameters: ConnectParametersOld): Promise; + disconnectFromServer(reason?: string): Promise; + getClient(): LocalClientEntry; + getClientId(): number; + getPrivateConversations(): PrivateConversationManager; + getChannelConversations(): ChannelConversationManager; + getSelectedClientInfo(): SelectedClientInfo; + getSideBar(): SideBarManager; + getPlaylistManager(): PlaylistManager; + initializeLocalClient(clientId: number, acceptedName: string): void; + getServerConnection(): AbstractServerConnection; + private handleConnectionStateChanged; + get connected(): boolean; + private generate_ssl_certificate_accept; + private _certificate_modal; + handleDisconnect(type: DisconnectReason, data?: any): void; + cancelAutoReconnect(log_event: boolean): void; + private on_connection_state_changed; + private updateVoiceStatus; + private lastRecordErrorPopup; + update_voice_status(): void; + sync_status_with_server(): void; + acquireInputHardware(): Promise; + startVoiceRecorder(notifyError: boolean): Promise<{ + state: "success" | "no-input"; + } | { + state: "error"; + message: string; + }>; + getVoiceRecorder(): RecorderProfile | undefined; + reconnect_properties(profile?: ConnectionProfile): ConnectParametersOld; + update_avatar(): void; + private initializeWhisperSession; + destroy(): void; + setMicrophoneMuted(muted: boolean, dontPlaySound?: boolean): void; + toggleMicrophone(): void; + isMicrophoneMuted(): boolean; + isMicrophoneDisabled(): boolean; + setSpeakerMuted(muted: boolean, dontPlaySound?: boolean): void; + toggleSpeakerMuted(): void; + isSpeakerMuted(): boolean; + isSpeakerDisabled(): boolean; + setSubscribeToAllChannels(flag: boolean): void; + isSubscribeToAllChannels(): boolean; + setAway(state: boolean | string): void; + private doSetAway; + toggleAway(): void; + isAway(): boolean; + setQueriesShown(flag: boolean): void; + areQueriesShown(): boolean; + getInputHardwareState(): InputHardwareState; + private setInputHardwareState; + hasOutputHardware(): boolean; + getPluginCmdRegistry(): PluginCmdRegistry; + startEchoTest(): Promise; + stopEchoTest(): void; + getCurrentServerUniqueId(): string; +} +export declare type ConnectionStateUpdateType = "microphone" | "speaker" | "away" | "subscribe" | "query"; +export interface ConnectionEvents { + notify_state_updated: { + state: ConnectionStateUpdateType; + }; + notify_connection_state_changed: { + oldState: ConnectionState; + newState: ConnectionState; + }; + notify_visibility_changed: { + visible: boolean; + }; + notify_handler_initialized: {}; +} diff --git a/imports/shared-app/ConnectionManager.d.ts b/imports/shared-app/ConnectionManager.d.ts new file mode 100644 index 0000000..277598f --- /dev/null +++ b/imports/shared-app/ConnectionManager.d.ts @@ -0,0 +1,35 @@ +import { ConnectionHandler } from "./ConnectionHandler"; +import { Registry } from "./events"; +export interface ConnectionManagerEvents { + notify_handler_created: { + handlerId: string; + handler: ConnectionHandler; + }; + notify_active_handler_changed: { + oldHandler: ConnectionHandler | undefined; + newHandler: ConnectionHandler | undefined; + oldHandlerId: string | undefined; + newHandlerId: string | undefined; + }; + notify_handler_deleted: { + handlerId: string; + handler: ConnectionHandler; + }; + notify_handler_order_changed: {}; +} +export declare class ConnectionManager { + private readonly events_; + private connectionHandlers; + private activeConnectionHandler; + constructor(); + events(): Registry; + spawnConnectionHandler(): ConnectionHandler; + destroyConnectionHandler(handler: ConnectionHandler): void; + setActiveConnectionHandler(handler: ConnectionHandler): void; + private doSetActiveConnectionHandler; + swapHandlerOrder(handlerA: ConnectionHandler, handlerB: ConnectionHandler): void; + findConnection(handlerId: string): ConnectionHandler | undefined; + getActiveConnectionHandler(): ConnectionHandler | undefined; + getAllConnectionHandlers(): ConnectionHandler[]; +} +export declare let server_connections: ConnectionManager; diff --git a/imports/shared-app/KeyControl.d.ts b/imports/shared-app/KeyControl.d.ts new file mode 100644 index 0000000..08359bb --- /dev/null +++ b/imports/shared-app/KeyControl.d.ts @@ -0,0 +1,18 @@ +import { KeyDescriptor } from "./PPTListener"; +export interface KeyControl { + category: string; + description: string; + handler: () => void; + icon: string; +} +export declare const TypeCategories: { + [key: string]: { + name: string; + }; +}; +export declare const KeyTypes: { + [key: string]: KeyControl; +}; +export declare function initializeKeyControl(): void; +export declare function setKey(action: string, key?: KeyDescriptor): void; +export declare function key(action: string): KeyDescriptor | undefined; diff --git a/imports/shared-app/MessageFormatter.d.ts b/imports/shared-app/MessageFormatter.d.ts new file mode 100644 index 0000000..64fabe4 --- /dev/null +++ b/imports/shared-app/MessageFormatter.d.ts @@ -0,0 +1 @@ +export declare function formatDate(secs: number): string; diff --git a/imports/shared-app/PPTListener.d.ts b/imports/shared-app/PPTListener.d.ts new file mode 100644 index 0000000..1bc9494 --- /dev/null +++ b/imports/shared-app/PPTListener.d.ts @@ -0,0 +1,147 @@ +export declare enum KeyCode { + KEY_CANCEL = 3, + KEY_HELP = 6, + KEY_BACK_SPACE = 8, + KEY_TAB = 9, + KEY_CLEAR = 12, + KEY_RETURN = 13, + KEY_ENTER = 14, + KEY_SHIFT = 16, + KEY_CONTROL = 17, + KEY_ALT = 18, + KEY_PAUSE = 19, + KEY_CAPS_LOCK = 20, + KEY_ESCAPE = 27, + KEY_SPACE = 32, + KEY_PAGE_UP = 33, + KEY_PAGE_DOWN = 34, + KEY_END = 35, + KEY_HOME = 36, + KEY_LEFT = 37, + KEY_UP = 38, + KEY_RIGHT = 39, + KEY_DOWN = 40, + KEY_PRINTSCREEN = 44, + KEY_INSERT = 45, + KEY_DELETE = 46, + KEY_0 = 48, + KEY_1 = 49, + KEY_2 = 50, + KEY_3 = 51, + KEY_4 = 52, + KEY_5 = 53, + KEY_6 = 54, + KEY_7 = 55, + KEY_8 = 56, + KEY_9 = 57, + KEY_SEMICOLON = 59, + KEY_EQUALS = 61, + KEY_A = 65, + KEY_B = 66, + KEY_C = 67, + KEY_D = 68, + KEY_E = 69, + KEY_F = 70, + KEY_G = 71, + KEY_H = 72, + KEY_I = 73, + KEY_J = 74, + KEY_K = 75, + KEY_L = 76, + KEY_M = 77, + KEY_N = 78, + KEY_O = 79, + KEY_P = 80, + KEY_Q = 81, + KEY_R = 82, + KEY_S = 83, + KEY_T = 84, + KEY_U = 85, + KEY_V = 86, + KEY_W = 87, + KEY_X = 88, + KEY_Y = 89, + KEY_Z = 90, + KEY_LEFT_CMD = 91, + KEY_RIGHT_CMD = 93, + KEY_CONTEXT_MENU = 93, + KEY_NUMPAD0 = 96, + KEY_NUMPAD1 = 97, + KEY_NUMPAD2 = 98, + KEY_NUMPAD3 = 99, + KEY_NUMPAD4 = 100, + KEY_NUMPAD5 = 101, + KEY_NUMPAD6 = 102, + KEY_NUMPAD7 = 103, + KEY_NUMPAD8 = 104, + KEY_NUMPAD9 = 105, + KEY_MULTIPLY = 106, + KEY_ADD = 107, + KEY_SEPARATOR = 108, + KEY_SUBTRACT = 109, + KEY_DECIMAL = 110, + KEY_DIVIDE = 111, + KEY_F1 = 112, + KEY_F2 = 113, + KEY_F3 = 114, + KEY_F4 = 115, + KEY_F5 = 116, + KEY_F6 = 117, + KEY_F7 = 118, + KEY_F8 = 119, + KEY_F9 = 120, + KEY_F10 = 121, + KEY_F11 = 122, + KEY_F12 = 123, + KEY_F13 = 124, + KEY_F14 = 125, + KEY_F15 = 126, + KEY_F16 = 127, + KEY_F17 = 128, + KEY_F18 = 129, + KEY_F19 = 130, + KEY_F20 = 131, + KEY_F21 = 132, + KEY_F22 = 133, + KEY_F23 = 134, + KEY_F24 = 135, + KEY_NUM_LOCK = 144, + KEY_SCROLL_LOCK = 145, + KEY_COMMA = 188, + KEY_PERIOD = 190, + KEY_SLASH = 191, + KEY_BACK_QUOTE = 192, + KEY_OPEN_BRACKET = 219, + KEY_BACK_SLASH = 220, + KEY_CLOSE_BRACKET = 221, + KEY_QUOTE = 222, + KEY_META = 224 +} +export declare enum EventType { + KEY_PRESS = 0, + KEY_RELEASE = 1, + KEY_TYPED = 2 +} +export declare enum SpecialKey { + CTRL = 0, + WINDOWS = 1, + SHIFT = 2, + ALT = 3 +} +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 declare function key_description(key: KeyDescriptor): string; diff --git a/imports/shared-app/SelectedClientInfo.d.ts b/imports/shared-app/SelectedClientInfo.d.ts new file mode 100644 index 0000000..2ae56f6 --- /dev/null +++ b/imports/shared-app/SelectedClientInfo.d.ts @@ -0,0 +1,56 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ClientForumInfo, ClientInfoType, ClientStatusInfo, ClientVersionInfo } from "tc-shared/ui/frames/side/ClientInfoDefinitions"; +import { ClientEntry } from "tc-shared/tree/Client"; +import { Registry } from "tc-shared/events"; +export declare type CachedClientInfoCategory = "name" | "description" | "online-state" | "country" | "volume" | "status" | "forum-account" | "group-channel" | "groups-server" | "version"; +export declare type CachedClientInfo = { + type: ClientInfoType; + name: string; + uniqueId: string; + databaseId: number; + clientId: number; + description: string; + joinTimestamp: number; + leaveTimestamp: number; + country: { + name: string; + flag: string; + }; + volume: { + volume: number; + muted: boolean; + }; + status: ClientStatusInfo; + forumAccount: ClientForumInfo | undefined; + channelGroup: number; + serverGroups: number[]; + version: ClientVersionInfo; +}; +export interface ClientInfoManagerEvents { + notify_client_changed: { + newClient: ClientEntry | undefined; + }; + notify_cache_changed: { + category: CachedClientInfoCategory; + }; +} +export declare class SelectedClientInfo { + readonly events: Registry; + private readonly connection; + private readonly listenerConnection; + private listenerClient; + private currentClient; + private currentClientStatus; + constructor(connection: ConnectionHandler); + destroy(): void; + getInfo(): CachedClientInfo; + setClient(client: ClientEntry | undefined): void; + getClient(): ClientEntry | undefined; + private unregisterClientEvents; + private registerClientEvents; + private updateCachedClientStatus; + private updateCachedCountry; + private updateCachedVolume; + private updateForumAccount; + private initializeClientInfo; +} diff --git a/imports/shared-app/SideBarManager.d.ts b/imports/shared-app/SideBarManager.d.ts new file mode 100644 index 0000000..639bd4c --- /dev/null +++ b/imports/shared-app/SideBarManager.d.ts @@ -0,0 +1,24 @@ +import { SideBarType } from "tc-shared/ui/frames/SideBarDefinitions"; +import { Registry } from "tc-shared/events"; +import { ClientEntry, MusicClientEntry } from "tc-shared/tree/Client"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export interface SideBarManagerEvents { + notify_content_type_changed: { + newContent: SideBarType; + }; +} +export declare class SideBarManager { + readonly events: Registry; + private readonly connection; + private currentType; + constructor(connection: ConnectionHandler); + destroy(): void; + getSideBarContent(): SideBarType; + setSideBarContent(content: SideBarType): void; + showPrivateConversations(): void; + showChannel(): void; + showServer(): void; + showClientInfo(client: ClientEntry): void; + showMusicPlayer(_client: MusicClientEntry): void; + clearSideBar(): void; +} diff --git a/imports/shared-app/audio/player.d.ts b/imports/shared-app/audio/player.d.ts new file mode 100644 index 0000000..d283622 --- /dev/null +++ b/imports/shared-app/audio/player.d.ts @@ -0,0 +1,5 @@ +export interface Device { + device_id: string; + driver: string; + name: string; +} diff --git a/imports/shared-app/audio/recorder.d.ts b/imports/shared-app/audio/recorder.d.ts new file mode 100644 index 0000000..b300ba4 --- /dev/null +++ b/imports/shared-app/audio/recorder.d.ts @@ -0,0 +1,67 @@ +import { AbstractInput, LevelMeter } from "../voice/RecorderBase"; +import { Registry } from "../events"; +export declare type DeviceQueryResult = {}; +export interface AudioRecorderBacked { + createInput(): AbstractInput; + createLevelMeter(device: IDevice): Promise; + getDeviceList(): DeviceList; + isRnNoiseSupported(): boolean; + toggleRnNoise(target: boolean): any; +} +export interface DeviceListEvents { + notify_list_updated: { + removedDeviceCount: number; + addedDeviceCount: number; + }; + notify_state_changed: { + oldState: DeviceListState; + newState: DeviceListState; + }; + notify_permissions_changed: { + oldState: PermissionState; + newState: PermissionState; + }; +} +export declare type DeviceListState = "healthy" | "uninitialized" | "no-permissions" | "error"; +export interface IDevice { + deviceId: string; + driver: string; + name: string; +} +export declare namespace IDevice { + const NoDeviceId = "none"; + const DefaultDeviceId = "default"; +} +export declare type PermissionState = "granted" | "denied" | "unknown"; +export interface DeviceList { + getEvents(): Registry; + isRefreshAvailable(): boolean; + refresh(): Promise; + requestPermissions(): Promise; + getPermissionState(): PermissionState; + getStatus(): DeviceListState; + getDevices(): IDevice[]; + getDefaultDeviceId(): string; + awaitHealthy(): Promise; + awaitInitialized(): Promise; +} +export declare abstract class AbstractDeviceList implements DeviceList { + protected readonly events: Registry; + protected listState: DeviceListState; + protected permissionState: PermissionState; + protected constructor(); + getStatus(): DeviceListState; + getPermissionState(): PermissionState; + protected setState(state: DeviceListState): void; + protected setPermissionState(state: PermissionState): void; + awaitInitialized(): Promise; + awaitHealthy(): Promise; + abstract getDefaultDeviceId(): string; + abstract getDevices(): IDevice[]; + abstract getEvents(): Registry; + abstract isRefreshAvailable(): boolean; + abstract refresh(): Promise; + abstract requestPermissions(): Promise; +} +export declare function getRecorderBackend(): AudioRecorderBacked; +export declare function setRecorderBackend(instance: AudioRecorderBacked): void; diff --git a/imports/shared-app/backend/NativeClient.d.ts b/imports/shared-app/backend/NativeClient.d.ts new file mode 100644 index 0000000..8501fcb --- /dev/null +++ b/imports/shared-app/backend/NativeClient.d.ts @@ -0,0 +1,15 @@ +export declare type NativeClientVersionInfo = { + version: string; + os_architecture: string; + os_platform: string; + os_platform_version: string; +}; +export interface NativeClientBackend { + openChangeLog(): void; + openClientUpdater(): void; + quit(): void; + showDeveloperOptions(): boolean; + openDeveloperTools(): void; + reloadWindow(): void; + getVersionInfo(): NativeClientVersionInfo; +} diff --git a/imports/shared-app/backend/WebClient.d.ts b/imports/shared-app/backend/WebClient.d.ts new file mode 100644 index 0000000..cc3fa89 --- /dev/null +++ b/imports/shared-app/backend/WebClient.d.ts @@ -0,0 +1,2 @@ +export interface WebClientBackend { +} diff --git a/imports/shared-app/backend/index.d.ts b/imports/shared-app/backend/index.d.ts new file mode 100644 index 0000000..2d09326 --- /dev/null +++ b/imports/shared-app/backend/index.d.ts @@ -0,0 +1,5 @@ +import { NativeClientBackend } from "tc-shared/backend/NativeClient"; +import { WebClientBackend } from "tc-shared/backend/WebClient"; +export declare function getBackend(target: "native"): NativeClientBackend; +export declare function getBackend(target: "web"): WebClientBackend; +export declare function setBackend(instance: NativeClientBackend | WebClientBackend): void; diff --git a/imports/shared-app/bookmarks.d.ts b/imports/shared-app/bookmarks.d.ts new file mode 100644 index 0000000..a751894 --- /dev/null +++ b/imports/shared-app/bookmarks.d.ts @@ -0,0 +1,48 @@ +import { ConnectionHandler } from "./ConnectionHandler"; +import { Registry } from "tc-shared/events"; +export interface BookmarkEvents { + notify_bookmarks_updated: {}; +} +export declare const bookmarkEvents: Registry; +export declare const boorkmak_connect: (mark: Bookmark, new_tab?: boolean) => void; +export interface ServerProperties { + server_address: string; + server_port: number; + server_password_hash?: string; + server_password?: string; +} +export declare enum BookmarkType { + ENTRY = 0, + DIRECTORY = 1 +} +export interface Bookmark { + type: BookmarkType.ENTRY; + parent: DirectoryBookmark; + 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; + last_icon_id?: number; + last_icon_server_id?: string; +} +export interface DirectoryBookmark { + type: BookmarkType.DIRECTORY; + parent: DirectoryBookmark; + readonly content: (Bookmark | DirectoryBookmark)[]; + unique_id: string; + display_name: string; +} +export declare function bookmarks(): DirectoryBookmark; +export declare function bookmarks_flat(): Bookmark[]; +export declare function find_bookmark(uuid: string): Bookmark | DirectoryBookmark | undefined; +export declare function parent_bookmark(bookmark: Bookmark): DirectoryBookmark; +export declare function create_bookmark(display_name: string, directory: DirectoryBookmark, server_properties: ServerProperties, nickname: string): Bookmark; +export declare function create_bookmark_directory(parent: DirectoryBookmark, name: string): DirectoryBookmark; +export declare function change_directory(parent: DirectoryBookmark, bookmark: Bookmark | DirectoryBookmark): void; +export declare function save_bookmark(bookmark?: Bookmark | DirectoryBookmark): void; +export declare function delete_bookmark(bookmark: Bookmark | DirectoryBookmark): void; +export declare function add_server_to_bookmarks(server: ConnectionHandler): void; diff --git a/imports/shared-app/clientservice/index.d.ts b/imports/shared-app/clientservice/index.d.ts new file mode 100644 index 0000000..21af2d7 --- /dev/null +++ b/imports/shared-app/clientservice/index.d.ts @@ -0,0 +1,3 @@ +import { ClientServiceInvite, ClientServices } from "tc-services"; +export declare let clientServices: ClientServices; +export declare let clientServiceInvite: ClientServiceInvite; diff --git a/imports/shared-app/connection/AbstractCommandHandler.d.ts b/imports/shared-app/connection/AbstractCommandHandler.d.ts new file mode 100644 index 0000000..4df579f --- /dev/null +++ b/imports/shared-app/connection/AbstractCommandHandler.d.ts @@ -0,0 +1,31 @@ +import { AbstractServerConnection, ServerCommand, SingleCommandHandler } from "../connection/ConnectionBase"; +export declare abstract class AbstractCommandHandler { + readonly connection: AbstractServerConnection; + handler_boss: AbstractCommandHandlerBoss | undefined; + volatile_handler_boss: boolean; + ignore_consumed: boolean; + protected constructor(connection: AbstractServerConnection); + /** + * @return If the command should be consumed + */ + abstract handle_command(command: ServerCommand): boolean; +} +export declare type ExplicitCommandHandler = (command: ServerCommand, consumed: boolean) => void | boolean; +export declare abstract class AbstractCommandHandlerBoss { + readonly connection: AbstractServerConnection; + protected command_handlers: AbstractCommandHandler[]; + protected single_command_handler: SingleCommandHandler[]; + protected explicitHandlers: { + [key: string]: ExplicitCommandHandler[]; + }; + protected constructor(connection: AbstractServerConnection); + destroy(): void; + register_explicit_handler(command: string, callback: ExplicitCommandHandler): () => void; + unregister_explicit_handler(command: string, callback: ExplicitCommandHandler): boolean; + register_handler(handler: AbstractCommandHandler): void; + unregister_handler(handler: AbstractCommandHandler): void; + register_single_handler(handler: SingleCommandHandler): void; + remove_single_handler(handler: SingleCommandHandler): void; + handlers(): AbstractCommandHandler[]; + invoke_handle(command: ServerCommand): boolean; +} diff --git a/imports/shared-app/connection/CommandHandler.d.ts b/imports/shared-app/connection/CommandHandler.d.ts new file mode 100644 index 0000000..e61ed75 --- /dev/null +++ b/imports/shared-app/connection/CommandHandler.d.ts @@ -0,0 +1,50 @@ +import { AbstractServerConnection, CommandOptions, ServerCommand } from "../connection/ConnectionBase"; +import { CommandResult } from "../connection/ServerConnectionDeclaration"; +import { ConnectionHandler } from "../ConnectionHandler"; +import { AbstractCommandHandler, AbstractCommandHandlerBoss } from "../connection/AbstractCommandHandler"; +export declare class ServerConnectionCommandBoss extends AbstractCommandHandlerBoss { + constructor(connection: AbstractServerConnection); +} +export declare class ConnectionCommandHandler extends AbstractCommandHandler { + readonly connection: AbstractServerConnection; + readonly connection_handler: ConnectionHandler; + constructor(connection: AbstractServerConnection); + private loggable_invoker; + proxy_command_promise(promise: Promise, options: CommandOptions): Promise; + handle_command(command: ServerCommand): boolean; + set_handler(command: string, handler: any): void; + unset_handler(command: string, handler?: any): void; + handleCommandResult(json: any): void; + handleCommandServerInit(json: any): void; + handleNotifyServerConnectionInfo(json: any): void; + handleNotifyConnectionInfo(json: any): void; + private createChannelFromJson; + private batchTreeUpdateFinishedTimeout; + handleCommandChannelList(json: any): void; + handleCommandChannelListFinished(): void; + handleCommandChannelCreate(json: any): void; + handleCommandChannelShow(json: any): void; + handleCommandChannelDelete(json: any): void; + handleCommandChannelHide(json: any): void; + handleCommandClientEnterView(json: any): void; + handleCommandClientLeftView(json: any): number; + handleNotifyClientMoved(json: any): number; + handleNotifyChannelMoved(json: any): number; + handleNotifyChannelEdited(json: any): number; + handleNotifyChannelDescriptionChanged(json: any): void; + handleNotifyTextMessage(json: any): void; + notifyClientChatComposing(json: any): void; + handleNotifyClientChatClosed(json: any): void; + handleNotifyClientUpdated(json: any): void; + handleNotifyServerEdited(json: any): void; + handleNotifyServerUpdated(json: any): void; + handleNotifyMusicPlayerInfo(json: any): void; + handleNotifyClientPoke(json: any): void; + handleNotifyServerGroupClientAdd(json: any): void; + handleNotifyServerGroupClientRemove(json: any): void; + handleNotifyClientChannelGroupChanged(json: any): void; + handleNotifyChannelSubscribed(json: any): void; + handleNotifyChannelUnsubscribed(json: any): void; + handleNotifyMusicStatusUpdate(json: any[]): void; + handleMusicPlayerSongChange(json: any[]): void; +} diff --git a/imports/shared-app/connection/CommandHelper.d.ts b/imports/shared-app/connection/CommandHelper.d.ts new file mode 100644 index 0000000..832a440 --- /dev/null +++ b/imports/shared-app/connection/CommandHelper.d.ts @@ -0,0 +1,28 @@ +import { ServerCommand } from "../connection/ConnectionBase"; +import { ClientNameInfo, Playlist, PlaylistInfo, PlaylistSong, QueryList, ServerGroupClient } from "../connection/ServerConnectionDeclaration"; +import { AbstractCommandHandler } from "../connection/AbstractCommandHandler"; +export declare class CommandHelper extends AbstractCommandHandler { + private whoAmIResponse; + private infoByUniqueIdRequest; + private infoByDatabaseIdRequest; + constructor(connection: any); + initialize(): void; + destroy(): void; + handle_command(command: ServerCommand): boolean; + getInfoFromUniqueId(...uniqueIds: string[]): Promise; + private handleNotifyClientGetNameFromDatabaseId; + getInfoFromClientDatabaseId(...clientDatabaseIds: number[]): Promise; + private handleNotifyClientNameFromUniqueId; + requestQueryList(server_id?: number): Promise; + requestPlaylistList(): Promise; + requestPlaylistSongs(playlist_id: number, process_result?: boolean): Promise; + request_playlist_client_list(playlist_id: number): Promise; + requestClientsByServerGroup(group_id: number): Promise; + requestPlaylistInfo(playlist_id: number): Promise; + /** + * @deprecated + * Its just a workaround for the query management. + * There is no garantee that the whoami trick will work forever + */ + getCurrentVirtualServerId(): Promise; +} diff --git a/imports/shared-app/connection/ConnectionBase.d.ts b/imports/shared-app/connection/ConnectionBase.d.ts new file mode 100644 index 0000000..bc6dcf2 --- /dev/null +++ b/imports/shared-app/connection/ConnectionBase.d.ts @@ -0,0 +1,65 @@ +import { CommandHelper } from "../connection/CommandHelper"; +import { HandshakeHandler } from "../connection/HandshakeHandler"; +import { CommandResult } from "../connection/ServerConnectionDeclaration"; +import { ServerAddress } from "../tree/Server"; +import { ConnectionHandler, ConnectionState } from "../ConnectionHandler"; +import { AbstractCommandHandlerBoss } from "../connection/AbstractCommandHandler"; +import { Registry } from "../events"; +import { AbstractVoiceConnection } from "../connection/VoiceConnection"; +import { VideoConnection } from "tc-shared/connection/VideoConnection"; +export interface CommandOptions { + flagset?: string[]; + process_result?: boolean; + timeout?: number; +} +export declare const CommandOptionDefaults: CommandOptions; +export declare type ConnectionPing = { + javascript: number | undefined; + native: number; +}; +export interface ServerConnectionEvents { + notify_connection_state_changed: { + oldState: ConnectionState; + newState: ConnectionState; + }; + notify_ping_updated: { + newPing: ConnectionPing; + }; +} +export declare type ConnectionStateListener = (old_state: ConnectionState, new_state: ConnectionState) => any; +export declare type ConnectionStatistics = { + bytesReceived: number; + bytesSend: number; +}; +export declare abstract class AbstractServerConnection { + readonly events: Registry; + readonly client: ConnectionHandler; + readonly command_helper: CommandHelper; + protected connectionState: ConnectionState; + protected constructor(client: ConnectionHandler); + abstract connect(address: ServerAddress, handshake: HandshakeHandler, timeout?: number): Promise; + abstract connected(): boolean; + abstract disconnect(reason?: string): Promise; + abstract getServerType(): "teaspeak" | "teamspeak" | "unknown"; + abstract getVoiceConnection(): AbstractVoiceConnection; + abstract getVideoConnection(): VideoConnection; + abstract command_handler_boss(): AbstractCommandHandlerBoss; + abstract send_command(command: string, data?: any | any[], options?: CommandOptions): Promise; + abstract remote_address(): ServerAddress; + connectionProxyAddress(): ServerAddress | undefined; + abstract handshake_handler(): HandshakeHandler; + abstract getControlStatistics(): ConnectionStatistics; + updateConnectionState(state: ConnectionState): void; + getConnectionState(): ConnectionState; + abstract ping(): ConnectionPing; +} +export declare class ServerCommand { + command: string; + arguments: any[]; +} +export interface SingleCommandHandler { + name?: string; + command?: string | string[]; + timeout?: number; + function: (command: ServerCommand) => boolean; +} diff --git a/imports/shared-app/connection/ConnectionFactory.d.ts b/imports/shared-app/connection/ConnectionFactory.d.ts new file mode 100644 index 0000000..bff00fc --- /dev/null +++ b/imports/shared-app/connection/ConnectionFactory.d.ts @@ -0,0 +1,8 @@ +import { AbstractServerConnection } from "../connection/ConnectionBase"; +import { ConnectionHandler } from "../ConnectionHandler"; +export interface ServerConnectionFactory { + create(client: ConnectionHandler): AbstractServerConnection; + destroy(instance: AbstractServerConnection): any; +} +export declare function setServerConnectionFactory(factory: ServerConnectionFactory): void; +export declare function getServerConnectionFactory(): ServerConnectionFactory; diff --git a/imports/shared-app/connection/DummyVoiceConnection.d.ts b/imports/shared-app/connection/DummyVoiceConnection.d.ts new file mode 100644 index 0000000..40d6b1c --- /dev/null +++ b/imports/shared-app/connection/DummyVoiceConnection.d.ts @@ -0,0 +1,32 @@ +import { AbstractVoiceConnection, VoiceConnectionStatus, WhisperSessionInitializer } from "../connection/VoiceConnection"; +import { RecorderProfile } from "../voice/RecorderProfile"; +import { AbstractServerConnection, ConnectionStatistics } from "../connection/ConnectionBase"; +import { VoiceClient } from "../voice/VoiceClient"; +import { WhisperSession, WhisperTarget } from "../voice/VoiceWhisper"; +export declare class DummyVoiceConnection extends AbstractVoiceConnection { + private recorder; + private voiceClients; + constructor(connection: AbstractServerConnection); + acquireVoiceRecorder(recorder: RecorderProfile | undefined): Promise; + availableVoiceClients(): VoiceClient[]; + decodingSupported(codec: number): boolean; + encodingSupported(codec: number): boolean; + getConnectionState(): VoiceConnectionStatus; + getEncoderCodec(): number; + registerVoiceClient(clientId: number): VoiceClient; + setEncoderCodec(codec: number): void; + unregisterVoiceClient(client: VoiceClient): Promise; + voiceRecorder(): RecorderProfile; + dropWhisperSession(session: WhisperSession): void; + getWhisperSessionInitializer(): WhisperSessionInitializer | undefined; + getWhisperSessions(): WhisperSession[]; + setWhisperSessionInitializer(initializer: WhisperSessionInitializer | undefined): void; + getWhisperTarget(): WhisperTarget | undefined; + startWhisper(target: WhisperTarget): Promise; + stopWhisper(): void; + getFailedMessage(): string; + isReplayingVoice(): boolean; + stopAllVoiceReplays(): void; + getConnectionStats(): Promise; + getRetryTimestamp(): number | 0; +} diff --git a/imports/shared-app/connection/ErrorCode.d.ts b/imports/shared-app/connection/ErrorCode.d.ts new file mode 100644 index 0000000..dcd5a79 --- /dev/null +++ b/imports/shared-app/connection/ErrorCode.d.ts @@ -0,0 +1,161 @@ +export declare enum ErrorCode { + OK = 0, + UNDEFINED = 1, + NOT_IMPLEMENTED = 2, + LIB_TIME_LIMIT_REACHED = 5, + COMMAND_NOT_FOUND = 256, + UNABLE_TO_BIND_NETWORK_PORT = 257, + NO_NETWORK_PORT_AVAILABLE = 258, + COMMAND_TIMED_OUT = 272, + COMMAND_ABORTED_CONNECTION_CLOSED = 273, + CLIENT_INVALID_ID = 512, + CLIENT_NICKNAME_INUSE = 513, + INVALID_ERROR_CODE = 514, + CLIENT_PROTOCOL_LIMIT_REACHED = 515, + CLIENT_INVALID_TYPE = 516, + CLIENT_ALREADY_SUBSCRIBED = 517, + CLIENT_NOT_LOGGED_IN = 518, + CLIENT_COULD_NOT_VALIDATE_IDENTITY = 519, + CLIENT_INVALID_PASSWORD = 520, + CLIENT_TOO_MANY_CLONES_CONNECTED = 521, + CLIENT_VERSION_OUTDATED = 522, + CLIENT_IS_ONLINE = 523, + CLIENT_IS_FLOODING = 524, + CLIENT_HACKED = 525, + CLIENT_CANNOT_VERIFY_NOW = 526, + CLIENT_LOGIN_NOT_PERMITTED = 527, + CLIENT_NOT_SUBSCRIBED = 528, + CLIENT_UNKNOWN = 529, + CLIENT_JOIN_RATE_LIMIT_REACHED = 530, + CLIENT_IS_ALREADY_MEMBER_OF_GROUP = 531, + CLIENT_IS_NOT_MEMBER_OF_GROUP = 532, + CLIENT_TYPE_IS_NOT_ALLOWED = 533, + CHANNEL_INVALID_ID = 768, + CHANNEL_PROTOCOL_LIMIT_REACHED = 769, + CHANNEL_ALREADY_IN = 770, + CHANNEL_NAME_INUSE = 771, + CHANNEL_NOT_EMPTY = 772, + CHANNEL_CAN_NOT_DELETE_DEFAULT = 773, + CHANNEL_DEFAULT_REQUIRE_PERMANENT = 774, + CHANNEL_INVALID_FLAGS = 775, + CHANNEL_PARENT_NOT_PERMANENT = 776, + CHANNEL_MAXCLIENTS_REACHED = 777, + CHANNEL_MAXFAMILY_REACHED = 778, + CHANNEL_INVALID_ORDER = 779, + CHANNEL_NO_FILETRANSFER_SUPPORTED = 780, + CHANNEL_INVALID_PASSWORD = 781, + CHANNEL_IS_PRIVATE_CHANNEL = 782, + CHANNEL_INVALID_SECURITY_HASH = 783, + CHANNEL_IS_DELETED = 784, + CHANNEL_NAME_INVALID = 785, + CHANNEL_LIMIT_REACHED = 786, + SERVER_INVALID_ID = 1024, + SERVER_RUNNING = 1025, + SERVER_IS_SHUTTING_DOWN = 1026, + SERVER_MAXCLIENTS_REACHED = 1027, + SERVER_INVALID_PASSWORD = 1028, + SERVER_DEPLOYMENT_ACTIVE = 1029, + SERVER_UNABLE_TO_STOP_OWN_SERVER = 1030, + SERVER_IS_VIRTUAL = 1031, + SERVER_WRONG_MACHINEID = 1032, + SERVER_IS_NOT_RUNNING = 1033, + SERVER_IS_BOOTING = 1034, + SERVER_STATUS_INVALID = 1035, + SERVER_MODAL_QUIT = 1036, + SERVER_VERSION_OUTDATED = 1037, + SERVER_ALREADY_JOINED = 1037, + SERVER_IS_NOT_SHUTTING_DOWN = 1038, + SERVER_MAX_VS_REACHED = 1039, + SERVER_UNBOUND = 1040, + SERVER_JOIN_RATE_LIMIT_REACHED = 1041, + SQL = 1280, + DATABASE_EMPTY_RESULT = 1281, + DATABASE_DUPLICATE_ENTRY = 1282, + DATABASE_NO_MODIFICATIONS = 1283, + DATABASE_CONSTRAINT = 1284, + DATABASE_REINVOKE = 1285, + PARAMETER_QUOTE = 1536, + PARAMETER_INVALID_COUNT = 1537, + PARAMETER_INVALID = 1538, + PARAMETER_NOT_FOUND = 1539, + PARAMETER_CONVERT = 1540, + PARAMETER_INVALID_SIZE = 1541, + PARAMETER_MISSING = 1542, + PARAMETER_CHECKSUM = 1543, + PARAMETER_CONSTRAINT_VIOLATION = 24592, + VS_CRITICAL = 1792, + CONNECTION_LOST = 1793, + NOT_CONNECTED = 1794, + NO_CACHED_CONNECTION_INFO = 1795, + CURRENTLY_NOT_POSSIBLE = 1796, + FAILED_CONNECTION_INITIALISATION = 1797, + COULD_NOT_RESOLVE_HOSTNAME = 1798, + INVALID_SERVER_CONNECTION_HANDLER_ID = 1799, + COULD_NOT_INITIALISE_INPUT_CLIENT = 1800, + CLIENTLIBRARY_NOT_INITIALISED = 1801, + SERVERLIBRARY_NOT_INITIALISED = 1802, + WHISPER_TOO_MANY_TARGETS = 1803, + WHISPER_NO_TARGETS = 1804, + FILE_INVALID_NAME = 2048, + FILE_INVALID_PERMISSIONS = 2049, + FILE_ALREADY_EXISTS = 2050, + FILE_NOT_FOUND = 2051, + FILE_IO_ERROR = 2052, + FILE_INVALID_TRANSFER_ID = 2053, + FILE_INVALID_PATH = 2054, + FILE_NO_FILES_AVAILABLE = 2055, + FILE_OVERWRITE_EXCLUDES_RESUME = 2056, + FILE_INVALID_SIZE = 2057, + FILE_ALREADY_IN_USE = 2058, + FILE_COULD_NOT_OPEN_CONNECTION = 2059, + FILE_NO_SPACE_LEFT_ON_DEVICE = 2060, + FILE_EXCEEDS_FILE_SYSTEM_MAXIMUM_SIZE = 2061, + FILE_TRANSFER_CONNECTION_TIMEOUT = 2062, + FILE_CONNECTION_LOST = 2063, + FILE_EXCEEDS_SUPPLIED_SIZE = 2064, + FILE_TRANSFER_COMPLETE = 2065, + FILE_TRANSFER_CANCELED = 2066, + FILE_TRANSFER_INTERRUPTED = 2067, + FILE_TRANSFER_SERVER_QUOTA_EXCEEDED = 2068, + FILE_TRANSFER_CLIENT_QUOTA_EXCEEDED = 2069, + FILE_TRANSFER_RESET = 2070, + FILE_TRANSFER_LIMIT_REACHED = 2071, + FILE_API_TIMEOUT = 2080, + FILE_VIRTUAL_SERVER_NOT_REGISTERED = 2081, + FILE_SERVER_TRANSFER_LIMIT_REACHED = 2082, + FILE_CLIENT_TRANSFER_LIMIT_REACHED = 2083, + SERVER_INSUFFICIENT_PERMISSIONS = 2568, + ACCOUNTING_SLOT_LIMIT_REACHED = 2817, + SERVER_CONNECT_BANNED = 3329, + BAN_FLOODING = 3331, + TOKEN_INVALID_ID = 3840, + WEB_HANDSHAKE_INVALID = 4096, + WEB_HANDSHAKE_UNSUPPORTED = 4097, + WEB_HANDSHAKE_IDENTITY_UNSUPPORTED = 4098, + WEB_HANDSHAKE_IDENTITY_PROOF_FAILED = 4099, + WEB_HANDSHAKE_IDENTITY_OUTDATED = 4100, + MUSIC_INVALID_ID = 4352, + MUSIC_LIMIT_REACHED = 4353, + MUSIC_CLIENT_LIMIT_REACHED = 4354, + MUSIC_INVALID_PLAYER_STATE = 4355, + MUSIC_INVALID_ACTION = 4356, + MUSIC_NO_PLAYER = 4357, + MUSIC_DISABLED = 4357, + PLAYLIST_INVALID_ID = 8448, + PLAYLIST_INVALID_SONG_ID = 8449, + PLAYLIST_ALREADY_IN_USE = 8450, + PLAYLIST_IS_IN_USE = 8451, + QUERY_NOT_EXISTS = 4608, + QUERY_ALREADY_EXISTS = 4609, + GROUP_INVALID_ID = 4864, + GROUP_NAME_INUSE = 4865, + GROUP_NOT_ASSIGNED_OVER_THIS_SERVER = 4866, + CONVERSATION_INVALID_ID = 8704, + CONVERSATION_MORE_DATA = 8705, + CONVERSATION_IS_PRIVATE = 8706, + CUSTOM_ERROR = 65535, + /** @deprecated Use SERVER_INSUFFICIENT_PERMISSIONS */ + PERMISSION_ERROR = 2568, + /** @deprecated Use DATABASE_EMPTY_RESULT */ + EMPTY_RESULT = 1281 +} diff --git a/imports/shared-app/connection/HandshakeHandler.d.ts b/imports/shared-app/connection/HandshakeHandler.d.ts new file mode 100644 index 0000000..02e35a5 --- /dev/null +++ b/imports/shared-app/connection/HandshakeHandler.d.ts @@ -0,0 +1,22 @@ +import { AbstractServerConnection } from "../connection/ConnectionBase"; +import { ConnectParameters } from "tc-shared/ui/modal/connect/Controller"; +export interface HandshakeIdentityHandler { + connection: AbstractServerConnection; + executeHandshake(): any; + registerCallback(callback: (success: boolean, message?: string) => any): any; + fillClientInitData(data: any): any; +} +export declare class HandshakeHandler { + private connection; + private handshakeImpl; + private handshakeFailed; + readonly parameters: ConnectParameters; + constructor(parameters: ConnectParameters); + setConnection(con: AbstractServerConnection): void; + initialize(): void; + get_identity_handler(): HandshakeIdentityHandler; + startHandshake(): void; + on_teamspeak(): void; + private handshake_failed; + private handleHandshakeFinished; +} diff --git a/imports/shared-app/connection/PluginCmdHandler.d.ts b/imports/shared-app/connection/PluginCmdHandler.d.ts new file mode 100644 index 0000000..82ce7b5 --- /dev/null +++ b/imports/shared-app/connection/PluginCmdHandler.d.ts @@ -0,0 +1,29 @@ +import { ConnectionHandler } from "../ConnectionHandler"; +import { CommandResult } from "../connection/ServerConnectionDeclaration"; +import { AbstractServerConnection } from "../connection/ConnectionBase"; +export interface PluginCommandInvoker { + clientId: number; + clientUniqueId: string; + clientName: string; +} +export declare abstract class PluginCmdHandler { + protected readonly channel: string; + protected currentServerConnection: AbstractServerConnection; + protected constructor(channel: string); + handleHandlerUnregistered(): void; + handleHandlerRegistered(): void; + getChannel(): string; + abstract handlePluginCommand(data: string, invoker: PluginCommandInvoker): any; + protected sendPluginCommand(data: string, mode: "server" | "view" | "channel" | "private", clientId?: number): Promise; +} +export declare class PluginCmdRegistry { + readonly connection: ConnectionHandler; + private readonly handler; + private handlerMap; + constructor(connection: ConnectionHandler); + destroy(): void; + registerHandler(handler: PluginCmdHandler): void; + unregisterHandler(handler: PluginCmdHandler): void; + private handlePluginCommand; + getPluginHandler(channel: string): T | undefined; +} diff --git a/imports/shared-app/connection/ServerConnectionDeclaration.d.ts b/imports/shared-app/connection/ServerConnectionDeclaration.d.ts new file mode 100644 index 0000000..15c96a5 --- /dev/null +++ b/imports/shared-app/connection/ServerConnectionDeclaration.d.ts @@ -0,0 +1,73 @@ +import { LaterPromise } from "../utils/LaterPromise"; +export declare class CommandResult { + success: boolean; + id: number; + message: string; + extra_message: string; + json: any; + bulks: any[]; + constructor(bulks: any); + getBulks(): CommandResult[]; + formattedMessage(): string; +} +export interface ClientNameInfo { + clientUniqueId: string; + clientNickname: string; + clientDatabaseId: number; +} +export interface ClientNameFromUid { + promise: LaterPromise; + keys: string[]; + response: ClientNameInfo[]; +} +export interface ServerGroupClient { + client_nickname: string; + client_unique_identifier: string; + client_database_id: number; +} +export interface QueryListEntry { + username: string; + unique_id: string; + bounded_server: number; +} +export interface QueryList { + flag_own: boolean; + flag_all: boolean; + queries: QueryListEntry[]; +} +export 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; +} +export 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; + playlist_max_songs: number; +} +export 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; +} diff --git a/imports/shared-app/connection/ServerFeatures.d.ts b/imports/shared-app/connection/ServerFeatures.d.ts new file mode 100644 index 0000000..2e347c6 --- /dev/null +++ b/imports/shared-app/connection/ServerFeatures.d.ts @@ -0,0 +1,35 @@ +import { ConnectionHandler } from "../ConnectionHandler"; +import { Registry } from "../events"; +export declare type ServerFeatureSupport = "unsupported" | "supported" | "experimental" | "deprecated"; +export declare enum ServerFeature { + ERROR_BULKS = "error-bulks", + ADVANCED_CHANNEL_CHAT = "advanced-channel-chat", + LOG_QUERY = "log-query", + WHISPER_ECHO = "whisper-echo", + VIDEO = "video", + SIDEBAR_MODE = "sidebar-mode" +} +export interface ServerFeatureEvents { + notify_state_changed: { + feature: ServerFeature; + version?: number; + support: ServerFeatureSupport; + }; +} +export declare class ServerFeatures { + readonly events: Registry; + private readonly connection; + private readonly explicitCommandHandler; + private readonly stateChangeListener; + private featureAwait; + private featureAwaitCallback; + private featuresSet; + private featureStates; + constructor(connection: ConnectionHandler); + destroy(): void; + supportsFeature(feature: ServerFeature, version?: number): boolean; + awaitFeatures(): Promise; + listenSupportChange(feature: ServerFeature, listener: (support: boolean) => void, version?: number): () => void; + private disableAllFeatures; + private setFeatureSupport; +} diff --git a/imports/shared-app/connection/VideoConnection.d.ts b/imports/shared-app/connection/VideoConnection.d.ts new file mode 100644 index 0000000..3bfd979 --- /dev/null +++ b/imports/shared-app/connection/VideoConnection.d.ts @@ -0,0 +1,153 @@ +import { VideoSource } from "tc-shared/video/VideoSource"; +import { Registry } from "tc-shared/events"; +import { ConnectionStatistics } from "tc-shared/connection/ConnectionBase"; +export declare type VideoBroadcastType = "camera" | "screen"; +export declare type VideoBroadcastStatistics = { + dimensions: { + width: number; + height: number; + }; + frameRate: number; + codec: { + name: string; + payloadType: number; + }; + maxBandwidth: number; + bandwidth: number; + qualityLimitation: "cpu" | "bandwidth"; + source: { + frameRate: number; + dimensions: { + width: number; + height: number; + }; + }; +}; +export interface VideoConnectionEvent { + notify_status_changed: { + oldState: VideoConnectionStatus; + newState: VideoConnectionStatus; + }; +} +export declare enum VideoConnectionStatus { + /** We're currently not connected to the target server */ + Disconnected = 0, + /** We're trying to connect to the target server */ + Connecting = 1, + /** We're connected */ + Connected = 2, + /** The connection has failed for the current server connection */ + Failed = 3, + /** Video connection is not supported (the server dosn't support it) */ + Unsupported = 4 +} +export declare enum VideoBroadcastState { + Stopped = 0, + Available = 1, + Initializing = 2, + Running = 3, + Buffering = 4 +} +export interface VideoClientEvents { + notify_broadcast_state_changed: { + broadcastType: VideoBroadcastType; + oldState: VideoBroadcastState; + newState: VideoBroadcastState; + }; + notify_dismissed_state_changed: { + broadcastType: VideoBroadcastType; + dismissed: boolean; + }; + notify_broadcast_stream_changed: { + broadcastType: VideoBroadcastType; + }; +} +export interface VideoClient { + getClientId(): number; + getEvents(): Registry; + getVideoState(broadcastType: VideoBroadcastType): VideoBroadcastState; + getVideoStream(broadcastType: VideoBroadcastType): MediaStream; + joinBroadcast(broadcastType: VideoBroadcastType): Promise; + leaveBroadcast(broadcastType: VideoBroadcastType): any; + dismissBroadcast(broadcastType: VideoBroadcastType): any; + isBroadcastDismissed(broadcastType: VideoBroadcastType): boolean; + showPip(broadcastType: VideoBroadcastType): Promise; +} +export interface LocalVideoBroadcastEvents { + notify_state_changed: { + oldState: LocalVideoBroadcastState; + newState: LocalVideoBroadcastState; + }; +} +export declare type LocalVideoBroadcastState = { + state: "stopped"; +} | { + state: "initializing"; +} | { + state: "failed"; + reason: string; +} | { + state: "broadcasting"; +}; +export interface VideoBroadcastConfig { + /** + * Ideal and max video width + */ + width: number; + /** + * Ideal and max video height + */ + height: number; + /** + * Dynamically change the video quality related to bandwidth constraints. + */ + dynamicQuality: boolean; + /** + * Max bandwidth which should be used (in bits/second). + * `0` indicates no bandwidth limit. + */ + maxBandwidth: number | 0; + /** + * Interval of enforcing keyframes. + * Zero means that no keyframes will be enforced. + */ + keyframeInterval: number | 0; + /** + * Maximal frame rate for the video. + * This might be ignored by some browsers. + */ + maxFrameRate: number; + /** + * The maximal + */ + dynamicFrameRate: boolean; +} +export interface LocalVideoBroadcast { + getEvents(): Registry; + getState(): LocalVideoBroadcastState; + getSource(): VideoSource | undefined; + getStatistics(): Promise; + /** + * @param source The source of the broadcast (No ownership will be taken. The voice connection must ref the source by itself!) + * @param constraints + */ + startBroadcasting(source: VideoSource, constraints: VideoBroadcastConfig): Promise; + /** + * @param source The source of the broadcast (No ownership will be taken. The voice connection must ref the source by itself!) + * @param constraints + */ + changeSource(source: VideoSource, constraints: VideoBroadcastConfig): Promise; + getConstraints(): VideoBroadcastConfig | undefined; + stopBroadcasting(): any; +} +export interface VideoConnection { + getEvents(): Registry; + getStatus(): VideoConnectionStatus; + getRetryTimestamp(): number | 0; + getFailedMessage(): string; + getConnectionStats(): Promise; + getLocalBroadcast(channel: VideoBroadcastType): LocalVideoBroadcast; + registerVideoClient(clientId: number): any; + registeredVideoClients(): VideoClient[]; + unregisterVideoClient(client: VideoClient): any; +} diff --git a/imports/shared-app/connection/VoiceConnection.d.ts b/imports/shared-app/connection/VoiceConnection.d.ts new file mode 100644 index 0000000..df40c71 --- /dev/null +++ b/imports/shared-app/connection/VoiceConnection.d.ts @@ -0,0 +1,71 @@ +import { RecorderProfile } from "../voice/RecorderProfile"; +import { AbstractServerConnection, ConnectionStatistics } from "../connection/ConnectionBase"; +import { Registry } from "../events"; +import { VoiceClient } from "../voice/VoiceClient"; +import { WhisperSession, WhisperTarget } from "../voice/VoiceWhisper"; +export declare enum VoiceConnectionStatus { + ClientUnsupported = 0, + ServerUnsupported = 1, + Connecting = 2, + Connected = 3, + Disconnecting = 4, + Disconnected = 5, + Failed = 6 +} +export interface VoiceConnectionEvents { + "notify_connection_status_changed": { + oldStatus: VoiceConnectionStatus; + newStatus: VoiceConnectionStatus; + }; + "notify_recorder_changed": { + oldRecorder: RecorderProfile | undefined; + newRecorder: RecorderProfile | undefined; + }; + "notify_whisper_created": { + session: WhisperSession; + }; + "notify_whisper_initialized": { + session: WhisperSession; + }; + "notify_whisper_destroyed": { + session: WhisperSession; + }; + "notify_voice_replay_state_change": { + replaying: boolean; + }; +} +export declare type WhisperSessionInitializeData = { + clientName: string; + clientUniqueId: string; + sessionTimeout: number; + blocked: boolean; + volume: number; +}; +export declare type WhisperSessionInitializer = (session: WhisperSession) => Promise; +export declare abstract class AbstractVoiceConnection { + readonly events: Registry; + readonly connection: AbstractServerConnection; + protected constructor(connection: AbstractServerConnection); + abstract getConnectionState(): VoiceConnectionStatus; + abstract getFailedMessage(): string; + abstract getRetryTimestamp(): number | 0; + abstract getConnectionStats(): Promise; + abstract encodingSupported(codec: number): boolean; + abstract decodingSupported(codec: number): boolean; + abstract registerVoiceClient(clientId: number): VoiceClient; + abstract availableVoiceClients(): VoiceClient[]; + abstract unregisterVoiceClient(client: VoiceClient): any; + abstract voiceRecorder(): RecorderProfile; + abstract acquireVoiceRecorder(recorder: RecorderProfile | undefined): Promise; + abstract getEncoderCodec(): number; + abstract setEncoderCodec(codec: number): any; + abstract stopAllVoiceReplays(): any; + abstract isReplayingVoice(): boolean; + abstract getWhisperSessions(): WhisperSession[]; + abstract dropWhisperSession(session: WhisperSession): any; + abstract setWhisperSessionInitializer(initializer: WhisperSessionInitializer | undefined): any; + abstract getWhisperSessionInitializer(): WhisperSessionInitializer | undefined; + abstract startWhisper(target: WhisperTarget): Promise; + abstract getWhisperTarget(): WhisperTarget | undefined; + abstract stopWhisper(): any; +} diff --git a/imports/shared-app/connection/rtc/Connection.d.ts b/imports/shared-app/connection/rtc/Connection.d.ts new file mode 100644 index 0000000..1b5b44b --- /dev/null +++ b/imports/shared-app/connection/rtc/Connection.d.ts @@ -0,0 +1,130 @@ +import { AbstractServerConnection } from "tc-shared/connection/ConnectionBase"; +import { Registry } from "tc-shared/events"; +import { RemoteRTPAudioTrack, RemoteRTPVideoTrack, TrackClientInfo } from "./RemoteTrack"; +import { WhisperTarget } from "tc-shared/voice/VoiceWhisper"; +import { VideoBroadcastConfig, VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +declare global { + interface RTCIceCandidate { + address: string | undefined; + } + interface HTMLCanvasElement { + captureStream(framed: number): MediaStream; + } +} +export declare type RtcVideoBroadcastStatistics = { + dimensions: { + width: number; + height: number; + }; + frameRate: number; + codec?: { + name: string; + payloadType: number; + }; + bandwidth?: { + currentBps: number; + maxBps: number; + }; + qualityLimitation: "cpu" | "bandwidth" | "none"; + source: { + frameRate: number; + dimensions: { + width: number; + height: number; + }; + }; +}; +export declare enum RTPConnectionState { + DISCONNECTED = 0, + CONNECTING = 1, + CONNECTED = 2, + FAILED = 3, + NOT_SUPPORTED = 4 +} +export declare type RTCSourceTrackType = "audio" | "audio-whisper" | "video" | "video-screen"; +export declare type RTCBroadcastableTrackType = Exclude; +export declare type RTCConnectionStatistics = { + videoBytesReceived: number; + videoBytesSent: number; + voiceBytesReceived: number; + voiceBytesSent: any; +}; +export interface RTCConnectionEvents { + notify_state_changed: { + oldState: RTPConnectionState; + newState: RTPConnectionState; + }; + notify_audio_assignment_changed: { + track: RemoteRTPAudioTrack; + info: TrackClientInfo | undefined; + }; + notify_video_assignment_changed: { + track: RemoteRTPVideoTrack; + info: TrackClientInfo | undefined; + }; +} +export declare class RTCConnection { + static readonly kEnableSdpTrace = true; + private readonly audioSupport; + private readonly events; + private readonly connection; + private readonly commandHandler; + private readonly sdpProcessor; + private connectionState; + private connectTimeout; + private failedReason; + private retryCalculator; + private retryTimestamp; + private retryTimeout; + private peer; + private localCandidateCount; + private peerRemoteDescriptionReceived; + private cachedRemoteIceCandidates; + private cachedRemoteSessionDescription; + private currentTracks; + private currentTransceiver; + private remoteAudioTracks; + private remoteVideoTracks; + private temporaryStreams; + constructor(connection: AbstractServerConnection, audioSupport: boolean); + destroy(): void; + isAudioEnabled(): boolean; + getConnection(): AbstractServerConnection; + getEvents(): Registry; + getConnectionState(): RTPConnectionState; + getFailReason(): string; + getRetryTimestamp(): number | 0; + restartConnection(): void; + reset(updateConnectionState: boolean): void; + setTrackSource(type: RTCSourceTrackType, source: MediaStreamTrack | null): Promise; + startVideoBroadcast(type: VideoBroadcastType, config: VideoBroadcastConfig): Promise; + changeVideoBroadcastConfig(type: VideoBroadcastType, config: VideoBroadcastConfig): Promise; + startAudioBroadcast(): Promise; + startWhisper(target: WhisperTarget): Promise; + stopTrackBroadcast(type: RTCBroadcastableTrackType): void; + setNotSupported(): void; + private updateConnectionState; + private handleFatalError; + private static checkBrowserSupport; + doInitialSetup(): void; + private updateTracks; + private doInitialSetup0; + private handleConnectionStateChanged; + private handleLocalIceCandidate; + handleRemoteIceCandidate(candidate: RTCIceCandidate | undefined, mediaLine: number): void; + applyCachedRemoteIceCandidates(): void; + private handleIceCandidateError; + private handleIceConnectionStateChanged; + private handleIceGatheringStateChanged; + private handleSignallingStateChanged; + private handleNegotiationNeeded; + private handlePeerConnectionStateChanged; + private handleDataChannel; + private releaseTemporaryStream; + private handleTrack; + private getOrCreateTempStream; + private doMapStream; + private handleStreamState; + getConnectionStatistics(): Promise; + getVideoBroadcastStatistics(type: RTCBroadcastableTrackType): Promise; +} diff --git a/imports/shared-app/connection/rtc/Negotiation.d.ts b/imports/shared-app/connection/rtc/Negotiation.d.ts new file mode 100644 index 0000000..63a2203 --- /dev/null +++ b/imports/shared-app/connection/rtc/Negotiation.d.ts @@ -0,0 +1,58 @@ +export interface RTCNegotiationMediaMapping { + direction: "sendrecv" | "recvonly" | "sendonly" | "inactive"; + ssrc: number; +} +export interface RTCNegotiationIceConfig { + username: string; + password: string; + fingerprint: string; + fingerprint_type: string; + setup: "active" | "passive" | "actpass"; + candidates: string[]; +} +export interface RTCNegotiationExtension { + id: number; + uri: string; + media?: "audio" | "video"; + direction?: "recvonly" | "sendonly"; + config?: string; +} +export interface RTCNegotiationCodec { + payload: number; + name: string; + channels?: number; + rate?: number; + fmtp?: string; + feedback?: string[]; +} +/** The offer send by the client to the server */ +export interface RTCNegotiationOffer { + type: "initial-offer" | "negotiation-offer"; + sessionId: number; + ssrcs: number[]; + ssrc_types: number[]; + ice: RTCNegotiationIceConfig; + extension: RTCNegotiationExtension | undefined; +} +/** The offer send by the server to the client */ +export interface RTCNegotiationMessage { + type: "initial-offer" | "negotiation-offer" | "initial-answer" | "negotiation-answer"; + sessionId: number; + sessionUsername: string; + ssrc: number[]; + ssrc_flags: number[]; + ice: RTCNegotiationIceConfig; + extension: RTCNegotiationExtension[] | undefined; + audio_codecs: RTCNegotiationCodec[] | undefined; + video_codecs: RTCNegotiationCodec[] | undefined; +} +export declare class RTCNegotiator { + private readonly peer; + callbackData: (data: string) => void; + callbackFailed: (reason: string) => void; + private sessionCodecs; + private sessionExtensions; + constructor(peer: RTCPeerConnection); + doInitialNegotiation(): void; + handleRemoteData(dataString: string): void; +} diff --git a/imports/shared-app/connection/rtc/RemoteTrack.d.ts b/imports/shared-app/connection/rtc/RemoteTrack.d.ts new file mode 100644 index 0000000..440efa5 --- /dev/null +++ b/imports/shared-app/connection/rtc/RemoteTrack.d.ts @@ -0,0 +1,68 @@ +import { Registry } from "tc-shared/events"; +export interface TrackClientInfo { + media?: number; + client_id: number; + client_database_id: number; + client_unique_id: string; + client_name: string; +} +export declare enum RemoteRTPTrackState { + /** The track isn't bound to any client */ + Unbound = 0, + /** The track is bound to a client, but isn't replaying anything */ + Bound = 1, + /** The track is currently replaying something (inherits the Bound characteristics) */ + Started = 2, + /** The track has been destroyed */ + Destroyed = 3 +} +export interface RemoteRTPTrackEvents { + notify_state_changed: { + oldState: RemoteRTPTrackState; + newState: RemoteRTPTrackState; + }; +} +declare global { + interface RTCRtpReceiver { + playoutDelayHint: number; + } +} +export declare class RemoteRTPTrack { + protected readonly events: Registry; + private readonly ssrc; + private readonly transceiver; + private currentState; + protected currentAssignment: TrackClientInfo; + constructor(ssrc: number, transceiver: RTCRtpTransceiver); + protected destroy(): void; + getEvents(): Registry; + getState(): RemoteRTPTrackState; + getSsrc(): number; + getTrack(): MediaStreamTrack; + getTransceiver(): RTCRtpTransceiver; + getCurrentAssignment(): TrackClientInfo | undefined; + protected setState(state: RemoteRTPTrackState): void; +} +export declare class RemoteRTPVideoTrack extends RemoteRTPTrack { + protected mediaStream: MediaStream; + constructor(ssrc: number, transceiver: RTCRtpTransceiver); + getMediaStream(): MediaStream; + protected handleTrackEnded(): void; +} +export declare class RemoteRTPAudioTrack extends RemoteRTPTrack { + protected htmlAudioNode: HTMLAudioElement; + protected mediaStream: MediaStream; + protected audioNode: MediaStreamAudioSourceNode; + protected gainNode: GainNode; + protected shouldReplay: boolean; + protected gain: number; + constructor(ssrc: number, transceiver: RTCRtpTransceiver); + protected handleTrackEnded(): void; + getGain(): GainNode | undefined; + setGain(value: number): void; + /** + * Mutes this track until the next setGain(..) call or a new sequence begins (state update) + */ + abortCurrentReplay(): void; + protected updateGainNode(): void; +} diff --git a/imports/shared-app/connection/rtc/SdpUtils.d.ts b/imports/shared-app/connection/rtc/SdpUtils.d.ts new file mode 100644 index 0000000..4645d5d --- /dev/null +++ b/imports/shared-app/connection/rtc/SdpUtils.d.ts @@ -0,0 +1,18 @@ +export declare class SdpProcessor { + private static readonly kAudioCodecs; + private static readonly kVideoCodecs; + private rtpRemoteChannelMapping; + private rtpLocalChannelMapping; + constructor(); + reset(): void; + getRemoteSsrcFromFromMediaId(mediaId: string): number | undefined; + getLocalSsrcFromFromMediaId(mediaId: string): number | undefined; + processIncomingSdp(sdpString: string, _mode: "offer" | "answer"): string; + processOutgoingSdp(sdpString: string, _mode: "offer" | "answer"): string; + private static generateRtpSSrcMapping; + private static patchLocalCodecs; +} +export declare namespace SdpCompressor { + function decompressSdp(sdp: string, mode: number): string; + function compressSdp(sdp: string, mode: number): string; +} diff --git a/imports/shared-app/connection/rtc/video/Connection.d.ts b/imports/shared-app/connection/rtc/video/Connection.d.ts new file mode 100644 index 0000000..58a13c1 --- /dev/null +++ b/imports/shared-app/connection/rtc/video/Connection.d.ts @@ -0,0 +1,28 @@ +import { LocalVideoBroadcast, VideoBroadcastType, VideoClient, VideoConnection, VideoConnectionEvent, VideoConnectionStatus } from "tc-shared/connection/VideoConnection"; +import { Registry } from "tc-shared/events"; +import { RTCConnection } from "../Connection"; +import { RtpVideoClient } from "./VideoClient"; +import { ConnectionStatistics } from "tc-shared/connection/ConnectionBase"; +export declare class RtpVideoConnection implements VideoConnection { + private readonly rtcConnection; + private readonly events; + private readonly listener; + private connectionState; + private broadcasts; + private registeredClients; + constructor(rtcConnection: RTCConnection); + private setConnectionState; + destroy(): void; + getRTCConnection(): RTCConnection; + getEvents(): Registry; + getStatus(): VideoConnectionStatus; + getRetryTimestamp(): number | 0; + getFailedMessage(): string; + registerVideoClient(clientId: number): RtpVideoClient; + registeredVideoClients(): VideoClient[]; + unregisterVideoClient(client: VideoClient): void; + private handleRtcConnectionStateChanged; + private handleVideoAssignmentChanged; + getConnectionStats(): Promise; + getLocalBroadcast(channel: VideoBroadcastType): LocalVideoBroadcast; +} diff --git a/imports/shared-app/connection/rtc/video/VideoClient.d.ts b/imports/shared-app/connection/rtc/video/VideoClient.d.ts new file mode 100644 index 0000000..5a10df0 --- /dev/null +++ b/imports/shared-app/connection/rtc/video/VideoClient.d.ts @@ -0,0 +1,36 @@ +import { VideoBroadcastState, VideoBroadcastType, VideoClient, VideoClientEvents } from "tc-shared/connection/VideoConnection"; +import { Registry } from "tc-shared/events"; +import { RemoteRTPVideoTrack } from "../RemoteTrack"; +import { RTCConnection } from "tc-shared/connection/rtc/Connection"; +export declare class RtpVideoClient implements VideoClient { + private readonly handle; + private readonly clientId; + private readonly events; + private readonly listenerTrackStateChanged; + private dismissedStates; + private currentTrack; + private trackStates; + private broadcastIds; + private joinedStates; + private pipElement; + private pipBroadcastType; + constructor(handle: RTCConnection, clientId: number); + getClientId(): number; + getEvents(): Registry; + getVideoStream(broadcastType: VideoBroadcastType): MediaStream; + getVideoState(broadcastType: VideoBroadcastType): VideoBroadcastState; + joinBroadcast(broadcastType: VideoBroadcastType): Promise; + leaveBroadcast(broadcastType: VideoBroadcastType): void; + destroy(): void; + getRtpTrack(type: VideoBroadcastType): RemoteRTPVideoTrack | undefined; + setRtpTrack(type: VideoBroadcastType, track: RemoteRTPVideoTrack | undefined): void; + setBroadcastId(type: VideoBroadcastType, id: number | undefined): void; + private setBroadcastDismissed; + dismissBroadcast(broadcastType: VideoBroadcastType): void; + isBroadcastDismissed(broadcastType: VideoBroadcastType): boolean; + showPip(broadcastType: VideoBroadcastType): Promise; + private stopPip; + private setBroadcastState; + private handleTrackStateChanged; + private updateBroadcastState; +} diff --git a/imports/shared-app/connectionlog/Definitions.d.ts b/imports/shared-app/connectionlog/Definitions.d.ts new file mode 100644 index 0000000..ad370af --- /dev/null +++ b/imports/shared-app/connectionlog/Definitions.d.ts @@ -0,0 +1,266 @@ +import * as React from "react"; +import { ServerEventLog } from "tc-shared/connectionlog/ServerEventLog"; +import { ViewReasonId } from "tc-shared/ConnectionHandler"; +import { PermissionInfo } from "tc-shared/permission/PermissionManager"; +export declare enum EventType { + CONNECTION_BEGIN = "connection.begin", + CONNECTION_HOSTNAME_RESOLVE = "connection.hostname.resolve", + CONNECTION_HOSTNAME_RESOLVE_ERROR = "connection.hostname.resolve.error", + CONNECTION_HOSTNAME_RESOLVED = "connection.hostname.resolved", + CONNECTION_LOGIN = "connection.login", + CONNECTION_CONNECTED = "connection.connected", + CONNECTION_FAILED = "connection.failed", + DISCONNECTED = "disconnected", + CONNECTION_VOICE_CONNECT = "connection.voice.connect", + CONNECTION_VOICE_CONNECT_FAILED = "connection.voice.connect.failed", + CONNECTION_VOICE_CONNECT_SUCCEEDED = "connection.voice.connect.succeeded", + CONNECTION_VOICE_DROPPED = "connection.voice.dropped", + CONNECTION_COMMAND_ERROR = "connection.command.error", + GLOBAL_MESSAGE = "global.message", + SERVER_WELCOME_MESSAGE = "server.welcome.message", + SERVER_HOST_MESSAGE = "server.host.message", + SERVER_HOST_MESSAGE_DISCONNECT = "server.host.message.disconnect", + SERVER_CLOSED = "server.closed", + SERVER_BANNED = "server.banned", + SERVER_REQUIRES_PASSWORD = "server.requires.password", + CLIENT_VIEW_ENTER = "client.view.enter", + CLIENT_VIEW_LEAVE = "client.view.leave", + CLIENT_VIEW_MOVE = "client.view.move", + CLIENT_VIEW_ENTER_OWN_CHANNEL = "client.view.enter.own.channel", + CLIENT_VIEW_LEAVE_OWN_CHANNEL = "client.view.leave.own.channel", + CLIENT_VIEW_MOVE_OWN_CHANNEL = "client.view.move.own.channel", + CLIENT_VIEW_MOVE_OWN = "client.view.move.own", + CLIENT_NICKNAME_CHANGED = "client.nickname.changed", + CLIENT_NICKNAME_CHANGED_OWN = "client.nickname.changed.own", + CLIENT_NICKNAME_CHANGE_FAILED = "client.nickname.change.failed", + CLIENT_SERVER_GROUP_ADD = "client.server.group.add", + CLIENT_SERVER_GROUP_REMOVE = "client.server.group.remove", + CLIENT_CHANNEL_GROUP_CHANGE = "client.channel.group.change", + PRIVATE_MESSAGE_RECEIVED = "private.message.received", + PRIVATE_MESSAGE_SEND = "private.message.send", + CHANNEL_CREATE = "channel.create", + CHANNEL_DELETE = "channel.delete", + ERROR_CUSTOM = "error.custom", + ERROR_PERMISSION = "error.permission", + CLIENT_POKE_RECEIVED = "client.poke.received", + CLIENT_POKE_SEND = "client.poke.send", + RECONNECT_SCHEDULED = "reconnect.scheduled", + RECONNECT_EXECUTE = "reconnect.execute", + RECONNECT_CANCELED = "reconnect.canceled", + WEBRTC_FATAL_ERROR = "webrtc.fatal.error" +} +export declare type EventClient = { + client_unique_id: string; + client_name: string; + client_id: number; +}; +export declare type EventChannelData = { + channel_id: number; + channel_name: string; +}; +export declare type EventServerAddress = { + server_hostname: string; + server_port: number; +}; +export declare namespace event { + type EventGlobalMessage = { + isOwnMessage: boolean; + sender: EventClient; + message: string; + }; + type EventConnectBegin = { + address: EventServerAddress; + client_nickname: string; + }; + type EventErrorCustom = { + message: string; + }; + type EventReconnectScheduled = { + timeout: number; + }; + type EventReconnectCanceled = {}; + type EventReconnectExecute = {}; + type EventErrorPermission = { + permission: PermissionInfo; + }; + type EventWelcomeMessage = { + message: string; + }; + type EventHostMessageDisconnect = { + message: string; + }; + type EventClientMove = { + channel_from?: EventChannelData; + channel_from_own: boolean; + channel_to?: EventChannelData; + channel_to_own: boolean; + client: EventClient; + client_own: boolean; + invoker?: EventClient; + message?: string; + reason: ViewReasonId; + }; + type EventClientEnter = { + channel_from?: EventChannelData; + channel_to?: EventChannelData; + client: EventClient; + invoker?: EventClient; + message?: string; + reason: ViewReasonId; + ban_time?: number; + }; + type EventClientLeave = { + channel_from?: EventChannelData; + channel_to?: EventChannelData; + client: EventClient; + invoker?: EventClient; + message?: string; + reason: ViewReasonId; + ban_time?: number; + }; + type EventChannelCreate = { + creator: EventClient; + channel: EventChannelData; + ownAction: boolean; + }; + type EventChannelToggle = { + channel: EventChannelData; + }; + type EventChannelDelete = { + deleter: EventClient; + channel: EventChannelData; + ownAction: boolean; + }; + type EventConnectionConnected = { + serverName: string; + serverAddress: EventServerAddress; + own_client: EventClient; + }; + type EventConnectionFailed = { + serverAddress: EventServerAddress; + }; + type EventConnectionLogin = {}; + type EventConnectionHostnameResolve = {}; + type EventConnectionHostnameResolved = { + address: EventServerAddress; + }; + type EventConnectionHostnameResolveError = { + message: string; + }; + type EventConnectionVoiceConnectFailed = { + reason: string; + reconnect_delay: number; + }; + type EventConnectionVoiceConnectSucceeded = {}; + type EventConnectionVoiceConnect = { + attemptCount: number; + }; + type EventConnectionVoiceDropped = {}; + type EventConnectionCommandError = { + error: any; + }; + type EventClientNicknameChanged = { + client: EventClient; + old_name: string; + new_name: string; + }; + type EventClientNicknameChangeFailed = { + reason: string; + }; + type EventServerClosed = { + message: string; + }; + type EventServerRequiresPassword = {}; + type EventServerBanned = { + message: string; + time: number; + invoker: EventClient; + }; + type EventClientPokeReceived = { + sender: EventClient; + message: string; + }; + type EventClientPokeSend = { + target: EventClient; + message: string; + }; + type EventPrivateMessageSend = { + target: EventClient; + message: string; + }; + type EventPrivateMessageReceived = { + sender: EventClient; + message: string; + }; + type EventWebrtcFatalError = { + message: string; + retryTimeout: number | 0; + }; +} +export declare type LogMessage = { + type: EventType; + uniqueId: string; + timestamp: number; + data: any; +}; +export interface TypeInfo { + "connection.begin": event.EventConnectBegin; + "global.message": event.EventGlobalMessage; + "error.custom": event.EventErrorCustom; + "error.permission": event.EventErrorPermission; + "connection.hostname.resolved": event.EventConnectionHostnameResolved; + "connection.hostname.resolve": event.EventConnectionHostnameResolve; + "connection.hostname.resolve.error": event.EventConnectionHostnameResolveError; + "connection.failed": event.EventConnectionFailed; + "connection.login": event.EventConnectionLogin; + "connection.connected": event.EventConnectionConnected; + "connection.voice.dropped": event.EventConnectionVoiceDropped; + "connection.voice.connect": event.EventConnectionVoiceConnect; + "connection.voice.connect.failed": event.EventConnectionVoiceConnectFailed; + "connection.voice.connect.succeeded": event.EventConnectionVoiceConnectSucceeded; + "connection.command.error": event.EventConnectionCommandError; + "reconnect.scheduled": event.EventReconnectScheduled; + "reconnect.canceled": event.EventReconnectCanceled; + "reconnect.execute": event.EventReconnectExecute; + "server.welcome.message": event.EventWelcomeMessage; + "server.host.message": event.EventWelcomeMessage; + "server.host.message.disconnect": event.EventHostMessageDisconnect; + "server.closed": event.EventServerClosed; + "server.requires.password": event.EventServerRequiresPassword; + "server.banned": event.EventServerBanned; + "client.view.enter": event.EventClientEnter; + "client.view.move": event.EventClientMove; + "client.view.leave": event.EventClientLeave; + "client.view.enter.own.channel": event.EventClientEnter; + "client.view.move.own.channel": event.EventClientMove; + "client.view.leave.own.channel": event.EventClientLeave; + "client.view.move.own": event.EventClientMove; + "client.nickname.change.failed": event.EventClientNicknameChangeFailed; + "client.nickname.changed": event.EventClientNicknameChanged; + "client.nickname.changed.own": event.EventClientNicknameChanged; + "channel.create": event.EventChannelCreate; + "channel.show": event.EventChannelToggle; + "channel.hide": event.EventChannelToggle; + "channel.delete": event.EventChannelDelete; + "client.poke.received": event.EventClientPokeReceived; + "client.poke.send": event.EventClientPokeSend; + "private.message.received": event.EventPrivateMessageReceived; + "private.message.send": event.EventPrivateMessageSend; + "webrtc.fatal.error": event.EventWebrtcFatalError; + "disconnected": any; +} +export interface EventDispatcher { + log(data: TypeInfo[EventType], logger: ServerEventLog): React.ReactNode; + notify(data: TypeInfo[EventType], logger: ServerEventLog): any; + sound(data: TypeInfo[EventType], logger: ServerEventLog): any; +} +export interface ServerLogUIEvents { + "query_log": {}; + "notify_log": { + log: LogMessage[]; + }; + "notify_log_add": { + event: LogMessage; + }; + "notify_show": {}; +} diff --git a/imports/shared-app/connectionlog/DispatcherFocus.d.ts b/imports/shared-app/connectionlog/DispatcherFocus.d.ts new file mode 100644 index 0000000..bb786c6 --- /dev/null +++ b/imports/shared-app/connectionlog/DispatcherFocus.d.ts @@ -0,0 +1,3 @@ +import { EventType } from "tc-shared/connectionlog/Definitions"; +export declare function requestWindowFocus(): void; +export declare function isFocusRequestEnabled(type: EventType): any; diff --git a/imports/shared-app/connectionlog/DispatcherNotifications.d.ts b/imports/shared-app/connectionlog/DispatcherNotifications.d.ts new file mode 100644 index 0000000..180eca5 --- /dev/null +++ b/imports/shared-app/connectionlog/DispatcherNotifications.d.ts @@ -0,0 +1,5 @@ +import { EventType, TypeInfo } from "tc-shared/connectionlog/Definitions"; +export declare type DispatcherLog = (data: TypeInfo[T], handlerId: string, eventType: T) => void; +export declare function findNotificationDispatcher(type: T): DispatcherLog; +export declare function getRegisteredNotificationDispatchers(): TypeInfo[]; +export declare function isNotificationEnabled(type: EventType): any; diff --git a/imports/shared-app/connectionlog/History.d.ts b/imports/shared-app/connectionlog/History.d.ts new file mode 100644 index 0000000..c78d19f --- /dev/null +++ b/imports/shared-app/connectionlog/History.d.ts @@ -0,0 +1,72 @@ +export declare const kUnknownHistoryServerUniqueId = "unknown"; +export declare type ConnectionHistoryEntry = { + id: number; + timestamp: number; + serverUniqueId: string | typeof kUnknownHistoryServerUniqueId; + targetAddress: string; + nickname: string; + hashedPassword: string; +}; +export declare type ConnectionHistoryServerEntry = { + firstConnectTimestamp: number; + firstConnectId: number; + lastConnectTimestamp: number; + lastConnectId: number; +}; +export declare type ConnectionHistoryServerInfo = { + name: string; + iconId: number; + country: string; + clientsOnline: number | -1; + clientsMax: number | -1; + passwordProtected: boolean; +}; +export declare class ConnectionHistory { + private database; + constructor(); + initializeDatabase(): Promise; + /** + * Register a new connection attempt. + * @param attempt + * @return Returns a unique connect attempt identifier id which could be later used to set the unique server id. + */ + logConnectionAttempt(attempt: { + targetAddress: string; + nickname: string; + hashedPassword: string; + }): Promise; + private resolveDatabaseServerInfo; + private updateDatabaseServerInfo; + /** + * Update the connection attempts target server id. + * @param connectionAttemptId + * @param serverUniqueId + */ + updateConnectionServerUniqueId(connectionAttemptId: number, serverUniqueId: string): Promise; + /** + * Update the connection attempt server password + * @param connectionAttemptId + * @param passwordHash + */ + updateConnectionServerPassword(connectionAttemptId: number, passwordHash: string): Promise; + /** + * Update the server info of the given server. + * @param serverUniqueId + * @param info + */ + updateServerInfo(serverUniqueId: string, info: ConnectionHistoryServerInfo): Promise; + deleteConnectionAttempts(target: string, targetType: "address" | "server-unique-id"): Promise; + /** + * Query the server info of a given server unique id + * @param serverUniqueId + */ + queryServerInfo(serverUniqueId: string): Promise<(ConnectionHistoryServerInfo & ConnectionHistoryServerEntry) | undefined>; + /** + * Query the last connected addresses/servers. + * @param maxUniqueServers + */ + lastConnectedServers(maxUniqueServers: number): Promise; + lastConnectInfo(target: string, targetType: "address" | "server-unique-id", onlySucceeded?: boolean): Promise; + countConnectCount(target: string, targetType: "address" | "server-unique-id"): Promise; +} +export declare let connectionHistory: ConnectionHistory; diff --git a/imports/shared-app/connectionlog/ServerEventLog.d.ts b/imports/shared-app/connectionlog/ServerEventLog.d.ts new file mode 100644 index 0000000..6297a3a --- /dev/null +++ b/imports/shared-app/connectionlog/ServerEventLog.d.ts @@ -0,0 +1,18 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +import { LogMessage, TypeInfo } from "tc-shared/connectionlog/Definitions"; +export interface ServerEventLogEvents { + notify_log_add: { + event: LogMessage; + }; +} +export declare class ServerEventLog { + readonly events: Registry; + private readonly connection; + private maxHistoryLength; + private eventLog; + constructor(connection: ConnectionHandler); + log(type: T, data: TypeInfo[T]): void; + getHistory(): LogMessage[]; + destroy(): void; +} diff --git a/imports/shared-app/conversations/AbstractConversion.d.ts b/imports/shared-app/conversations/AbstractConversion.d.ts new file mode 100644 index 0000000..a8934af --- /dev/null +++ b/imports/shared-app/conversations/AbstractConversion.d.ts @@ -0,0 +1,128 @@ +import { ChatEvent, ChatEventMessage, ChatMessage, ChatState, ConversationHistoryResponse } from "../ui/frames/side/AbstractConversationDefinitions"; +import { Registry } from "tc-shared/events"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ChannelConversationMode } from "tc-shared/tree/Channel"; +export declare const kMaxChatFrameMessageSize = 50; +export interface AbstractConversationEvents { + notify_chat_event: { + triggerUnread: boolean; + event: ChatEvent; + }; + notify_unread_timestamp_changed: { + timestamp: number; + }; + notify_unread_state_changed: { + unread: boolean; + }; + notify_send_toggle: { + enabled: boolean; + }; + notify_state_changed: { + oldSTate: ChatState; + newState: ChatState; + }; + notify_history_state_changed: { + hasHistory: boolean; + }; + notify_conversation_mode_changed: { + newMode: ChannelConversationMode; + }; + notify_read_state_changed: { + readable: boolean; + }; +} +export declare abstract class AbstractChat { + readonly events: Registry; + protected readonly connection: ConnectionHandler; + protected readonly chatId: string; + protected presentMessages: ChatEvent[]; + protected presentEvents: Exclude[]; + private mode; + protected failedPermission: string; + protected errorMessage: string; + private conversationMode; + protected unreadTimestamp: number; + protected unreadState: boolean; + protected messageSendEnabled: boolean; + private conversationReadable; + private history; + protected constructor(connection: ConnectionHandler, chatId: string); + destroy(): void; + getCurrentMode(): ChatState; + protected setCurrentMode(mode: ChatState): void; + registerChatEvent(event: ChatEvent, triggerUnread: boolean): void; + protected registerIncomingMessage(message: ChatMessage, isOwnMessage: boolean, uniqueId: string): void; + protected doSendMessage(message: string, targetMode: number, target: number): Promise; + getChatId(): string; + isUnread(): boolean; + getConversationMode(): ChannelConversationMode; + isPrivate(): boolean; + protected setConversationMode(mode: ChannelConversationMode, logChange: boolean): void; + isReadable(): boolean; + protected setReadable(flag: boolean): void; + isSendEnabled(): boolean; + getUnreadTimestamp(): number | undefined; + getPresentMessages(): ChatEvent[]; + getPresentEvents(): ChatEvent[]; + getErrorMessage(): string | undefined; + getFailedPermission(): string | undefined; + setUnreadTimestamp(timestamp: number): void; + protected updateUnreadState(): void; + hasHistory(): boolean; + protected setHistory(hasHistory: boolean): void; + protected lastEvent(): ChatEvent | undefined; + protected sendMessageSendingEnabled(enabled: boolean): void; + abstract queryHistory(criteria: { + begin?: number; + end?: number; + limit?: number; + }): Promise; + abstract queryCurrentMessages(): any; + abstract sendMessage(text: string): any; +} +export interface AbstractChatManagerEvents { + notify_selected_changed: { + oldConversation: ConversationType; + newConversation: ConversationType; + }; + notify_conversation_destroyed: { + conversation: ConversationType; + }; + notify_conversation_created: { + conversation: ConversationType; + }; + notify_unread_count_changed: { + unreadConversations: number; + }; + notify_cross_conversation_support_changed: { + crossConversationSupported: boolean; + }; +} +export declare abstract class AbstractChatManager, ConversationType extends AbstractChat, ConversationEvents extends AbstractConversationEvents> { + readonly events: Registry; + readonly connection: ConnectionHandler; + protected readonly listenerConnection: (() => void)[]; + private readonly listenerUnreadTimestamp; + private conversations; + private selectedConversation; + private currentUnreadCount; + private crossConversationSupport; + historyUiStates: { + [id: string]: { + executingUIHistoryQuery: boolean; + historyErrorMessage: string | undefined; + historyRetryTimestamp: number; + }; + }; + protected constructor(connection: ConnectionHandler); + destroy(): void; + getConversations(): ConversationType[]; + getUnreadCount(): number; + hasCrossConversationSupport(): boolean; + getSelectedConversation(): ConversationType; + setSelectedConversation(conversation: ConversationType | undefined): void; + findConversationById(id: string): ConversationType; + protected registerConversation(conversation: ConversationType): void; + protected unregisterConversation(conversation: ConversationType): void; + protected setCrossConversationSupport(supported: boolean): void; +} diff --git a/imports/shared-app/conversations/ChannelConversationManager.d.ts b/imports/shared-app/conversations/ChannelConversationManager.d.ts new file mode 100644 index 0000000..8ef5b27 --- /dev/null +++ b/imports/shared-app/conversations/ChannelConversationManager.d.ts @@ -0,0 +1,57 @@ +import { AbstractChat, AbstractConversationEvents, AbstractChatManager, AbstractChatManagerEvents } from "./AbstractConversion"; +import { ChatMessage, ConversationHistoryResponse } from "../ui/frames/side/AbstractConversationDefinitions"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ChannelConversationMode } from "tc-shared/tree/Channel"; +export interface ChannelConversationEvents extends AbstractConversationEvents { + notify_messages_deleted: { + messages: string[]; + }; + notify_messages_loaded: {}; +} +export declare class ChannelConversation extends AbstractChat { + private readonly handle; + readonly conversationId: number; + private conversationVolatile; + private preventUnreadUpdate; + private executingHistoryQueries; + private pendingHistoryQueries; + historyQueryResponse: ChatMessage[]; + constructor(handle: ChannelConversationManager, id: number); + destroy(): void; + queryHistory(criteria: { + begin?: number; + end?: number; + limit?: number; + }): Promise; + queryCurrentMessages(): void; + canClientAccessChat(): boolean; + private executeHistoryQuery; + updateIndexFromServer(info: any): void; + handleIncomingMessage(message: ChatMessage, isOwnMessage: boolean): void; + handleDeleteMessages(criteria: { + begin: number; + end: number; + cldbid: number; + limit: number; + }): void; + deleteMessage(messageUniqueId: string): void; + setUnreadTimestamp(timestamp: number): void; + setConversationMode(mode: ChannelConversationMode, logChange: boolean): void; + localClientSwitchedChannel(type: "join" | "leave"): void; + sendMessage(text: string): void; + updateAccessState(): void; +} +export interface ChannelConversationManagerEvents extends AbstractChatManagerEvents { +} +export declare class ChannelConversationManager extends AbstractChatManager { + readonly connection: ConnectionHandler; + constructor(connection: ConnectionHandler); + destroy(): void; + findConversation(channelId: number): ChannelConversation; + findOrCreateConversation(channelId: number): ChannelConversation; + destroyConversation(id: number): void; + queryUnreadFlags(): void; + private handleConversationHistory; + private handleConversationIndex; + private handleConversationMessageDelete; +} diff --git a/imports/shared-app/conversations/PrivateConversationHistory.d.ts b/imports/shared-app/conversations/PrivateConversationHistory.d.ts new file mode 100644 index 0000000..f34341c --- /dev/null +++ b/imports/shared-app/conversations/PrivateConversationHistory.d.ts @@ -0,0 +1,13 @@ +import { ChatEvent } from "../ui/frames/side/AbstractConversationDefinitions"; +export declare function queryConversationEvents(clientUniqueId: string, query: { + begin: number; + end: number; + direction: "backwards" | "forwards"; + limit: number; +}): Promise<{ + events: (ChatEvent & { + databaseId: number; + })[]; + hasMore: boolean; +}>; +export declare function registerConversationEvent(clientUniqueId: string, event: ChatEvent): Promise; diff --git a/imports/shared-app/conversations/PrivateConversationManager.d.ts b/imports/shared-app/conversations/PrivateConversationManager.d.ts new file mode 100644 index 0000000..3614bef --- /dev/null +++ b/imports/shared-app/conversations/PrivateConversationManager.d.ts @@ -0,0 +1,67 @@ +import { AbstractChat, AbstractConversationEvents, AbstractChatManager, AbstractChatManagerEvents } from "tc-shared/conversations/AbstractConversion"; +import { ClientEntry } from "tc-shared/tree/Client"; +import { ChatEvent, ChatMessage, ConversationHistoryResponse } from "../ui/frames/side/AbstractConversationDefinitions"; +import { ChannelTreeEvents } from "tc-shared/tree/ChannelTree"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare type OutOfViewClient = { + nickname: string; + clientId: number; + uniqueId: string; +}; +export interface PrivateConversationEvents extends AbstractConversationEvents { + notify_partner_typing: {}; + notify_partner_changed: { + chatId: string; + clientId: number; + name: string; + }; + notify_partner_name_changed: { + chatId: string; + name: string; + }; +} +export declare class PrivateConversation extends AbstractChat { + readonly clientUniqueId: string; + private activeClientListener; + private activeClient; + private lastClientInfo; + private conversationOpen; + constructor(manager: PrivateConversationManager, client: ClientEntry | OutOfViewClient); + destroy(): void; + getActiveClient(): ClientEntry | OutOfViewClient | undefined; + currentClientId(): number; + getLastClientInfo(): OutOfViewClient; + setActiveClientEntry(client: ClientEntry | OutOfViewClient | undefined): void; + hasUnreadMessages(): boolean; + handleIncomingMessage(client: ClientEntry | OutOfViewClient, isOwnMessage: boolean, message: ChatMessage): void; + handleChatRemotelyClosed(clientId: number): void; + handleClientEnteredView(client: ClientEntry, mode: "server-join" | "local-reconnect" | "appear"): void; + handleRemoteComposing(_clientId: number): void; + sendMessage(text: string): void; + sendChatClose(): void; + handleEventLeftView(event: ChannelTreeEvents["notify_client_leave_view"]): void; + private registerClientEvents; + private unregisterClientEvents; + private updateClientInfo; + setUnreadTimestamp(timestamp: number): void; + canClientAccessChat(): boolean; + handleLocalClientDisconnect(explicitDisconnect: boolean): void; + queryCurrentMessages(): void; + registerChatEvent(event: ChatEvent, triggerUnread: boolean): void; + queryHistory(criteria: { + begin?: number; + end?: number; + limit?: number; + }): Promise; +} +export interface PrivateConversationManagerEvents extends AbstractChatManagerEvents { +} +export declare class PrivateConversationManager extends AbstractChatManager { + readonly connection: ConnectionHandler; + private channelTreeInitialized; + constructor(connection: ConnectionHandler); + destroy(): void; + findConversation(client: ClientEntry | string): PrivateConversation; + findOrCreateConversation(client: ClientEntry | OutOfViewClient): PrivateConversation; + closeConversation(...conversations: PrivateConversation[]): void; +} diff --git a/imports/shared-app/crypto/asn1.d.ts b/imports/shared-app/crypto/asn1.d.ts new file mode 100644 index 0000000..9f99e6b --- /dev/null +++ b/imports/shared-app/crypto/asn1.d.ts @@ -0,0 +1,83 @@ +export declare 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): any; + hexByte(byte: number): string; + parseStringISO(start: any, end: any): string; + parseStringUTF(start: any, end: any): string; + parseStringBMP(start: any, end: any): string; + parseTime(start: any, end: any, shortYear: any): string; + parseInteger(start: any, end: any): string; + isASCII(start: number, end: number): boolean; + parseBitString(start: any, end: any, maxLength: any): string; + parseOctetString(start: any, end: any, maxLength: any): any; + parseOID(start: any, end: any, maxLength: any): any; +} +export declare enum TagClass { + UNIVERSAL = 0, + APPLICATION = 1, + CONTEXT = 2, + PRIVATE = 3 +} +export declare enum TagType { + EOC = 0, + BOOLEAN = 1, + INTEGER = 2, + BIT_STRING = 3, + OCTET_STRING = 4, + NULL = 5, + OBJECT_IDENTIFIER = 6, + ObjectDescriptor = 7, + EXTERNAL = 8, + REAL = 9, + ENUMERATED = 10, + EMBEDDED_PDV = 11, + UTF8String = 12, + SEQUENCE = 16, + SET = 17, + NumericString = 18, + PrintableString = 19, + TeletextString = 20, + VideotexString = 21, + IA5String = 22, + UTCTime = 23, + GeneralizedTime = 24, + GraphicString = 25, + VisibleString = 26, + GeneralString = 27, + UniversalString = 28, + BMPString = 30 +} +declare class ASN1Tag { + tagClass: TagClass; + type: TagType; + tagConstructed: boolean; + tagNumber: number; + constructor(stream: Stream); + isUniversal(): boolean; + isEOC(): boolean; +} +export declare 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): any; + typeName(): string; + toString(): string; + toPrettyString(indent: any): string; + posStart(): number; + posContent(): number; + posEnd(): number; + static decodeLength(stream: Stream): any; + static encodeLength(buffer: Uint8Array, offset: number, length: number): void; +} +export declare function decode(stream: string | ArrayBuffer): ASN1; +export {}; diff --git a/imports/shared-app/crypto/crc32.d.ts b/imports/shared-app/crypto/crc32.d.ts new file mode 100644 index 0000000..c219105 --- /dev/null +++ b/imports/shared-app/crypto/crc32.d.ts @@ -0,0 +1,7 @@ +export declare class Crc32 { + private static readonly lookup; + private crc; + constructor(); + update(data: ArrayBufferLike): void; + digest(radix: number): string; +} diff --git a/imports/shared-app/crypto/hex.d.ts b/imports/shared-app/crypto/hex.d.ts new file mode 100644 index 0000000..4a6ebd5 --- /dev/null +++ b/imports/shared-app/crypto/hex.d.ts @@ -0,0 +1 @@ +export declare function encode(buffer: any): string; diff --git a/imports/shared-app/crypto/md5.d.ts b/imports/shared-app/crypto/md5.d.ts new file mode 100644 index 0000000..4935a45 --- /dev/null +++ b/imports/shared-app/crypto/md5.d.ts @@ -0,0 +1 @@ +export declare function md5(uint8Array: Uint8Array): string; diff --git a/imports/shared-app/crypto/sha.d.ts b/imports/shared-app/crypto/sha.d.ts new file mode 100644 index 0000000..8cd0898 --- /dev/null +++ b/imports/shared-app/crypto/sha.d.ts @@ -0,0 +1,2 @@ +export declare function encode_text(buffer: string): ArrayBuffer; +export declare function sha1(message: string | ArrayBuffer): PromiseLike; diff --git a/imports/shared-app/crypto/uid.d.ts b/imports/shared-app/crypto/uid.d.ts new file mode 100644 index 0000000..607543b --- /dev/null +++ b/imports/shared-app/crypto/uid.d.ts @@ -0,0 +1 @@ +export declare function guid(): string; diff --git a/imports/shared-app/devel_main.d.ts b/imports/shared-app/devel_main.d.ts new file mode 100644 index 0000000..9489fbc --- /dev/null +++ b/imports/shared-app/devel_main.d.ts @@ -0,0 +1 @@ +import "./proto"; diff --git a/imports/shared-app/dns.d.ts b/imports/shared-app/dns.d.ts new file mode 100644 index 0000000..717c12d --- /dev/null +++ b/imports/shared-app/dns.d.ts @@ -0,0 +1,15 @@ +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 declare const default_options: ResolveOptions; diff --git a/imports/shared-app/events.d.ts b/imports/shared-app/events.d.ts new file mode 100644 index 0000000..9eff02b --- /dev/null +++ b/imports/shared-app/events.d.ts @@ -0,0 +1 @@ +export * from "tc-events"; diff --git a/imports/shared-app/events/ClientGlobalControlHandler.d.ts b/imports/shared-app/events/ClientGlobalControlHandler.d.ts new file mode 100644 index 0000000..48e64e4 --- /dev/null +++ b/imports/shared-app/events/ClientGlobalControlHandler.d.ts @@ -0,0 +1,3 @@ +import { Registry } from "../events"; +import { ClientGlobalControlEvents } from "../events/GlobalEvents"; +export declare function initialize(event_registry: Registry): void; diff --git a/imports/shared-app/events/GlobalEvents.d.ts b/imports/shared-app/events/GlobalEvents.d.ts new file mode 100644 index 0000000..e6ab2a1 --- /dev/null +++ b/imports/shared-app/events/GlobalEvents.d.ts @@ -0,0 +1,39 @@ +import { ConnectionHandler } from "../ConnectionHandler"; +import { Registry } from "../events"; +import { VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +export declare type PermissionEditorTab = "groups-server" | "groups-channel" | "channel" | "client" | "client-channel"; +export interface ClientGlobalControlEvents { + action_open_window: { + window: "settings" | /* use action_open_window_settings! */ "about" | "settings-registry" | "css-variable-editor" | "bookmark-manage" | "query-manage" | "query-create" | "ban-list" | "permissions" | "token-list" | "token-use" | "server-echo-test"; + connection?: ConnectionHandler; + }; + action_w2g: { + following: number; + handlerId: string; + } | { + videoUrl: string; + handlerId: string; + }; + action_toggle_video_broadcasting: { + connection: ConnectionHandler; + broadcastType: VideoBroadcastType; + enabled: boolean; + quickSelect?: boolean; + defaultDevice?: string; + }; + action_edit_video_broadcasting: { + connection: ConnectionHandler; + broadcastType: VideoBroadcastType; + }; + action_open_window_connect: { + newTab: boolean; + }; + action_open_window_settings: { + defaultCategory?: string; + }; + action_open_window_permissions: { + connection?: ConnectionHandler; + defaultTab: PermissionEditorTab; + }; +} +export declare const global_client_actions: Registry; diff --git a/imports/shared-app/file/Avatars.d.ts b/imports/shared-app/file/Avatars.d.ts new file mode 100644 index 0000000..27e75cc --- /dev/null +++ b/imports/shared-app/file/Avatars.d.ts @@ -0,0 +1,64 @@ +import { Registry } from "../events"; +export declare const kIPCAvatarChannel = "avatars"; +export declare const kLoadingAvatarImage = "img/loading_image.svg"; +export declare const kDefaultAvatarImage = "img/style/avatar.png"; +export declare type AvatarState = "unset" | "loading" | "errored" | "loaded"; +export interface AvatarStateData { + "unset": {}; + "loading": {}; + "errored": { + message: string; + }; + "loaded": { + url: string; + }; +} +interface AvatarEvents { + avatar_changed: { + newAvatarHash: string; + }; + avatar_state_changed: { + oldState: AvatarState; + newState: AvatarState; + newStateData: AvatarStateData[keyof AvatarStateData]; + }; +} +export declare abstract class ClientAvatar { + readonly events: Registry; + readonly clientAvatarId: string; + private currentAvatarHash; + private state; + private stateData; + loadingTimestamp: number; + constructor(clientAvatarId: string); + destroy(): void; + protected setState(state: T, data: AvatarStateData[T], force?: boolean): void; + getTypedStateData(state: T): AvatarStateData[T]; + setUnset(): void; + setLoading(): void; + setLoaded(data: AvatarStateData["loaded"]): void; + setErrored(data: AvatarStateData["errored"]): void; + awaitLoaded(): Promise; + getState(): AvatarState; + getStateData(): AvatarStateData[AvatarState]; + getAvatarHash(): string | "unknown"; + getAvatarUrl(): string; + getLoadError(): string; + protected abstract destroyStateData(state: AvatarState, data: AvatarStateData[AvatarState]): any; +} +export declare abstract class AbstractAvatarManager { + abstract resolveAvatar(clientAvatarId: string, avatarHash?: string): ClientAvatar; + abstract resolveClientAvatar(client: { + id?: number; + database_id?: number; + clientUniqueId: string; + }): any; +} +export declare abstract class AbstractAvatarManagerFactory { + abstract hasManager(handlerId: string): boolean; + abstract getManager(handlerId: string): AbstractAvatarManager; +} +export declare function setGlobalAvatarManagerFactory(factory: AbstractAvatarManagerFactory): void; +export declare function getGlobalAvatarManagerFactory(): AbstractAvatarManagerFactory; +export declare function uniqueId2AvatarId(unique_id: string): string; +export {}; diff --git a/imports/shared-app/file/FileManager.d.ts b/imports/shared-app/file/FileManager.d.ts new file mode 100644 index 0000000..7cb154f --- /dev/null +++ b/imports/shared-app/file/FileManager.d.ts @@ -0,0 +1,70 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { CommandResult } from "tc-shared/connection/ServerConnectionDeclaration"; +import { AvatarManager } from "tc-shared/file/LocalAvatars"; +import { FileDownloadTransfer, FileTransfer, FileUploadTransfer, FinishedFileTransfer, TransferSourceSupplier, TransferTargetSupplier } from "tc-shared/file/Transfer"; +import { Registry } from "tc-shared/events"; +export declare enum FileType { + DIRECTORY = 0, + FILE = 1 +} +export interface FileInfo { + name: string; + type: FileType; + datetime: number; + size: number; + empty: boolean; +} +export declare type InitializeUploadOptions = { + path: string; + name: string; + channel?: number; + channelPassword?: string; + source: TransferSourceSupplier; +}; +export declare type InitializeDownloadOptions = { + path: string; + name: string; + channel?: number; + channelPassword?: string; + targetSupplier: TransferTargetSupplier; +}; +export interface FileManagerEvents { + notify_transfer_registered: { + transfer: FileTransfer; + }; +} +export declare class FileManager { + private static readonly MAX_CONCURRENT_TRANSFERS; + readonly connectionHandler: ConnectionHandler; + readonly avatars: AvatarManager; + readonly events: Registry; + readonly finishedTransfers: FinishedFileTransfer[]; + private readonly commandHandler; + private readonly registeredTransfers_; + private clientTransferIdIndex; + private scheduledTransferUpdate; + private transerUpdateIntervalId; + constructor(connection: any); + destroy(): void; + requestFileList(path: string, channelId?: number, channelPassword?: string): Promise; + requestFileInfo(files: { + channelId?: number; + channelPassword?: string; + path: string; + }[]): Promise<(FileInfo | CommandResult)[]>; + deleteFile(props: { + name: string; + path?: string; + cid?: number; + cpw?: string; + }): Promise; + deleteIcon(iconId: number): Promise; + registeredTransfers(): FileTransfer[]; + findTransfer(id: number): FileTransfer; + findTransfer(channelId: number, path: string, name: string): FileTransfer; + initializeFileDownload(options: InitializeDownloadOptions): FileDownloadTransfer; + initializeFileUpload(options: InitializeUploadOptions): FileUploadTransfer; + private registerTransfer; + private scheduleTransferUpdate; + private updateRegisteredTransfers; +} diff --git a/imports/shared-app/file/Icons.d.ts b/imports/shared-app/file/Icons.d.ts new file mode 100644 index 0000000..74e8550 --- /dev/null +++ b/imports/shared-app/file/Icons.d.ts @@ -0,0 +1,61 @@ +import { Registry } from "tc-shared/events"; +export declare const kIPCIconChannel = "icons"; +export declare const kGlobalIconHandlerId = "global"; +export interface RemoteIconEvents { + notify_state_changed: { + oldState: RemoteIconState; + newState: RemoteIconState; + }; +} +export declare type RemoteIconState = "loading" | "loaded" | "error" | "empty" | "destroyed"; +export declare type RemoteIconInfo = { + iconId: number; + serverUniqueId: string; + handlerId?: string; +}; +export declare abstract class RemoteIcon { + readonly events: Registry; + readonly iconId: number; + readonly serverUniqueId: string; + private state; + protected imageUrl: string; + protected errorMessage: string; + protected constructor(serverUniqueId: string, iconId: number); + destroy(): void; + getState(): RemoteIconState; + protected setState(state: RemoteIconState): void; + hasImageUrl(): boolean; + /** + * Will throw an string if the icon isn't in loaded state + */ + getImageUrl(): string; + protected setImageUrl(url: string): void; + /** + * Will throw an string if the state isn't error + */ + getErrorMessage(): string | undefined; + protected setErrorMessage(message: string): void; + /** + * Waits 'till the icon has been loaded or any other, non loading, state has been reached. + */ + awaitLoaded(): Promise; + /** + * Returns true if the icon isn't loading any more. + * This includes all other states like error, destroy or empty. + */ + isLoaded(): boolean; +} +export declare abstract class AbstractIconManager { + protected static iconUniqueKey(iconId: number, serverUniqueId: string): string; + /** + * @param iconId The requested icon + * @param serverUniqueId The server unique id for the icon + * @param handlerId Hint which connection handler should be used if we're downloading the icon + */ + abstract resolveIcon(iconId: number, serverUniqueId?: string, handlerId?: string): RemoteIcon; +} +export declare function setIconManager(instance: AbstractIconManager): void; +export declare function getIconManager(): AbstractIconManager; +export declare function generateIconJQueryTag(icon: RemoteIcon | undefined, options?: { + animate?: boolean; +}): JQuery; diff --git a/imports/shared-app/file/ImageCache.d.ts b/imports/shared-app/file/ImageCache.d.ts new file mode 100644 index 0000000..2462308 --- /dev/null +++ b/imports/shared-app/file/ImageCache.d.ts @@ -0,0 +1,35 @@ +export declare enum ImageType { + UNKNOWN = 0, + BITMAP = 1, + PNG = 2, + GIF = 3, + SVG = 4, + JPEG = 5 +} +export declare function imageType2MediaType(type: ImageType, file?: boolean): "svg" | "jpeg" | "png" | "bmp" | "gif" | "svg+xml"; +export declare function responseImageType(encoded_data: string | ArrayBuffer, base64_encoded?: boolean): ImageType; +export declare type ImageCacheState = { + state: "loaded"; + instance: Cache; +} | { + state: "errored"; + reason: string; +} | { + state: "unloaded"; +}; +export declare class ImageCache { + readonly cacheName: string; + private state; + private constructor(); + static load(cacheName: string): Promise; + private initialize; + private getCacheInstance; + isPersistent(): boolean; + reset(): Promise; + cleanup(maxAge: number): Promise; + resolveCached(key: string, maxAge?: number): Promise; + putCache(key: string, value: Response, type?: string, headers?: { + [key: string]: string; + }): Promise; + delete(key: string): Promise; +} diff --git a/imports/shared-app/file/LocalAvatars.d.ts b/imports/shared-app/file/LocalAvatars.d.ts new file mode 100644 index 0000000..30db201 --- /dev/null +++ b/imports/shared-app/file/LocalAvatars.d.ts @@ -0,0 +1,25 @@ +import { FileManager } from "../file/FileManager"; +import { FileDownloadTransfer } from "../file/Transfer"; +import { AbstractAvatarManager, ClientAvatar } from "../file/Avatars"; +export declare class AvatarManager extends AbstractAvatarManager { + readonly handle: FileManager; + private cachedAvatars; + constructor(handle: FileManager); + destroy(): void; + create_avatar_download(client_avatar_id: string): FileDownloadTransfer; + private executeAvatarLoad0; + private executeAvatarLoad; + updateCache(clientAvatarId: string, clientAvatarHash: string): Promise; + resolveAvatar(clientAvatarId: string, avatarHash?: string, cacheOnly?: boolean): ClientAvatar; + resolveClientAvatar(client: { + id?: number; + database_id?: number; + clientUniqueId: string; + }): ClientAvatar; + private static generate_default_image; + generate_chat_tag(client: { + id?: number; + database_id?: number; + }, client_unique_id: string, callback_loaded?: (successfully: boolean, error?: any) => any): JQuery; + flush_cache(): void; +} diff --git a/imports/shared-app/file/LocalIcons.d.ts b/imports/shared-app/file/LocalIcons.d.ts new file mode 100644 index 0000000..62f07a2 --- /dev/null +++ b/imports/shared-app/file/LocalIcons.d.ts @@ -0,0 +1,2 @@ +import { ImageCache } from "tc-shared/file/ImageCache"; +export declare let localIconCache: ImageCache; diff --git a/imports/shared-app/file/RemoteAvatars.d.ts b/imports/shared-app/file/RemoteAvatars.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/file/RemoteAvatars.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/file/RemoteIcons.d.ts b/imports/shared-app/file/RemoteIcons.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/file/RemoteIcons.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/file/Transfer.d.ts b/imports/shared-app/file/Transfer.d.ts new file mode 100644 index 0000000..16da093 --- /dev/null +++ b/imports/shared-app/file/Transfer.d.ts @@ -0,0 +1,199 @@ +import { Registry } from "../events"; +import { CommandResult } from "../connection/ServerConnectionDeclaration"; +import { ErrorCode } from "../connection/ErrorCode"; +export declare enum TransferSourceType { + BROWSER_FILE = 0, + BUFFER = 1, + TEXT = 2 +} +export declare abstract class TransferSource { + readonly type: TransferSourceType; + protected constructor(type: TransferSourceType); + abstract fileSize(): Promise; +} +export declare abstract class BrowserFileTransferSource extends TransferSource { + protected constructor(); + abstract getFile(): File; +} +export declare abstract class BufferTransferSource extends TransferSource { + protected constructor(); + abstract getBuffer(): ArrayBuffer; +} +export declare abstract class TextTransferSource extends TransferSource { + protected constructor(); + abstract getText(): string; +} +export declare type TransferSourceSupplier = (transfer: FileUploadTransfer) => Promise; +export declare enum TransferTargetType { + RESPONSE = 0, + DOWNLOAD = 1, + FILE = 2 +} +export declare abstract class TransferTarget { + readonly type: TransferTargetType; + protected constructor(type: TransferTargetType); +} +export declare abstract class DownloadTransferTarget extends TransferTarget { + protected constructor(); +} +export declare abstract class ResponseTransferTarget extends TransferTarget { + protected constructor(); + abstract hasResponse(): boolean; + abstract getResponse(): Response; +} +export declare abstract class FileTransferTarget extends TransferTarget { + protected constructor(); + abstract getFilePath(): string; + abstract hasFileName(): boolean; + abstract getFileName(): string; +} +export declare type TransferTargetSupplier = (transfer: FileDownloadTransfer) => Promise; +export declare enum FileTransferState { + PENDING = 0, + INITIALIZING = 1, + CONNECTING = 2, + RUNNING = 3, + FINISHED = 4, + ERRORED = 5, + CANCELED = 6 +} +export declare enum CancelReason { + USER_ACTION = 0, + SERVER_DISCONNECTED = 1 +} +export declare enum FileTransferDirection { + UPLOAD = 0, + DOWNLOAD = 1 +} +export interface FileTransferEvents { + "notify_state_updated": { + oldState: FileTransferState; + newState: FileTransferState; + }; + "notify_progress": { + progress: TransferProgress; + }; + "notify_transfer_canceled": {}; +} +export interface TransferProperties { + channel_id: number | 0; + path: string; + name: string; +} +export interface InitializedTransferProperties { + serverTransferId: number; + transferKey: string; + addresses: { + serverAddress: string; + serverPort: number; + }[]; + protocol: number; + seekOffset: number; + fileSize?: number; +} +export interface TransferInitializeError { + error: "initialize"; + commandResult: string | CommandResult; +} +export interface TransferConnectError { + error: "connection"; + reason: "missing-provider" | "provider-initialize-error" | "handle-initialize-error" | "network-error"; + extraMessage?: string; +} +export interface TransferIOError { + error: "io"; + reason: "unsupported-target" | "failed-to-initialize-target" | "buffer-transfer-failed"; + extraMessage?: string; +} +export interface TransferErrorStatus { + error: "status"; + status: ErrorCode; + extraMessage: string; +} +export interface TransferErrorTimeout { + error: "timeout"; +} +export declare type TransferErrorType = TransferInitializeError | TransferConnectError | TransferIOError | TransferErrorStatus | TransferErrorTimeout; +export interface TransferProgress { + timestamp: number; + file_bytes_transferred: number; + file_current_offset: number; + file_start_offset: number; + file_total_size: number; + network_bytes_received: number; + network_bytes_send: number; + network_current_speed: number; + network_average_speed: number; +} +export interface TransferTimings { + timestampScheduled: number; + timestampExecuted: number; + timestampTransferBegin: number; + timestampEnd: number; +} +export interface FinishedFileTransfer { + readonly clientTransferId: number; + readonly timings: TransferTimings; + readonly properties: TransferProperties; + readonly direction: FileTransferDirection; + readonly state: FileTransferState.CANCELED | FileTransferState.FINISHED | FileTransferState.ERRORED; + readonly transferError?: TransferErrorType; + readonly transferErrorMessage?: string; + readonly bytesTransferred: number; +} +export declare class FileTransfer { + readonly events: Registry; + readonly clientTransferId: number; + readonly direction: FileTransferDirection; + readonly properties: TransferProperties; + readonly timings: TransferTimings; + lastStateUpdate: number; + private cancelReason; + private transferProperties_; + private transferError_; + private transferErrorMessage_; + private transferState_; + private progress_; + protected constructor(direction: any, clientTransferId: any, properties: any); + destroy(): void; + isRunning(): boolean; + isPending(): boolean; + isFinished(): boolean; + transferState(): FileTransferState; + transferProperties(): InitializedTransferProperties | undefined; + currentError(): TransferErrorType | undefined; + currentErrorMessage(): string | undefined; + lastProgressInfo(): TransferProgress | undefined; + setFailed(error: TransferErrorType, asMessage: string): void; + setProperties(properties: InitializedTransferProperties): void; + requestCancel(reason: CancelReason): void; + setTransferState(newState: FileTransferState): void; + updateProgress(progress: TransferProgress): void; + awaitFinished(): Promise; +} +export declare class FileDownloadTransfer extends FileTransfer { + readonly targetSupplier: TransferTargetSupplier; + target: TransferTarget; + constructor(clientTransferId: any, properties: TransferProperties, targetSupplier: any); +} +export declare class FileUploadTransfer extends FileTransfer { + readonly sourceSupplier: TransferSourceSupplier; + source: TransferSource; + fileSize: number; + constructor(clientTransferId: any, properties: TransferProperties, sourceSupplier: any); +} +export declare abstract class TransferProvider { + private static instance_; + static provider(): TransferProvider; + static setProvider(provider: TransferProvider): void; + abstract executeFileDownload(transfer: FileDownloadTransfer): any; + abstract executeFileUpload(transfer: FileUploadTransfer): any; + abstract targetSupported(type: TransferTargetType): any; + abstract sourceSupported(type: TransferSourceType): any; + createResponseTarget(): Promise; + createDownloadTarget(filename?: string): Promise; + createFileTarget(path?: string, filename?: string): Promise; + createBufferSource(buffer: ArrayBuffer): Promise; + createTextSource(text: string): Promise; + createBrowserFileSource(file: File): Promise; +} diff --git a/imports/shared-app/i18n/country.d.ts b/imports/shared-app/i18n/country.d.ts new file mode 100644 index 0000000..738bc01 --- /dev/null +++ b/imports/shared-app/i18n/country.d.ts @@ -0,0 +1 @@ +export declare function country_name(alpha_code: string, fallback?: string): string; diff --git a/imports/shared-app/i18n/localize.d.ts b/imports/shared-app/i18n/localize.d.ts new file mode 100644 index 0000000..f901cb1 --- /dev/null +++ b/imports/shared-app/i18n/localize.d.ts @@ -0,0 +1,76 @@ +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 declare function tr(message: string, key?: string): string; +export declare function tra(message: string, ...args: (string | number | boolean)[]): string; +export declare function tra(message: string, ...args: any[]): JQuery[]; +export declare function traj(message: string, ...args: any[]): JQuery[]; +export declare function load_file(url: string, path: string): Promise; +export declare function load_repository(url: string): Promise; +export declare namespace config { + interface TranslationConfig { + current_repository_url?: string; + current_language?: string; + current_translation_url?: string; + current_translation_path?: string; + } + interface RepositoryConfig { + repositories?: { + url?: string; + repository?: TranslationRepository; + }[]; + } + function repository_config(): RepositoryConfig; + function save_repository_config(): void; + function translation_config(): TranslationConfig; + function save_translation_config(): void; +} +export declare function register_repository(repository: TranslationRepository): void; +export declare function registered_repositories(): TranslationRepository[]; +export declare function delete_repository(repository: TranslationRepository): void; +export declare function iterate_repositories(callback_entry: (repository: TranslationRepository) => any): Promise; +export declare function select_translation(repository: TranslationRepository, entry: RepositoryTranslation): void; +export declare function initialize(): Promise; +declare global { + interface Window { + tr(message: string): string; + tra(message: string, ...args: (string | number | boolean | null | undefined)[]): string; + tra(message: string, ...args: any[]): JQuery[]; + log: any; + StaticSettings: any; + } + const tr: typeof window.tr; + const tra: typeof window.tra; +} diff --git a/imports/shared-app/ipc/BrowserIPC.d.ts b/imports/shared-app/ipc/BrowserIPC.d.ts new file mode 100644 index 0000000..dd053fa --- /dev/null +++ b/imports/shared-app/ipc/BrowserIPC.d.ts @@ -0,0 +1,49 @@ +import "broadcastchannel-polyfill"; +import { ConnectHandler } from "../ipc/ConnectHandler"; +interface IpcRawMessage { + timestampSend: number; + sourcePeerId: string; + targetPeerId: string; + targetChannelId: string; + message: ChannelMessage; +} +export interface ChannelMessage { + type: string; + data: any; +} +export declare abstract class BasicIPCHandler { + protected static readonly BROADCAST_UNIQUE_ID = "00000000-0000-4000-0000-000000000000"; + protected readonly applicationChannelId: string; + protected readonly localPeerId: string; + protected registeredChannels: IPCChannel[]; + protected constructor(applicationChannelId: string); + setup(): void; + getApplicationChannelId(): string; + getLocalPeerId(): string; + abstract sendMessage(message: IpcRawMessage): any; + protected handleMessage(message: IpcRawMessage): void; + /** + * @param channelId + * @param remotePeerId The peer to receive messages from. If empty messages will be broadcasted + */ + createChannel(channelId: string, remotePeerId?: string): IPCChannel; + /** + * Create a channel which only communicates with the TeaSpeak - Core. + * @param channelId + */ + createCoreControlChannel(channelId: string): IPCChannel; + channels(): IPCChannel[]; + deleteChannel(channel: IPCChannel): void; +} +export interface IPCChannel { + /** Channel id */ + readonly channelId: string; + /** Target peer id. If set only messages from that process will be processed */ + targetPeerId?: string; + messageHandler: (sourcePeerId: string, broadcast: boolean, message: ChannelMessage) => void; + sendMessage(type: string, data: any, remotePeerId?: string): any; +} +export declare function setupIpcHandler(): void; +export declare function getIpcInstance(): BasicIPCHandler; +export declare function getInstanceConnectHandler(): ConnectHandler; +export {}; diff --git a/imports/shared-app/ipc/ConnectHandler.d.ts b/imports/shared-app/ipc/ConnectHandler.d.ts new file mode 100644 index 0000000..ba1e5d9 --- /dev/null +++ b/imports/shared-app/ipc/ConnectHandler.d.ts @@ -0,0 +1,39 @@ +import { BasicIPCHandler } from "../ipc/BrowserIPC"; +export declare type ConnectRequestData = { + address: string; + profile?: string; + username?: string; + password?: { + value: string; + hashed: boolean; + }; +}; +export interface ConnectOffer { + request_id: string; + data: ConnectRequestData; +} +export interface ConnectOfferAnswer { + request_id: string; + accepted: boolean; +} +export interface ConnectExecute { + request_id: string; +} +export interface ConnectExecuted { + request_id: string; + succeeded: boolean; + message?: string; +} +export declare class ConnectHandler { + private static readonly CHANNEL_NAME; + readonly ipc_handler: BasicIPCHandler; + private ipc_channel; + callback_available: (data: ConnectRequestData) => boolean; + callback_execute: (data: ConnectRequestData) => boolean | string; + private _pending_connect_offers; + private _pending_connects_requests; + constructor(ipc_handler: BasicIPCHandler); + setup(): void; + private onMessage; + post_connect_request(data: ConnectRequestData, callback_avail: () => Promise): Promise; +} diff --git a/imports/shared-app/log.d.ts b/imports/shared-app/log.d.ts new file mode 100644 index 0000000..488b020 --- /dev/null +++ b/imports/shared-app/log.d.ts @@ -0,0 +1,64 @@ +export declare enum LogCategory { + CHANNEL = 0, + CHANNEL_PROPERTIES = 1, + CLIENT = 2, + BOOKMARKS = 3, + SERVER = 4, + PERMISSIONS = 5, + GENERAL = 6, + NETWORKING = 7, + VOICE = 8, + CHAT = 9, + AUDIO = 10, + I18N = 11, + IPC = 12, + IDENTITIES = 13, + STATISTICS = 14, + DNS = 15, + FILE_TRANSFER = 16, + EVENT_REGISTRY = 17, + WEBRTC = 18, + VIDEO = 19 +} +export declare enum LogType { + TRACE = 0, + DEBUG = 1, + INFO = 2, + WARNING = 3, + ERROR = 4 +} +export declare let enabled_mapping: Map; +export declare let level_mapping: Map; +declare enum GroupMode { + NATIVE = 0, + PREFIX = 1 +} +export declare function initialize(defaultLogLevel: LogType): void; +export declare function logTrace(category: LogCategory, message: string, ...optionalParams: any[]): void; +export declare function logDebug(category: LogCategory, message: string, ...optionalParams: any[]): void; +export declare function logInfo(category: LogCategory, message: string, ...optionalParams: any[]): void; +export declare function logWarn(category: LogCategory, message: string, ...optionalParams: any[]): void; +export declare function logError(category: LogCategory, message: string, ...optionalParams: any[]): void; +export declare function group(level: LogType, category: LogCategory, name: string, ...optionalParams: any[]): Group; +export declare function logGroupNative(level: LogType, category: LogCategory, name: string, ...optionalParams: any[]): Group; +export declare function table(level: LogType, category: LogCategory, title: string, args: any): void; +export declare class Group { + readonly mode: GroupMode; + readonly level: LogType; + readonly category: LogCategory; + readonly enabled: boolean; + owner: Group; + private readonly name; + private readonly optionalParams; + private isCollapsed; + private initialized; + private logPrefix; + 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(): void; + get prefix(): string; + set prefix(prefix: string); +} +export {}; diff --git a/imports/shared-app/main.d.ts b/imports/shared-app/main.d.ts new file mode 100644 index 0000000..f5826ae --- /dev/null +++ b/imports/shared-app/main.d.ts @@ -0,0 +1,26 @@ +import { UrlParameterParser } from "tc-shared/settings"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ConnectRequestData } from "tc-shared/ipc/ConnectHandler"; +import "svg-sprites/client-icons"; +import "../css/load-css"; +import "./proto"; +import "./video-viewer/Controller"; +import "./profiles/ConnectionProfile"; +import "./update/UpdaterWeb"; +import "./file/LocalIcons"; +import "./connection/CommandHandler"; +import "./connection/ConnectionBase"; +import "./connection/rtc/Connection"; +import "./connection/rtc/video/Connection"; +import "./video/VideoSource"; +import "./media/Video"; +import "./ui/AppController"; +import "./ui/frames/menu-bar/MainMenu"; +import "./ui/modal/connect/Controller"; +import "./ui/elements/ContextDivider"; +import "./ui/elements/Tab"; +import "./clientservice"; +import "./text/bbcode/InviteController"; +export declare function handleNativeConnectRequest(url: URL): void; +export declare function handleConnectRequest(serverAddress: string, serverUniqueId: string | undefined, parameters: UrlParameterParser): Promise; +export declare function handle_connect_request(properties: ConnectRequestData, _connection: ConnectionHandler): void; diff --git a/imports/shared-app/media/Stream.d.ts b/imports/shared-app/media/Stream.d.ts new file mode 100644 index 0000000..2da4107 --- /dev/null +++ b/imports/shared-app/media/Stream.d.ts @@ -0,0 +1,11 @@ +import { InputStartError } from "tc-shared/voice/RecorderBase"; +export declare type MediaStreamType = "audio" | "video"; +export declare enum MediaPermissionStatus { + Unknown = 0, + Granted = 1, + Denied = 2 +} +export declare function requestMediaStreamWithConstraints(constraints: MediaTrackConstraints, type: MediaStreamType): Promise; +export declare function requestMediaStream(deviceId: string | undefined, groupId: string | undefined, type: MediaStreamType): Promise; +export declare function queryMediaPermissions(type: MediaStreamType, changeListener?: (value: PermissionState) => void): Promise; +export declare function stopMediaStream(stream: MediaStream): void; diff --git a/imports/shared-app/media/Video.d.ts b/imports/shared-app/media/Video.d.ts new file mode 100644 index 0000000..225466a --- /dev/null +++ b/imports/shared-app/media/Video.d.ts @@ -0,0 +1,39 @@ +import { ScreenCaptureDevice, VideoDevice, VideoDriver, VideoDriverEvents, VideoPermissionStatus, VideoSource, VideoSourceCapabilities, VideoSourceInitialSettings } from "tc-shared/video/VideoSource"; +import { Registry } from "tc-shared/events"; +declare global { + interface MediaDevices { + getDisplayMedia(options?: any): Promise; + } +} +export declare class WebVideoDriver implements VideoDriver { + private readonly events; + private currentPermissionStatus; + constructor(); + private setPermissionStatus; + private handleSystemPermissionState; + initialize(): Promise; + getDevices(): Promise; + requestPermissions(): Promise; + getEvents(): Registry; + getPermissionStatus(): VideoPermissionStatus; + createVideoSource(id: string | undefined): Promise; + screenQueryAvailable(): boolean; + queryScreenCaptureDevices(): Promise; + createScreenSource(_id: string | undefined, _allowFocusLoss: boolean): Promise; +} +export declare class WebVideoSource implements VideoSource { + private readonly deviceId; + private readonly displayName; + private readonly stream; + private readonly initialSettings; + private referenceCount; + constructor(deviceId: string, displayName: string, stream: MediaStream); + destroy(): void; + getId(): string; + getName(): string; + getStream(): MediaStream; + getInitialSettings(): VideoSourceInitialSettings; + getCapabilities(): VideoSourceCapabilities; + deref(): void; + ref(): this; +} diff --git a/imports/shared-app/music/PlaylistManager.d.ts b/imports/shared-app/music/PlaylistManager.d.ts new file mode 100644 index 0000000..301a9fa --- /dev/null +++ b/imports/shared-app/music/PlaylistManager.d.ts @@ -0,0 +1,95 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +export declare type PlaylistEntry = { + type: "song"; + id: number; + previousId: number; + url: string; + urlLoader: string; + invokerDatabaseId: number; + metadata: PlaylistSongMetadata; +}; +export declare type PlaylistSongMetadata = { + status: "loading"; +} | { + status: "unparsed"; + metadata: string; +} | { + status: "loaded"; + metadata: string; + title: string; + description: string; + thumbnailUrl?: string; + length: number; +}; +export interface SubscribedPlaylistEvents { + notify_status_changed: {}; + notify_entry_added: { + entry: PlaylistEntry; + }; + notify_entry_deleted: { + entry: PlaylistEntry; + }; + notify_entry_reordered: { + entry: PlaylistEntry; + oldPreviousId: number; + }; + notify_entry_updated: { + entry: PlaylistEntry; + }; +} +export declare type SubscribedPlaylistStatus = { + status: "loaded"; + songs: PlaylistEntry[]; +} | { + status: "loading"; +} | { + status: "error"; + error: string; +} | { + status: "no-permissions"; + failedPermission: string; +} | { + status: "unloaded"; +}; +export declare abstract class SubscribedPlaylist { + readonly events: Registry; + readonly playlistId: number; + readonly serverUniqueId: string; + protected status: SubscribedPlaylistStatus; + protected refCount: number; + protected constructor(serverUniqueId: string, playlistId: number); + ref(): SubscribedPlaylist; + unref(): void; + destroy(): void; + /** + * Query the playlist songs from the remote server. + * The playlist status will change on a successfully or failed query. + * + * @param forceQuery Forcibly query even we're subscribed and already aware of all songs. + */ + abstract querySongs(forceQuery: boolean): Promise; + abstract addSong(url: string, urlLoader: "any" | "youtube" | "ffmpeg" | "channel", targetSongId: number | 0, mode?: "before" | "after" | "last"): Promise; + abstract deleteEntry(entryId: number): Promise; + abstract reorderEntry(entryId: number, targetEntryId: number, mode: "before" | "after"): Promise; + getStatus(): Readonly; + protected setStatus(status: SubscribedPlaylistStatus): void; +} +export declare class PlaylistManager { + readonly connection: ConnectionHandler; + private listenerConnection; + private playlistEntryListCache; + private subscribedPlaylist; + constructor(connection: ConnectionHandler); + destroy(): void; + queryPlaylistEntries(playlistId: number): Promise; + reorderSong(playlistId: number, songId: number, previousSongId: number): Promise; + addSong(playlistId: number, url: string, urlLoader: "any" | "youtube" | "ffmpeg" | "channel", previousSongId: number | 0): Promise; + removeSong(playlistId: number, entryId: number): Promise; + /** + * @param playlistId + * @return Returns a subscribed playlist. + * Attention: You have to manually destroy the object! + */ + createSubscribedPlaylist(playlistId: number): SubscribedPlaylist; +} diff --git a/imports/shared-app/permission/GroupManager.d.ts b/imports/shared-app/permission/GroupManager.d.ts new file mode 100644 index 0000000..838d757 --- /dev/null +++ b/imports/shared-app/permission/GroupManager.d.ts @@ -0,0 +1,88 @@ +import { LaterPromise } from "../utils/LaterPromise"; +import { PermissionValue } from "../permission/PermissionManager"; +import { ServerCommand } from "../connection/ConnectionBase"; +import { ConnectionHandler } from "../ConnectionHandler"; +import { AbstractCommandHandler } from "../connection/AbstractCommandHandler"; +import { Registry } from "../events"; +export declare enum GroupType { + QUERY = 0, + TEMPLATE = 1, + NORMAL = 2 +} +export declare enum GroupTarget { + SERVER = 0, + CHANNEL = 1 +} +export declare class GroupProperties { + iconid: number; + sortid: number; + savedb: boolean; + namemode: number; +} +export declare class GroupPermissionRequest { + group_id: number; + promise: LaterPromise; +} +export declare type GroupUpdate = { + key: GroupProperty; + group: Group; + oldValue: any; + newValue: any; +}; +export interface GroupManagerEvents { + notify_reset: {}; + notify_groups_created: { + groups: Group[]; + cause: "list-update" | "initialize" | "user-action"; + }; + notify_groups_deleted: { + groups: Group[]; + cause: "list-update" | "reset" | "user-action"; + }; + notify_groups_updated: { + updates: GroupUpdate[]; + }; + notify_groups_received: {}; +} +export declare type GroupProperty = "name" | "icon" | "sort-id" | "save-db" | "name-mode"; +export interface GroupEvents { + notify_group_deleted: {}; + notify_properties_updated: { + updated_properties: GroupProperty[]; + }; + notify_needed_powers_updated: {}; +} +export declare class Group { + readonly handle: GroupManager; + readonly events: Registry; + readonly properties: GroupProperties; + 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); + updatePropertiesFromGroupList(data: any): GroupUpdate[]; +} +export declare class GroupManager extends AbstractCommandHandler { + static sorter(): (a: Group, b: Group) => number; + readonly events: Registry; + readonly connectionHandler: ConnectionHandler; + serverGroups: Group[]; + channelGroups: Group[]; + private allGroupsReceived; + private readonly connectionStateListener; + private groupPermissionRequests; + constructor(client: ConnectionHandler); + destroy(): void; + reset(): void; + handle_command(command: ServerCommand): boolean; + requestGroups(): void; + findServerGroup(id: number): Group | undefined; + findChannelGroup(id: number): Group | undefined; + private handleGroupList; + request_permissions(group: Group): Promise; + private handleGroupPermissionList; +} diff --git a/imports/shared-app/permission/PermissionManager.d.ts b/imports/shared-app/permission/PermissionManager.d.ts new file mode 100644 index 0000000..cfcea5d --- /dev/null +++ b/imports/shared-app/permission/PermissionManager.d.ts @@ -0,0 +1,150 @@ +import { PermissionType } from "../permission/PermissionType"; +import { LaterPromise } from "../utils/LaterPromise"; +import { ServerCommand } from "../connection/ConnectionBase"; +import { CommandResult } from "../connection/ServerConnectionDeclaration"; +import { ConnectionHandler } from "../ConnectionHandler"; +import { AbstractCommandHandler } from "../connection/AbstractCommandHandler"; +import { Registry } from "../events"; +export declare class PermissionInfo { + name: string; + id: number; + description: string; + is_boolean(): boolean; + id_grant(): number; +} +export declare class PermissionGroup { + begin: number; + end: number; + deep: number; + name: string; +} +export declare class GroupedPermissions { + group: PermissionGroup; + permissions: PermissionInfo[]; + children: GroupedPermissions[]; + parent: GroupedPermissions; +} +export declare class PermissionValue { + readonly type: PermissionInfo; + value: number | undefined; + flag_skip: boolean; + flag_negate: boolean; + granted_value: number; + constructor(type: any, value?: any); + granted(requiredValue: number, required?: boolean): boolean; + hasValue(): boolean; + hasGrant(): boolean; + valueOr(fallback: number): number; + valueNormalOr(fallback: number): number; +} +export declare class NeededPermissionValue extends PermissionValue { + constructor(type: any, value: any); +} +export declare type PermissionRequestKeys = { + client_id?: number; + channel_id?: number; + playlist_id?: number; +}; +export declare type PermissionRequest = PermissionRequestKeys & { + timeout_id: any; + promise: LaterPromise; +}; +export declare namespace find { + type Entry = { + type: "server" | "channel" | "client" | "client_channel" | "channel_group" | "server_group"; + value: number; + id: number; + }; + type Client = Entry & { + type: "client"; + client_id: number; + }; + type Channel = Entry & { + type: "channel"; + channel_id: number; + }; + type Server = Entry & { + type: "server"; + }; + type ClientChannel = Entry & { + type: "client_channel"; + client_id: number; + channel_id: number; + }; + type ChannelGroup = Entry & { + type: "channel_group"; + group_id: number; + }; + type ServerGroup = Entry & { + type: "server_group"; + group_id: number; + }; +} +export interface PermissionManagerEvents { + client_permissions_changed: {}; +} +export declare type RequestLists = "requests_channel_permissions" | "requests_client_permissions" | "requests_client_channel_permissions" | "requests_playlist_permissions" | "requests_playlist_client_permissions"; +export declare class PermissionManager extends AbstractCommandHandler { + readonly events: Registry; + readonly handle: ConnectionHandler; + permissionList: PermissionInfo[]; + permissionGroups: PermissionGroup[]; + neededPermissions: NeededPermissionValue[]; + needed_permission_change_listener: { + [permission: string]: ((value?: PermissionValue) => void)[]; + }; + requests_channel_permissions: PermissionRequest[]; + requests_client_permissions: PermissionRequest[]; + requests_client_channel_permissions: PermissionRequest[]; + requests_playlist_permissions: PermissionRequest[]; + requests_playlist_client_permissions: PermissionRequest[]; + requests_permfind: { + timeout_id: number; + permission: string; + callback: (status: "success" | "error", data: any) => void; + }[]; + initializedListener: ((initialized: boolean) => void)[]; + private cacheNeededPermissions; + static readonly group_mapping: { + name: string; + deep: number; + }[]; + private _group_mapping; + static parse_permission_bulk(json: any[], manager: PermissionManager): PermissionValue[]; + constructor(client: ConnectionHandler); + destroy(): void; + handle_command(command: ServerCommand): boolean; + initialized(): boolean; + requestPermissionList(): void; + private onPermissionList; + private onNeededPermissions; + register_needed_permission(key: PermissionType, listener: () => any): () => void; + unregister_needed_permission(key: PermissionType, listener: () => any): void; + resolveInfo?(key: number | string | PermissionType): PermissionInfo; + private onChannelPermList; + private execute_channel_permission_request; + requestChannelPermissions(channelId: number, processResult?: boolean): Promise; + private onClientPermList; + private execute_client_permission_request; + requestClientPermissions(client_id: number): Promise; + private onChannelClientPermList; + private execute_client_channel_permission_request; + requestClientChannelPermissions(client_id: number, channel_id: number): Promise; + private onPlaylistPermList; + private execute_playlist_permission_request; + requestPlaylistPermissions(playlist_id: number): Promise; + private onPlaylistClientPermList; + private execute_playlist_client_permission_request; + requestPlaylistClientPermissions(playlist_id: number, client_database_id: number): Promise; + private readonly criteria_equal; + private execute_permission_request; + private fullfill_permission_request; + find_permission(...permissions: string[]): Promise; + neededPermission(key: number | string | PermissionType | PermissionInfo): NeededPermissionValue; + groupedPermissions(): GroupedPermissions[]; + /** + * Generates an enum with all know permission types, used for the enum above + */ + export_permission_types(): string; + getFailedPermission(command: CommandResult, index?: number): any; +} diff --git a/imports/shared-app/permission/PermissionType.d.ts b/imports/shared-app/permission/PermissionType.d.ts new file mode 100644 index 0000000..f21c38d --- /dev/null +++ b/imports/shared-app/permission/PermissionType.d.ts @@ -0,0 +1,363 @@ +export declare enum PermissionType { + B_SERVERINSTANCE_HELP_VIEW = "b_serverinstance_help_view", + B_SERVERINSTANCE_VERSION_VIEW = "b_serverinstance_version_view", + B_SERVERINSTANCE_INFO_VIEW = "b_serverinstance_info_view", + B_SERVERINSTANCE_VIRTUALSERVER_LIST = "b_serverinstance_virtualserver_list", + B_SERVERINSTANCE_BINDING_LIST = "b_serverinstance_binding_list", + B_SERVERINSTANCE_PERMISSION_LIST = "b_serverinstance_permission_list", + B_SERVERINSTANCE_PERMISSION_FIND = "b_serverinstance_permission_find", + B_VIRTUALSERVER_CREATE = "b_virtualserver_create", + B_VIRTUALSERVER_DELETE = "b_virtualserver_delete", + B_VIRTUALSERVER_START_ANY = "b_virtualserver_start_any", + B_VIRTUALSERVER_STOP_ANY = "b_virtualserver_stop_any", + B_VIRTUALSERVER_CHANGE_MACHINE_ID = "b_virtualserver_change_machine_id", + B_VIRTUALSERVER_CHANGE_TEMPLATE = "b_virtualserver_change_template", + B_SERVERQUERY_LOGIN = "b_serverquery_login", + B_SERVERINSTANCE_TEXTMESSAGE_SEND = "b_serverinstance_textmessage_send", + B_SERVERINSTANCE_LOG_VIEW = "b_serverinstance_log_view", + B_SERVERINSTANCE_LOG_ADD = "b_serverinstance_log_add", + B_SERVERINSTANCE_STOP = "b_serverinstance_stop", + B_SERVERINSTANCE_MODIFY_SETTINGS = "b_serverinstance_modify_settings", + B_SERVERINSTANCE_MODIFY_QUERYGROUP = "b_serverinstance_modify_querygroup", + B_SERVERINSTANCE_MODIFY_TEMPLATES = "b_serverinstance_modify_templates", + B_VIRTUALSERVER_SELECT = "b_virtualserver_select", + B_VIRTUALSERVER_SELECT_GODMODE = "b_virtualserver_select_godmode", + B_VIRTUALSERVER_INFO_VIEW = "b_virtualserver_info_view", + B_VIRTUALSERVER_CONNECTIONINFO_VIEW = "b_virtualserver_connectioninfo_view", + B_VIRTUALSERVER_CHANNEL_LIST = "b_virtualserver_channel_list", + B_VIRTUALSERVER_CHANNEL_SEARCH = "b_virtualserver_channel_search", + B_VIRTUALSERVER_CLIENT_LIST = "b_virtualserver_client_list", + B_VIRTUALSERVER_CLIENT_SEARCH = "b_virtualserver_client_search", + B_VIRTUALSERVER_CLIENT_DBLIST = "b_virtualserver_client_dblist", + B_VIRTUALSERVER_CLIENT_DBSEARCH = "b_virtualserver_client_dbsearch", + B_VIRTUALSERVER_CLIENT_DBINFO = "b_virtualserver_client_dbinfo", + B_VIRTUALSERVER_PERMISSION_FIND = "b_virtualserver_permission_find", + B_VIRTUALSERVER_CUSTOM_SEARCH = "b_virtualserver_custom_search", + B_VIRTUALSERVER_START = "b_virtualserver_start", + B_VIRTUALSERVER_STOP = "b_virtualserver_stop", + B_VIRTUALSERVER_TOKEN_LIST = "b_virtualserver_token_list", + B_VIRTUALSERVER_TOKEN_ADD = "b_virtualserver_token_add", + B_VIRTUALSERVER_TOKEN_USE = "b_virtualserver_token_use", + B_VIRTUALSERVER_TOKEN_DELETE = "b_virtualserver_token_delete", + B_VIRTUALSERVER_LOG_VIEW = "b_virtualserver_log_view", + B_VIRTUALSERVER_LOG_ADD = "b_virtualserver_log_add", + B_VIRTUALSERVER_JOIN_IGNORE_PASSWORD = "b_virtualserver_join_ignore_password", + B_VIRTUALSERVER_NOTIFY_REGISTER = "b_virtualserver_notify_register", + B_VIRTUALSERVER_NOTIFY_UNREGISTER = "b_virtualserver_notify_unregister", + B_VIRTUALSERVER_SNAPSHOT_CREATE = "b_virtualserver_snapshot_create", + B_VIRTUALSERVER_SNAPSHOT_DEPLOY = "b_virtualserver_snapshot_deploy", + B_VIRTUALSERVER_PERMISSION_RESET = "b_virtualserver_permission_reset", + B_VIRTUALSERVER_MODIFY_NAME = "b_virtualserver_modify_name", + B_VIRTUALSERVER_MODIFY_WELCOMEMESSAGE = "b_virtualserver_modify_welcomemessage", + B_VIRTUALSERVER_MODIFY_MAXCHANNELS = "b_virtualserver_modify_maxchannels", + B_VIRTUALSERVER_MODIFY_MAXCLIENTS = "b_virtualserver_modify_maxclients", + B_VIRTUALSERVER_MODIFY_RESERVED_SLOTS = "b_virtualserver_modify_reserved_slots", + B_VIRTUALSERVER_MODIFY_PASSWORD = "b_virtualserver_modify_password", + B_VIRTUALSERVER_MODIFY_DEFAULT_SERVERGROUP = "b_virtualserver_modify_default_servergroup", + B_VIRTUALSERVER_MODIFY_DEFAULT_MUSICGROUP = "b_virtualserver_modify_default_musicgroup", + B_VIRTUALSERVER_MODIFY_DEFAULT_CHANNELGROUP = "b_virtualserver_modify_default_channelgroup", + B_VIRTUALSERVER_MODIFY_DEFAULT_CHANNELADMINGROUP = "b_virtualserver_modify_default_channeladmingroup", + B_VIRTUALSERVER_MODIFY_CHANNEL_FORCED_SILENCE = "b_virtualserver_modify_channel_forced_silence", + B_VIRTUALSERVER_MODIFY_COMPLAIN = "b_virtualserver_modify_complain", + B_VIRTUALSERVER_MODIFY_ANTIFLOOD = "b_virtualserver_modify_antiflood", + B_VIRTUALSERVER_MODIFY_FT_SETTINGS = "b_virtualserver_modify_ft_settings", + B_VIRTUALSERVER_MODIFY_FT_QUOTAS = "b_virtualserver_modify_ft_quotas", + B_VIRTUALSERVER_MODIFY_HOSTMESSAGE = "b_virtualserver_modify_hostmessage", + B_VIRTUALSERVER_MODIFY_HOSTBANNER = "b_virtualserver_modify_hostbanner", + B_VIRTUALSERVER_MODIFY_HOSTBUTTON = "b_virtualserver_modify_hostbutton", + B_VIRTUALSERVER_MODIFY_PORT = "b_virtualserver_modify_port", + B_VIRTUALSERVER_MODIFY_HOST = "b_virtualserver_modify_host", + B_VIRTUALSERVER_MODIFY_DEFAULT_MESSAGES = "b_virtualserver_modify_default_messages", + B_VIRTUALSERVER_MODIFY_AUTOSTART = "b_virtualserver_modify_autostart", + B_VIRTUALSERVER_MODIFY_NEEDED_IDENTITY_SECURITY_LEVEL = "b_virtualserver_modify_needed_identity_security_level", + B_VIRTUALSERVER_MODIFY_PRIORITY_SPEAKER_DIMM_MODIFICATOR = "b_virtualserver_modify_priority_speaker_dimm_modificator", + B_VIRTUALSERVER_MODIFY_LOG_SETTINGS = "b_virtualserver_modify_log_settings", + B_VIRTUALSERVER_MODIFY_MIN_CLIENT_VERSION = "b_virtualserver_modify_min_client_version", + B_VIRTUALSERVER_MODIFY_ICON_ID = "b_virtualserver_modify_icon_id", + B_VIRTUALSERVER_MODIFY_WEBLIST = "b_virtualserver_modify_weblist", + B_VIRTUALSERVER_MODIFY_COUNTRY_CODE = "b_virtualserver_modify_country_code", + B_VIRTUALSERVER_MODIFY_CODEC_ENCRYPTION_MODE = "b_virtualserver_modify_codec_encryption_mode", + B_VIRTUALSERVER_MODIFY_TEMPORARY_PASSWORDS = "b_virtualserver_modify_temporary_passwords", + B_VIRTUALSERVER_MODIFY_TEMPORARY_PASSWORDS_OWN = "b_virtualserver_modify_temporary_passwords_own", + B_VIRTUALSERVER_MODIFY_CHANNEL_TEMP_DELETE_DELAY_DEFAULT = "b_virtualserver_modify_channel_temp_delete_delay_default", + B_VIRTUALSERVER_MODIFY_MUSIC_BOT_LIMIT = "b_virtualserver_modify_music_bot_limit", + I_CHANNEL_MIN_DEPTH = "i_channel_min_depth", + I_CHANNEL_MAX_DEPTH = "i_channel_max_depth", + B_CHANNEL_GROUP_INHERITANCE_END = "b_channel_group_inheritance_end", + I_CHANNEL_PERMISSION_MODIFY_POWER = "i_channel_permission_modify_power", + I_CHANNEL_NEEDED_PERMISSION_MODIFY_POWER = "i_channel_needed_permission_modify_power", + B_CHANNEL_INFO_VIEW = "b_channel_info_view", + B_VIRTUALSERVER_CHANNEL_PERMISSION_LIST = "b_virtualserver_channel_permission_list", + B_CHANNEL_CREATE_CHILD = "b_channel_create_child", + B_CHANNEL_CREATE_PERMANENT = "b_channel_create_permanent", + B_CHANNEL_CREATE_SEMI_PERMANENT = "b_channel_create_semi_permanent", + B_CHANNEL_CREATE_TEMPORARY = "b_channel_create_temporary", + B_CHANNEL_CREATE_WITH_TOPIC = "b_channel_create_with_topic", + B_CHANNEL_CREATE_WITH_DESCRIPTION = "b_channel_create_with_description", + B_CHANNEL_CREATE_WITH_PASSWORD = "b_channel_create_with_password", + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_OPUSVOICE = "b_channel_create_modify_with_codec_opusvoice", + B_CHANNEL_CREATE_MODIFY_WITH_CODEC_OPUSMUSIC = "b_channel_create_modify_with_codec_opusmusic", + I_CHANNEL_CREATE_MODIFY_WITH_CODEC_MAXQUALITY = "i_channel_create_modify_with_codec_maxquality", + I_CHANNEL_CREATE_MODIFY_WITH_CODEC_LATENCY_FACTOR_MIN = "i_channel_create_modify_with_codec_latency_factor_min", + B_CHANNEL_CREATE_WITH_MAXCLIENTS = "b_channel_create_with_maxclients", + B_CHANNEL_CREATE_WITH_MAXFAMILYCLIENTS = "b_channel_create_with_maxfamilyclients", + B_CHANNEL_CREATE_WITH_SORTORDER = "b_channel_create_with_sortorder", + B_CHANNEL_CREATE_WITH_DEFAULT = "b_channel_create_with_default", + B_CHANNEL_CREATE_WITH_NEEDED_TALK_POWER = "b_channel_create_with_needed_talk_power", + B_CHANNEL_CREATE_MODIFY_WITH_FORCE_PASSWORD = "b_channel_create_modify_with_force_password", + I_CHANNEL_CREATE_MODIFY_WITH_TEMP_DELETE_DELAY = "i_channel_create_modify_with_temp_delete_delay", + I_CHANNEL_CREATE_MODIFY_CONVERSATION_HISTORY_LENGTH = "i_channel_create_modify_conversation_history_length", + B_CHANNEL_CREATE_MODIFY_CONVERSATION_HISTORY_UNLIMITED = "b_channel_create_modify_conversation_history_unlimited", + B_CHANNEL_CREATE_MODIFY_CONVERSATION_MODE_PRIVATE = "b_channel_create_modify_conversation_mode_private", + B_CHANNEL_CREATE_MODIFY_CONVERSATION_MODE_PUBLIC = "b_channel_create_modify_conversation_mode_public", + B_CHANNEL_CREATE_MODIFY_CONVERSATION_MODE_NONE = "b_channel_create_modify_conversation_mode_none", + B_CHANNEL_CREATE_MODIFY_SIDEBAR_MODE = "b_channel_create_modify_sidebar_mode", + B_CHANNEL_MODIFY_PARENT = "b_channel_modify_parent", + B_CHANNEL_MODIFY_MAKE_DEFAULT = "b_channel_modify_make_default", + B_CHANNEL_MODIFY_MAKE_PERMANENT = "b_channel_modify_make_permanent", + B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT = "b_channel_modify_make_semi_permanent", + B_CHANNEL_MODIFY_MAKE_TEMPORARY = "b_channel_modify_make_temporary", + B_CHANNEL_MODIFY_NAME = "b_channel_modify_name", + B_CHANNEL_MODIFY_TOPIC = "b_channel_modify_topic", + B_CHANNEL_MODIFY_DESCRIPTION = "b_channel_modify_description", + B_CHANNEL_MODIFY_PASSWORD = "b_channel_modify_password", + B_CHANNEL_MODIFY_CODEC = "b_channel_modify_codec", + B_CHANNEL_MODIFY_CODEC_QUALITY = "b_channel_modify_codec_quality", + B_CHANNEL_MODIFY_CODEC_LATENCY_FACTOR = "b_channel_modify_codec_latency_factor", + B_CHANNEL_MODIFY_MAXCLIENTS = "b_channel_modify_maxclients", + B_CHANNEL_MODIFY_MAXFAMILYCLIENTS = "b_channel_modify_maxfamilyclients", + B_CHANNEL_MODIFY_SORTORDER = "b_channel_modify_sortorder", + B_CHANNEL_MODIFY_NEEDED_TALK_POWER = "b_channel_modify_needed_talk_power", + I_CHANNEL_MODIFY_POWER = "i_channel_modify_power", + I_CHANNEL_NEEDED_MODIFY_POWER = "i_channel_needed_modify_power", + B_CHANNEL_MODIFY_MAKE_CODEC_ENCRYPTED = "b_channel_modify_make_codec_encrypted", + B_CHANNEL_MODIFY_TEMP_DELETE_DELAY = "b_channel_modify_temp_delete_delay", + B_CHANNEL_CONVERSATION_MESSAGE_DELETE = "b_channel_conversation_message_delete", + B_CHANNEL_DELETE_PERMANENT = "b_channel_delete_permanent", + B_CHANNEL_DELETE_SEMI_PERMANENT = "b_channel_delete_semi_permanent", + B_CHANNEL_DELETE_TEMPORARY = "b_channel_delete_temporary", + B_CHANNEL_DELETE_FLAG_FORCE = "b_channel_delete_flag_force", + I_CHANNEL_DELETE_POWER = "i_channel_delete_power", + I_CHANNEL_NEEDED_DELETE_POWER = "i_channel_needed_delete_power", + B_CHANNEL_JOIN_PERMANENT = "b_channel_join_permanent", + B_CHANNEL_JOIN_SEMI_PERMANENT = "b_channel_join_semi_permanent", + B_CHANNEL_JOIN_TEMPORARY = "b_channel_join_temporary", + B_CHANNEL_JOIN_IGNORE_PASSWORD = "b_channel_join_ignore_password", + B_CHANNEL_JOIN_IGNORE_MAXCLIENTS = "b_channel_join_ignore_maxclients", + I_CHANNEL_JOIN_POWER = "i_channel_join_power", + I_CHANNEL_NEEDED_JOIN_POWER = "i_channel_needed_join_power", + B_CHANNEL_IGNORE_JOIN_POWER = "b_channel_ignore_join_power", + I_CHANNEL_VIEW_POWER = "i_channel_view_power", + I_CHANNEL_NEEDED_VIEW_POWER = "i_channel_needed_view_power", + B_CHANNEL_IGNORE_VIEW_POWER = "b_channel_ignore_view_power", + I_CHANNEL_SUBSCRIBE_POWER = "i_channel_subscribe_power", + I_CHANNEL_NEEDED_SUBSCRIBE_POWER = "i_channel_needed_subscribe_power", + B_CHANNEL_IGNORE_SUBSCRIBE_POWER = "b_channel_ignore_subscribe_power", + I_CHANNEL_DESCRIPTION_VIEW_POWER = "i_channel_description_view_power", + I_CHANNEL_NEEDED_DESCRIPTION_VIEW_POWER = "i_channel_needed_description_view_power", + B_CHANNEL_IGNORE_DESCRIPTION_VIEW_POWER = "b_channel_ignore_description_view_power", + I_ICON_ID = "i_icon_id", + I_MAX_ICON_FILESIZE = "i_max_icon_filesize", + I_MAX_PLAYLIST_SIZE = "i_max_playlist_size", + I_MAX_PLAYLISTS = "i_max_playlists", + B_ICON_MANAGE = "b_icon_manage", + B_GROUP_IS_PERMANENT = "b_group_is_permanent", + I_GROUP_AUTO_UPDATE_TYPE = "i_group_auto_update_type", + I_GROUP_AUTO_UPDATE_MAX_VALUE = "i_group_auto_update_max_value", + I_GROUP_SORT_ID = "i_group_sort_id", + I_GROUP_SHOW_NAME_IN_TREE = "i_group_show_name_in_tree", + B_VIRTUALSERVER_SERVERGROUP_LIST = "b_virtualserver_servergroup_list", + B_VIRTUALSERVER_SERVERGROUP_PERMISSION_LIST = "b_virtualserver_servergroup_permission_list", + B_VIRTUALSERVER_SERVERGROUP_CLIENT_LIST = "b_virtualserver_servergroup_client_list", + B_VIRTUALSERVER_CHANNELGROUP_LIST = "b_virtualserver_channelgroup_list", + B_VIRTUALSERVER_CHANNELGROUP_PERMISSION_LIST = "b_virtualserver_channelgroup_permission_list", + B_VIRTUALSERVER_CHANNELGROUP_CLIENT_LIST = "b_virtualserver_channelgroup_client_list", + B_VIRTUALSERVER_SERVERGROUP_CREATE = "b_virtualserver_servergroup_create", + B_VIRTUALSERVER_CHANNELGROUP_CREATE = "b_virtualserver_channelgroup_create", + I_SERVER_GROUP_MODIFY_POWER = "i_server_group_modify_power", + I_SERVER_GROUP_NEEDED_MODIFY_POWER = "i_server_group_needed_modify_power", + I_SERVER_GROUP_MEMBER_ADD_POWER = "i_server_group_member_add_power", + I_SERVER_GROUP_SELF_ADD_POWER = "i_server_group_self_add_power", + I_SERVER_GROUP_NEEDED_MEMBER_ADD_POWER = "i_server_group_needed_member_add_power", + I_SERVER_GROUP_MEMBER_REMOVE_POWER = "i_server_group_member_remove_power", + I_SERVER_GROUP_SELF_REMOVE_POWER = "i_server_group_self_remove_power", + I_SERVER_GROUP_NEEDED_MEMBER_REMOVE_POWER = "i_server_group_needed_member_remove_power", + I_CHANNEL_GROUP_MODIFY_POWER = "i_channel_group_modify_power", + I_CHANNEL_GROUP_NEEDED_MODIFY_POWER = "i_channel_group_needed_modify_power", + I_CHANNEL_GROUP_MEMBER_ADD_POWER = "i_channel_group_member_add_power", + I_CHANNEL_GROUP_SELF_ADD_POWER = "i_channel_group_self_add_power", + I_CHANNEL_GROUP_NEEDED_MEMBER_ADD_POWER = "i_channel_group_needed_member_add_power", + I_CHANNEL_GROUP_MEMBER_REMOVE_POWER = "i_channel_group_member_remove_power", + I_CHANNEL_GROUP_SELF_REMOVE_POWER = "i_channel_group_self_remove_power", + I_CHANNEL_GROUP_NEEDED_MEMBER_REMOVE_POWER = "i_channel_group_needed_member_remove_power", + I_GROUP_MEMBER_ADD_POWER = "i_group_member_add_power", + I_GROUP_NEEDED_MEMBER_ADD_POWER = "i_group_needed_member_add_power", + I_GROUP_MEMBER_REMOVE_POWER = "i_group_member_remove_power", + I_GROUP_NEEDED_MEMBER_REMOVE_POWER = "i_group_needed_member_remove_power", + I_GROUP_MODIFY_POWER = "i_group_modify_power", + I_GROUP_NEEDED_MODIFY_POWER = "i_group_needed_modify_power", + I_PERMISSION_MODIFY_POWER = "i_permission_modify_power", + B_PERMISSION_MODIFY_POWER_IGNORE = "b_permission_modify_power_ignore", + B_VIRTUALSERVER_SERVERGROUP_DELETE = "b_virtualserver_servergroup_delete", + B_VIRTUALSERVER_CHANNELGROUP_DELETE = "b_virtualserver_channelgroup_delete", + I_CLIENT_PERMISSION_MODIFY_POWER = "i_client_permission_modify_power", + I_CLIENT_NEEDED_PERMISSION_MODIFY_POWER = "i_client_needed_permission_modify_power", + I_CLIENT_MAX_CLONES_UID = "i_client_max_clones_uid", + I_CLIENT_MAX_CLONES_IP = "i_client_max_clones_ip", + I_CLIENT_MAX_CLONES_HWID = "i_client_max_clones_hwid", + I_CLIENT_MAX_IDLETIME = "i_client_max_idletime", + I_CLIENT_MAX_AVATAR_FILESIZE = "i_client_max_avatar_filesize", + I_CLIENT_MAX_CHANNEL_SUBSCRIPTIONS = "i_client_max_channel_subscriptions", + I_CLIENT_MAX_CHANNELS = "i_client_max_channels", + I_CLIENT_MAX_TEMPORARY_CHANNELS = "i_client_max_temporary_channels", + I_CLIENT_MAX_SEMI_CHANNELS = "i_client_max_semi_channels", + I_CLIENT_MAX_PERMANENT_CHANNELS = "i_client_max_permanent_channels", + B_CLIENT_USE_PRIORITY_SPEAKER = "b_client_use_priority_speaker", + B_CLIENT_IS_PRIORITY_SPEAKER = "b_client_is_priority_speaker", + B_CLIENT_SKIP_CHANNELGROUP_PERMISSIONS = "b_client_skip_channelgroup_permissions", + B_CLIENT_FORCE_PUSH_TO_TALK = "b_client_force_push_to_talk", + B_CLIENT_IGNORE_BANS = "b_client_ignore_bans", + B_CLIENT_IGNORE_VPN = "b_client_ignore_vpn", + B_CLIENT_IGNORE_ANTIFLOOD = "b_client_ignore_antiflood", + B_CLIENT_ENFORCE_VALID_HWID = "b_client_enforce_valid_hwid", + B_CLIENT_ALLOW_INVALID_PACKET = "b_client_allow_invalid_packet", + B_CLIENT_ALLOW_INVALID_BADGES = "b_client_allow_invalid_badges", + B_CLIENT_ISSUE_CLIENT_QUERY_COMMAND = "b_client_issue_client_query_command", + B_CLIENT_USE_RESERVED_SLOT = "b_client_use_reserved_slot", + B_CLIENT_USE_CHANNEL_COMMANDER = "b_client_use_channel_commander", + B_CLIENT_REQUEST_TALKER = "b_client_request_talker", + B_CLIENT_AVATAR_DELETE_OTHER = "b_client_avatar_delete_other", + B_CLIENT_IS_STICKY = "b_client_is_sticky", + B_CLIENT_IGNORE_STICKY = "b_client_ignore_sticky", + B_CLIENT_MUSIC_CREATE_PERMANENT = "b_client_music_create_permanent", + B_CLIENT_MUSIC_CREATE_SEMI_PERMANENT = "b_client_music_create_semi_permanent", + B_CLIENT_MUSIC_CREATE_TEMPORARY = "b_client_music_create_temporary", + B_CLIENT_MUSIC_MODIFY_PERMANENT = "b_client_music_modify_permanent", + B_CLIENT_MUSIC_MODIFY_SEMI_PERMANENT = "b_client_music_modify_semi_permanent", + B_CLIENT_MUSIC_MODIFY_TEMPORARY = "b_client_music_modify_temporary", + I_CLIENT_MUSIC_CREATE_MODIFY_MAX_VOLUME = "i_client_music_create_modify_max_volume", + I_CLIENT_MUSIC_LIMIT = "i_client_music_limit", + I_CLIENT_MUSIC_NEEDED_DELETE_POWER = "i_client_music_needed_delete_power", + I_CLIENT_MUSIC_DELETE_POWER = "i_client_music_delete_power", + I_CLIENT_MUSIC_PLAY_POWER = "i_client_music_play_power", + I_CLIENT_MUSIC_NEEDED_PLAY_POWER = "i_client_music_needed_play_power", + I_CLIENT_MUSIC_MODIFY_POWER = "i_client_music_modify_power", + I_CLIENT_MUSIC_NEEDED_MODIFY_POWER = "i_client_music_needed_modify_power", + I_CLIENT_MUSIC_RENAME_POWER = "i_client_music_rename_power", + I_CLIENT_MUSIC_NEEDED_RENAME_POWER = "i_client_music_needed_rename_power", + B_VIRTUALSERVER_PLAYLIST_PERMISSION_LIST = "b_virtualserver_playlist_permission_list", + B_PLAYLIST_CREATE = "b_playlist_create", + I_PLAYLIST_VIEW_POWER = "i_playlist_view_power", + I_PLAYLIST_NEEDED_VIEW_POWER = "i_playlist_needed_view_power", + I_PLAYLIST_MODIFY_POWER = "i_playlist_modify_power", + I_PLAYLIST_NEEDED_MODIFY_POWER = "i_playlist_needed_modify_power", + I_PLAYLIST_PERMISSION_MODIFY_POWER = "i_playlist_permission_modify_power", + I_PLAYLIST_NEEDED_PERMISSION_MODIFY_POWER = "i_playlist_needed_permission_modify_power", + I_PLAYLIST_DELETE_POWER = "i_playlist_delete_power", + I_PLAYLIST_NEEDED_DELETE_POWER = "i_playlist_needed_delete_power", + I_PLAYLIST_SONG_ADD_POWER = "i_playlist_song_add_power", + I_PLAYLIST_SONG_NEEDED_ADD_POWER = "i_playlist_song_needed_add_power", + I_PLAYLIST_SONG_REMOVE_POWER = "i_playlist_song_remove_power", + I_PLAYLIST_SONG_NEEDED_REMOVE_POWER = "i_playlist_song_needed_remove_power", + I_PLAYLIST_SONG_MOVE_POWER = "i_playlist_song_move_power", + I_PLAYLIST_SONG_NEEDED_MOVE_POWER = "i_playlist_song_needed_move_power", + B_CLIENT_INFO_VIEW = "b_client_info_view", + B_CLIENT_PERMISSIONOVERVIEW_VIEW = "b_client_permissionoverview_view", + B_CLIENT_PERMISSIONOVERVIEW_OWN = "b_client_permissionoverview_own", + B_CLIENT_REMOTEADDRESS_VIEW = "b_client_remoteaddress_view", + I_CLIENT_SERVERQUERY_VIEW_POWER = "i_client_serverquery_view_power", + I_CLIENT_NEEDED_SERVERQUERY_VIEW_POWER = "i_client_needed_serverquery_view_power", + B_CLIENT_CUSTOM_INFO_VIEW = "b_client_custom_info_view", + B_CLIENT_MUSIC_CHANNEL_LIST = "b_client_music_channel_list", + B_CLIENT_MUSIC_SERVER_LIST = "b_client_music_server_list", + I_CLIENT_MUSIC_INFO = "i_client_music_info", + I_CLIENT_MUSIC_NEEDED_INFO = "i_client_music_needed_info", + B_VIRTUALSERVER_CHANNELCLIENT_PERMISSION_LIST = "b_virtualserver_channelclient_permission_list", + B_VIRTUALSERVER_CLIENT_PERMISSION_LIST = "b_virtualserver_client_permission_list", + I_CLIENT_KICK_FROM_SERVER_POWER = "i_client_kick_from_server_power", + I_CLIENT_NEEDED_KICK_FROM_SERVER_POWER = "i_client_needed_kick_from_server_power", + I_CLIENT_KICK_FROM_CHANNEL_POWER = "i_client_kick_from_channel_power", + I_CLIENT_NEEDED_KICK_FROM_CHANNEL_POWER = "i_client_needed_kick_from_channel_power", + I_CLIENT_BAN_POWER = "i_client_ban_power", + I_CLIENT_NEEDED_BAN_POWER = "i_client_needed_ban_power", + I_CLIENT_MOVE_POWER = "i_client_move_power", + I_CLIENT_NEEDED_MOVE_POWER = "i_client_needed_move_power", + I_CLIENT_COMPLAIN_POWER = "i_client_complain_power", + I_CLIENT_NEEDED_COMPLAIN_POWER = "i_client_needed_complain_power", + B_CLIENT_COMPLAIN_LIST = "b_client_complain_list", + B_CLIENT_COMPLAIN_DELETE_OWN = "b_client_complain_delete_own", + B_CLIENT_COMPLAIN_DELETE = "b_client_complain_delete", + B_CLIENT_BAN_LIST = "b_client_ban_list", + B_CLIENT_BAN_LIST_GLOBAL = "b_client_ban_list_global", + B_CLIENT_BAN_TRIGGER_LIST = "b_client_ban_trigger_list", + B_CLIENT_BAN_CREATE = "b_client_ban_create", + B_CLIENT_BAN_CREATE_GLOBAL = "b_client_ban_create_global", + B_CLIENT_BAN_NAME = "b_client_ban_name", + B_CLIENT_BAN_IP = "b_client_ban_ip", + B_CLIENT_BAN_HWID = "b_client_ban_hwid", + B_CLIENT_BAN_EDIT = "b_client_ban_edit", + B_CLIENT_BAN_EDIT_GLOBAL = "b_client_ban_edit_global", + B_CLIENT_BAN_DELETE_OWN = "b_client_ban_delete_own", + B_CLIENT_BAN_DELETE = "b_client_ban_delete", + B_CLIENT_BAN_DELETE_OWN_GLOBAL = "b_client_ban_delete_own_global", + B_CLIENT_BAN_DELETE_GLOBAL = "b_client_ban_delete_global", + I_CLIENT_BAN_MAX_BANTIME = "i_client_ban_max_bantime", + I_CLIENT_PRIVATE_TEXTMESSAGE_POWER = "i_client_private_textmessage_power", + I_CLIENT_NEEDED_PRIVATE_TEXTMESSAGE_POWER = "i_client_needed_private_textmessage_power", + B_CLIENT_EVEN_TEXTMESSAGE_SEND = "b_client_even_textmessage_send", + B_CLIENT_SERVER_TEXTMESSAGE_SEND = "b_client_server_textmessage_send", + B_CLIENT_CHANNEL_TEXTMESSAGE_SEND = "b_client_channel_textmessage_send", + B_CLIENT_OFFLINE_TEXTMESSAGE_SEND = "b_client_offline_textmessage_send", + I_CLIENT_TALK_POWER = "i_client_talk_power", + I_CLIENT_NEEDED_TALK_POWER = "i_client_needed_talk_power", + I_CLIENT_POKE_POWER = "i_client_poke_power", + I_CLIENT_NEEDED_POKE_POWER = "i_client_needed_poke_power", + I_CLIENT_POKE_MAX_CLIENTS = "i_client_poke_max_clients", + B_CLIENT_SET_FLAG_TALKER = "b_client_set_flag_talker", + I_CLIENT_WHISPER_POWER = "i_client_whisper_power", + I_CLIENT_NEEDED_WHISPER_POWER = "i_client_needed_whisper_power", + B_VIDEO_SCREEN = "b_video_screen", + B_VIDEO_CAMERA = "b_video_camera", + I_VIDEO_MAX_KBPS = "i_video_max_kbps", + I_VIDEO_MAX_STREAMS = "i_video_max_streams", + I_VIDEO_MAX_SCREEN_STREAMS = "i_video_max_screen_streams", + I_VIDEO_MAX_CAMERA_STREAMS = "i_video_max_camera_streams", + B_CLIENT_MODIFY_DESCRIPTION = "b_client_modify_description", + B_CLIENT_MODIFY_OWN_DESCRIPTION = "b_client_modify_own_description", + B_CLIENT_USE_BBCODE_ANY = "b_client_use_bbcode_any", + B_CLIENT_USE_BBCODE_URL = "b_client_use_bbcode_url", + B_CLIENT_USE_BBCODE_IMAGE = "b_client_use_bbcode_image", + B_CLIENT_MODIFY_DBPROPERTIES = "b_client_modify_dbproperties", + B_CLIENT_DELETE_DBPROPERTIES = "b_client_delete_dbproperties", + B_CLIENT_CREATE_MODIFY_SERVERQUERY_LOGIN = "b_client_create_modify_serverquery_login", + B_CLIENT_QUERY_CREATE = "b_client_query_create", + B_CLIENT_QUERY_CREATE_OWN = "b_client_query_create_own", + B_CLIENT_QUERY_LIST = "b_client_query_list", + B_CLIENT_QUERY_LIST_OWN = "b_client_query_list_own", + B_CLIENT_QUERY_RENAME = "b_client_query_rename", + B_CLIENT_QUERY_RENAME_OWN = "b_client_query_rename_own", + B_CLIENT_QUERY_CHANGE_PASSWORD = "b_client_query_change_password", + B_CLIENT_QUERY_CHANGE_OWN_PASSWORD = "b_client_query_change_own_password", + B_CLIENT_QUERY_CHANGE_PASSWORD_GLOBAL = "b_client_query_change_password_global", + B_CLIENT_QUERY_DELETE = "b_client_query_delete", + B_CLIENT_QUERY_DELETE_OWN = "b_client_query_delete_own", + B_FT_IGNORE_PASSWORD = "b_ft_ignore_password", + B_FT_TRANSFER_LIST = "b_ft_transfer_list", + I_FT_FILE_UPLOAD_POWER = "i_ft_file_upload_power", + I_FT_NEEDED_FILE_UPLOAD_POWER = "i_ft_needed_file_upload_power", + I_FT_FILE_DOWNLOAD_POWER = "i_ft_file_download_power", + I_FT_NEEDED_FILE_DOWNLOAD_POWER = "i_ft_needed_file_download_power", + I_FT_FILE_DELETE_POWER = "i_ft_file_delete_power", + I_FT_NEEDED_FILE_DELETE_POWER = "i_ft_needed_file_delete_power", + I_FT_FILE_RENAME_POWER = "i_ft_file_rename_power", + I_FT_NEEDED_FILE_RENAME_POWER = "i_ft_needed_file_rename_power", + I_FT_FILE_BROWSE_POWER = "i_ft_file_browse_power", + I_FT_NEEDED_FILE_BROWSE_POWER = "i_ft_needed_file_browse_power", + I_FT_DIRECTORY_CREATE_POWER = "i_ft_directory_create_power", + I_FT_NEEDED_DIRECTORY_CREATE_POWER = "i_ft_needed_directory_create_power", + I_FT_QUOTA_MB_DOWNLOAD_PER_CLIENT = "i_ft_quota_mb_download_per_client", + I_FT_QUOTA_MB_UPLOAD_PER_CLIENT = "i_ft_quota_mb_upload_per_client", + I_FT_MAX_BANDWIDTH_DOWNLOAD = "i_ft_max_bandwidth_download", + I_FT_MAX_BANDWIDTH_UPLOAD = "i_ft_max_bandwidth_upload" +} +export default PermissionType; diff --git a/imports/shared-app/profiles/ConnectionProfile.d.ts b/imports/shared-app/profiles/ConnectionProfile.d.ts new file mode 100644 index 0000000..57c44ce --- /dev/null +++ b/imports/shared-app/profiles/ConnectionProfile.d.ts @@ -0,0 +1,31 @@ +import { IdentitifyType, Identity } from "../profiles/Identity"; +import { AbstractServerConnection } from "../connection/ConnectionBase"; +import { HandshakeIdentityHandler } from "../connection/HandshakeHandler"; +export declare class ConnectionProfile { + id: string; + profileName: string; + defaultUsername: string; + defaultPassword: string; + selectedIdentityType: string; + identities: { + [key: string]: Identity; + }; + constructor(id: string); + connectUsername(): string; + selectedIdentity(current_type?: IdentitifyType): Identity; + selectedType(): IdentitifyType | undefined; + setIdentity(type: IdentitifyType, identity: Identity): void; + spawnIdentityHandshakeHandler(connection: AbstractServerConnection): HandshakeIdentityHandler | undefined; + encode(): string; + valid(): boolean; +} +export declare function createConnectProfile(name: string, id?: string): ConnectionProfile; +export declare function save(): void; +export declare function mark_need_save(): void; +export declare function requires_save(): boolean; +export declare function availableConnectProfiles(): ConnectionProfile[]; +export declare function findConnectProfile(id: string): ConnectionProfile | undefined; +export declare function find_profile_by_name(name: string): ConnectionProfile | undefined; +export declare function defaultConnectProfile(): ConnectionProfile; +export declare function set_default_profile(profile: ConnectionProfile): ConnectionProfile; +export declare function delete_profile(profile: ConnectionProfile): void; diff --git a/imports/shared-app/profiles/Identity.d.ts b/imports/shared-app/profiles/Identity.d.ts new file mode 100644 index 0000000..9604f6a --- /dev/null +++ b/imports/shared-app/profiles/Identity.d.ts @@ -0,0 +1,34 @@ +import { AbstractServerConnection, ServerCommand } from "../connection/ConnectionBase"; +import { HandshakeIdentityHandler } from "../connection/HandshakeHandler"; +import { AbstractCommandHandler } from "../connection/AbstractCommandHandler"; +export declare enum IdentitifyType { + TEAFORO = 0, + TEAMSPEAK = 1, + NICKNAME = 2 +} +export interface Identity { + fallback_name(): string | undefined; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + encode?(): string; + decode(data: string): Promise; + spawn_identity_handshake_handler(connection: AbstractServerConnection): HandshakeIdentityHandler; +} +export declare function decode_identity(type: IdentitifyType, data: string): Promise; +export declare function create_identity(type: IdentitifyType): Identity; +export declare class HandshakeCommandHandler extends AbstractCommandHandler { + readonly handle: T; + constructor(connection: AbstractServerConnection, handle: T); + handle_command(command: ServerCommand): boolean; +} +export declare abstract class AbstractHandshakeIdentityHandler implements HandshakeIdentityHandler { + connection: AbstractServerConnection; + protected callbacks: ((success: boolean, message?: string) => any)[]; + protected constructor(connection: AbstractServerConnection); + registerCallback(callback: (success: boolean, message?: string) => any): void; + fillClientInitData(data: any): void; + abstract executeHandshake(): any; + protected trigger_success(): void; + protected trigger_fail(message: string): void; +} diff --git a/imports/shared-app/profiles/identities/NameIdentity.d.ts b/imports/shared-app/profiles/identities/NameIdentity.d.ts new file mode 100644 index 0000000..2397efc --- /dev/null +++ b/imports/shared-app/profiles/identities/NameIdentity.d.ts @@ -0,0 +1,16 @@ +import { IdentitifyType, Identity } from "../../profiles/Identity"; +import { AbstractServerConnection } from "../../connection/ConnectionBase"; +import { HandshakeIdentityHandler } from "../../connection/HandshakeHandler"; +export declare class NameIdentity implements Identity { + private _name; + constructor(name?: string); + set_name(name: string): void; + name(): string; + fallback_name(): string | undefined; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + decode(data: any): Promise; + encode?(): string; + spawn_identity_handshake_handler(connection: AbstractServerConnection): HandshakeIdentityHandler; +} diff --git a/imports/shared-app/profiles/identities/TeaForumIdentity.d.ts b/imports/shared-app/profiles/identities/TeaForumIdentity.d.ts new file mode 100644 index 0000000..307266f --- /dev/null +++ b/imports/shared-app/profiles/identities/TeaForumIdentity.d.ts @@ -0,0 +1,21 @@ +import { IdentitifyType, Identity } from "../../profiles/Identity"; +import { AbstractServerConnection } from "../../connection/ConnectionBase"; +import { HandshakeIdentityHandler } from "../../connection/HandshakeHandler"; +import * as forum from "./teaspeak-forum"; +export declare class TeaForumIdentity implements Identity { + private readonly identity_data; + valid(): boolean; + constructor(data: forum.Data); + data(): forum.Data; + decode(data: any): Promise; + encode(): string; + spawn_identity_handshake_handler(connection: AbstractServerConnection): HandshakeIdentityHandler; + fallback_name(): string | undefined; + type(): IdentitifyType; + uid(): string; + static identity(): TeaForumIdentity; +} +export declare function set_static_identity(identity: TeaForumIdentity): void; +export declare function update_forum(): void; +export declare function valid_static_forum_identity(): boolean; +export declare function static_forum_identity(): TeaForumIdentity | undefined; diff --git a/imports/shared-app/profiles/identities/TeamSpeakIdentity.d.ts b/imports/shared-app/profiles/identities/TeamSpeakIdentity.d.ts new file mode 100644 index 0000000..f8b7a8a --- /dev/null +++ b/imports/shared-app/profiles/identities/TeamSpeakIdentity.d.ts @@ -0,0 +1,67 @@ +import { AbstractHandshakeIdentityHandler, HandshakeCommandHandler, IdentitifyType, Identity } from "../../profiles/Identity"; +import { AbstractServerConnection } from "../../connection/ConnectionBase"; +import { HandshakeIdentityHandler } from "../../connection/HandshakeHandler"; +export declare namespace CryptoHelper { + function base64UrlEncode(str: any): any; + function base64UrlDecode(str: string, pad?: boolean): string; + function arraybufferToString(buf: any): string; + function export_ecc_key(crypto_key: CryptoKey, public_key: boolean): Promise; + function decryptTeaSpeakIdentity(buffer: Uint8Array): Promise; + function encryptTeaSpeakIdentity(buffer: Uint8Array): Promise; + /** + * @param buffer base64 encoded ASN.1 string + */ + function decodeTomCryptKey(buffer: string): { + crv: string; + d: any; + x: any; + y: any; + ext: boolean; + key_ops: string[]; + kty: string; + }; +} +export declare class TeaSpeakHandshakeHandler extends AbstractHandshakeIdentityHandler { + identity: TeaSpeakIdentity; + handler: HandshakeCommandHandler; + constructor(connection: AbstractServerConnection, identity: TeaSpeakIdentity); + executeHandshake(): void; + private handle_proof; + protected trigger_fail(message: string): void; + protected trigger_success(): void; + fillClientInitData(data: any): void; +} +export declare class TeaSpeakIdentity implements Identity { + static generateNew(): Promise; + static import_ts(ts_string: string, ini?: boolean): Promise; + hash_number: string; + private_key: string; + _name: string; + publicKey: string; + private _initialized; + private _crypto_key; + private _crypto_key_sign; + private _unique_id; + constructor(private_key?: string, hash?: string, name?: string, initialize?: boolean); + fallback_name(): string | undefined; + uid(): string; + type(): IdentitifyType; + valid(): boolean; + decode(data: string): Promise; + encode?(): string; + level(): Promise; + private static calculateLevel; + /** + * @param {string} a + * @param {string} b + * @description b must be smaller (in bytes) then a + */ + private static string_add; + improve_level_for(time: number, threads: number): Promise; + improveLevelNative(target: number, threads: number, active_callback: () => boolean, callback_level?: (current: number) => any, callback_status?: (hash_rate: number) => any): Promise; + improveLevelJavascript(target: number, activeCallback: () => boolean): Promise; + private initialize; + export_ts(ini?: boolean): Promise; + sign_message(message: string, hash?: string): Promise; + spawn_identity_handshake_handler(connection: AbstractServerConnection): HandshakeIdentityHandler; +} diff --git a/imports/shared-app/profiles/identities/teaspeak-forum.d.ts b/imports/shared-app/profiles/identities/teaspeak-forum.d.ts new file mode 100644 index 0000000..b3c4739 --- /dev/null +++ b/imports/shared-app/profiles/identities/teaspeak-forum.d.ts @@ -0,0 +1,59 @@ +declare global { + interface Window { + grecaptcha: GReCaptcha; + } +} +interface GReCaptcha { + render(container: string | HTMLElement, parameters: { + sitekey: string; + theme?: "dark" | "light"; + size?: "compact" | "normal"; + tabindex?: number; + callback?: (token: string) => any; + "expired-callback"?: () => any; + "error-callback"?: (error: any) => any; + }): string; + reset(widget_id?: string): any; +} +export declare namespace gcaptcha { + function initialize(): Promise; + function spawn(container: JQuery, key: string, callback_data: (token: string) => any): Promise; +} +export declare class Data { + readonly auth_key: string; + readonly raw: string; + readonly sign: string; + parsed: { + user_id: number; + user_name: string; + data_age: number; + user_group_id: number; + is_staff: boolean; + user_groups: number[]; + }; + constructor(auth: string, raw: string, sign: string); + data_json(): string; + data_sign(): string; + name(): string; + user_id(): number; + user_group(): number; + is_stuff(): boolean; + is_premium(): boolean; + data_age(): Date; + is_expired(): boolean; + should_renew(): boolean; +} +export declare function logged_in(): boolean; +export declare function data(): Data; +export interface LoginResult { + status: "success" | "captcha" | "error"; + error_message?: string; + captcha?: { + type: "gre-captcha" | "unknown"; + data: any; + }; +} +export declare function login(username: string, password: string, captcha?: any): Promise; +export declare function renew_data(): Promise<"success" | "login-required">; +export declare function logout(): Promise; +export {}; diff --git a/imports/shared-app/proto.d.ts b/imports/shared-app/proto.d.ts new file mode 100644 index 0000000..c42bcfd --- /dev/null +++ b/imports/shared-app/proto.d.ts @@ -0,0 +1,51 @@ +/// +import "jsrender"; +declare global { + function setInterval(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; + function setTimeout(handler: TimerHandler, timeout?: number, ...arguments: any[]): number; + interface Array { + remove(elem?: T): boolean; + last?(): T; + pop_front(): T | undefined; + toggle(entry: T): boolean; + } + interface JSON { + map_to(object: T, json: any, variables?: string | string[], validator?: (map_field: string, map_value: string) => boolean, variable_direction?: number): number; + map_field_to(object: T, value: any, field: string): boolean; + } + type JQueryScrollType = "height" | "width"; + interface JQuery { + renderTag(values?: any): JQuery; + hasScrollBar(direction?: JQueryScrollType): boolean; + visible_height(): number; + visible_width(): number; + firstParent(selector: string): JQuery; + } + interface JQueryStatic { + spawn(tagName: K): JQuery; + } + interface Window { + __REACT_DEVTOOLS_GLOBAL_HOOK__: any; + readonly webkitAudioContext: typeof AudioContext; + readonly AudioContext: typeof OfflineAudioContext; + readonly OfflineAudioContext: typeof OfflineAudioContext; + readonly webkitOfflineAudioContext: typeof OfflineAudioContext; + readonly RTCPeerConnection: typeof RTCPeerConnection; + readonly Pointer_stringify: any; + readonly require: typeof require; + } + const __non_webpack_require__: typeof require; + interface Navigator { + browserSpecs: { + name: string; + version: string; + }; + mozGetUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; + webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: NavigatorUserMediaSuccessCallback, errorCallback: NavigatorUserMediaErrorCallback): void; + } + interface ObjectConstructor { + isSimilar(a: any, b: any): boolean; + } +} +declare const _default: {}; +export = _default; diff --git a/imports/shared-app/settings.d.ts b/imports/shared-app/settings.d.ts new file mode 100644 index 0000000..21c79d8 --- /dev/null +++ b/imports/shared-app/settings.d.ts @@ -0,0 +1,184 @@ +import { Registry } from "./events"; +export declare type RegistryValueType = boolean | number | string | object; +export declare type RegistryValueTypeNames = "boolean" | "number" | "string" | "object"; +export declare type RegistryValueTypeMapping = T extends boolean ? "boolean" : T extends number ? "number" : T extends string ? "string" : T extends object ? "object" : never; +export interface RegistryKey { + key: string; + valueType: RegistryValueTypeMapping; + fallbackKeys?: string | string[]; + fallbackImports?: { + [key: string]: (value: string) => ValueType; + }; + description?: string; + requireRestart?: boolean; +} +export interface ValuedRegistryKey extends RegistryKey { + defaultValue: ValueType; +} +export declare class UrlParameterParser { + private readonly url; + constructor(url: URL); + private getParameter; + getValue(key: RegistryKey, defaultValue: DV): V | DV; + getValue(key: ValuedRegistryKey, defaultValue?: V): V; +} +export declare class UrlParameterBuilder { + private parameters; + setValue(key: RegistryKey, value: V): void; + build(): string; +} +/** + * Switched appended to the application via the URL. + * TODO: Passing native client switches + */ +export declare namespace AppParameters { + const Instance: UrlParameterParser; + function getValue(key: RegistryKey, defaultValue: DV): V | DV; + function getValue(key: ValuedRegistryKey, defaultValue?: V): V; +} +export declare namespace AppParameters { + const KEY_CONNECT_ADDRESS: RegistryKey; + const KEY_CONNECT_INVITE_REFERENCE: RegistryKey; + const KEY_CONNECT_NO_SINGLE_INSTANCE: ValuedRegistryKey; + const KEY_CONNECT_TYPE: ValuedRegistryKey; + const KEY_CONNECT_NICKNAME: RegistryKey; + const KEY_CONNECT_TOKEN: RegistryKey; + const KEY_CONNECT_PROFILE: RegistryKey; + const KEY_CONNECT_SERVER_PASSWORD: RegistryKey; + const KEY_CONNECT_PASSWORDS_HASHED: ValuedRegistryKey; + const KEY_CONNECT_CHANNEL: RegistryKey; + const KEY_CONNECT_CHANNEL_PASSWORD: RegistryKey; + const KEY_IPC_APP_ADDRESS: RegistryKey; + const KEY_IPC_CORE_PEER_ADDRESS: RegistryKey; + const KEY_MODAL_IDENTITY_CODE: RegistryKey; + const KEY_MODAL_TARGET: RegistryKey; + const KEY_LOAD_DUMMY_ERROR: ValuedRegistryKey; +} +export declare class StaticSettings { + private static _instance; + static get instance(): StaticSettings; + protected staticValues: {}; + protected constructor(_reserved?: any); + static(key: RegistryKey, defaultValue: DV): V | DV; + static(key: ValuedRegistryKey, defaultValue?: V): V; +} +export interface SettingsEvents { + notify_setting_changed: { + setting: string; + mode: "global" | "server"; + oldValue: string; + newValue: string; + newCastedValue: any; + }; +} +export declare class Settings { + static readonly KEY_USER_IS_NEW: ValuedRegistryKey; + static readonly KEY_LOG_LEVEL: RegistryKey; + static readonly KEY_DISABLE_COSMETIC_SLOWDOWN: ValuedRegistryKey; + static readonly KEY_DISABLE_CONTEXT_MENU: ValuedRegistryKey; + static readonly KEY_DISABLE_GLOBAL_CONTEXT_MENU: ValuedRegistryKey; + static readonly KEY_DISABLE_UNLOAD_DIALOG: ValuedRegistryKey; + static readonly KEY_DISABLE_VOICE: ValuedRegistryKey; + static readonly KEY_DISABLE_MULTI_SESSION: ValuedRegistryKey; + static readonly KEY_I18N_DEFAULT_REPOSITORY: ValuedRegistryKey; + static readonly KEY_CLIENT_STATE_MICROPHONE_MUTED: ValuedRegistryKey; + static readonly KEY_CLIENT_STATE_SPEAKER_MUTED: ValuedRegistryKey; + static readonly KEY_CLIENT_STATE_QUERY_SHOWN: ValuedRegistryKey; + static readonly KEY_CLIENT_STATE_SUBSCRIBE_ALL_CHANNELS: ValuedRegistryKey; + static readonly KEY_CLIENT_STATE_AWAY: ValuedRegistryKey; + static readonly KEY_CLIENT_AWAY_MESSAGE: ValuedRegistryKey; + static readonly KEY_FLAG_CONNECT_DEFAULT: ValuedRegistryKey; + static readonly KEY_CONNECT_ADDRESS: ValuedRegistryKey; + static readonly KEY_CONNECT_PROFILE: ValuedRegistryKey; + static readonly KEY_CONNECT_USERNAME: ValuedRegistryKey; + static readonly KEY_CONNECT_PASSWORD: ValuedRegistryKey; + static readonly KEY_FLAG_CONNECT_PASSWORD: ValuedRegistryKey; + static readonly KEY_CONNECT_HISTORY: ValuedRegistryKey; + static readonly KEY_CONNECT_SHOW_HISTORY: ValuedRegistryKey; + static readonly KEY_CONNECT_NO_DNSPROXY: ValuedRegistryKey; + static readonly KEY_CERTIFICATE_CALLBACK: ValuedRegistryKey; + static readonly KEY_SOUND_MASTER: ValuedRegistryKey; + static readonly KEY_SOUND_MASTER_SOUNDS: ValuedRegistryKey; + static readonly KEY_SOUND_VOLUMES: RegistryKey; + static readonly KEY_CHAT_FIXED_TIMESTAMPS: ValuedRegistryKey; + static readonly KEY_CHAT_COLLOQUIAL_TIMESTAMPS: ValuedRegistryKey; + static readonly KEY_CHAT_COLORED_EMOJIES: ValuedRegistryKey; + static readonly KEY_CHAT_HIGHLIGHT_CODE: ValuedRegistryKey; + static readonly KEY_CHAT_TAG_URLS: ValuedRegistryKey; + static readonly KEY_CHAT_ENABLE_MARKDOWN: ValuedRegistryKey; + static readonly KEY_CHAT_ENABLE_BBCODE: ValuedRegistryKey; + static readonly KEY_CHAT_IMAGE_WHITELIST_REGEX: ValuedRegistryKey; + static readonly KEY_CHAT_LAST_USED_EMOJI: ValuedRegistryKey; + static readonly KEY_SWITCH_INSTANT_CHAT: ValuedRegistryKey; + static readonly KEY_SWITCH_INSTANT_CLIENT: ValuedRegistryKey; + static readonly KEY_HOSTBANNER_BACKGROUND: ValuedRegistryKey; + static readonly KEY_CHANNEL_EDIT_ADVANCED: ValuedRegistryKey; + static readonly KEY_PERMISSIONS_SHOW_ALL: ValuedRegistryKey; + static readonly KEY_TEAFORO_URL: ValuedRegistryKey; + static readonly KEY_FONT_SIZE: ValuedRegistryKey; + static readonly KEY_ICON_SIZE: ValuedRegistryKey; + static readonly KEY_KEYCONTROL_DATA: ValuedRegistryKey; + static readonly KEY_LAST_INVITE_LINK_TYPE: ValuedRegistryKey; + static readonly KEY_TRANSFERS_SHOW_FINISHED: ValuedRegistryKey; + static readonly KEY_TRANSFER_DOWNLOAD_FOLDER: RegistryKey; + static readonly KEY_IPC_REMOTE_ADDRESS: RegistryKey; + static readonly KEY_W2G_SIDEBAR_COLLAPSED: ValuedRegistryKey; + static readonly KEY_VOICE_ECHO_TEST_ENABLED: ValuedRegistryKey; + static readonly KEY_RTC_EXTRA_VIDEO_CHANNELS: ValuedRegistryKey; + static readonly KEY_RTC_EXTRA_AUDIO_CHANNELS: ValuedRegistryKey; + static readonly KEY_RNNOISE_FILTER: ValuedRegistryKey; + static readonly KEY_LOADER_ANIMATION_ABORT: ValuedRegistryKey; + static readonly KEY_STOP_VIDEO_ON_SWITCH: ValuedRegistryKey; + static readonly KEY_VIDEO_SHOW_ALL_CLIENTS: ValuedRegistryKey; + static readonly KEY_VIDEO_FORCE_SHOW_OWN_VIDEO: ValuedRegistryKey; + static readonly KEY_VIDEO_AUTO_SUBSCRIBE_MODE: ValuedRegistryKey; + static readonly KEY_VIDEO_DEFAULT_MAX_WIDTH: ValuedRegistryKey; + static readonly KEY_VIDEO_DEFAULT_MAX_HEIGHT: ValuedRegistryKey; + static readonly KEY_VIDEO_DEFAULT_MAX_BANDWIDTH: ValuedRegistryKey; + static readonly KEY_VIDEO_DEFAULT_KEYFRAME_INTERVAL: ValuedRegistryKey; + static readonly KEY_VIDEO_DYNAMIC_QUALITY: ValuedRegistryKey; + static readonly KEY_VIDEO_DYNAMIC_FRAME_RATE: ValuedRegistryKey; + static readonly KEY_VIDEO_QUICK_SETUP: ValuedRegistryKey; + static readonly KEY_INVITE_SHORT_URL: ValuedRegistryKey; + static readonly KEY_INVITE_ADVANCED_ENABLED: ValuedRegistryKey; + static readonly FN_LOG_ENABLED: (category: string) => RegistryKey; + static readonly FN_SEPARATOR_STATE: (separator: string) => RegistryKey; + static readonly FN_LOG_LEVEL_ENABLED: (category: string) => RegistryKey; + static readonly FN_INVITE_LINK_SETTING: (name: string) => RegistryKey; + static readonly FN_SERVER_CHANNEL_SUBSCRIBE_MODE: (channel_id: number) => RegistryKey; + static readonly FN_SERVER_CHANNEL_COLLAPSED: (channel_id: number) => ValuedRegistryKey; + static readonly FN_PROFILE_RECORD: (name: string) => RegistryKey; + static readonly FN_CHANNEL_CHAT_READ: (id: number) => RegistryKey; + static readonly FN_CLIENT_MUTED: (clientUniqueId: string) => RegistryKey; + static readonly FN_CLIENT_VOLUME: (clientUniqueId: string) => RegistryKey; + static readonly FN_EVENTS_NOTIFICATION_ENABLED: (event: string) => RegistryKey; + static readonly FN_EVENTS_LOG_ENABLED: (event: string) => RegistryKey; + static readonly FN_EVENTS_FOCUS_ENABLED: (event: string) => RegistryKey; + static readonly KEYS: any[]; + static initialize(): void; + readonly events: Registry; + private readonly cacheGlobal; + private saveWorker; + private updated; + constructor(); + getValue(key: RegistryKey, defaultValue: DV): V | DV; + getValue(key: ValuedRegistryKey, defaultValue?: V): V; + setValue(key: RegistryKey, value?: T): void; + globalChangeListener(key: RegistryKey, listener: (newValue: T) => void): () => void; + save(): void; +} +export declare class ServerSettings { + private cacheServer; + private serverUniqueId; + private serverSaveWorker; + private serverSettingsUpdated; + private _destroyed; + constructor(); + destroy(): void; + getValue(key: RegistryKey, defaultValue: DV): V | DV; + getValue(key: ValuedRegistryKey, defaultValue?: V): V; + setValue(key: RegistryKey, value?: T): void; + setServer(server_unique_id: string): void; + save(): void; +} +export declare let settings: Settings; diff --git a/imports/shared-app/sound/Sounds.d.ts b/imports/shared-app/sound/Sounds.d.ts new file mode 100644 index 0000000..cd62056 --- /dev/null +++ b/imports/shared-app/sound/Sounds.d.ts @@ -0,0 +1,82 @@ +import { ConnectionHandler } from "../ConnectionHandler"; +export declare enum Sound { + SOUND_TEST = "sound.test", + SOUND_EGG = "sound.egg", + AWAY_ACTIVATED = "away_activated", + AWAY_DEACTIVATED = "away_deactivated", + MICROPHONE_MUTED = "microphone.muted", + MICROPHONE_ACTIVATED = "microphone.activated", + SOUND_MUTED = "sound.muted", + SOUND_ACTIVATED = "sound.activated", + CONNECTION_CONNECTED = "connection.connected", + CONNECTION_DISCONNECTED = "connection.disconnected", + CONNECTION_BANNED = "connection.banned", + CONNECTION_DISCONNECTED_TIMEOUT = "connection.disconnected.timeout", + CONNECTION_REFUSED = "connection.refused", + SERVER_EDITED = "server.edited", + SERVER_EDITED_SELF = "server.edited.self", + SERVER_KICKED = "server.kicked", + CHANNEL_CREATED = "channel.created", + CHANNEL_MOVED = "channel.moved", + CHANNEL_EDITED = "channel.edited", + CHANNEL_EDITED_SELF = "channel.edited.self", + CHANNEL_DELETED = "channel.deleted", + CHANNEL_JOINED = "channel.joined", + CHANNEL_KICKED = "channel.kicked", + USER_MOVED = "user.moved", + USER_MOVED_SELF = "user.moved.self", + USER_POKED_SELF = "user.poked.self", + USER_BANNED = "user.banned", + USER_ENTERED = "user.joined", + USER_ENTERED_MOVED = "user.joined.moved", + USER_ENTERED_KICKED = "user.joined.kicked", + USER_ENTERED_CONNECT = "user.joined.connect", + USER_LEFT = "user.left", + USER_LEFT_MOVED = "user.left.moved", + USER_LEFT_KICKED_CHANNEL = "user.left.kicked.server", + USER_LEFT_KICKED_SERVER = "user.left.kicked.channel", + USER_LEFT_DISCONNECT = "user.left.disconnect", + USER_LEFT_BANNED = "user.left.banned", + USER_LEFT_TIMEOUT = "user.left.timeout", + ERROR_INSUFFICIENT_PERMISSIONS = "error.insufficient_permissions", + MESSAGE_SEND = "message.send", + MESSAGE_RECEIVED = "message.received", + GROUP_SERVER_ASSIGNED = "group.server.assigned", + GROUP_SERVER_REVOKED = "group.server.revoked", + GROUP_CHANNEL_CHANGED = "group.channel.changed", + GROUP_SERVER_ASSIGNED_SELF = "group.server.assigned.self", + GROUP_SERVER_REVOKED_SELF = "group.server.revoked.self", + GROUP_CHANNEL_CHANGED_SELF = "group.channel.changed.self" +} +export interface SoundHandle { + key: string; + filename: string; +} +export interface SoundFile { + path: string; + volume?: number; +} +export declare function get_sound_volume(sound: Sound, default_volume?: number): number; +export declare function set_sound_volume(sound: Sound, volume: number): void; +export declare function get_master_volume(): number; +export declare function set_master_volume(volume: number): void; +export declare function overlap_activated(): boolean; +export declare function set_overlap_activated(flag: boolean): void; +export declare function ignore_output_muted(): boolean; +export declare function set_ignore_output_muted(flag: boolean): void; +export declare function save(): void; +export declare function initialize(): Promise; +export interface PlaybackOptions { + ignore_muted?: boolean; + ignore_overlap?: boolean; + default_volume?: number; + callback?: (flag: boolean) => any; +} +export declare function resolve_sound(sound: Sound): Promise; +export declare let manager: SoundManager; +export declare class SoundManager { + private readonly _handle; + private _playing_sounds; + constructor(handle: ConnectionHandler); + play(_sound: Sound, options?: PlaybackOptions): void; +} diff --git a/imports/shared-app/text/bbcode.d.ts b/imports/shared-app/text/bbcode.d.ts new file mode 100644 index 0000000..f4e1984 --- /dev/null +++ b/imports/shared-app/text/bbcode.d.ts @@ -0,0 +1,14 @@ +/// +import "./bbcode.scss"; +export declare const escapeBBCode: (text: string) => string; +export declare const allowedBBCodes: string[]; +export interface BBCodeRenderOptions { + convertSingleUrls: boolean; +} +export declare const BBCodeRenderer: (props: { + message: string; + settings: BBCodeRenderOptions; + handlerId?: string; +}) => JSX.Element; +export declare function renderBBCodeAsJQuery(message: string, settings: BBCodeRenderOptions): JQuery[]; +export declare function renderBBCodeAsText(message: string): string; diff --git a/imports/shared-app/text/bbcode/EmojiUtil.d.ts b/imports/shared-app/text/bbcode/EmojiUtil.d.ts new file mode 100644 index 0000000..3b73c49 --- /dev/null +++ b/imports/shared-app/text/bbcode/EmojiUtil.d.ts @@ -0,0 +1 @@ +export declare function getTwenmojiHashFromNativeEmoji(emoji: string): string; diff --git a/imports/shared-app/text/bbcode/InviteController.d.ts b/imports/shared-app/text/bbcode/InviteController.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/text/bbcode/InviteController.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/text/bbcode/InviteDefinitions.d.ts b/imports/shared-app/text/bbcode/InviteDefinitions.d.ts new file mode 100644 index 0000000..f205e81 --- /dev/null +++ b/imports/shared-app/text/bbcode/InviteDefinitions.d.ts @@ -0,0 +1,18 @@ +export declare type IpcInviteInfoLoaded = { + linkId: string; + serverAddress: string; + serverUniqueId: string; + serverName: string; + connectParameters: string; + channelId?: number; + channelName?: string; + expireTimestamp: number | 0; +}; +export declare type IpcInviteInfo = ({ + status: "success"; +} & IpcInviteInfoLoaded) | { + status: "error"; + message: string; +} | { + status: "not-found" | "expired"; +}; diff --git a/imports/shared-app/text/bbcode/InviteRenderer.d.ts b/imports/shared-app/text/bbcode/InviteRenderer.d.ts new file mode 100644 index 0000000..252061f --- /dev/null +++ b/imports/shared-app/text/bbcode/InviteRenderer.d.ts @@ -0,0 +1,6 @@ +/// +export declare function isInviteLink(url: string): boolean; +export declare const InviteLinkRenderer: (props: { + url: string; + handlerId: string; +}) => JSX.Element; diff --git a/imports/shared-app/text/bbcode/emoji.d.ts b/imports/shared-app/text/bbcode/emoji.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/text/bbcode/emoji.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/text/bbcode/highlight.d.ts b/imports/shared-app/text/bbcode/highlight.d.ts new file mode 100644 index 0000000..02d3198 --- /dev/null +++ b/imports/shared-app/text/bbcode/highlight.d.ts @@ -0,0 +1 @@ +import '!style-loader!css-loader!highlight.js/styles/darcula.css'; diff --git a/imports/shared-app/text/bbcode/image.d.ts b/imports/shared-app/text/bbcode/image.d.ts new file mode 100644 index 0000000..208a496 --- /dev/null +++ b/imports/shared-app/text/bbcode/image.d.ts @@ -0,0 +1,2 @@ +export declare const regexImage: RegExp; +export declare function fixupJQueryImageTags(container: JQuery): void; diff --git a/imports/shared-app/text/bbcode/renderer.d.ts b/imports/shared-app/text/bbcode/renderer.d.ts new file mode 100644 index 0000000..142cb12 --- /dev/null +++ b/imports/shared-app/text/bbcode/renderer.d.ts @@ -0,0 +1,13 @@ +import { Context } from "react"; +import TextRenderer from "vendor/xbbcode/renderer/text"; +import ReactRenderer from "vendor/xbbcode/renderer/react"; +import HTMLRenderer from "vendor/xbbcode/renderer/html"; +import "./emoji"; +import "./highlight"; +import "./youtube"; +import "./url"; +import "./image"; +export declare let BBCodeHandlerContext: Context; +export declare const rendererText: TextRenderer; +export declare const rendererReact: ReactRenderer; +export declare const rendererHTML: HTMLRenderer; diff --git a/imports/shared-app/text/bbcode/url.d.ts b/imports/shared-app/text/bbcode/url.d.ts new file mode 100644 index 0000000..75690f1 --- /dev/null +++ b/imports/shared-app/text/bbcode/url.d.ts @@ -0,0 +1,6 @@ +/// +export declare const SimpleUrlRenderer: (props: { + target: string; + children: any; +}) => JSX.Element; +export declare function fixupJQueryUrlTags(container: JQuery): void; diff --git a/imports/shared-app/text/bbcode/youtube.d.ts b/imports/shared-app/text/bbcode/youtube.d.ts new file mode 100644 index 0000000..407e022 --- /dev/null +++ b/imports/shared-app/text/bbcode/youtube.d.ts @@ -0,0 +1,6 @@ +import * as React from "react"; +export declare const isYoutubeLink: (text: string) => boolean; +export declare const YoutubeRenderer: (props: { + children?: React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>[]; + url: string; +}) => JSX.Element; diff --git a/imports/shared-app/text/chat.d.ts b/imports/shared-app/text/chat.d.ts new file mode 100644 index 0000000..558c02b --- /dev/null +++ b/imports/shared-app/text/chat.d.ts @@ -0,0 +1 @@ +export declare function preprocessChatMessageForSend(message: string): string; diff --git a/imports/shared-app/text/markdown.d.ts b/imports/shared-app/text/markdown.d.ts new file mode 100644 index 0000000..f25de9c --- /dev/null +++ b/imports/shared-app/text/markdown.d.ts @@ -0,0 +1,11 @@ +import { Env, Options, Token } from "remarkable/lib"; +export declare class MD2BBCodeRenderer { + private static renderers; + private _options; + currentLineCount: number; + reset(): void; + render(tokens: Token[], options: Options, env: Env): string; + private renderToken; + options(): any; +} +export declare function renderMarkdownAsBBCode(message: string, textProcessor: (text: string) => string): string; diff --git a/imports/shared-app/tree/Channel.d.ts b/imports/shared-app/tree/Channel.d.ts new file mode 100644 index 0000000..c5fefc4 --- /dev/null +++ b/imports/shared-app/tree/Channel.d.ts @@ -0,0 +1,152 @@ +import { ChannelTree } from "./ChannelTree"; +import { ClientEntry } from "./Client"; +import { PermissionType } from "../permission/PermissionType"; +import { Registry } from "../events"; +import { ChannelTreeEntry, ChannelTreeEntryEvents } from "./ChannelTreeEntry"; +import { ClientIcon } from "svg-sprites/client-icons"; +import { EventChannelData } from "tc-shared/connectionlog/Definitions"; +export declare enum ChannelType { + PERMANENT = 0, + SEMI_PERMANENT = 1, + TEMPORARY = 2 +} +export declare namespace ChannelType { + function normalize(mode: ChannelType): string; +} +export declare enum ChannelSubscribeMode { + SUBSCRIBED = 0, + UNSUBSCRIBED = 1, + INHERITED = 2 +} +export declare enum ChannelConversationMode { + Public = 0, + Private = 1, + None = 2 +} +export declare enum ChannelSidebarMode { + Conversation = 0, + Description = 1, + FileTransfer = 2, + Unknown = 255 +} +export 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; + channel_conversation_mode: ChannelConversationMode; + channel_conversation_history_length: number; + channel_sidebar_mode: ChannelSidebarMode; +} +export interface ChannelEvents extends ChannelTreeEntryEvents { + notify_properties_updated: { + updated_properties: { + [Key in keyof ChannelProperties]: ChannelProperties[Key]; + }; + channel_properties: ChannelProperties; + }; + notify_cached_password_updated: { + reason: "channel-password-changed" | "password-miss-match" | "password-entered"; + new_hash?: string; + }; + notify_subscribe_state_changed: { + channel_subscribed: boolean; + }; + notify_collapsed_state_changed: { + collapsed: boolean; + }; + notify_description_changed: {}; +} +export declare type ChannelNameAlignment = "center" | "right" | "left" | "normal" | "repetitive"; +export declare class ChannelNameParser { + readonly originalName: string; + alignment: ChannelNameAlignment; + text: string; + uniqueId: string; + constructor(name: string, hasParentChannel: boolean); + private parse; +} +export declare class ChannelEntry extends ChannelTreeEntry { + channelTree: ChannelTree; + channelId: number; + parent?: ChannelEntry; + properties: ChannelProperties; + channel_previous?: ChannelEntry; + channel_next?: ChannelEntry; + child_channel_head?: ChannelEntry; + readonly events: Registry; + parsed_channel_name: ChannelNameParser; + private _family_index; + private _destroyed; + private cachedPasswordHash; + private channelDescriptionCached; + private channelDescriptionCallback; + private channelDescriptionPromise; + private collapsed; + private subscribed; + private subscriptionMode; + private client_list; + private readonly clientPropertyChangedListener; + constructor(channelTree: ChannelTree, channelId: number, channelName: string); + destroy(): void; + channelName(): string; + channelDepth(): number; + formattedChannelName(): string; + getChannelDescription(): Promise; + isDescriptionCached(): boolean; + private doGetChannelDescription; + registerClient(client: ClientEntry): void; + unregisterClient(client: ClientEntry, noEvent?: boolean): void; + private reorderClientList; + parent_channel(): ChannelEntry; + hasParent(): boolean; + getChannelId(): number; + children(deep?: boolean): ChannelEntry[]; + clients(deep?: boolean): ClientEntry[]; + channelClientsOrdered(): ClientEntry[]; + calculate_family_index(enforce_recalculate?: boolean): number; + showContextMenu(x: number, y: number, on_close?: () => void): void; + updateVariables(...variables: { + key: string; + value: string; + }[]): void; + generate_bbcode(): string; + generate_tag(braces?: boolean): JQuery; + channelType(): ChannelType; + joinChannel(ignorePasswordFlag?: boolean): Promise; + requestChannelPassword(ignorePermission: PermissionType): Promise<{ + hash: string; + } | undefined>; + invalidateCachedPassword(): void; + setCachedHashedPassword(passwordHash: string): void; + getCachedPasswordHash(): string; + updateSubscribeMode(): Promise; + subscribe(): Promise; + unsubscribe(inherited_subscription_mode?: boolean): Promise; + isCollapsed(): boolean; + setCollapsed(flag: boolean): void; + isSubscribed(): boolean; + setSubscribed(flag: boolean): void; + getSubscriptionMode(): ChannelSubscribeMode; + setSubscriptionMode(mode: ChannelSubscribeMode, dontSyncSubscribeMode?: boolean): void; + log_data(): EventChannelData; + getStatusIcon(): ClientIcon | undefined; + handleDescriptionChanged(): void; +} diff --git a/imports/shared-app/tree/ChannelTree.d.ts b/imports/shared-app/tree/ChannelTree.d.ts new file mode 100644 index 0000000..052e4d0 --- /dev/null +++ b/imports/shared-app/tree/ChannelTree.d.ts @@ -0,0 +1,123 @@ +import { Group } from "tc-shared/permission/GroupManager"; +import { ServerAddress, ServerEntry } from "./Server"; +import { ChannelEntry, ChannelProperties } from "./Channel"; +import { ClientEntry } from "./Client"; +import { ChannelTreeEntry } from "./ChannelTreeEntry"; +import { ConnectionHandler, ViewReasonId } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +import { ChannelTreePopoutController } from "tc-shared/ui/tree/popout/Controller"; +import "./EntryTagsHandler"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +export interface ChannelTreeEvents { + notify_tree_reset: {}; + notify_query_view_state_changed: { + queries_shown: boolean; + }; + notify_popout_state_changed: { + popoutShown: boolean; + }; + notify_entry_move_begin: {}; + notify_entry_move_end: {}; + notify_channel_created: { + channel: ChannelEntry; + }; + notify_channel_moved: { + channel: ChannelEntry; + previousParent: ChannelEntry | undefined; + previousOrder: ChannelEntry | undefined; + }; + notify_channel_deleted: { + channel: ChannelEntry; + }; + notify_channel_client_order_changed: { + channel: ChannelEntry; + }; + notify_channel_updated: { + channel: ChannelEntry; + channelProperties: ChannelProperties; + updatedProperties: ChannelProperties; + }; + notify_channel_list_received: {}; + notify_client_enter_view: { + client: ClientEntry; + reason: ViewReasonId; + isServerJoin: boolean; + targetChannel: ChannelEntry; + }; + notify_client_moved: { + client: ClientEntry; + oldChannel: ChannelEntry | undefined; + newChannel: ChannelEntry; + }; + notify_client_leave_view: { + client: ClientEntry; + reason: ViewReasonId; + message?: string; + isServerLeave: boolean; + sourceChannel: ChannelEntry; + }; + notify_selected_entry_changed: { + oldEntry: ChannelTreeEntry | undefined; + newEntry: ChannelTreeEntry | undefined; + }; +} +export declare class ChannelTree { + readonly events: Registry; + client: ConnectionHandler; + server: ServerEntry; + channels: ChannelEntry[]; + clients: ClientEntry[]; + channelsInitialized: boolean; + readonly popoutController: ChannelTreePopoutController; + mainTreeUiEvents: Registry; + private selectedEntry; + private showQueries; + private channelLast?; + private channelFirst?; + constructor(client: ConnectionHandler); + channelsOrdered(): ChannelEntry[]; + findEntryId(entryId: number): ServerEntry | ChannelEntry | ClientEntry; + getSelectedEntry(): ChannelTreeEntry | undefined; + setSelectedEntry(entry: ChannelTreeEntry | undefined): void; + destroy(): void; + initialiseHead(serverName: string, address: ServerAddress): void; + rootChannel(): ChannelEntry[]; + deleteChannel(channel: ChannelEntry): void; + handleChannelCreated(previous: ChannelEntry, parent: ChannelEntry, channelId: number, channelName: string): ChannelEntry; + findChannel(channelId: number): ChannelEntry | undefined; + /** + * Resolve a channel by its path + */ + resolveChannelPath(target: string): ChannelEntry | undefined; + find_channel_by_name(name: string, parent?: ChannelEntry, force_parent?: boolean): ChannelEntry | undefined; + private unregisterChannelFromTree; + moveChannel(channel: ChannelEntry, channelPrevious: ChannelEntry, parent: ChannelEntry, isInsertMove: boolean): void; + deleteClient(client: ClientEntry, reason: { + reason: ViewReasonId; + message?: string; + serverLeave: boolean; + }): void; + registerClient(client: ClientEntry): void; + unregisterClient(client: ClientEntry): void; + insertClient(client: ClientEntry, channel: ChannelEntry, reason: { + reason: ViewReasonId; + isServerJoin: boolean; + }): ClientEntry; + moveClient(client: ClientEntry, targetChannel: ChannelEntry): void; + findClient?(clientId: number): ClientEntry; + find_client_by_dbid?(client_dbid: number): ClientEntry; + find_client_by_unique_id?(unique_id: string): ClientEntry; + showContextMenu(x: number, y: number, on_close?: () => void): void; + showMultiSelectContextMenu(entries: ChannelTreeEntry[], x: number, y: number): void; + clientsByGroup(group: Group): ClientEntry[]; + clientsByChannel(channel: ChannelEntry): ClientEntry[]; + reset(): void; + spawnCreateChannel(parent?: ChannelEntry): void; + toggle_server_queries(flag: boolean): void; + areServerQueriesShown(): boolean; + get_first_channel?(): ChannelEntry; + unsubscribe_all_channels(): void; + subscribe_all_channels(): void; + expand_channels(root?: ChannelEntry): void; + collapse_channels(root?: ChannelEntry): void; +} diff --git a/imports/shared-app/tree/ChannelTreeEntry.d.ts b/imports/shared-app/tree/ChannelTreeEntry.d.ts new file mode 100644 index 0000000..c8c6712 --- /dev/null +++ b/imports/shared-app/tree/ChannelTreeEntry.d.ts @@ -0,0 +1,16 @@ +import { Registry } from "../events"; +export interface ChannelTreeEntryEvents { + notify_unread_state_change: { + unread: boolean; + }; +} +export declare abstract class ChannelTreeEntry { + readonly events: Registry; + readonly uniqueEntryId: number; + protected selected_: boolean; + protected unread_: boolean; + protected constructor(); + setUnread(flag: boolean): void; + isUnread(): boolean; + abstract showContextMenu(pageX: number, pageY: number, on_close?: any): any; +} diff --git a/imports/shared-app/tree/Client.d.ts b/imports/shared-app/tree/Client.d.ts new file mode 100644 index 0000000..010e402 --- /dev/null +++ b/imports/shared-app/tree/Client.d.ts @@ -0,0 +1,259 @@ +import * as contextmenu from "../ui/elements/ContextMenu"; +import { Registry } from "../events"; +import { ChannelTree } from "./ChannelTree"; +import { Group } from "../permission/GroupManager"; +import { ChannelEntry } from "./Channel"; +import { ConnectionHandler } from "../ConnectionHandler"; +import { ChannelTreeEntry, ChannelTreeEntryEvents } from "./ChannelTreeEntry"; +import { ClientIcon } from "svg-sprites/client-icons"; +import { VoiceClient } from "../voice/VoiceClient"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +import { VideoClient } from "tc-shared/connection/VideoConnection"; +import { EventClient } from "tc-shared/connectionlog/Definitions"; +export declare enum ClientType { + CLIENT_VOICE = 0, + CLIENT_QUERY = 1, + CLIENT_INTERNAL = 2, + CLIENT_WEB = 3, + CLIENT_MUSIC = 4, + CLIENT_UNDEFINED = 5 +} +export 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_channel_group_inherited_channel_id: number; + client_lastconnected: number; + client_created: number; + client_totalconnections: number; + client_flag_avatar: string; + client_icon_id: number; + client_away_message: string; + client_away: boolean; + client_country: string; + client_input_hardware: boolean; + client_output_hardware: boolean; + client_input_muted: boolean; + client_output_muted: boolean; + client_is_channel_commander: boolean; + client_teaforo_id: number; + client_teaforo_name: string; + client_teaforo_flags: number; + client_month_bytes_uploaded: number; + client_month_bytes_downloaded: number; + client_total_bytes_uploaded: number; + client_total_bytes_downloaded: number; + client_talk_power: number; + client_talk_request: number; + client_talk_request_msg: string; + client_is_talker: boolean; + client_is_priority_speaker: boolean; +} +export declare class ClientConnectionInfo { + connection_bandwidth_received_last_minute_control: number; + connection_bandwidth_received_last_minute_keepalive: number; + connection_bandwidth_received_last_minute_speech: number; + connection_bandwidth_received_last_second_control: number; + connection_bandwidth_received_last_second_keepalive: number; + connection_bandwidth_received_last_second_speech: number; + connection_bandwidth_sent_last_minute_control: number; + connection_bandwidth_sent_last_minute_keepalive: number; + connection_bandwidth_sent_last_minute_speech: number; + connection_bandwidth_sent_last_second_control: number; + connection_bandwidth_sent_last_second_keepalive: number; + connection_bandwidth_sent_last_second_speech: number; + connection_bytes_received_control: number; + connection_bytes_received_keepalive: number; + connection_bytes_received_speech: number; + connection_bytes_sent_control: number; + connection_bytes_sent_keepalive: number; + connection_bytes_sent_speech: number; + connection_packets_received_control: number; + connection_packets_received_keepalive: number; + connection_packets_received_speech: number; + connection_packets_sent_control: number; + connection_packets_sent_keepalive: number; + connection_packets_sent_speech: number; + connection_ping: number; + connection_ping_deviation: number; + connection_server2client_packetloss_control: number; + connection_server2client_packetloss_keepalive: number; + connection_server2client_packetloss_speech: number; + connection_server2client_packetloss_total: number; + connection_client2server_packetloss_speech: number; + connection_client2server_packetloss_keepalive: number; + connection_client2server_packetloss_control: number; + connection_client2server_packetloss_total: number; + connection_filetransfer_bandwidth_sent: number; + connection_filetransfer_bandwidth_received: number; + connection_connected_time: number; + connection_idle_time: number; + connection_client_ip: string | undefined; + connection_client_port: number; +} +export interface ClientEvents extends ChannelTreeEntryEvents { + notify_properties_updated: { + updated_properties: { + [Key in keyof ClientProperties]: ClientProperties[Key]; + }; + client_properties: ClientProperties; + }; + notify_mute_state_change: { + muted: boolean; + }; + notify_speak_state_change: { + speaking: boolean; + }; + notify_audio_level_changed: { + newValue: number; + }; + notify_status_icon_changed: { + newIcon: ClientIcon; + }; + notify_video_handle_changed: { + oldHandle: VideoClient | undefined; + newHandle: VideoClient | undefined; + }; +} +export declare class ClientEntry extends ChannelTreeEntry { + readonly events: Registry; + channelTree: ChannelTree; + protected _clientId: number; + protected _channel: ChannelEntry; + protected _properties: ClientProperties; + protected lastVariableUpdate: number; + protected _speaking: boolean; + protected voiceHandle: VoiceClient; + protected voiceVolume: number; + protected voiceMuted: boolean; + private readonly voiceCallbackStateChanged; + protected videoHandle: VideoClient; + private promiseClientInfo; + private promiseClientInfoTimestamp; + private promiseConnectionInfo; + private promiseConnectionInfoTimestamp; + private promiseConnectionInfoResolve; + private promiseConnectionInfoReject; + constructor(clientId: number, clientName: any, properties?: ClientProperties); + destroy(): void; + setVoiceClient(handle: VoiceClient): void; + setVideoClient(handle: VideoClient): void; + private handleVoiceStateChange; + private updateVoiceVolume; + getVoiceClient(): VoiceClient; + getVideoClient(): VideoClient; + get properties(): ClientProperties; + getStatusIcon(): ClientIcon; + currentChannel(): ChannelEntry; + clientNickName(): string; + clientUid(): string; + clientId(): number; + isMuted(): boolean; + setMuted(flagMuted: boolean, force: boolean): void; + protected contextmenu_info(): contextmenu.MenuEntry[]; + protected assignment_context(): contextmenu.MenuEntry[]; + open_assignment_modal(): void; + open_text_chat(): void; + showContextMenu(x: number, y: number, on_close?: () => void): void; + 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; + set speaking(flag: any); + isSpeaking(): boolean; + updateVariables(...variables: { + key: string; + value: string; + }[]): void; + updateClientVariables(force_update?: boolean): Promise; + assignedServerGroupIds(): number[]; + assignedChannelGroup(): number; + groupAssigned(group: Group): boolean; + onDelete(): void; + calculateOnlineTime(): number; + avatarId?(): string; + log_data(): EventClient; + request_connection_info(): Promise; + set_connection_info(info: ClientConnectionInfo): void; + setAudioVolume(value: number): void; + getAudioVolume(): number; +} +export declare class LocalClientEntry extends ClientEntry { + handle: ConnectionHandler; + constructor(handle: ConnectionHandler); + showContextMenu(x: number, y: number, on_close?: () => void): void; + renameSelf(new_name: string): Promise; + openRenameModal(): void; + openRename(events: Registry): void; +} +export declare enum MusicClientPlayerState { + SLEEPING = 0, + LOADING = 1, + PLAYING = 2, + PAUSED = 3, + STOPPED = 4 +} +export declare class MusicClientProperties extends ClientProperties { + player_state: number; + player_volume: number; + client_playlist_id: number; + client_disabled: boolean; + client_flag_notify_song_change: boolean; + client_bot_type: number; + client_uptime_mode: number; +} +export declare class SongInfo { + song_id: number; + song_url: string; + song_invoker: number; + song_loaded: boolean; + song_title: string; + song_description: string; + song_thumbnail: string; + song_length: number; +} +export declare class MusicClientPlayerInfo extends SongInfo { + 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; +} +export interface MusicClientEvents extends ClientEvents { + notify_music_player_song_change: { + newSong: SongInfo | undefined; + }; + notify_music_player_timestamp: { + bufferedIndex: number; + replayIndex: number; + }; + notify_subscribe_state_changed: { + subscribed: boolean; + }; +} +export declare class MusicClientEntry extends ClientEntry { + private subscribed; + private _info_promise; + private _info_promise_age; + private _info_promise_resolve; + private _info_promise_reject; + constructor(clientId: any, clientName: any); + destroy(): void; + get properties(): MusicClientProperties; + isSubscribed(): boolean; + subscribe(): Promise; + showContextMenu(x: number, y: number, on_close?: () => void): void; + handlePlayerInfo(json: any): void; + requestPlayerInfo(max_age?: number): Promise; + isCurrentlyPlaying(): boolean; +} diff --git a/imports/shared-app/tree/EntryTagsHandler.d.ts b/imports/shared-app/tree/EntryTagsHandler.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/tree/EntryTagsHandler.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/tree/Server.d.ts b/imports/shared-app/tree/Server.d.ts new file mode 100644 index 0000000..c885254 --- /dev/null +++ b/imports/shared-app/tree/Server.d.ts @@ -0,0 +1,122 @@ +import { ChannelTree } from "./ChannelTree"; +import * as contextmenu from "../ui/elements/ContextMenu"; +import { Registry } from "../events"; +import { ChannelTreeEntry, ChannelTreeEntryEvents } from "./ChannelTreeEntry"; +export declare class ServerProperties { + virtualserver_host: string; + virtualserver_port: number; + virtualserver_name: string; + virtualserver_name_phonetic: string; + virtualserver_icon_id: number; + virtualserver_version: string; + virtualserver_platform: string; + virtualserver_unique_identifier: string; + virtualserver_clientsonline: number; + virtualserver_queryclientsonline: number; + virtualserver_channelsonline: number; + virtualserver_uptime: number; + virtualserver_created: number; + virtualserver_maxclients: number; + virtualserver_reserved_slots: number; + virtualserver_password: string; + virtualserver_flag_password: boolean; + virtualserver_ask_for_privilegekey: boolean; + virtualserver_welcomemessage: string; + virtualserver_hostmessage: string; + virtualserver_hostmessage_mode: number; + virtualserver_hostbanner_url: string; + virtualserver_hostbanner_gfx_url: string; + virtualserver_hostbanner_gfx_interval: number; + virtualserver_hostbanner_mode: number; + virtualserver_hostbutton_tooltip: string; + virtualserver_hostbutton_url: string; + virtualserver_hostbutton_gfx_url: string; + virtualserver_codec_encryption_mode: number; + virtualserver_default_music_group: number; + virtualserver_default_server_group: number; + virtualserver_default_channel_group: number; + virtualserver_default_channel_admin_group: number; + virtualserver_default_client_description: string; + virtualserver_default_channel_description: string; + virtualserver_default_channel_topic: string; + virtualserver_antiflood_points_tick_reduce: number; + virtualserver_antiflood_points_needed_command_block: number; + virtualserver_antiflood_points_needed_ip_block: number; + virtualserver_country_code: string; + virtualserver_complain_autoban_count: number; + virtualserver_complain_autoban_time: number; + virtualserver_complain_remove_time: number; + virtualserver_needed_identity_security_level: number; + virtualserver_weblist_enabled: boolean; + virtualserver_min_clients_in_channel_before_forced_silence: number; + virtualserver_channel_temp_delete_delay_default: number; + virtualserver_priority_speaker_dimm_modificator: number; + virtualserver_max_upload_total_bandwidth: number; + virtualserver_upload_quota: number; + virtualserver_max_download_total_bandwidth: number; + virtualserver_download_quota: number; + virtualserver_month_bytes_downloaded: number; + virtualserver_month_bytes_uploaded: number; + virtualserver_total_bytes_downloaded: number; + virtualserver_total_bytes_uploaded: number; +} +export interface ServerConnectionInfo { + connection_filetransfer_bandwidth_sent: number; + connection_filetransfer_bandwidth_received: number; + connection_filetransfer_bytes_sent_total: number; + connection_filetransfer_bytes_received_total: number; + connection_filetransfer_bytes_sent_month: number; + connection_filetransfer_bytes_received_month: number; + connection_packets_sent_total: number; + connection_bytes_sent_total: number; + connection_packets_received_total: number; + connection_bytes_received_total: number; + connection_bandwidth_sent_last_second_total: number; + connection_bandwidth_sent_last_minute_total: number; + connection_bandwidth_received_last_second_total: number; + connection_bandwidth_received_last_minute_total: number; + connection_connected_time: number; + connection_packetloss_total: number; + connection_ping: number; +} +export interface ServerAddress { + host: string; + port: number; +} +export declare function parseServerAddress(address: string): ServerAddress | undefined; +export interface ServerEvents extends ChannelTreeEntryEvents { + notify_properties_updated: { + updated_properties: Partial; + server_properties: ServerProperties; + }; +} +export declare class ServerEntry extends ChannelTreeEntry { + remote_address: ServerAddress; + channelTree: ChannelTree; + properties: ServerProperties; + readonly events: Registry; + private info_request_promise; + private info_request_promise_resolve; + private info_request_promise_reject; + private _info_connection_promise; + private _info_connection_promise_timestamp; + private _info_connection_promise_resolve; + private _info_connection_promise_reject; + lastInfoRequest: number; + nextInfoRequest: number; + private _destroyed; + constructor(tree: any, name: any, address: ServerAddress); + destroy(): void; + contextMenuItems(): contextmenu.MenuEntry[]; + showContextMenu(x: number, y: number, on_close?: () => void): void; + updateVariables(is_self_notify: boolean, ...variables: { + key: string; + value: string; + }[]): void; + updateProperties(): Promise; + request_connection_info(): Promise; + set_connection_info(info: ServerConnectionInfo): void; + shouldUpdateProperties(): boolean; + calculateUptime(): number; + reset(): void; +} diff --git a/imports/shared-app/ui/AppController.d.ts b/imports/shared-app/ui/AppController.d.ts new file mode 100644 index 0000000..a0cd9d0 --- /dev/null +++ b/imports/shared-app/ui/AppController.d.ts @@ -0,0 +1,21 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare class AppController { + private uiEvents; + private listener; + private currentConnection; + private listenerConnection; + private container; + private controlBarEvents; + private connectionListEvents; + private sideBarController; + private serverLogController; + private hostBannerController; + constructor(); + destroy(): void; + initialize(): void; + setConnectionHandler(connection: ConnectionHandler): void; + renderApp(): void; + private notifyChannelTree; + private notifyVideoContainer; +} +export declare let appViewController: AppController; diff --git a/imports/shared-app/ui/AppDefinitions.d.ts b/imports/shared-app/ui/AppDefinitions.d.ts new file mode 100644 index 0000000..05cdc2e --- /dev/null +++ b/imports/shared-app/ui/AppDefinitions.d.ts @@ -0,0 +1,13 @@ +import { Registry } from "tc-shared/events"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +export interface AppUiEvents { + query_channel_tree: {}; + query_video_container: {}; + notify_channel_tree: { + events: Registry | undefined; + handlerId: string; + }; + notify_video_container: { + container: HTMLDivElement | undefined; + }; +} diff --git a/imports/shared-app/ui/AppRenderer.d.ts b/imports/shared-app/ui/AppRenderer.d.ts new file mode 100644 index 0000000..d44ff52 --- /dev/null +++ b/imports/shared-app/ui/AppRenderer.d.ts @@ -0,0 +1,18 @@ +/// +import { Registry } from "tc-shared/events"; +import { ControlBarEvents } from "tc-shared/ui/frames/control-bar/Definitions"; +import { ConnectionListUIEvents } from "tc-shared/ui/frames/connection-handler-list/Definitions"; +import { SideBarEvents } from "tc-shared/ui/frames/SideBarDefinitions"; +import { SideHeaderEvents } from "tc-shared/ui/frames/side/HeaderDefinitions"; +import { ServerEventLogUiEvents } from "tc-shared/ui/frames/log/Definitions"; +import { HostBannerUiEvents } from "tc-shared/ui/frames/HostBannerDefinitions"; +import { AppUiEvents } from "tc-shared/ui/AppDefinitions"; +export declare const TeaAppMainView: (props: { + events: Registry; + controlBar: Registry; + connectionList: Registry; + sidebar: Registry; + sidebarHeader: Registry; + log: Registry; + hostBanner: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/ContextMenu.d.ts b/imports/shared-app/ui/ContextMenu.d.ts new file mode 100644 index 0000000..996af96 --- /dev/null +++ b/imports/shared-app/ui/ContextMenu.d.ts @@ -0,0 +1,41 @@ +import { RemoteIcon } from "tc-shared/file/Icons"; +import { ClientIcon } from "svg-sprites/client-icons"; +export declare type MenuEntryLabel = { + text: string; + bold?: boolean; +} | string; +export declare type MenuEntryClickable = { + uniqueId?: string; + label: MenuEntryLabel; + enabled?: boolean; + visible?: boolean; + click?: () => void; + icon?: RemoteIcon | ClientIcon; +}; +export declare type ContextMenuEntryNormal = { + type: "normal"; + subMenu?: ContextMenuEntry[]; +} & MenuEntryClickable; +export declare type ContextMenuEntrySeparator = { + uniqueId?: string; + type: "separator"; + visible?: boolean; +}; +export declare type ContextMenuEntryCheckbox = { + type: "checkbox"; + checked?: boolean; +} & MenuEntryClickable; +export declare type ContextMenuEntry = ContextMenuEntryNormal | ContextMenuEntrySeparator | ContextMenuEntryCheckbox; +export interface ContextMenuFactory { + spawnContextMenu(position: { + pageX: number; + pageY: number; + }, entries: ContextMenuEntry[], callbackClose?: () => void): any; + closeContextMenu(): any; +} +export declare function setGlobalContextMenuFactory(instance: ContextMenuFactory): void; +export declare function spawnContextMenu(position: { + pageX: number; + pageY: number; +}, entries: ContextMenuEntry[], callbackClose?: () => void): void; +export declare function closeContextMenu(): void; diff --git a/imports/shared-app/ui/elements/ContextDivider.d.ts b/imports/shared-app/ui/elements/ContextDivider.d.ts new file mode 100644 index 0000000..7ded90f --- /dev/null +++ b/imports/shared-app/ui/elements/ContextDivider.d.ts @@ -0,0 +1,6 @@ +declare global { + interface JQuery { + dividerfy(): this; + } +} +export {}; diff --git a/imports/shared-app/ui/elements/ContextMenu.d.ts b/imports/shared-app/ui/elements/ContextMenu.d.ts new file mode 100644 index 0000000..497a7bc --- /dev/null +++ b/imports/shared-app/ui/elements/ContextMenu.d.ts @@ -0,0 +1,44 @@ +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 declare enum MenuEntryType { + CLOSE = 0, + ENTRY = 1, + CHECKBOX = 2, + HR = 3, + SUB_MENU = 4 +} +export declare class Entry { + static HR(): { + callback: () => void; + type: MenuEntryType; + name: string; + icon: string; + }; + static CLOSE(callback: () => void): { + callback: () => void; + type: MenuEntryType; + name: string; + icon: string; + }; +} +export interface ContextMenuProvider { + despawn_context_menu(): any; + spawn_context_menu(x: number, y: number, ...entries: MenuEntry[]): any; + initialize(): any; + finalize(): any; + html_format_enabled(): boolean; +} +export declare function spawn_context_menu(x: number, y: number, ...entries: MenuEntry[]): void; +export declare function despawn_context_menu(): void; +export declare function get_provider(): ContextMenuProvider; +export declare function set_provider(_provider: ContextMenuProvider): void; diff --git a/imports/shared-app/ui/elements/Modal.d.ts b/imports/shared-app/ui/elements/Modal.d.ts new file mode 100644 index 0000000..517c7d6 --- /dev/null +++ b/imports/shared-app/ui/elements/Modal.d.ts @@ -0,0 +1,52 @@ +export declare enum ElementType { + HEADER = 0, + BODY = 1, + FOOTER = 2 +} +export declare type BodyCreator = (() => JQuery | JQuery[] | string) | string | JQuery | JQuery[]; +export declare const ModalFunctions: { + divify: (val: JQuery) => JQuery; + jqueriefy: (val: BodyCreator, type?: ElementType) => JQuery | JQuery[]; + warpProperties(data: any): ModalProperties; +}; +export declare class ModalProperties { + template?: string; + header: BodyCreator; + body: BodyCreator; + footer: BodyCreator; + closeListener: (() => void) | (() => void)[]; + registerCloseListener(listener: () => void): this; + width: number | string; + min_width?: number | string; + height: number | string; + closeable: boolean; + triggerClose(): void; + template_properties?: any; + trigger_tab: boolean; + full_size?: boolean; +} +export declare class Modal { + private _htmlTag; + properties: ModalProperties; + shown: boolean; + open_listener: (() => any)[]; + close_listener: (() => any)[]; + close_elements: JQuery; + constructor(props: ModalProperties); + get htmlTag(): JQuery; + private _create; + open(): void; + close(): void; + set_closeable(flag: boolean): void; +} +export declare function createModal(data: ModalProperties | any): Modal; +export declare class InputModalProperties extends ModalProperties { + maxLength?: number; + field_title?: string; + field_label?: string; + field_placeholder?: string; + error_message?: string; +} +export declare function createInputModal(headMessage: BodyCreator, question: BodyCreator, validator: (input: string) => boolean, callback: (flag: boolean | string) => void, props?: InputModalProperties | any): Modal; +export declare function createErrorModal(header: BodyCreator, message: BodyCreator, props?: ModalProperties | any): Modal; +export declare function createInfoModal(header: BodyCreator, message: BodyCreator, props?: ModalProperties | any): Modal; diff --git a/imports/shared-app/ui/elements/NetGraph.d.ts b/imports/shared-app/ui/elements/NetGraph.d.ts new file mode 100644 index 0000000..2cc3a10 --- /dev/null +++ b/imports/shared-app/ui/elements/NetGraph.d.ts @@ -0,0 +1,65 @@ +export declare type Entry = { + timestamp: number; + upload?: number; + download?: number; + highlight?: boolean; +}; +export declare type Style = { + background_color: string; + separator_color: string; + separator_count: number; + separator_width: number; + upload: { + fill: string; + stroke: string; + strike_width: number; + }; + download: { + fill: string; + stroke: string; + strike_width: number; + }; +}; +export declare type TimeSpan = { + origin: { + begin: number; + end: number; + time: number; + }; + target: { + begin: number; + end: number; + time: number; + }; +}; +export declare class Graph { + private static _loops; + readonly canvas: HTMLCanvasElement; + style: Style; + private _canvas_context; + private _entries; + private _entry_max; + private _max_space; + private _max_gap; + private _animate_loop; + _time_span: TimeSpan; + private _detailed_shown; + callback_detailed_info: (upload: number, download: number, timestamp: number, event: MouseEvent) => any; + callback_detailed_hide: () => any; + constructor(canvas: HTMLCanvasElement); + initialize(): void; + terminate(): void; + max_gap_size(value?: number): number; + private recalculate_cache; + insert_entry(entry: Entry): void; + insert_entries(entries: Entry[]): void; + resize(): void; + cleanup(): void; + calculate_time_span(): { + begin: number; + end: number; + }; + draw(): void; + private on_mouse_move; + private on_mouse_leave; +} diff --git a/imports/shared-app/ui/elements/Slider.d.ts b/imports/shared-app/ui/elements/Slider.d.ts new file mode 100644 index 0000000..2b44f45 --- /dev/null +++ b/imports/shared-app/ui/elements/Slider.d.ts @@ -0,0 +1,12 @@ +export interface SliderOptions { + min_value?: number; + max_value?: number; + initial_value?: number; + step?: number; + unit?: string; + value_field?: JQuery | JQuery[]; +} +export interface Slider { + value(value?: number): number; +} +export declare function sliderfy(slider: JQuery, options?: SliderOptions): Slider; diff --git a/imports/shared-app/ui/elements/Tab.d.ts b/imports/shared-app/ui/elements/Tab.d.ts new file mode 100644 index 0000000..1176f6a --- /dev/null +++ b/imports/shared-app/ui/elements/Tab.d.ts @@ -0,0 +1,10 @@ +declare global { + interface JQuery { + asTabWidget(copy?: boolean): JQuery; + tabify(copy?: boolean): this; + changeElementType(type: string): JQuery; + } +} +export declare const TabFunctions: { + tabify(template: JQuery, copy?: boolean): JQuery; +}; diff --git a/imports/shared-app/ui/elements/Tooltip.d.ts b/imports/shared-app/ui/elements/Tooltip.d.ts new file mode 100644 index 0000000..b9ad39b --- /dev/null +++ b/imports/shared-app/ui/elements/Tooltip.d.ts @@ -0,0 +1,10 @@ +export declare type Handle = { + show(): any; + is_shown(): any; + hide(): any; + update(): any; +}; +export declare function initialize(entry: JQuery, callbacks?: { + on_show?(tag: JQuery): any; + on_hide?(tag: JQuery): any; +}): Handle; diff --git a/imports/shared-app/ui/frames/HostBannerController.d.ts b/imports/shared-app/ui/frames/HostBannerController.d.ts new file mode 100644 index 0000000..331c210 --- /dev/null +++ b/imports/shared-app/ui/frames/HostBannerController.d.ts @@ -0,0 +1,13 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +import { HostBannerUiEvents } from "tc-shared/ui/frames/HostBannerDefinitions"; +export declare class HostBannerController { + readonly uiEvents: Registry; + private currentConnection; + private listenerConnection; + constructor(); + destroy(): void; + setConnectionHandler(handler: ConnectionHandler): void; + protected initializeConnectionHandler(handler: ConnectionHandler): void; + private notifyHostBanner; +} diff --git a/imports/shared-app/ui/frames/HostBannerDefinitions.d.ts b/imports/shared-app/ui/frames/HostBannerDefinitions.d.ts new file mode 100644 index 0000000..cea0913 --- /dev/null +++ b/imports/shared-app/ui/frames/HostBannerDefinitions.d.ts @@ -0,0 +1,18 @@ +export declare type HostBannerInfoMode = "original" | "resize-ratio" | "resize"; +export declare type HostBannerInfoSet = { + mode: HostBannerInfoMode; + linkUrl: string | undefined; + imageUrl: string; + updateInterval: number; +}; +export declare type HostBannerInfo = { + status: "none"; +} | ({ + status: "set"; +} & HostBannerInfoSet); +export interface HostBannerUiEvents { + query_host_banner: {}; + notify_host_banner: { + banner: HostBannerInfo; + }; +} diff --git a/imports/shared-app/ui/frames/HostBannerRenderer.d.ts b/imports/shared-app/ui/frames/HostBannerRenderer.d.ts new file mode 100644 index 0000000..f4b0265 --- /dev/null +++ b/imports/shared-app/ui/frames/HostBannerRenderer.d.ts @@ -0,0 +1,6 @@ +import { Registry } from "tc-shared/events"; +import { HostBannerUiEvents } from "tc-shared/ui/frames/HostBannerDefinitions"; +import * as React from "react"; +export declare const HostBanner: React.MemoExoticComponent<(props: { + events: Registry; +}) => JSX.Element>; diff --git a/imports/shared-app/ui/frames/SideBarController.d.ts b/imports/shared-app/ui/frames/SideBarController.d.ts new file mode 100644 index 0000000..5a915f2 --- /dev/null +++ b/imports/shared-app/ui/frames/SideBarController.d.ts @@ -0,0 +1,23 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +import { SideHeaderController } from "tc-shared/ui/frames/side/HeaderController"; +import { SideBarEvents } from "tc-shared/ui/frames/SideBarDefinitions"; +import { Registry } from "tc-shared/events"; +import { MusicBotController } from "tc-shared/ui/frames/side/MusicBotController"; +export declare class SideBarController { + readonly uiEvents: Registry; + private currentConnection; + private listenerConnection; + private header; + private clientInfo; + private privateConversations; + private channelBar; + private musicPanel; + constructor(); + setConnection(connection: ConnectionHandler): void; + destroy(): void; + renderInto(container: HTMLDivElement): void; + getMusicController(): MusicBotController; + getHeaderController(): SideHeaderController; + private sendContent; + private sendContentData; +} diff --git a/imports/shared-app/ui/frames/SideBarDefinitions.d.ts b/imports/shared-app/ui/frames/SideBarDefinitions.d.ts new file mode 100644 index 0000000..e3b1c7f --- /dev/null +++ b/imports/shared-app/ui/frames/SideBarDefinitions.d.ts @@ -0,0 +1,48 @@ +import { Registry } from "tc-shared/events"; +import { PrivateConversationUIEvents } from "tc-shared/ui/frames/side/PrivateConversationDefinitions"; +import { ClientInfoEvents } from "tc-shared/ui/frames/side/ClientInfoDefinitions"; +import { SideHeaderEvents } from "tc-shared/ui/frames/side/HeaderDefinitions"; +import { ChannelBarUiEvents } from "tc-shared/ui/frames/side/ChannelBarDefinitions"; +import { MusicBotUiEvents } from "tc-shared/ui/frames/side/MusicBotDefinitions"; +import { MusicPlaylistUiEvents } from "tc-shared/ui/frames/side/MusicPlaylistDefinitions"; +import { ChannelConversationUiEvents } from "tc-shared/ui/frames/side/ChannelConversationDefinitions"; +export declare type SideBarType = "none" | "server" | "channel" | "private-chat" | "client-info" | "music-manage"; +export interface SideBarTypeData { + "none": {}; + "channel": { + events: Registry; + }; + "private-chat": { + events: Registry; + handlerId: string; + }; + "client-info": { + events: Registry; + }; + "music-manage": { + botEvents: Registry; + playlistEvents: Registry; + }; + "server": { + handlerId: string; + chatEvents: Registry; + }; +} +export declare type SideBarNotifyContentData = { + content: T; + data: SideBarTypeData[T]; +}; +export interface SideBarEvents { + query_content: {}; + query_content_data: { + content: SideBarType; + }; + query_header_data: {}; + notify_content: { + content: SideBarType; + }; + notify_content_data: SideBarNotifyContentData; + notify_header_data: { + events: Registry; + }; +} diff --git a/imports/shared-app/ui/frames/SideBarRenderer.d.ts b/imports/shared-app/ui/frames/SideBarRenderer.d.ts new file mode 100644 index 0000000..52189de --- /dev/null +++ b/imports/shared-app/ui/frames/SideBarRenderer.d.ts @@ -0,0 +1,9 @@ +/// +import { SideHeaderEvents } from "tc-shared/ui/frames/side/HeaderDefinitions"; +import { Registry } from "tc-shared/events"; +import { SideBarEvents } from "tc-shared/ui/frames/SideBarDefinitions"; +export declare const SideBarRenderer: (props: { + events: Registry; + eventsHeader: Registry; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/chat.d.ts b/imports/shared-app/ui/frames/chat.d.ts new file mode 100644 index 0000000..dce18a8 --- /dev/null +++ b/imports/shared-app/ui/frames/chat.d.ts @@ -0,0 +1,38 @@ +export declare enum ChatType { + GENERAL = 0, + SERVER = 1, + CHANNEL = 2, + CLIENT = 3 +} +export declare function htmlEscape(message: string): string[]; +export declare function formatElement(object: any, escape_html?: boolean): JQuery[]; +export declare function formatMessage(pattern: string, ...objects: any[]): JQuery[]; +export declare function formatMessageString(pattern: string, ...args: string[]): string; +export declare function parseMessageWithArguments(pattern: string, argumentCount: number): (string | number)[]; +export declare namespace network { + const KB = 1024; + const MB: number; + const GB: number; + const TB: number; + function byteSizeToString(value: number): string; + function format_bytes(value: number, options?: { + time?: string; + unit?: string; + exact?: boolean; + }): string; +} +export declare const K = 1000; +export declare const M: number; +export declare const G: number; +export declare const T: number; +export declare function format_number(value: number, options?: { + time?: string; + unit?: string; +}): string; +export declare const TIME_SECOND = 1000; +export declare const TIME_MINUTE: number; +export declare const TIME_HOUR: number; +export declare const TIME_DAY: number; +export declare const TIME_WEEK: number; +export declare function format_time(time: number, default_value: string): string; +export declare function set_icon_size(size: string): void; diff --git a/imports/shared-app/ui/frames/connection-handler-list/Controller.d.ts b/imports/shared-app/ui/frames/connection-handler-list/Controller.d.ts new file mode 100644 index 0000000..f383608 --- /dev/null +++ b/imports/shared-app/ui/frames/connection-handler-list/Controller.d.ts @@ -0,0 +1,3 @@ +import { Registry } from "tc-shared/events"; +import { ConnectionListUIEvents } from "tc-shared/ui/frames/connection-handler-list/Definitions"; +export declare function initializeConnectionListController(events: Registry): void; diff --git a/imports/shared-app/ui/frames/connection-handler-list/Definitions.d.ts b/imports/shared-app/ui/frames/connection-handler-list/Definitions.d.ts new file mode 100644 index 0000000..f5a5fed --- /dev/null +++ b/imports/shared-app/ui/frames/connection-handler-list/Definitions.d.ts @@ -0,0 +1,56 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type MouseMoveCoordinates = { + x: number; + y: number; + xOffset: number; +}; +export declare type HandlerConnectionState = "disconnected" | "connecting" | "connected"; +export declare type HandlerStatus = { + connectionState: HandlerConnectionState; + handlerName: string; + voiceReplaying: boolean; + serverIcon: RemoteIconInfo | undefined; +}; +export interface ConnectionListUIEvents { + action_set_active_handler: { + handlerId: string; + }; + action_destroy_handler: { + handlerId: string; + }; + action_scroll: { + direction: "left" | "right"; + }; + action_move_handler: { + handlerId: string | undefined; + mouse?: MouseMoveCoordinates; + }; + action_set_moving_position: { + offsetX: number; + width: number; + }; + action_swap_handler: { + handlerIdOne: string; + handlerIdTwo: string; + }; + query_handler_status: { + handlerId: string; + }; + query_handler_list: {}; + notify_handler_list: { + handlerIds: string[]; + activeHandlerId: string | undefined; + }; + notify_active_handler: { + handlerId: string; + }; + notify_handler_status: { + handlerId: string; + status: HandlerStatus; + }; + notify_scroll_status: { + left: boolean; + right: boolean; + }; + notify_destroy: {}; +} diff --git a/imports/shared-app/ui/frames/connection-handler-list/Renderer.d.ts b/imports/shared-app/ui/frames/connection-handler-list/Renderer.d.ts new file mode 100644 index 0000000..9898c83 --- /dev/null +++ b/imports/shared-app/ui/frames/connection-handler-list/Renderer.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { ConnectionListUIEvents } from "tc-shared/ui/frames/connection-handler-list/Definitions"; +export declare const ConnectionHandlerList: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/control-bar/Button.d.ts b/imports/shared-app/ui/frames/control-bar/Button.d.ts new file mode 100644 index 0000000..46e7a89 --- /dev/null +++ b/imports/shared-app/ui/frames/control-bar/Button.d.ts @@ -0,0 +1,25 @@ +/// +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import { ClientIcon } from "svg-sprites/client-icons"; +export interface ButtonState { + switched: boolean; + dropdownShowed: boolean; + dropdownForceShow: boolean; +} +export interface ButtonProperties { + colorTheme?: "red" | "default"; + autoSwitch: boolean; + tooltip?: string; + iconNormal: string | ClientIcon; + iconSwitched?: string | ClientIcon; + onToggle?: (state: boolean) => boolean | void; + className?: string; + switched?: boolean; +} +export declare class Button extends ReactComponentBase { + protected defaultState(): ButtonState; + render(): JSX.Element; + private onMouseEnter; + private onMouseLeave; + private onClick; +} diff --git a/imports/shared-app/ui/frames/control-bar/Controller.d.ts b/imports/shared-app/ui/frames/control-bar/Controller.d.ts new file mode 100644 index 0000000..1a6bfa9 --- /dev/null +++ b/imports/shared-app/ui/frames/control-bar/Controller.d.ts @@ -0,0 +1,39 @@ +import { Registry } from "tc-shared/events"; +import { ControlBarEvents, ControlBarMode } from "tc-shared/ui/frames/control-bar/Definitions"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +declare class InfoController { + private readonly mode; + private readonly events; + private currentHandler; + private globalEvents; + private globalHandlerRegisteredEvents; + private handlerRegisteredEvents; + private defaultRecorderListener; + constructor(events: Registry, mode: ControlBarMode); + getCurrentHandler(): ConnectionHandler; + getMode(): ControlBarMode; + initialize(): void; + destroy(): void; + private registerDefaultRecorderEvents; + private unregisterDefaultRecorderEvents; + private registerGlobalHandlerEvents; + private unregisterGlobalHandlerEvents; + private registerCurrentHandlerEvents; + private unregisterCurrentHandlerEvents; + setConnectionHandler(handler: ConnectionHandler): void; + sendConnectionState(): void; + sendBookmarks(): void; + sendAwayState(): void; + sendMicrophoneState(): void; + sendMicrophoneList(): void; + sendSpeakerState(): void; + sendSubscribeState(): void; + sendQueryState(): void; + sendHostButton(): void; + sendVideoState(type: VideoBroadcastType): void; + sendCameraList(): void; +} +export declare function initializePopoutControlBarController(events: Registry, handler: ConnectionHandler): void; +export declare function initializeControlBarController(events: Registry, mode: ControlBarMode): InfoController; +export {}; diff --git a/imports/shared-app/ui/frames/control-bar/Definitions.d.ts b/imports/shared-app/ui/frames/control-bar/Definitions.d.ts new file mode 100644 index 0000000..3ffd6fc --- /dev/null +++ b/imports/shared-app/ui/frames/control-bar/Definitions.d.ts @@ -0,0 +1,130 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +import { VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +export declare type ControlBarMode = "main" | "channel-popout"; +export declare type ConnectionState = { + currentlyConnected: boolean; + generallyConnected: boolean; + multisession: boolean; +}; +export declare type Bookmark = { + uniqueId: string; + label: string; + icon: RemoteIconInfo | undefined; + children?: Bookmark[]; +}; +export declare type AwayState = { + locallyAway: boolean; + globallyAway: "partial" | "full" | "none"; +}; +export declare type MicrophoneState = "enabled" | "disabled" | "muted"; +export declare type VideoState = "enabled" | "disabled" | "unavailable" | "unsupported" | "disconnected"; +export declare type HostButtonInfo = { + title?: string; + target?: string; + url: string; +}; +export declare type VideoDeviceInfo = { + name: string; + id: string; +}; +export declare type MicrophoneDeviceInfo = { + name: string; + id: string; + driver: string; + selected: boolean; +}; +export interface ControlBarEvents { + action_connection_connect: { + newTab: boolean; + }; + action_connection_disconnect: { + generally: boolean; + }; + action_bookmark_connect: { + bookmarkUniqueId: string; + newTab: boolean; + }; + action_bookmark_manage: {}; + action_bookmark_add_current_server: {}; + action_toggle_away: { + away: boolean; + globally: boolean; + promptMessage?: boolean; + }; + action_toggle_microphone: { + enabled: boolean; + targetDeviceId?: string; + }; + action_toggle_speaker: { + enabled: boolean; + }; + action_toggle_subscribe: { + subscribe: boolean; + }; + action_toggle_query: { + show: boolean; + }; + action_query_manage: {}; + action_toggle_video: { + broadcastType: VideoBroadcastType; + enable: boolean; + quickStart?: boolean; + deviceId?: string; + }; + action_manage_video: { + broadcastType: VideoBroadcastType; + }; + action_open_microphone_settings: {}; + query_mode: {}; + query_connection_state: {}; + query_bookmarks: {}; + query_away_state: {}; + query_microphone_state: {}; + query_microphone_list: {}; + query_speaker_state: {}; + query_subscribe_state: {}; + query_query_state: {}; + query_host_button: {}; + query_video_state: { + broadcastType: VideoBroadcastType; + }; + query_camera_list: {}; + notify_mode: { + mode: ControlBarMode; + }; + notify_connection_state: { + state: ConnectionState; + }; + notify_bookmarks: { + marks: Bookmark[]; + }; + notify_away_state: { + state: AwayState; + }; + notify_microphone_state: { + state: MicrophoneState; + }; + notify_microphone_list: { + devices: MicrophoneDeviceInfo[]; + }; + notify_speaker_state: { + enabled: boolean; + }; + notify_subscribe_state: { + subscribe: boolean; + }; + notify_query_state: { + shown: boolean; + }; + notify_host_button: { + button: HostButtonInfo | undefined; + }; + notify_video_state: { + broadcastType: VideoBroadcastType; + state: VideoState; + }; + notify_camera_list: { + devices: VideoDeviceInfo[]; + }; + notify_destroy: {}; +} diff --git a/imports/shared-app/ui/frames/control-bar/DropDown.d.ts b/imports/shared-app/ui/frames/control-bar/DropDown.d.ts new file mode 100644 index 0000000..3d0a0ff --- /dev/null +++ b/imports/shared-app/ui/frames/control-bar/DropDown.d.ts @@ -0,0 +1,18 @@ +import * as React from "react"; +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export interface DropdownEntryProperties { + icon?: string | RemoteIconInfo; + text: JSX.Element | string; + onClick?: (event: React.MouseEvent) => void; + onAuxClick?: (event: React.MouseEvent) => void; + onContextMenu?: (event: React.MouseEvent) => void; + children?: React.ReactElement[]; +} +export declare class DropdownEntry extends ReactComponentBase { + protected defaultState(): {}; + render(): JSX.Element; +} +export declare const DropdownContainer: (props: { + children: any; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/control-bar/Renderer.d.ts b/imports/shared-app/ui/frames/control-bar/Renderer.d.ts new file mode 100644 index 0000000..670b5db --- /dev/null +++ b/imports/shared-app/ui/frames/control-bar/Renderer.d.ts @@ -0,0 +1,7 @@ +/// +import { Registry } from "tc-shared/events"; +import { ControlBarEvents } from "tc-shared/ui/frames/control-bar/Definitions"; +export declare const ControlBar2: (props: { + events: Registry; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/footer/Renderer.d.ts b/imports/shared-app/ui/frames/footer/Renderer.d.ts new file mode 100644 index 0000000..a81708d --- /dev/null +++ b/imports/shared-app/ui/frames/footer/Renderer.d.ts @@ -0,0 +1,2 @@ +/// +export declare const FooterRenderer: () => JSX.Element; diff --git a/imports/shared-app/ui/frames/footer/StatusController.d.ts b/imports/shared-app/ui/frames/footer/StatusController.d.ts new file mode 100644 index 0000000..8252fc6 --- /dev/null +++ b/imports/shared-app/ui/frames/footer/StatusController.d.ts @@ -0,0 +1,23 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ConnectionComponent, ConnectionStatusEvents } from "./StatusDefinitions"; +import { Registry } from "tc-shared/events"; +export declare class StatusController { + private readonly events; + private currentConnectionHandler; + private listenerHandler; + private detailedInfoOpen; + private detailUpdateTimer; + private componentStatusNotifyState; + private connectionStatusNotifyState; + constructor(events: Registry); + getEvents(): Registry; + setConnectionHandler(handler: ConnectionHandler | undefined): void; + setDetailsShown(flag: boolean): void; + private registerHandlerEvents; + private unregisterHandlerEvents; + private getComponentStatus; + notifyComponentStatus(component: ConnectionComponent): Promise; + private doNotifyComponentStatus; + notifyConnectionStatus(): Promise; + private doNotifyConnectionStatus; +} diff --git a/imports/shared-app/ui/frames/footer/StatusDefinitions.d.ts b/imports/shared-app/ui/frames/footer/StatusDefinitions.d.ts new file mode 100644 index 0000000..c6142cb --- /dev/null +++ b/imports/shared-app/ui/frames/footer/StatusDefinitions.d.ts @@ -0,0 +1,42 @@ +export declare type ConnectionStatus = { + type: "healthy"; + bytesReceived?: number; + bytesSend?: number; +} | { + type: "unhealthy"; + reason: string; + retryTimestamp: number; +} | { + type: "connecting-signalling"; + state: "initializing" | "connecting" | "authentication"; +} | { + type: "connecting-voice"; +} | { + type: "connecting-video"; +} | { + type: "disconnected"; +} | { + type: "unsupported"; + side: "server" | "client"; +}; +export declare type ConnectionComponent = "signaling" | "video" | "voice"; +export interface ConnectionStatusEvents { + action_toggle_component_detail: { + shown: boolean | undefined; + }; + query_component_detail_state: {}; + query_component_status: { + component: ConnectionComponent; + }; + query_connection_status: {}; + notify_component_detail_state: { + shown: boolean; + }; + notify_component_status: { + component: ConnectionComponent; + status: ConnectionStatus; + }; + notify_connection_status: { + status: ConnectionStatus; + }; +} diff --git a/imports/shared-app/ui/frames/footer/StatusRenderer.d.ts b/imports/shared-app/ui/frames/footer/StatusRenderer.d.ts new file mode 100644 index 0000000..6e244b8 --- /dev/null +++ b/imports/shared-app/ui/frames/footer/StatusRenderer.d.ts @@ -0,0 +1,6 @@ +import { Registry } from "tc-shared/events"; +import { ConnectionStatusEvents } from "tc-shared/ui/frames/footer/StatusDefinitions"; +import * as React from "react"; +export declare const StatusEvents: React.Context>; +export declare const StatusTextRenderer: React.MemoExoticComponent<() => JSX.Element>; +export declare const StatusDetailRenderer: () => JSX.Element; diff --git a/imports/shared-app/ui/frames/image_preview.d.ts b/imports/shared-app/ui/frames/image_preview.d.ts new file mode 100644 index 0000000..2f545ac --- /dev/null +++ b/imports/shared-app/ui/frames/image_preview.d.ts @@ -0,0 +1,4 @@ +export declare function preview_image(url: string, original_url: string): void; +export declare function preview_image_tag(tag: JQuery): void; +export declare function current_url(): string; +export declare function close_preview(): void; diff --git a/imports/shared-app/ui/frames/log/Controller.d.ts b/imports/shared-app/ui/frames/log/Controller.d.ts new file mode 100644 index 0000000..05758aa --- /dev/null +++ b/imports/shared-app/ui/frames/log/Controller.d.ts @@ -0,0 +1,12 @@ +import { Registry } from "tc-shared/events"; +import { ServerEventLogUiEvents } from "tc-shared/ui/frames/log/Definitions"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare class ServerEventLogController { + readonly events: Registry; + private currentConnection; + private listenerConnection; + constructor(); + destroy(): void; + setConnectionHandler(handler: ConnectionHandler): void; + private sendLogs; +} diff --git a/imports/shared-app/ui/frames/log/Definitions.d.ts b/imports/shared-app/ui/frames/log/Definitions.d.ts new file mode 100644 index 0000000..fd77091 --- /dev/null +++ b/imports/shared-app/ui/frames/log/Definitions.d.ts @@ -0,0 +1,14 @@ +import { LogMessage } from "tc-shared/connectionlog/Definitions"; +export interface ServerEventLogUiEvents { + query_handler_id: {}; + query_log: {}; + notify_log_add: { + event: LogMessage; + }; + notify_log: { + events: LogMessage[]; + }; + notify_handler_id: { + handlerId: string | undefined; + }; +} diff --git a/imports/shared-app/ui/frames/log/Renderer.d.ts b/imports/shared-app/ui/frames/log/Renderer.d.ts new file mode 100644 index 0000000..b8496f7 --- /dev/null +++ b/imports/shared-app/ui/frames/log/Renderer.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { ServerEventLogUiEvents } from "tc-shared/ui/frames/log/Definitions"; +export declare const ServerLogFrame: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/log/RendererEvent.d.ts b/imports/shared-app/ui/frames/log/RendererEvent.d.ts new file mode 100644 index 0000000..798ca07 --- /dev/null +++ b/imports/shared-app/ui/frames/log/RendererEvent.d.ts @@ -0,0 +1,5 @@ +import * as React from "react"; +import { TypeInfo } from "tc-shared/connectionlog/Definitions"; +export declare type RendererEvent = (data: TypeInfo[T], handlerId: string, eventType: T) => React.ReactNode; +export declare function findLogEventRenderer(type: T): RendererEvent; +export declare function getRegisteredLogEventRenderer(): TypeInfo[]; diff --git a/imports/shared-app/ui/frames/menu-bar/MainMenu.d.ts b/imports/shared-app/ui/frames/menu-bar/MainMenu.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/ui/frames/menu-bar/MainMenu.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/ui/frames/menu-bar/index.d.ts b/imports/shared-app/ui/frames/menu-bar/index.d.ts new file mode 100644 index 0000000..7d3c60b --- /dev/null +++ b/imports/shared-app/ui/frames/menu-bar/index.d.ts @@ -0,0 +1,30 @@ +import { ClientIcon } from "svg-sprites/client-icons"; +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type MenuBarEntrySeparator = { + uniqueId?: string; + type: "separator"; +}; +export declare type MenuBarEntryNormal = { + uniqueId?: string; + type: "normal"; + label: string; + disabled?: boolean; + visible?: boolean; + icon?: ClientIcon | RemoteIconInfo; + click?: () => void; + children?: MenuBarEntry[]; +}; +export declare type MenuBarEntry = MenuBarEntrySeparator | MenuBarEntryNormal; +export interface MenuBarDriver { + /** + * Separators on top level might not be rendered. + * @param entries + */ + setEntries(entries: MenuBarEntry[]): any; + /** + * Removes the menu bar + */ + clearEntries(): any; +} +export declare function getMenuBarDriver(): MenuBarDriver; +export declare function setMenuBarDriver(driver_: MenuBarDriver): void; diff --git a/imports/shared-app/ui/frames/side/AbstractConversationController.d.ts b/imports/shared-app/ui/frames/side/AbstractConversationController.d.ts new file mode 100644 index 0000000..5b6a195 --- /dev/null +++ b/imports/shared-app/ui/frames/side/AbstractConversationController.d.ts @@ -0,0 +1,29 @@ +import { AbstractConversationUiEvents } from "./AbstractConversationDefinitions"; +import { Registry } from "../../../events"; +import { AbstractChat, AbstractChatManager, AbstractChatManagerEvents, AbstractConversationEvents } from "tc-shared/conversations/AbstractConversion"; +export declare const kMaxChatFrameMessageSize = 50; +export declare abstract class AbstractConversationController, ManagerEvents extends AbstractChatManagerEvents, ConversationType extends AbstractChat, ConversationEvents extends AbstractConversationEvents> { + protected readonly uiEvents: Registry; + protected conversationManager: Manager | undefined; + protected listenerManager: (() => void)[]; + protected currentSelectedConversation: ConversationType; + protected currentSelectedListener: (() => void)[]; + protected constructor(); + destroy(): void; + getUiEvents(): Registry; + protected setConversationManager(manager: Manager | undefined): void; + protected registerConversationManagerEvents(manager: Manager): void; + protected registerConversationEvents(conversation: ConversationType): void; + protected setCurrentlySelected(conversation: ConversationType | undefined): void; + handlePanelShow(): void; + protected reportStateToUI(conversation: AbstractChat): void; + uiQueryHistory(conversation: AbstractChat, timestamp: number, enforce?: boolean): void; + protected getCurrentConversation(): ConversationType | undefined; + protected handleQueryConversationState(event: AbstractConversationUiEvents["query_conversation_state"]): void; + protected handleQueryHistory(event: AbstractConversationUiEvents["query_conversation_history"]): void; + protected handleClearUnreadFlag(event: AbstractConversationUiEvents["action_clear_unread_flag" | "action_self_typing"]): void; + protected handleSendMessage(event: AbstractConversationUiEvents["action_send_message"]): void; + protected handleJumpToPresent(event: AbstractConversationUiEvents["action_jump_to_present"]): void; + private handleQuerySelectedChat; + private handleActionSelectChat; +} diff --git a/imports/shared-app/ui/frames/side/AbstractConversationDefinitions.d.ts b/imports/shared-app/ui/frames/side/AbstractConversationDefinitions.d.ts new file mode 100644 index 0000000..8cb63d3 --- /dev/null +++ b/imports/shared-app/ui/frames/side/AbstractConversationDefinitions.d.ts @@ -0,0 +1,158 @@ +export interface ChatMessage { + timestamp: number; + message: string; + sender_name: string; + sender_unique_id: string; + sender_database_id: number; +} +export declare type ChatEvent = { + timestamp: number; + uniqueId: string; +} & (ChatEventUnreadTrigger | ChatEventMessage | ChatEventMessageSendFailed | ChatEventLocalUserSwitch | ChatEventQueryFailed | ChatEventPartnerInstanceChanged | ChatEventLocalAction | ChatEventPartnerAction | ChatEventModeChanged); +export interface ChatEventUnreadTrigger { + type: "unread-trigger"; +} +export interface ChatEventMessageSendFailed { + type: "message-failed"; + error: "permission" | "error"; + failedPermission?: string; + errorMessage?: string; +} +export interface ChatEventMessage { + type: "message"; + message: ChatMessage; + isOwnMessage: boolean; +} +export interface ChatEventLocalUserSwitch { + type: "local-user-switch"; + mode: "join" | "leave"; +} +export interface ChatEventQueryFailed { + type: "query-failed"; + message: string; +} +export interface ChatEventPartnerInstanceChanged { + type: "partner-instance-changed"; + oldClient: string; + newClient: string; +} +export interface ChatEventLocalAction { + type: "local-action"; + action: "disconnect" | "reconnect"; +} +export interface ChatEventPartnerAction { + type: "partner-action"; + action: "disconnect" | "close" | "reconnect"; +} +export interface ChatEventModeChanged { + type: "mode-changed"; + newMode: "normal" | "private" | "none"; +} +export declare type ChatState = "normal" | "loading" | "no-permissions" | "error" | "unloaded"; +export declare type ChatHistoryState = "none" | "loading" | "available" | "error"; +export interface ChatStateNormal { + state: "normal"; + chatFrameMaxMessageCount: number; + sendEnabled: boolean; + unreadTimestamp: number | undefined; + events: ChatEvent[]; + historyState: ChatHistoryState; + historyErrorMessage: string; + historyRetryTimestamp: number; + showUserSwitchEvents: boolean; +} +export interface ChatStateNoPermissions { + state: "no-permissions"; + failedPermission: string; +} +export interface ChatStateError { + state: "error"; + errorMessage: string; +} +export interface ChatStateLoading { + state: "loading"; +} +export interface ChatStatePrivate { + state: "private"; + crossChannelChatSupported: boolean; +} +export declare type ChatStateData = ChatStateNormal | ChatStateNoPermissions | ChatStateError | ChatStateLoading | ChatStatePrivate; +export interface AbstractConversationUiEvents { + action_select_chat: { + chatId: "unselected" | string; + }; + action_clear_unread_flag: { + chatId: string; + }; + action_self_typing: { + chatId: string; + }; + action_delete_message: { + chatId: string; + uniqueId: string; + }; + action_send_message: { + text: string; + chatId: string; + }; + action_jump_to_present: { + chatId: string; + }; + action_focus_chat: {}; + query_selected_chat: {}; + query_conversation_state: { + chatId: string; + }; + notify_conversation_state: { + chatId: string; + } & ChatStateData; + query_conversation_history: { + chatId: string; + timestamp: number; + }; + notify_conversation_history: { + chatId: string; + state: "success" | "error"; + errorMessage?: string; + retryTimestamp?: number; + events?: ChatEvent[]; + hasMoreMessages?: boolean; + }; + notify_selected_chat: { + chatId: "unselected" | string; + }; + notify_panel_show: {}; + notify_chat_event: { + chatId: string; + triggerUnread: boolean; + event: ChatEvent; + }; + notify_chat_message_delete: { + chatId: string; + messageIds: string[]; + }; + notify_unread_timestamp_changed: { + chatId: string; + timestamp: number; + }; + notify_private_state_changed: { + chatId: string; + private: boolean; + }; + notify_send_enabled: { + chatId: string; + enabled: boolean; + }; + notify_partner_typing: { + chatId: string; + }; + notify_destroy: {}; +} +export interface ConversationHistoryResponse { + status: "success" | "error" | "no-permission" | "private" | "unsupported"; + events?: ChatEvent[]; + moreEvents?: boolean; + nextAllowedQuery?: number; + errorMessage?: string; + failedPermission?: string; +} diff --git a/imports/shared-app/ui/frames/side/AbstractConversationRenderer.d.ts b/imports/shared-app/ui/frames/side/AbstractConversationRenderer.d.ts new file mode 100644 index 0000000..c3b394d --- /dev/null +++ b/imports/shared-app/ui/frames/side/AbstractConversationRenderer.d.ts @@ -0,0 +1,9 @@ +import * as React from "react"; +import { Registry } from "tc-shared/events"; +import { AbstractConversationUiEvents } from "./AbstractConversationDefinitions"; +export declare const ConversationPanel: React.MemoExoticComponent<(props: { + events: Registry; + handlerId: string; + messagesDeletable: boolean; + noFirstMessageOverlay: boolean; +}) => JSX.Element>; diff --git a/imports/shared-app/ui/frames/side/ChannelBarController.d.ts b/imports/shared-app/ui/frames/side/ChannelBarController.d.ts new file mode 100644 index 0000000..f12e6fe --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelBarController.d.ts @@ -0,0 +1,22 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +import { ChannelBarUiEvents } from "tc-shared/ui/frames/side/ChannelBarDefinitions"; +import { ChannelConversationController } from "tc-shared/ui/frames/side/ChannelConversationController"; +export declare class ChannelBarController { + readonly uiEvents: Registry; + private channelConversations; + private description; + private fileBrowser; + private currentConnection; + private listenerConnection; + private currentChannel; + private listenerChannel; + constructor(); + destroy(): void; + getChannelConversationController(): ChannelConversationController; + setConnectionHandler(handler: ConnectionHandler): void; + private setChannel; + private notifyChannelId; + private notifyChannelMode; + private notifyModeData; +} diff --git a/imports/shared-app/ui/frames/side/ChannelBarDefinitions.d.ts b/imports/shared-app/ui/frames/side/ChannelBarDefinitions.d.ts new file mode 100644 index 0000000..01d1491 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelBarDefinitions.d.ts @@ -0,0 +1,36 @@ +import { Registry } from "tc-shared/events"; +import { ChannelConversationUiEvents } from "tc-shared/ui/frames/side/ChannelConversationDefinitions"; +import { ChannelDescriptionUiEvents } from "tc-shared/ui/frames/side/ChannelDescriptionDefinitions"; +import { ChannelFileBrowserUiEvents } from "tc-shared/ui/frames/side/ChannelFileBrowserDefinitions"; +export declare type ChannelBarMode = "conversation" | "description" | "file-transfer" | "none"; +export interface ChannelBarModeData { + "conversation": { + events: Registry; + }; + "description": { + events: Registry; + }; + "file-transfer": { + events: Registry; + }; + "none": {}; +} +export declare type ChannelBarNotifyModeData = { + content: T; + data: ChannelBarModeData[T]; +}; +export interface ChannelBarUiEvents { + query_mode: {}; + query_channel_id: {}; + query_data: { + mode: ChannelBarMode; + }; + notify_mode: { + mode: ChannelBarMode; + }; + notify_channel_id: { + channelId: number; + handlerId: string; + }; + notify_data: ChannelBarNotifyModeData; +} diff --git a/imports/shared-app/ui/frames/side/ChannelBarRenderer.d.ts b/imports/shared-app/ui/frames/side/ChannelBarRenderer.d.ts new file mode 100644 index 0000000..9d5dede --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelBarRenderer.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { ChannelBarUiEvents } from "tc-shared/ui/frames/side/ChannelBarDefinitions"; +export declare const ChannelBarRenderer: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/side/ChannelConversationController.d.ts b/imports/shared-app/ui/frames/side/ChannelConversationController.d.ts new file mode 100644 index 0000000..a890091 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelConversationController.d.ts @@ -0,0 +1,14 @@ +import { ConnectionHandler } from "../../../ConnectionHandler"; +import { AbstractConversationController } from "./AbstractConversationController"; +import { ChannelConversation, ChannelConversationEvents, ChannelConversationManager, ChannelConversationManagerEvents } from "tc-shared/conversations/ChannelConversationManager"; +import { ChannelConversationUiEvents } from "tc-shared/ui/frames/side/ChannelConversationDefinitions"; +export declare class ChannelConversationController extends AbstractConversationController { + private connection; + private connectionListener; + constructor(); + destroy(): void; + setConnectionHandler(connection: ConnectionHandler): void; + private initializeConnectionListener; + private handleMessageDelete; + protected registerConversationEvents(conversation: ChannelConversation): void; +} diff --git a/imports/shared-app/ui/frames/side/ChannelConversationDefinitions.d.ts b/imports/shared-app/ui/frames/side/ChannelConversationDefinitions.d.ts new file mode 100644 index 0000000..a80ff0d --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelConversationDefinitions.d.ts @@ -0,0 +1,3 @@ +import { AbstractConversationUiEvents } from "tc-shared/ui/frames/side/AbstractConversationDefinitions"; +export interface ChannelConversationUiEvents extends AbstractConversationUiEvents { +} diff --git a/imports/shared-app/ui/frames/side/ChannelDescriptionController.d.ts b/imports/shared-app/ui/frames/side/ChannelDescriptionController.d.ts new file mode 100644 index 0000000..1fce180 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelDescriptionController.d.ts @@ -0,0 +1,16 @@ +import { ChannelEntry } from "tc-shared/tree/Channel"; +import { Registry } from "tc-shared/events"; +import { ChannelDescriptionUiEvents } from "tc-shared/ui/frames/side/ChannelDescriptionDefinitions"; +export declare class ChannelDescriptionController { + readonly uiEvents: Registry; + private currentChannel; + private listenerChannel; + private descriptionSendPending; + private cachedDescriptionStatus; + private cachedDescriptionAge; + constructor(); + destroy(): void; + setChannel(channel: ChannelEntry): void; + private notifyDescription; + private updateCachedDescriptionStatus; +} diff --git a/imports/shared-app/ui/frames/side/ChannelDescriptionDefinitions.d.ts b/imports/shared-app/ui/frames/side/ChannelDescriptionDefinitions.d.ts new file mode 100644 index 0000000..526c3ed --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelDescriptionDefinitions.d.ts @@ -0,0 +1,17 @@ +export declare type ChannelDescriptionStatus = { + status: "success"; + description: string; + handlerId: string; +} | { + status: "error"; + reason: string; +} | { + status: "no-permissions"; + failedPermission: string; +}; +export interface ChannelDescriptionUiEvents { + query_description: {}; + notify_description: { + status: ChannelDescriptionStatus; + }; +} diff --git a/imports/shared-app/ui/frames/side/ChannelDescriptionRenderer.d.ts b/imports/shared-app/ui/frames/side/ChannelDescriptionRenderer.d.ts new file mode 100644 index 0000000..5ec260f --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelDescriptionRenderer.d.ts @@ -0,0 +1,6 @@ +import { ChannelDescriptionUiEvents } from "tc-shared/ui/frames/side/ChannelDescriptionDefinitions"; +import { Registry } from "tc-shared/events"; +import * as React from "react"; +export declare const ChannelDescriptionRenderer: React.MemoExoticComponent<(props: { + events: Registry; +}) => JSX.Element>; diff --git a/imports/shared-app/ui/frames/side/ChannelFileBrowserController.d.ts b/imports/shared-app/ui/frames/side/ChannelFileBrowserController.d.ts new file mode 100644 index 0000000..8ef8fe4 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelFileBrowserController.d.ts @@ -0,0 +1,15 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { Registry } from "tc-shared/events"; +import { ChannelFileBrowserUiEvents } from "tc-shared/ui/frames/side/ChannelFileBrowserDefinitions"; +import { ChannelEntry } from "tc-shared/tree/Channel"; +export declare class ChannelFileBrowserController { + readonly uiEvents: Registry; + private currentConnection; + private remoteBrowseEvents; + private currentChannel; + constructor(); + destroy(): void; + setConnectionHandler(connection: ConnectionHandler): void; + setChannel(channel: ChannelEntry | undefined): void; + private notifyEvents; +} diff --git a/imports/shared-app/ui/frames/side/ChannelFileBrowserDefinitions.d.ts b/imports/shared-app/ui/frames/side/ChannelFileBrowserDefinitions.d.ts new file mode 100644 index 0000000..c1d24ec --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelFileBrowserDefinitions.d.ts @@ -0,0 +1,9 @@ +import { FileBrowserEvents } from "tc-shared/ui/modal/transfer/FileDefinitions"; +import { Registry } from "tc-shared/events"; +export interface ChannelFileBrowserUiEvents { + query_events: {}; + notify_events: { + browserEvents: Registry; + channelId: number; + }; +} diff --git a/imports/shared-app/ui/frames/side/ChannelFileBrowserRenderer.d.ts b/imports/shared-app/ui/frames/side/ChannelFileBrowserRenderer.d.ts new file mode 100644 index 0000000..7bd70f1 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ChannelFileBrowserRenderer.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { ChannelFileBrowserUiEvents } from "tc-shared/ui/frames/side/ChannelFileBrowserDefinitions"; +export declare const ChannelFileBrowser: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/side/ClientInfoController.d.ts b/imports/shared-app/ui/frames/side/ClientInfoController.d.ts new file mode 100644 index 0000000..6c2e834 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ClientInfoController.d.ts @@ -0,0 +1,22 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare class ClientInfoController { + private readonly uiEvents; + private connection; + private listenerConnection; + constructor(); + destroy(): void; + setConnectionHandler(connection: ConnectionHandler): void; + private initializeConnection; + private generateGroupInfo; + private sendClient; + private sendChannelGroup; + private sendServerGroups; + private sendClientStatus; + private sendClientName; + private sendClientDescription; + private sendOnline; + private sendCountry; + private sendVolume; + private sendVersion; + private sendForum; +} diff --git a/imports/shared-app/ui/frames/side/ClientInfoDefinitions.d.ts b/imports/shared-app/ui/frames/side/ClientInfoDefinitions.d.ts new file mode 100644 index 0000000..10f9693 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ClientInfoDefinitions.d.ts @@ -0,0 +1,96 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type ClientInfoType = "query" | "voice" | "self"; +export declare type ClientInfoInfo = { + type: ClientInfoType; + handlerId: string; + clientId: number | 0; + clientUniqueId: string; + clientDatabaseId: number; +}; +export declare type OptionalClientInfoInfo = { + contextHash: string; +} & (ClientInfoInfo | { + type: "none"; +}); +export declare type ClientStatusInfo = { + microphoneMuted: boolean; + microphoneDisabled: boolean; + speakerMuted: boolean; + speakerDisabled: boolean; + away: boolean | string; +}; +export declare type ClientForumInfo = { + userId: number; + nickname: string; + flags: number; +}; +export declare type ClientInfoOnline = { + joinTimestamp: number; + leaveTimestamp: number | 0; +}; +export declare type ClientGroupInfo = { + groupId: number; + groupIcon: RemoteIconInfo; + groupName: string; + groupSortOrder: number; +}; +export declare type ClientCountryInfo = { + flag: string; + name: string; +}; +export declare type ClientVolumeInfo = { + volume: number; + muted: boolean; +}; +export declare type ClientVersionInfo = { + platform: string; + version: string; +}; +export interface ClientInfoEvents { + action_show_full_info: {}; + action_edit_avatar: {}; + query_client: {}; + query_channel_group: {}; + query_server_groups: {}; + query_client_name: {}; + query_client_description: {}; + query_status: {}; + query_online: {}; + query_country: {}; + query_volume: {}; + query_version: {}; + query_forum: {}; + notify_client_name: { + name: string; + }; + notify_client_description: { + description: string; + }; + notify_channel_group: { + group: ClientGroupInfo | undefined; + }; + notify_server_groups: { + groups: ClientGroupInfo[]; + }; + notify_status: { + status: ClientStatusInfo; + }; + notify_online: { + status: ClientInfoOnline; + }; + notify_country: { + country: ClientCountryInfo; + }; + notify_volume: { + volume: ClientVolumeInfo; + }; + notify_version: { + version: ClientVersionInfo; + }; + notify_forum: { + forum: ClientForumInfo; + }; + notify_client: { + info: ClientInfoInfo | undefined; + }; +} diff --git a/imports/shared-app/ui/frames/side/ClientInfoRenderer.d.ts b/imports/shared-app/ui/frames/side/ClientInfoRenderer.d.ts new file mode 100644 index 0000000..a04d0e3 --- /dev/null +++ b/imports/shared-app/ui/frames/side/ClientInfoRenderer.d.ts @@ -0,0 +1,6 @@ +/// +import { ClientInfoEvents } from "tc-shared/ui/frames/side/ClientInfoDefinitions"; +import { Registry } from "tc-shared/events"; +export declare const ClientInfoRenderer: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/side/HeaderController.d.ts b/imports/shared-app/ui/frames/side/HeaderController.d.ts new file mode 100644 index 0000000..5138001 --- /dev/null +++ b/imports/shared-app/ui/frames/side/HeaderController.d.ts @@ -0,0 +1,26 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { SideHeaderEvents } from "tc-shared/ui/frames/side/HeaderDefinitions"; +import { Registry } from "tc-shared/events"; +export declare class SideHeaderController { + readonly uiEvents: Registry; + private connection; + private listenerConnection; + private listenerVoiceChannel; + private listenerTextChannel; + private currentVoiceChannel; + private currentTextChannel; + private pingUpdateInterval; + constructor(); + private initialize; + private initializeConnection; + setConnectionHandler(connection: ConnectionHandler): void; + getConnectionHandler(): ConnectionHandler | undefined; + destroy(): void; + private sendChannelState; + private updateVoiceChannel; + private updateTextChannel; + private sendPing; + private sendPrivateConversationInfo; + private sendClientInfoOwnClient; + private sendServerInfo; +} diff --git a/imports/shared-app/ui/frames/side/HeaderDefinitions.d.ts b/imports/shared-app/ui/frames/side/HeaderDefinitions.d.ts new file mode 100644 index 0000000..318c094 --- /dev/null +++ b/imports/shared-app/ui/frames/side/HeaderDefinitions.d.ts @@ -0,0 +1,65 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type SideHeaderState = SideHeaderStateNone | SideHeaderStateConversation | SideHeaderStateClient | SideHeaderStateMusicBot; +export declare type SideHeaderStateNone = { + state: "none"; +}; +export declare type SideHeaderStateConversation = { + state: "conversation"; + mode: "channel" | "private" | "server"; +}; +export declare type SideHeaderStateClient = { + state: "client"; +}; +export declare type SideHeaderStateMusicBot = { + state: "music-bot"; +}; +export declare type SideHeaderChannelState = { + state: "not-connected"; +} | { + state: "connected"; + channelName: string; + channelIcon: RemoteIconInfo; + channelUserCount: number; + channelMaxUser: number | -1; +}; +export declare type SideHeaderPingInfo = { + native: number; + javaScript: number | undefined; +}; +export declare type PrivateConversationInfo = { + unread: number; + open: number; +}; +export declare type SideHeaderServerInfo = { + name: string; + icon: RemoteIconInfo; +}; +export interface SideHeaderEvents { + action_bot_manage: {}; + action_bot_add_song: {}; + action_switch_channel_chat: {}; + action_open_conversation: {}; + query_server_info: {}; + query_current_channel_state: { + mode: "voice" | "text"; + }; + query_private_conversations: {}; + query_client_info_own_client: {}; + query_ping: {}; + notify_current_channel_state: { + mode: "voice" | "text"; + state: SideHeaderChannelState; + }; + notify_ping: { + ping: SideHeaderPingInfo | undefined; + }; + notify_private_conversations: { + info: PrivateConversationInfo; + }; + notify_client_info_own_client: { + isOwnClient: boolean; + }; + notify_server_info: { + info: SideHeaderServerInfo | undefined; + }; +} diff --git a/imports/shared-app/ui/frames/side/HeaderRenderer.d.ts b/imports/shared-app/ui/frames/side/HeaderRenderer.d.ts new file mode 100644 index 0000000..8cf5e6e --- /dev/null +++ b/imports/shared-app/ui/frames/side/HeaderRenderer.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; +import { Registry } from "tc-shared/events"; +import { SideHeaderEvents, SideHeaderState } from "tc-shared/ui/frames/side/HeaderDefinitions"; +export declare const SideHeaderRenderer: React.MemoExoticComponent<(props: { + events: Registry; + state: SideHeaderState; +}) => JSX.Element>; diff --git a/imports/shared-app/ui/frames/side/MusicBotController.d.ts b/imports/shared-app/ui/frames/side/MusicBotController.d.ts new file mode 100644 index 0000000..dd14fa0 --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicBotController.d.ts @@ -0,0 +1,29 @@ +import { Registry } from "tc-shared/events"; +import { MusicBotUiEvents } from "tc-shared/ui/frames/side/MusicBotDefinitions"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { MusicClientEntry } from "tc-shared/tree/Client"; +import { MusicPlaylistUiEvents } from "tc-shared/ui/frames/side/MusicPlaylistDefinitions"; +export declare class MusicBotController { + private readonly uiEvents; + private readonly playlistController; + private listenerConnection; + private listenerBot; + private currentConnection; + private currentBot; + private playerTimestamp; + private currentSongInfo; + constructor(); + destroy(): void; + getBotUiEvents(): Registry; + getPlaylistUiEvents(): Registry; + setConnection(connection: ConnectionHandler): void; + setBot(bot: MusicClientEntry): void; + private initializeConnectionListener; + private initializeBotListener; + private updatePlaylist; + private updatePlayerInfo; + private reportPlayerState; + private reportSongInfo; + private reportPlayerTimestamp; + private reportVolume; +} diff --git a/imports/shared-app/ui/frames/side/MusicBotDefinitions.d.ts b/imports/shared-app/ui/frames/side/MusicBotDefinitions.d.ts new file mode 100644 index 0000000..4d2c16e --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicBotDefinitions.d.ts @@ -0,0 +1,56 @@ +export declare type MusicBotSongInfo = { + type: "none"; +} | { + type: "loading"; + url: string; +} | { + type: "song"; + url: string; + thumbnail: string; + title: string; + description: string; +}; +export declare type MusicBotPlayerState = "paused" | "playing"; +export declare type MusicBotPlayerTimestamp = { + base: number; + playOffset: number; + bufferOffset: number; + total: number; + seekable: boolean; +}; +export interface MusicBotUiEvents { + action_player_action: { + action: "play" | "pause" | "forward" | "rewind"; + }; + action_seek_to: { + target: number; + }; + action_change_volume: { + mode: "local" | "remote"; + volume: number; + }; + query_player_state: {}; + query_player_timestamp: {}; + query_song_info: {}; + query_volume: { + mode: "local" | "remote"; + }; + notify_player_state: { + state: MusicBotPlayerState; + }; + notify_player_timestamp: { + timestamp: MusicBotPlayerTimestamp; + }; + notify_player_seek_timestamp: { + offset: number | undefined; + applySeek: boolean; + }; + notify_song_info: { + info: MusicBotSongInfo; + }; + notify_volume: { + mode: "local" | "remote"; + volume: number; + }; + notify_bot_changed: {}; +} diff --git a/imports/shared-app/ui/frames/side/MusicBotRenderer.d.ts b/imports/shared-app/ui/frames/side/MusicBotRenderer.d.ts new file mode 100644 index 0000000..d0cab96 --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicBotRenderer.d.ts @@ -0,0 +1,8 @@ +/// +import { Registry } from "tc-shared/events"; +import { MusicPlaylistUiEvents } from "tc-shared/ui/frames/side/MusicPlaylistDefinitions"; +import { MusicBotUiEvents } from "tc-shared/ui/frames/side/MusicBotDefinitions"; +export declare const MusicBotRenderer: (props: { + botEvents: Registry; + playlistEvents: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/side/MusicPlaylistController.d.ts b/imports/shared-app/ui/frames/side/MusicPlaylistController.d.ts new file mode 100644 index 0000000..5236418 --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicPlaylistController.d.ts @@ -0,0 +1,18 @@ +import { SubscribedPlaylist } from "tc-shared/music/PlaylistManager"; +import { Registry } from "tc-shared/events"; +import { MusicPlaylistUiEvents } from "tc-shared/ui/frames/side/MusicPlaylistDefinitions"; +export declare class MusicPlaylistController { + readonly uiEvents: Registry; + private currentPlaylist; + private listenerPlaylist; + private currentSongId; + constructor(); + destroy(): void; + setCurrentPlaylist(playlist: SubscribedPlaylist | "loading"): void; + getCurrentPlaylist(): SubscribedPlaylist | "loading" | undefined; + getCurrentSongId(): number; + setCurrentSongId(id: number | 0): void; + private initializePlaylistListener; + private reportPlaylistStatus; + private reportPlaylistEntry; +} diff --git a/imports/shared-app/ui/frames/side/MusicPlaylistDefinitions.d.ts b/imports/shared-app/ui/frames/side/MusicPlaylistDefinitions.d.ts new file mode 100644 index 0000000..af82c4e --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicPlaylistDefinitions.d.ts @@ -0,0 +1,58 @@ +export declare type MusicPlaylistStatus = { + status: "loading" | "unselected" | "unloaded"; +} | { + status: "error"; + reason: string; +} | { + status: "loaded"; + serverUniqueId: string; + playlistId: number; + songs: number[]; + activeSong: number; +} | { + status: "no-permissions"; + failedPermission: string; +}; +export declare type MusicPlaylistEntryInfo = { + type: "loading"; + url: string | undefined; +} | { + type: "song"; + url: string; + title: string; + description: string; + length: number; + thumbnailImage: string; +}; +export interface MusicPlaylistUiEvents { + action_load_playlist: { + forced: boolean; + }; + action_entry_delete: { + entryId: number; + }; + action_reorder_song: { + entryId: number; + targetEntryId: number; + mode: "before" | "after"; + }; + action_add_song: { + url: string; + mode: "before" | "after" | "last"; + targetEntryId?: number; + }; + action_select_entry: { + entryId: number; + }; + query_playlist_status: {}; + query_entry_status: { + entryId: number; + }; + notify_playlist_status: { + status: MusicPlaylistStatus; + }; + notify_entry_status: { + entryId: number; + status: MusicPlaylistEntryInfo; + }; +} diff --git a/imports/shared-app/ui/frames/side/MusicPlaylistRenderer.d.ts b/imports/shared-app/ui/frames/side/MusicPlaylistRenderer.d.ts new file mode 100644 index 0000000..52bdd06 --- /dev/null +++ b/imports/shared-app/ui/frames/side/MusicPlaylistRenderer.d.ts @@ -0,0 +1,11 @@ +/// +import { Registry } from "tc-shared/events"; +import { MusicPlaylistUiEvents } from "tc-shared/ui/frames/side/MusicPlaylistDefinitions"; +export declare function formatPlaytime(value: number): string; +export declare const DefaultThumbnail: (_props: { + type: "loading" | "none-present"; +}) => JSX.Element; +export declare const MusicPlaylistList: (props: { + events: Registry; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/side/PopoutConversationRenderer.d.ts b/imports/shared-app/ui/frames/side/PopoutConversationRenderer.d.ts new file mode 100644 index 0000000..b8d1a6f --- /dev/null +++ b/imports/shared-app/ui/frames/side/PopoutConversationRenderer.d.ts @@ -0,0 +1,12 @@ +/// +import { IpcRegistryDescription } from "tc-shared/events"; +import { AbstractConversationUiEvents } from "./AbstractConversationDefinitions"; +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +declare class PopoutConversationRenderer extends AbstractModal { + private readonly events; + private readonly userData; + constructor(events: IpcRegistryDescription, userData: any); + renderBody(): JSX.Element; + renderTitle(): string; +} +export = PopoutConversationRenderer; diff --git a/imports/shared-app/ui/frames/side/PrivateConversationController.d.ts b/imports/shared-app/ui/frames/side/PrivateConversationController.d.ts new file mode 100644 index 0000000..63d128b --- /dev/null +++ b/imports/shared-app/ui/frames/side/PrivateConversationController.d.ts @@ -0,0 +1,25 @@ +import { ConnectionHandler } from "../../../ConnectionHandler"; +import { PrivateConversationUIEvents } from "../../../ui/frames/side/PrivateConversationDefinitions"; +import { AbstractConversationUiEvents } from "./AbstractConversationDefinitions"; +import { AbstractConversationController } from "./AbstractConversationController"; +import { PrivateConversation, PrivateConversationEvents, PrivateConversationManager, PrivateConversationManagerEvents } from "tc-shared/conversations/PrivateConversationManager"; +export declare type OutOfViewClient = { + nickname: string; + clientId: number; + uniqueId: string; +}; +export declare class PrivateConversationController extends AbstractConversationController { + private connection; + private connectionListener; + private listenerConversation; + constructor(); + destroy(): void; + setConnectionHandler(connection: ConnectionHandler): void; + private initializeConnectionListener; + protected registerConversationManagerEvents(manager: PrivateConversationManager): void; + focusInput(): void; + private reportConversationList; + private handleQueryPrivateConversations; + private handleConversationClose; + protected handleActionSelfTyping1(_event: AbstractConversationUiEvents["action_self_typing"]): void; +} diff --git a/imports/shared-app/ui/frames/side/PrivateConversationDefinitions.d.ts b/imports/shared-app/ui/frames/side/PrivateConversationDefinitions.d.ts new file mode 100644 index 0000000..8728061 --- /dev/null +++ b/imports/shared-app/ui/frames/side/PrivateConversationDefinitions.d.ts @@ -0,0 +1,32 @@ +import { AbstractConversationUiEvents } from "./AbstractConversationDefinitions"; +export declare type PrivateConversationInfo = { + nickname: string; + uniqueId: string; + clientId: number; + chatId: string; + lastMessage: number; + unreadMessages: boolean; +}; +export interface PrivateConversationUIEvents extends AbstractConversationUiEvents { + action_close_chat: { + chatId: string; + }; + query_private_conversations: {}; + notify_private_conversations: { + conversations: PrivateConversationInfo[]; + selected: string; + }; + notify_partner_changed: { + chatId: string; + clientId: number; + name: string; + }; + notify_partner_name_changed: { + chatId: string; + name: string; + }; + notify_unread_state_changed: { + chatId: string; + unread: boolean; + }; +} diff --git a/imports/shared-app/ui/frames/side/PrivateConversationRenderer.d.ts b/imports/shared-app/ui/frames/side/PrivateConversationRenderer.d.ts new file mode 100644 index 0000000..d0b599c --- /dev/null +++ b/imports/shared-app/ui/frames/side/PrivateConversationRenderer.d.ts @@ -0,0 +1,7 @@ +/// +import { Registry } from "tc-shared/events"; +import { PrivateConversationUIEvents } from "tc-shared/ui/frames/side/PrivateConversationDefinitions"; +export declare const PrivateConversationsPanel: (props: { + events: Registry; + handlerId: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/frames/video/Controller.d.ts b/imports/shared-app/ui/frames/video/Controller.d.ts new file mode 100644 index 0000000..403507f --- /dev/null +++ b/imports/shared-app/ui/frames/video/Controller.d.ts @@ -0,0 +1,10 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare class ChannelVideoFrame { + private readonly handle; + private readonly events; + private container; + private controller; + constructor(handle: ConnectionHandler); + destroy(): void; + getContainer(): HTMLDivElement; +} diff --git a/imports/shared-app/ui/frames/video/Definitions.d.ts b/imports/shared-app/ui/frames/video/Definitions.d.ts new file mode 100644 index 0000000..6169ab4 --- /dev/null +++ b/imports/shared-app/ui/frames/video/Definitions.d.ts @@ -0,0 +1,162 @@ +import { ClientIcon } from "svg-sprites/client-icons"; +import { VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +export declare const kLocalVideoId = "__local__video__"; +export declare const kLocalBroadcastChannels: VideoBroadcastType[]; +export declare type ChannelVideoInfo = { + clientName: string; + clientUniqueId: string; + clientId: number; + statusIcon: ClientIcon; +}; +export declare type ChannelVideoStreamState = "available" | "streaming" | "ignored" | "none"; +export declare type VideoStatistics = { + type: "sender"; + mode: "camara" | "screen"; + dimensions: { + width: number; + height: number; + }; + frameRate: number; + codec: { + name: string; + payloadType: number; + }; + maxBandwidth: number; + bandwidth: number; + qualityLimitation: "cpu" | "bandwidth"; + source: { + frameRate: number; + dimensions: { + width: number; + height: number; + }; + }; +} | { + type: "receiver"; + mode: "camara" | "screen"; + dimensions: { + width: number; + height: number; + }; + frameRate: number; + codec: { + name: string; + payloadType: number; + }; +}; +export declare type VideoStreamState = { + state: "disconnected"; +} | { + state: "available"; +} | { + state: "connecting"; +} | { + state: "failed"; + reason?: string; +} | { + state: "connected"; + stream: MediaStream; +}; +export declare type VideoSubscribeInfo = { + totalSubscriptions: number; + subscribedStreams: { + [T in VideoBroadcastType]: number; + }; + subscribeLimits: { + [T in VideoBroadcastType]?: number; + }; + maxSubscriptions: number | undefined; +}; +/** + * "muted": The video has been muted locally + * "unset": The video will be normally played + * "empty": No video available + */ +export declare type LocalVideoState = "muted" | "unset" | "empty"; +export interface ChannelVideoEvents { + action_toggle_expended: { + expended: boolean; + }; + action_video_scroll: { + direction: "left" | "right"; + }; + action_set_spotlight: { + videoId: string | undefined; + expend: boolean; + }; + action_focus_spotlight: {}; + action_set_fullscreen: { + videoId: string | undefined; + }; + action_set_pip: { + videoId: string | undefined; + broadcastType: VideoBroadcastType; + }; + action_toggle_mute: { + videoId: string; + broadcastType: VideoBroadcastType | undefined; + muted: boolean; + }; + action_dismiss: { + videoId: string; + broadcastType: VideoBroadcastType; + }; + query_expended: {}; + query_videos: {}; + query_video: { + videoId: string; + }; + query_video_info: { + videoId: string; + }; + query_video_statistics: { + videoId: string; + broadcastType: VideoBroadcastType; + }; + query_spotlight: {}; + query_video_stream: { + videoId: string; + broadcastType: VideoBroadcastType; + }; + query_subscribe_info: {}; + notify_expended: { + expended: boolean; + }; + notify_videos: { + videoIds: string[]; + }; + notify_video: { + videoId: string; + cameraStream: ChannelVideoStreamState; + screenStream: ChannelVideoStreamState; + }; + notify_video_info: { + videoId: string; + info: ChannelVideoInfo; + }; + notify_video_info_status: { + videoId: string; + statusIcon: ClientIcon; + }; + notify_video_arrows: { + left: boolean; + right: boolean; + }; + notify_spotlight: { + videoId: string | undefined; + }; + notify_video_statistics: { + videoId: string | undefined; + broadcastType: VideoBroadcastType; + statistics: VideoStatistics; + }; + notify_video_stream: { + videoId: string; + broadcastType: VideoBroadcastType; + state: VideoStreamState; + }; + notify_subscribe_info: { + info: VideoSubscribeInfo; + }; +} +export declare function makeVideoAutoplay(video: HTMLVideoElement): () => void; diff --git a/imports/shared-app/ui/frames/video/Renderer.d.ts b/imports/shared-app/ui/frames/video/Renderer.d.ts new file mode 100644 index 0000000..1ca9341 --- /dev/null +++ b/imports/shared-app/ui/frames/video/Renderer.d.ts @@ -0,0 +1,7 @@ +/// +import { Registry } from "tc-shared/events"; +import { ChannelVideoEvents } from "tc-shared/ui/frames/video/Definitions"; +export declare const ChannelVideoRenderer: (props: { + handlerId: string; + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/htmltags.d.ts b/imports/shared-app/ui/htmltags.d.ts new file mode 100644 index 0000000..cbd36e7 --- /dev/null +++ b/imports/shared-app/ui/htmltags.d.ts @@ -0,0 +1,21 @@ +export interface ClientProperties { + client_id: number; + client_unique_id: string; + client_name: string; + add_braces?: boolean; + client_database_id?: number; +} +export interface ChannelProperties { + channel_id: number; + channel_name: string; + channel_display_name?: string; + add_braces?: boolean; +} +export declare function generate_client(properties: ClientProperties): string; +export declare function generate_client_object(properties: ClientProperties): JQuery; +export declare function generate_channel(properties: ChannelProperties): string; +export declare function generate_channel_object(properties: ChannelProperties): JQuery; +export declare namespace callbacks { + function callback_context_client(element: JQuery): boolean; + function callback_context_channel(element: JQuery): boolean; +} diff --git a/imports/shared-app/ui/jsrender.d.ts b/imports/shared-app/ui/jsrender.d.ts new file mode 100644 index 0000000..1bb195f --- /dev/null +++ b/imports/shared-app/ui/jsrender.d.ts @@ -0,0 +1 @@ +export declare function setupJSRender(): boolean; diff --git a/imports/shared-app/ui/modal/ModalAbout.d.ts b/imports/shared-app/ui/modal/ModalAbout.d.ts new file mode 100644 index 0000000..ef03057 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalAbout.d.ts @@ -0,0 +1 @@ +export declare function spawnAbout(): void; diff --git a/imports/shared-app/ui/modal/ModalAvatar.d.ts b/imports/shared-app/ui/modal/ModalAvatar.d.ts new file mode 100644 index 0000000..b85567a --- /dev/null +++ b/imports/shared-app/ui/modal/ModalAvatar.d.ts @@ -0,0 +1 @@ +export declare function spawnAvatarUpload(callback_data: (data: ArrayBuffer | undefined | null) => any): void; diff --git a/imports/shared-app/ui/modal/ModalAvatarList.d.ts b/imports/shared-app/ui/modal/ModalAvatarList.d.ts new file mode 100644 index 0000000..1a1bd59 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalAvatarList.d.ts @@ -0,0 +1,3 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare const human_file_size: (size: number) => string; +export declare function spawnAvatarList(client: ConnectionHandler): void; diff --git a/imports/shared-app/ui/modal/ModalBanClient.d.ts b/imports/shared-app/ui/modal/ModalBanClient.d.ts new file mode 100644 index 0000000..54ef6c8 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalBanClient.d.ts @@ -0,0 +1,12 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare type BanEntry = { + name?: string; + unique_id: string; +}; +export declare function spawnBanClient(client: ConnectionHandler, entries: BanEntry | BanEntry[], callback: (data: { + length: number; + reason: string; + no_name: boolean; + no_ip: boolean; + no_hwid: boolean; +}) => void): void; diff --git a/imports/shared-app/ui/modal/ModalBanList.d.ts b/imports/shared-app/ui/modal/ModalBanList.d.ts new file mode 100644 index 0000000..7c8b6ab --- /dev/null +++ b/imports/shared-app/ui/modal/ModalBanList.d.ts @@ -0,0 +1,24 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare function openBanList(client: ConnectionHandler): void; +export declare const duration_data: { + sec: { + text: string; + "1-text": string; + scale: number; + }; + min: { + text: string; + "1-text": string; + scale: number; + }; + hours: { + text: string; + "1-text": string; + scale: number; + }; + days: { + text: string; + "1-text": string; + scale: number; + }; +}; diff --git a/imports/shared-app/ui/modal/ModalBookmarks.d.ts b/imports/shared-app/ui/modal/ModalBookmarks.d.ts new file mode 100644 index 0000000..2fe7984 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalBookmarks.d.ts @@ -0,0 +1 @@ +export declare function spawnBookmarkModal(): void; diff --git a/imports/shared-app/ui/modal/ModalChangeLatency.d.ts b/imports/shared-app/ui/modal/ModalChangeLatency.d.ts new file mode 100644 index 0000000..de69b04 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalChangeLatency.d.ts @@ -0,0 +1,3 @@ +import { ClientEntry } from "../../tree/Client"; +import { VoicePlayerLatencySettings } from "../../voice/VoicePlayer"; +export declare function spawnChangeLatency(client: ClientEntry, current: VoicePlayerLatencySettings, reset: () => VoicePlayerLatencySettings, apply: (settings: VoicePlayerLatencySettings) => void, callback_flush?: () => any): void; diff --git a/imports/shared-app/ui/modal/ModalChangeVolumeNew.d.ts b/imports/shared-app/ui/modal/ModalChangeVolumeNew.d.ts new file mode 100644 index 0000000..8d7ad58 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalChangeVolumeNew.d.ts @@ -0,0 +1,22 @@ +import { ClientEntry, MusicClientEntry } from "tc-shared/tree/Client"; +export interface VolumeChangeEvents { + "change-volume": { + newValue: number; + origin: "user-input" | "reset" | "unknown"; + }; + "query-volume": {}; + "query-volume-response": { + volume: number; + }; + "apply-volume": { + newValue: number; + origin: "user-input" | "reset" | "unknown"; + }; + "apply-volume-result": { + newValue: number; + success: boolean; + }; + "close-modal": {}; +} +export declare function spawnClientVolumeChange(client: ClientEntry): import("../react-elements/internal-modal/Controller").InternalModalController; +export declare function spawnMusicBotVolumeChange(client: MusicClientEntry, maxValue: number): import("../react-elements/internal-modal/Controller").InternalModalController; diff --git a/imports/shared-app/ui/modal/ModalChannelInfo.d.ts b/imports/shared-app/ui/modal/ModalChannelInfo.d.ts new file mode 100644 index 0000000..c75d1f9 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalChannelInfo.d.ts @@ -0,0 +1,2 @@ +import { ChannelEntry } from "../../tree/Channel"; +export declare function openChannelInfo(channel: ChannelEntry): void; diff --git a/imports/shared-app/ui/modal/ModalClientInfo.d.ts b/imports/shared-app/ui/modal/ModalClientInfo.d.ts new file mode 100644 index 0000000..7b62e48 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalClientInfo.d.ts @@ -0,0 +1,2 @@ +import { ClientEntry } from "../../tree/Client"; +export declare function openClientInfo(client: ClientEntry): void; diff --git a/imports/shared-app/ui/modal/ModalConnect.d.ts b/imports/shared-app/ui/modal/ModalConnect.d.ts new file mode 100644 index 0000000..9cb40af --- /dev/null +++ b/imports/shared-app/ui/modal/ModalConnect.d.ts @@ -0,0 +1,6 @@ +export declare const Regex: { + DOMAIN: RegExp; + IP_V4: RegExp; + IP_V6: RegExp; + IP: RegExp; +}; diff --git a/imports/shared-app/ui/modal/ModalGroupAssignment.d.ts b/imports/shared-app/ui/modal/ModalGroupAssignment.d.ts new file mode 100644 index 0000000..28762ca --- /dev/null +++ b/imports/shared-app/ui/modal/ModalGroupAssignment.d.ts @@ -0,0 +1,2 @@ +import { ClientEntry } from "../../tree/Client"; +export declare function createServerGroupAssignmentModal(client: ClientEntry, callback: (groups: number[], flag: boolean) => Promise): void; diff --git a/imports/shared-app/ui/modal/ModalGroupCreate.d.ts b/imports/shared-app/ui/modal/ModalGroupCreate.d.ts new file mode 100644 index 0000000..e719a35 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalGroupCreate.d.ts @@ -0,0 +1,34 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare type GroupInfo = { + id: number; + name: string; + type: "query" | "template" | "normal"; +}; +export interface GroupCreateModalEvents { + action_set_name: { + name: string | undefined; + }; + action_set_type: { + target: "query" | "template" | "normal"; + }; + action_set_source: { + group: number; + }; + action_cancel: {}; + action_create: { + name: string; + target: "query" | "template" | "normal"; + source: number; + }; + query_available_groups: {}; + query_available_groups_result: { + groups: GroupInfo[]; + }; + query_client_permissions: {}; + notify_client_permissions: { + createTemplateGroup: boolean; + createQueryGroup: boolean; + }; + notify_destroy: {}; +} +export declare function spawnGroupCreate(connection: ConnectionHandler, target: "server" | "channel", sourceGroup?: number): void; diff --git a/imports/shared-app/ui/modal/ModalGroupPermissionCopy.d.ts b/imports/shared-app/ui/modal/ModalGroupPermissionCopy.d.ts new file mode 100644 index 0000000..aadf61f --- /dev/null +++ b/imports/shared-app/ui/modal/ModalGroupPermissionCopy.d.ts @@ -0,0 +1,30 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare type GroupInfo = { + id: number; + name: string; + type: "query" | "template" | "normal"; +}; +export interface GroupPermissionCopyModalEvents { + action_set_source: { + group: number; + }; + action_set_target: { + group: number; + }; + action_cancel: {}; + action_copy: { + source: number; + target: number; + }; + query_available_groups: {}; + query_available_groups_result: { + groups: GroupInfo[]; + }; + query_client_permissions: {}; + notify_client_permissions: { + createTemplateGroup: boolean; + createQueryGroup: boolean; + }; + notify_destroy: {}; +} +export declare function spawnModalGroupPermissionCopy(connection: ConnectionHandler, target: "channel" | "server", sourceGroup?: number, targetGroup?: number): void; diff --git a/imports/shared-app/ui/modal/ModalIconSelect.d.ts b/imports/shared-app/ui/modal/ModalIconSelect.d.ts new file mode 100644 index 0000000..576619c --- /dev/null +++ b/imports/shared-app/ui/modal/ModalIconSelect.d.ts @@ -0,0 +1,3 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare function spawnIconSelect(client: ConnectionHandler, callback_icon?: (id: number) => any, selected_icon?: number): void; +export declare function spawnIconUpload(client: ConnectionHandler): void; diff --git a/imports/shared-app/ui/modal/ModalIdentity.d.ts b/imports/shared-app/ui/modal/ModalIdentity.d.ts new file mode 100644 index 0000000..372e9b3 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalIdentity.d.ts @@ -0,0 +1,4 @@ +import { Modal } from "../../ui/elements/Modal"; +import { TeaSpeakIdentity } from "../../profiles/identities/TeamSpeakIdentity"; +export declare function spawnTeamSpeakIdentityImprove(identity: TeaSpeakIdentity, name: string): Modal; +export declare function spawnTeamSpeakIdentityImport(callback: (identity: TeaSpeakIdentity) => any): Modal; diff --git a/imports/shared-app/ui/modal/ModalInvite.d.ts b/imports/shared-app/ui/modal/ModalInvite.d.ts new file mode 100644 index 0000000..3dd6af8 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalInvite.d.ts @@ -0,0 +1,2 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare function spawnInviteEditor(connection: ConnectionHandler): void; diff --git a/imports/shared-app/ui/modal/ModalKeySelect.d.ts b/imports/shared-app/ui/modal/ModalKeySelect.d.ts new file mode 100644 index 0000000..7577d31 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalKeySelect.d.ts @@ -0,0 +1,2 @@ +import { KeyEvent } from "../../PPTListener"; +export declare function spawnKeySelect(callback: (key?: KeyEvent) => void): void; diff --git a/imports/shared-app/ui/modal/ModalMusicManage.d.ts b/imports/shared-app/ui/modal/ModalMusicManage.d.ts new file mode 100644 index 0000000..2ffa126 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalMusicManage.d.ts @@ -0,0 +1,3 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +import { MusicClientEntry } from "../../tree/Client"; +export declare function openMusicManage(client: ConnectionHandler, bot: MusicClientEntry): void; diff --git a/imports/shared-app/ui/modal/ModalNewcomer.d.ts b/imports/shared-app/ui/modal/ModalNewcomer.d.ts new file mode 100644 index 0000000..d82c46e --- /dev/null +++ b/imports/shared-app/ui/modal/ModalNewcomer.d.ts @@ -0,0 +1,16 @@ +import { Modal } from "tc-shared/ui/elements/Modal"; +export interface EventModalNewcomer { + "show_step": { + "step": "welcome" | "microphone" | "identity" | "finish"; + }; + "exit_guide": { + ask_yesno: boolean; + }; + "modal-shown": {}; + "action-next-help": {}; + "step-status": { + allowNextStep: boolean; + allowPreviousStep: boolean; + }; +} +export declare function openModalNewcomer(): Modal; diff --git a/imports/shared-app/ui/modal/ModalPoke.d.ts b/imports/shared-app/ui/modal/ModalPoke.d.ts new file mode 100644 index 0000000..1f54ac2 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalPoke.d.ts @@ -0,0 +1,11 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export interface ServerEntry { + source: ConnectionHandler; + add_message(invoker: PokeInvoker, message: string): any; +} +export declare type PokeInvoker = { + name: string; + id: number; + unique_id: string; +}; +export declare function spawnPoke(source: ConnectionHandler, invoker: PokeInvoker, message: string): void; diff --git a/imports/shared-app/ui/modal/ModalQuery.d.ts b/imports/shared-app/ui/modal/ModalQuery.d.ts new file mode 100644 index 0000000..de18dc8 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalQuery.d.ts @@ -0,0 +1,6 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare function spawnQueryCreate(connection: ConnectionHandler, callback_created?: (user: any, pass: any) => any): void; +export declare function spawnQueryCreated(credentials: { + username: string; + password: string; +}, just_created: boolean): void; diff --git a/imports/shared-app/ui/modal/ModalQueryManage.d.ts b/imports/shared-app/ui/modal/ModalQueryManage.d.ts new file mode 100644 index 0000000..ca561bb --- /dev/null +++ b/imports/shared-app/ui/modal/ModalQueryManage.d.ts @@ -0,0 +1,2 @@ +import { ConnectionHandler } from "../../ConnectionHandler"; +export declare function spawnQueryManage(client: ConnectionHandler): void; diff --git a/imports/shared-app/ui/modal/ModalServerEdit.d.ts b/imports/shared-app/ui/modal/ModalServerEdit.d.ts new file mode 100644 index 0000000..23fae0d --- /dev/null +++ b/imports/shared-app/ui/modal/ModalServerEdit.d.ts @@ -0,0 +1,2 @@ +import { ServerEntry, ServerProperties } from "../../tree/Server"; +export declare function createServerModal(server: ServerEntry, callback: (properties?: ServerProperties) => Promise): void; diff --git a/imports/shared-app/ui/modal/ModalServerInfo.d.ts b/imports/shared-app/ui/modal/ModalServerInfo.d.ts new file mode 100644 index 0000000..ff0f200 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalServerInfo.d.ts @@ -0,0 +1,2 @@ +import { ServerEntry } from "../../tree/Server"; +export declare function openServerInfo(server: ServerEntry): void; diff --git a/imports/shared-app/ui/modal/ModalServerInfoBandwidth.d.ts b/imports/shared-app/ui/modal/ModalServerInfoBandwidth.d.ts new file mode 100644 index 0000000..9f4f485 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalServerInfoBandwidth.d.ts @@ -0,0 +1,9 @@ +import { ServerConnectionInfo, ServerEntry } from "../../tree/Server"; +import { Modal } from "../../ui/elements/Modal"; +export declare enum RequestInfoStatus { + SUCCESS = 0, + UNKNOWN = 1, + NO_PERMISSION = 2 +} +export declare type ServerBandwidthInfoUpdateCallback = (status: RequestInfoStatus, info?: ServerConnectionInfo) => any; +export declare function openServerInfoBandwidth(server: ServerEntry, update_callbacks?: ServerBandwidthInfoUpdateCallback[]): Modal; diff --git a/imports/shared-app/ui/modal/ModalSettings.d.ts b/imports/shared-app/ui/modal/ModalSettings.d.ts new file mode 100644 index 0000000..b8898e4 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalSettings.d.ts @@ -0,0 +1,158 @@ +import { Modal } from "tc-shared/ui/elements/Modal"; +import { Registry } from "tc-shared/events"; +declare type ProfileInfoEvent = { + id: string; + name: string; + nickname: string; + identity_type: "teaforo" | "teamspeak" | "nickname"; + identity_forum?: { + valid: boolean; + fallback_name: string; + }; + identity_nickname?: { + name: string; + fallback_name: string; + }; + identity_teamspeak?: { + unique_id: string; + fallback_name: string; + }; +}; +export interface SettingProfileEvents { + "reload-profile": { + profile_id?: string; + }; + "select-profile": { + profile_id: string; + }; + "query-profile-list": {}; + "query-profile-list-result": { + status: "error" | "success" | "timeout"; + error?: string; + profiles?: ProfileInfoEvent[]; + }; + "query-profile": { + profile_id: string; + }; + "query-profile-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + error?: string; + info?: ProfileInfoEvent; + }; + "select-identity-type": { + profile_id: string; + identity_type: "teamspeak" | "teaforo" | "nickname" | "unset"; + }; + "query-profile-validity": { + profile_id: string; + }; + "query-profile-validity-result": { + profile_id: string; + status: "error" | "success" | "timeout"; + error?: string; + valid?: boolean; + }; + "create-profile": { + name: string; + }; + "create-profile-result": { + status: "error" | "success" | "timeout"; + name: string; + profile_id?: string; + error?: string; + }; + "delete-profile": { + profile_id: string; + }; + "delete-profile-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + error?: string; + }; + "set-default-profile": { + profile_id: string; + }; + "set-default-profile-result": { + status: "error" | "success" | "timeout"; + old_profile_id: string; + new_profile_id?: string; + error?: string; + }; + "set-profile-name": { + profile_id: string; + name: string; + }; + "set-profile-name-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + name?: string; + }; + "set-default-name": { + profile_id: string; + name: string | null; + }; + "set-default-name-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + name?: string | null; + }; + "query-identity-teamspeak": { + profile_id: string; + }; + "query-identity-teamspeak-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + error?: string; + level?: number; + }; + "set-identity-name-name": { + profile_id: string; + name: string; + }; + "set-identity-name-name-result": { + status: "error" | "success" | "timeout"; + profile_id: string; + error?: string; + name?: string; + }; + "generate-identity-teamspeak": { + profile_id: string; + }; + "generate-identity-teamspeak-result": { + profile_id: string; + status: "error" | "success" | "timeout"; + error?: string; + level?: number; + unique_id?: string; + }; + "improve-identity-teamspeak-level": { + profile_id: string; + }; + "improve-identity-teamspeak-level-update": { + profile_id: string; + new_level: number; + }; + "import-identity-teamspeak": { + profile_id: string; + }; + "import-identity-teamspeak-result": { + profile_id: string; + level?: number; + unique_id?: string; + }; + "export-identity-teamspeak": { + profile_id: string; + filename: string; + }; + "setup-forum-connection": {}; +} +export declare function spawnSettingsModal(default_page?: string): Modal; +export declare namespace modal_settings { + interface ProfileViewSettings { + forum_setuppable: boolean; + } + function initialize_identity_profiles_controller(event_registry: Registry): void; + function initialize_identity_profiles_view(container: JQuery, event_registry: Registry, settings: ProfileViewSettings): void; +} +export {}; diff --git a/imports/shared-app/ui/modal/ModalYesNo.d.ts b/imports/shared-app/ui/modal/ModalYesNo.d.ts new file mode 100644 index 0000000..905add5 --- /dev/null +++ b/imports/shared-app/ui/modal/ModalYesNo.d.ts @@ -0,0 +1,6 @@ +import { BodyCreator } from "../../ui/elements/Modal"; +export declare function spawnYesNo(header: BodyCreator, body: BodyCreator, callback: (_: boolean) => any, properties?: { + text_yes?: string; + text_no?: string; + closeable?: boolean; +}): import("../elements/Modal").Modal; diff --git a/imports/shared-app/ui/modal/channel-edit/Controller.d.ts b/imports/shared-app/ui/modal/channel-edit/Controller.d.ts new file mode 100644 index 0000000..3db2d3a --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/Controller.d.ts @@ -0,0 +1,9 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import { ChannelEntry, ChannelProperties } from "tc-shared/tree/Channel"; +import PermissionType from "tc-shared/permission/PermissionType"; +export declare type ChannelEditCallback = (properties: Partial, permissions: ChannelEditChangedPermission[]) => void; +export declare type ChannelEditChangedPermission = { + permission: PermissionType; + value: number; +}; +export declare const spawnChannelEditNew: (connection: ConnectionHandler, channel: ChannelEntry, parent: ChannelEntry, callback: ChannelEditCallback) => void; diff --git a/imports/shared-app/ui/modal/channel-edit/ControllerPermissions.d.ts b/imports/shared-app/ui/modal/channel-edit/ControllerPermissions.d.ts new file mode 100644 index 0000000..8758849 --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/ControllerPermissions.d.ts @@ -0,0 +1,11 @@ +import { ChannelPropertyPermission } from "tc-shared/ui/modal/channel-edit/Definitions"; +import { PermissionManager } from "tc-shared/permission/PermissionManager"; +import { ChannelEntry } from "tc-shared/tree/Channel"; +import { ChannelTree } from "tc-shared/tree/ChannelTree"; +export declare type ChannelPropertyPermissionsProvider = { + provider: (permissions: PermissionManager, channel: ChannelEntry | undefined, channelTree: ChannelTree) => ChannelPropertyPermission[T]; + registerUpdates: (callback: () => void, permissions: PermissionManager, channel: ChannelEntry | undefined, channelTree: ChannelTree) => (() => void)[]; +}; +export declare const ChannelPropertyPermissionsProviders: { + [T in keyof ChannelPropertyPermission]?: ChannelPropertyPermissionsProvider; +}; diff --git a/imports/shared-app/ui/modal/channel-edit/ControllerProperties.d.ts b/imports/shared-app/ui/modal/channel-edit/ControllerProperties.d.ts new file mode 100644 index 0000000..e0fe092 --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/ControllerProperties.d.ts @@ -0,0 +1,10 @@ +import { ChannelEntry, ChannelProperties } from "tc-shared/tree/Channel"; +import { ChannelEditableProperty } from "tc-shared/ui/modal/channel-edit/Definitions"; +import { ChannelTree } from "tc-shared/tree/ChannelTree"; +export declare type ChannelPropertyProvider = { + provider: (properties: ChannelProperties, channel: ChannelEntry | undefined, parentChannel: ChannelEntry | undefined, channelTree: ChannelTree) => Promise; + applier: (value: ChannelEditableProperty[T], properties: Partial, channel: ChannelEntry | undefined) => void; +}; +export declare const ChannelPropertyProviders: { + [T in keyof ChannelEditableProperty]?: ChannelPropertyProvider; +}; diff --git a/imports/shared-app/ui/modal/channel-edit/ControllerValidation.d.ts b/imports/shared-app/ui/modal/channel-edit/ControllerValidation.d.ts new file mode 100644 index 0000000..9fa2ca4 --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/ControllerValidation.d.ts @@ -0,0 +1,7 @@ +import { ChannelEditableProperty } from "tc-shared/ui/modal/channel-edit/Definitions"; +import { ChannelEntry, ChannelProperties } from "tc-shared/tree/Channel"; +import { ChannelTree } from "tc-shared/tree/ChannelTree"; +import { PermissionManager } from "tc-shared/permission/PermissionManager"; +export declare const ChannelPropertyValidators: { + [T in keyof ChannelEditableProperty]?: (currentProperties: ChannelProperties, originalProperties: ChannelProperties, channel: ChannelEntry | undefined, parent: ChannelEntry | undefined, permissions: PermissionManager, channelTree: ChannelTree) => boolean; +}; diff --git a/imports/shared-app/ui/modal/channel-edit/Definitions.d.ts b/imports/shared-app/ui/modal/channel-edit/Definitions.d.ts new file mode 100644 index 0000000..3a836e0 --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/Definitions.d.ts @@ -0,0 +1,146 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type ChannelEditablePermissions = "join" | "view" | "view-description" | "subscribe" | "modify" | "delete" | "browse" | "upload" | "download" | "rename" | "directory-create" | "file-delete"; +export declare type ChannelEditablePermissionValue = { + state: "editable" | "readonly" | "applying"; + value: number; +} | { + state: "loading" | "unsupported"; +}; +export declare type ChannelEditPermissionsState = { + state: "editable" | "loading"; +} | { + state: "no-permissions"; + failedPermission: string; +} | { + state: "error"; + reason: string; +}; +export interface ChannelEditableProperty { + "name": { + rawName: string; + parsedName?: string; + parsedAlignment?: "center" | "right" | "left" | "normal" | "repetitive"; + maxNameLength?: number; + hasParent?: boolean; + spacerUniqueId?: string; + }; + "phoneticName": string; + "icon": { + iconId: number; + remoteIcon?: RemoteIconInfo; + }; + "type": { + type: "default" | "permanent" | "semi-permanent" | "temporary"; + originallyDefault?: boolean; + }; + sideBar: "conversation" | "description" | "file-transfer" | "unknown" | "not-supported"; + "password": { + state: "set"; + password?: string; + } | { + state: "clear"; + }; + "sortingOrder": { + previousChannelId: number; + availableChannels: { + channelName: string; + channelId: number; + }[] | undefined; + }; + "topic": string; + "description": string; + "codec": { + type: number; + quality: number; + }; + "talkPower": number; + "encryptedVoiceData": { + encrypted: boolean; + serverSetting?: "encrypted" | "unencrypted" | "individual"; + }; + "maxUsers": "unlimited" | number; + "maxFamilyUsers": "unlimited" | "inherited" | number; + "deleteDelay": number; +} +export interface ChannelPropertyPermission { + name: boolean; + icon: boolean; + password: { + editable: boolean; + enforced: boolean; + }; + talkPower: boolean; + sortingOrder: boolean; + topic: boolean; + description: boolean; + channelType: { + permanent: boolean; + semiPermanent: boolean; + temporary: boolean; + default: boolean; + }; + sidebarMode: boolean; + maxUsers: boolean; + maxFamilyUsers: boolean; + codec: { + opusVoice: boolean; + opusMusic: boolean; + }; + codecQuality: boolean; + deleteDelay: { + editable: boolean; + maxDelay: number | -1; + }; + encryptVoiceData: boolean; +} +export interface ChannelPropertyStatus { + name: boolean; + password: boolean; +} +export declare type ChannelEditPropertyEvent = { + property: T; + value: ChannelEditableProperty[T]; +}; +export declare type ChannelEditPermissionEvent = { + permission: T; + value: ChannelPropertyPermission[T]; +}; +export interface ChannelEditEvents { + action_cancel: {}; + action_apply: {}; + action_change_property: { + property: keyof ChannelEditableProperty; + value: ChannelEditableProperty[keyof ChannelEditableProperty]; + }; + action_change_permission: { + permission: ChannelEditablePermissions; + value: number; + }; + action_icon_select: {}; + query_property: { + property: keyof ChannelEditableProperty; + }; + query_property_permission: { + permission: keyof ChannelPropertyPermission; + }; + query_permission: { + permission: ChannelEditablePermissions; + }; + query_permissions: {}; + query_property_valid_state: { + property: keyof ChannelEditableProperty; + }; + notify_property: ChannelEditPropertyEvent; + notify_property_permission: ChannelEditPermissionEvent; + notify_permission: { + permission: ChannelEditablePermissions; + value: ChannelEditablePermissionValue; + }; + notify_permissions: { + state: ChannelEditPermissionsState; + }; + notify_property_validate_state: { + property: keyof ChannelEditableProperty; + valid: boolean; + }; +} diff --git a/imports/shared-app/ui/modal/channel-edit/Renderer.d.ts b/imports/shared-app/ui/modal/channel-edit/Renderer.d.ts new file mode 100644 index 0000000..2bc4a3f --- /dev/null +++ b/imports/shared-app/ui/modal/channel-edit/Renderer.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { IpcRegistryDescription } from "tc-shared/events"; +import { ChannelEditEvents } from "tc-shared/ui/modal/channel-edit/Definitions"; +import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions"; +declare class ChannelEditModal extends AbstractModal { + private readonly events; + private readonly isChannelCreate; + constructor(events: IpcRegistryDescription, isChannelCreate: boolean); + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; + color(): "none" | "blue"; +} +export = ChannelEditModal; diff --git a/imports/shared-app/ui/modal/connect/Controller.d.ts b/imports/shared-app/ui/modal/connect/Controller.d.ts new file mode 100644 index 0000000..0718a9a --- /dev/null +++ b/imports/shared-app/ui/modal/connect/Controller.d.ts @@ -0,0 +1,19 @@ +import { ConnectionProfile } from "tc-shared/profiles/ConnectionProfile"; +export declare type ConnectParameters = { + targetAddress: string; + serverPassword?: string; + serverPasswordHashed?: boolean; + nickname: string; + nicknameSpecified: boolean; + profile: ConnectionProfile; + token?: string; + defaultChannel?: string | number; + defaultChannelPassword?: string; + defaultChannelPasswordHashed?: boolean; +}; +export declare type ConnectModalOptions = { + connectInANewTab?: boolean; + selectedAddress?: string; + selectedProfile?: ConnectionProfile; +}; +export declare function spawnConnectModalNew(options: ConnectModalOptions): void; diff --git a/imports/shared-app/ui/modal/connect/Definitions.d.ts b/imports/shared-app/ui/modal/connect/Definitions.d.ts new file mode 100644 index 0000000..7cf935c --- /dev/null +++ b/imports/shared-app/ui/modal/connect/Definitions.d.ts @@ -0,0 +1,61 @@ +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare const kUnknownHistoryServerUniqueId = "unknown"; +export declare type ConnectProfileEntry = { + id: string; + name: string; + valid: boolean; +}; +export declare type ConnectHistoryEntry = { + id: number; + targetAddress: string; + uniqueServerId: string | typeof kUnknownHistoryServerUniqueId; +}; +export declare type ConnectHistoryServerInfo = { + icon: RemoteIconInfo; + name: string; + password: boolean; + country: string; + clients: number | -1; + maxClients: number | -1; +}; +export interface ConnectUiVariables { + "server_address": { + currentAddress: string; + defaultAddress?: string; + }; + readonly "server_address_valid": boolean; + "nickname": { + currentNickname: string | undefined; + defaultNickname?: string; + }; + readonly "nickname_valid": boolean; + "password": { + password: string; + hashed: boolean; + } | undefined; + "profiles": { + profiles?: ConnectProfileEntry[]; + selected: string; + }; + readonly "profile_valid": boolean; + "historyShown": boolean; + readonly "history": { + history: ConnectHistoryEntry[]; + selected: number | -1; + }; + readonly "history_entry": ConnectHistoryServerInfo; + readonly "history_connections": number; +} +export interface ConnectUiEvents { + action_manage_profiles: {}; + action_select_history: { + id: number; + }; + action_connect: { + newTab: boolean; + }; + action_delete_history: { + target: string; + targetType: "address" | "server-unique-id"; + }; +} diff --git a/imports/shared-app/ui/modal/connect/Renderer.d.ts b/imports/shared-app/ui/modal/connect/Renderer.d.ts new file mode 100644 index 0000000..bbeb72f --- /dev/null +++ b/imports/shared-app/ui/modal/connect/Renderer.d.ts @@ -0,0 +1,17 @@ +import { ConnectUiEvents, ConnectUiVariables } from "tc-shared/ui/modal/connect/Definitions"; +import * as React from "react"; +import { IpcRegistryDescription } from "tc-shared/events"; +import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable"; +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +declare class ConnectModal extends AbstractModal { + private readonly events; + private readonly variables; + private readonly connectNewTabByDefault; + constructor(events: IpcRegistryDescription, variables: IpcVariableDescriptor, connectNewTabByDefault: boolean); + protected onDestroy(): void; + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; + color(): "none" | "blue"; + verticalAlignment(): "top" | "center" | "bottom"; +} +export = ConnectModal; diff --git a/imports/shared-app/ui/modal/css-editor/Controller.d.ts b/imports/shared-app/ui/modal/css-editor/Controller.d.ts new file mode 100644 index 0000000..87be52b --- /dev/null +++ b/imports/shared-app/ui/modal/css-editor/Controller.d.ts @@ -0,0 +1 @@ +export declare function spawnModalCssVariableEditor(): void; diff --git a/imports/shared-app/ui/modal/css-editor/Definitions.d.ts b/imports/shared-app/ui/modal/css-editor/Definitions.d.ts new file mode 100644 index 0000000..9d57966 --- /dev/null +++ b/imports/shared-app/ui/modal/css-editor/Definitions.d.ts @@ -0,0 +1,41 @@ +export interface CssVariable { + name: string; + defaultValue: string; + overwriteValue: boolean; + customValue?: string; +} +export interface CssEditorEvents { + action_set_filter: { + filter: string | undefined; + }; + action_select_entry: { + variable: CssVariable; + }; + action_override_toggle: { + variableName: string; + enabled: boolean; + value?: string; + }; + action_change_override_value: { + variableName: string; + value: string; + }; + action_reset: {}; + action_randomize: {}; + action_export: { + allValues: boolean; + }; + action_import: { + config: string; + }; + query_css_variables: {}; + notify_css_variables: { + variables: CssVariable[]; + }; + notify_export_result: { + config: string; + }; + notify_import_result: { + success: boolean; + }; +} diff --git a/imports/shared-app/ui/modal/css-editor/Renderer.d.ts b/imports/shared-app/ui/modal/css-editor/Renderer.d.ts new file mode 100644 index 0000000..1977f95 --- /dev/null +++ b/imports/shared-app/ui/modal/css-editor/Renderer.d.ts @@ -0,0 +1,11 @@ +/// +import { CssEditorEvents } from "tc-shared/ui/modal/css-editor/Definitions"; +import { IpcRegistryDescription } from "tc-shared/events"; +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +declare class PopoutConversationUI extends AbstractModal { + private readonly events; + constructor(events: IpcRegistryDescription); + renderBody(): JSX.Element; + renderTitle(): JSX.Element; +} +export = PopoutConversationUI; diff --git a/imports/shared-app/ui/modal/echo-test/Controller.d.ts b/imports/shared-app/ui/modal/echo-test/Controller.d.ts new file mode 100644 index 0000000..9da0408 --- /dev/null +++ b/imports/shared-app/ui/modal/echo-test/Controller.d.ts @@ -0,0 +1,2 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare function spawnEchoTestModal(connection: ConnectionHandler): void; diff --git a/imports/shared-app/ui/modal/echo-test/Definitions.d.ts b/imports/shared-app/ui/modal/echo-test/Definitions.d.ts new file mode 100644 index 0000000..ed65098 --- /dev/null +++ b/imports/shared-app/ui/modal/echo-test/Definitions.d.ts @@ -0,0 +1,45 @@ +export declare type VoiceConnectionState = "connecting" | "connected" | "disconnected" | "unsupported-client" | "unsupported-server" | "failed"; +export declare type TestState = { + state: "initializing" | "running" | "stopped" | "microphone-invalid" | "unsupported"; +} | { + state: "start-failed"; + error: string; +} | { + state: "muted"; + microphone: boolean; + speaker: boolean; +}; +export interface EchoTestEvents { + action_troubleshooting_finished: { + status: "test-again" | "aborted"; + }; + action_close: {}; + action_test_result: { + status: "success" | "fail"; + }; + action_open_microphone_settings: {}; + action_toggle_tests: { + enabled: boolean; + }; + action_start_test: {}; + action_stop_test: {}; + action_unmute: {}; + query_voice_connection_state: {}; + query_test_state: {}; + query_test_toggle: {}; + notify_destroy: {}; + notify_close: {}; + notify_test_phase: { + phase: "testing" | "troubleshooting"; + }; + notify_voice_connection_state: { + state: VoiceConnectionState; + message?: string; + }; + notify_test_state: { + state: TestState; + }; + notify_tests_toggle: { + enabled: boolean; + }; +} diff --git a/imports/shared-app/ui/modal/echo-test/Renderer.d.ts b/imports/shared-app/ui/modal/echo-test/Renderer.d.ts new file mode 100644 index 0000000..eb0055f --- /dev/null +++ b/imports/shared-app/ui/modal/echo-test/Renderer.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { IpcRegistryDescription } from "tc-shared/events"; +import { EchoTestEvents } from "./Definitions"; +import { Translatable } from "tc-shared/ui/react-elements/i18n"; +import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions"; +declare class ModalEchoTest extends AbstractModal { + private readonly events; + constructor(events: IpcRegistryDescription); + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; +} +export = ModalEchoTest; diff --git a/imports/shared-app/ui/modal/global-settings-editor/Controller.d.ts b/imports/shared-app/ui/modal/global-settings-editor/Controller.d.ts new file mode 100644 index 0000000..d31fdac --- /dev/null +++ b/imports/shared-app/ui/modal/global-settings-editor/Controller.d.ts @@ -0,0 +1 @@ +export declare function spawnGlobalSettingsEditor(): void; diff --git a/imports/shared-app/ui/modal/global-settings-editor/Definitions.d.ts b/imports/shared-app/ui/modal/global-settings-editor/Definitions.d.ts new file mode 100644 index 0000000..789c0bc --- /dev/null +++ b/imports/shared-app/ui/modal/global-settings-editor/Definitions.d.ts @@ -0,0 +1,40 @@ +import { RegistryValueTypeNames } from "tc-shared/settings"; +export interface Setting { + key: string; + type: RegistryValueTypeNames; + description: string | undefined; + defaultValue: any | undefined; +} +export interface ModalGlobalSettingsEditorEvents { + action_select_setting: { + setting: string; + }; + action_set_filter: { + filter: string; + }; + action_set_value: { + setting: string; + value: string; + }; + query_settings: {}; + query_setting: { + setting: string; + }; + notify_settings: { + settings: Setting[]; + }; + notify_setting: { + setting: string; + status: "success" | "not-found"; + info?: Setting; + value?: string; + }; + notify_selected_setting: { + setting: string; + }; + notify_setting_value: { + setting: string; + value: string; + }; + notify_destroy: {}; +} diff --git a/imports/shared-app/ui/modal/global-settings-editor/Renderer.d.ts b/imports/shared-app/ui/modal/global-settings-editor/Renderer.d.ts new file mode 100644 index 0000000..d25c821 --- /dev/null +++ b/imports/shared-app/ui/modal/global-settings-editor/Renderer.d.ts @@ -0,0 +1,12 @@ +import { Translatable } from "tc-shared/ui/react-elements/i18n"; +import * as React from "react"; +import { IpcRegistryDescription, Registry } from "tc-shared/events"; +import { ModalGlobalSettingsEditorEvents } from "tc-shared/ui/modal/global-settings-editor/Definitions"; +import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions"; +declare class ModalGlobalSettingsEditor extends AbstractModal { + protected readonly events: Registry; + constructor(events: IpcRegistryDescription); + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; +} +export = ModalGlobalSettingsEditor; diff --git a/imports/shared-app/ui/modal/invite/Controller.d.ts b/imports/shared-app/ui/modal/invite/Controller.d.ts new file mode 100644 index 0000000..2b9d1f7 --- /dev/null +++ b/imports/shared-app/ui/modal/invite/Controller.d.ts @@ -0,0 +1,3 @@ +import { ChannelEntry } from "tc-shared/tree/Channel"; +import { ServerEntry } from "tc-shared/tree/Server"; +export declare function spawnInviteGenerator(target: ChannelEntry | ServerEntry): void; diff --git a/imports/shared-app/ui/modal/invite/Definitions.d.ts b/imports/shared-app/ui/modal/invite/Definitions.d.ts new file mode 100644 index 0000000..fddb002 --- /dev/null +++ b/imports/shared-app/ui/modal/invite/Definitions.d.ts @@ -0,0 +1,35 @@ +export declare type InviteChannel = { + channelId: number; + channelName: string; + depth: number; +}; +export interface InviteUiVariables { + shortLink: boolean; + advancedSettings: boolean; + selectedChannel: number | 0; + channelPassword: { + raw: string | undefined; + hashed: string | undefined; + }; + token: string | undefined; + expiresAfter: number | 0; + webClientUrlBase: { + override: string | undefined; + fallback: string; + }; + readonly availableChannels: InviteChannel[]; + readonly generatedLink: { + status: "generating"; + } | { + status: "error"; + message: string; + } | { + status: "success"; + longUrl: string; + shortUrl: string; + expireDate: number | 0; + }; +} +export interface InviteUiEvents { + action_close: {}; +} diff --git a/imports/shared-app/ui/modal/invite/Renderer.d.ts b/imports/shared-app/ui/modal/invite/Renderer.d.ts new file mode 100644 index 0000000..24c24c8 --- /dev/null +++ b/imports/shared-app/ui/modal/invite/Renderer.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { AbstractModal } from "tc-shared/ui/react-elements/modal/Definitions"; +import { IpcRegistryDescription } from "tc-events"; +import { InviteUiEvents, InviteUiVariables } from "tc-shared/ui/modal/invite/Definitions"; +import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable"; +declare class ModalInvite extends AbstractModal { + private readonly events; + private readonly variables; + private readonly serverName; + constructor(events: IpcRegistryDescription, variables: IpcVariableDescriptor, serverName: string); + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; +} +export = ModalInvite; diff --git a/imports/shared-app/ui/modal/permission/ModalPermissionEditor.d.ts b/imports/shared-app/ui/modal/permission/ModalPermissionEditor.d.ts new file mode 100644 index 0000000..ae5224b --- /dev/null +++ b/imports/shared-app/ui/modal/permission/ModalPermissionEditor.d.ts @@ -0,0 +1,192 @@ +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +import * as React from "react"; +import { PermissionEditorTab } from "tc-shared/events/GlobalEvents"; +export declare type PermissionEditorSubject = "groups-server" | "groups-channel" | "channel" | "client" | "client-channel" | "none"; +export declare const PermissionTabName: { + [T in PermissionEditorTab]: { + name: string; + useTranslate: () => string; + renderTranslate: () => React.ReactNode; + }; +}; +export declare type GroupProperties = { + id: number; + type: "query" | "template" | "normal"; + name: string; + iconId: number; + sortId: number; + saveDB: boolean; + needed_modify_power: number; + needed_member_add: number; + needed_member_remove: number; +}; +export declare type GroupUpdateEntry = { + property: "name" | "icon" | "sort" | "save"; + value: any; +}; +export declare type ChannelInfo = { + id: number; + iconId: number; + name: string; + depth: number; +}; +export interface PermissionModalEvents { + action_activate_tab: { + tab: PermissionEditorTab; + activeGroupId?: number; + activeChannelId?: number; + activeClientDatabaseId?: number; + }; + action_select_group: { + target: "server" | "channel"; + id: number; + }; + action_select_channel: { + target: "channel" | "client-channel"; + id: number; + }; + action_select_client: { + target: "client" | "client-channel"; + id: number | string | undefined; + }; + action_set_permission_editor_subject: { + mode: PermissionEditorSubject; + groupId?: number; + channelId?: number; + clientDatabaseId?: number; + }; + action_create_group: { + target: "server" | "channel"; + sourceGroup?: number; + }; + action_rename_group: { + target: "server" | "channel"; + id: number | "selected"; + newName: string; + }; + action_rename_group_result: { + target: "server" | "channel"; + id: number; + status: "success" | "error"; + error?: string; + }; + action_delete_group: { + target: "server" | "channel"; + id: number | "selected"; + mode: "ask" | "force"; + }; + action_delete_group_result: { + target: "server" | "channel"; + id: number; + status: "success" | "error"; + error?: string; + }; + action_group_copy_permissions: { + target: "server" | "channel"; + sourceGroup: number; + }; + action_server_group_add_client: { + id: number; + client: number | string; + }; + action_server_group_add_client_result: { + id: number; + client: number | string; + status: "success" | "error" | "no-permissions"; + error?: string; + }; + action_server_group_remove_client: { + id: number; + client: number; + }; + action_server_group_remove_client_result: { + id: number; + client: number; + status: "success" | "error" | "no-permissions"; + error?: string; + }; + query_groups: { + target: "server" | "channel"; + }; + query_groups_result: { + target: "server" | "channel"; + groups: GroupProperties[]; + }; + query_group_clients: { + id: number; + }; + query_group_clients_result: { + id: number; + status: "success" | "error" | "no-permissions"; + error?: string; + clients?: { + name: string; + databaseId: number; + uniqueId: string; + }[]; + }; + query_channels: {}; + query_channels_result: { + channels: ChannelInfo[]; + }; + query_client_permissions: {}; + query_client_info: { + client: number | string; + }; + query_client_info_result: { + client: number | string; + state: "success" | "error" | "no-such-client" | "no-permission"; + error?: string; + info?: { + name: string; + uniqueId: string; + databaseId: number; + }; + failedPermission?: string; + }; + notify_group_updated: { + target: "server" | "channel"; + id: number; + properties: GroupUpdateEntry[]; + }; + notify_groups_created: { + target: "server" | "channel"; + groups: GroupProperties[]; + }; + notify_groups_deleted: { + target: "server" | "channel"; + groups: number[]; + }; + notify_groups_reset: {}; + notify_client_permissions: { + permissionModifyPower: number; + serverGroupCreate: boolean; + channelGroupCreate: boolean; + serverGroupModifyPower: number; + channelGroupModifyPower: number; + modifyQueryGroups: boolean; + modifyTemplateGroups: boolean; + serverGroupMemberAddPower: number; + serverGroupMemberRemovePower: number; + serverGroupPermissionList: boolean; + channelGroupPermissionList: boolean; + channelPermissionList: boolean; + clientPermissionList: boolean; + clientChannelPermissionList: boolean; + }; + notify_client_list_toggled: { + visible: boolean; + }; + notify_channel_updated: { + id: number; + property: "name" | "icon"; + value: any; + }; + notify_destroy: {}; +} +export declare type DefaultTabValues = { + groupId?: number; + channelId?: number; + clientDatabaseId?: number; +}; +export declare function spawnPermissionEditorModal(connection: ConnectionHandler, defaultTab?: PermissionEditorTab, values?: DefaultTabValues): void; diff --git a/imports/shared-app/ui/modal/permission/PermissionEditor.d.ts b/imports/shared-app/ui/modal/permission/PermissionEditor.d.ts new file mode 100644 index 0000000..bb6aa91 --- /dev/null +++ b/imports/shared-app/ui/modal/permission/PermissionEditor.d.ts @@ -0,0 +1,118 @@ +import * as React from "react"; +import { Registry } from "tc-shared/events"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export interface EditorGroupedPermissions { + groupId: string; + groupName: string; + permissions: { + id: number; + name: string; + description: string; + }[]; + children: EditorGroupedPermissions[]; +} +declare type PermissionEditorMode = "unset" | "no-permissions" | "normal"; +export interface PermissionEditorEvents { + action_set_mode: { + mode: PermissionEditorMode; + failedPermission?: string; + }; + action_toggle_client_button: { + visible: boolean; + }; + action_toggle_client_list: { + visible: boolean; + }; + action_set_filter: { + filter?: string; + }; + action_set_assigned_only: { + value: boolean; + }; + action_set_default_value: { + value: number; + }; + action_open_icon_select: { + iconId?: number; + }; + action_set_senseless_permissions: { + permissions: string[]; + }; + action_remove_permissions: { + permissions: { + name: string; + mode: "value" | "grant"; + }[]; + }; + action_remove_permissions_result: { + permissions: { + name: string; + mode: "value" | "grant"; + success: boolean; + }[]; + }; + action_set_permissions: { + permissions: { + name: string; + mode: "value" | "grant"; + value?: number; + flagNegate?: boolean; + flagSkip?: boolean; + }[]; + }; + action_set_permissions_result: { + permissions: { + name: string; + mode: "value" | "grant"; + newValue?: number; + flagNegate?: boolean; + flagSkip?: boolean; + }[]; + }; + action_toggle_group: { + groupId: string | null; + collapsed: boolean; + }; + action_start_permission_edit: { + target: "value" | "grant"; + permission: string; + defaultValue: number; + }; + action_add_permission_group: { + groupId: string; + mode: "value" | "grant"; + }; + action_remove_permission_group: { + groupId: string; + mode: "value" | "grant"; + }; + query_permission_list: {}; + query_permission_list_result: { + hideSenselessPermissions: boolean; + permissions: EditorGroupedPermissions[]; + }; + query_permission_values: {}; + query_permission_values_result: { + status: "error" | "success"; + error?: string; + permissions?: { + name: string; + value?: number; + flagNegate?: boolean; + flagSkip?: boolean; + granted?: number; + }[]; + }; +} +interface PermissionEditorProperties { + connection: ConnectionHandler; + events: Registry; +} +interface PermissionEditorState { + state: "no-permissions" | "unset" | "normal"; +} +export declare class PermissionEditor extends React.Component { + render(): JSX.Element[]; + componentDidMount(): void; +} +export {}; diff --git a/imports/shared-app/ui/modal/permission/SenselessPermissions.d.ts b/imports/shared-app/ui/modal/permission/SenselessPermissions.d.ts new file mode 100644 index 0000000..3be5e3c --- /dev/null +++ b/imports/shared-app/ui/modal/permission/SenselessPermissions.d.ts @@ -0,0 +1,6 @@ +import PermissionType from "../../../permission/PermissionType"; +export declare const senseless_server_group_permissions: PermissionType[]; +export declare const senseless_channel_group_permissions: PermissionType[]; +export declare const senseless_channel_permissions: PermissionType[]; +export declare const senseless_client_permissions: PermissionType[]; +export declare const senseless_client_channel_permissions: PermissionType[]; diff --git a/imports/shared-app/ui/modal/permission/TabHandler.d.ts b/imports/shared-app/ui/modal/permission/TabHandler.d.ts new file mode 100644 index 0000000..450782b --- /dev/null +++ b/imports/shared-app/ui/modal/permission/TabHandler.d.ts @@ -0,0 +1,12 @@ +import * as React from "react"; +import { Registry } from "tc-shared/events"; +import { PermissionModalEvents } from "tc-shared/ui/modal/permission/ModalPermissionEditor"; +import { PermissionEditorEvents } from "tc-shared/ui/modal/permission/PermissionEditor"; +import { ConnectionHandler } from "tc-shared/ConnectionHandler"; +export declare class SideBar extends React.Component<{ + connection: ConnectionHandler; + modalEvents: Registry; + editorEvents: Registry; +}, {}> { + render(): JSX.Element[]; +} diff --git a/imports/shared-app/ui/modal/settings/Heighlight.d.ts b/imports/shared-app/ui/modal/settings/Heighlight.d.ts new file mode 100644 index 0000000..5fcf316 --- /dev/null +++ b/imports/shared-app/ui/modal/settings/Heighlight.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +export declare const HighlightContainer: (props: { + children: string | number | boolean | {} | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[]; + classList?: string; + highlightedId?: string; + onClick?: () => void; +}) => JSX.Element; +export declare const HighlightRegion: (props: React.HTMLProps & { + highlightId: string; +}) => React.DetailedReactHTMLElement & { + highlightId: string; +}, HTMLDivElement>; +export declare const HighlightText: (props: { + highlightId: string; + className?: string; + children?: string | number | boolean | {} | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[]; +}) => JSX.Element; diff --git a/imports/shared-app/ui/modal/settings/Keymap.d.ts b/imports/shared-app/ui/modal/settings/Keymap.d.ts new file mode 100644 index 0000000..04a9e74 --- /dev/null +++ b/imports/shared-app/ui/modal/settings/Keymap.d.ts @@ -0,0 +1,28 @@ +/// +import { KeyDescriptor } from "tc-shared/PPTListener"; +export interface KeyMapEvents { + query_keymap: { + action: string; + query_type: "query-selected" | "general"; + }; + query_keymap_result: { + action: string; + status: "success" | "error" | "timeout"; + error?: string; + key?: KeyDescriptor; + }; + set_keymap: { + action: string; + key?: KeyDescriptor; + }; + set_keymap_result: { + action: string; + status: "success" | "error" | "timeout"; + error?: string; + key?: KeyDescriptor; + }; + set_selected_action: { + action: string; + }; +} +export declare const KeyMapSettings: () => JSX.Element; diff --git a/imports/shared-app/ui/modal/settings/Microphone.d.ts b/imports/shared-app/ui/modal/settings/Microphone.d.ts new file mode 100644 index 0000000..6de8a45 --- /dev/null +++ b/imports/shared-app/ui/modal/settings/Microphone.d.ts @@ -0,0 +1,78 @@ +import { Registry } from "tc-shared/events"; +import { DeviceListState } from "tc-shared/audio/recorder"; +export declare type MicrophoneSetting = "volume" | "vad-type" | "ppt-key" | "ppt-release-delay" | "ppt-release-delay-active" | "threshold-threshold" | "rnnoise"; +export declare type MicrophoneDevice = { + id: string; + name: string; + driver: string; + default: boolean; +}; +export declare type SelectedMicrophone = { + type: "default"; +} | { + type: "none"; +} | { + type: "device"; + deviceId: string; +}; +export declare type MicrophoneDevices = { + status: "error"; + error: string; +} | { + status: "audio-not-initialized"; +} | { + status: "no-permissions"; + shouldAsk: boolean; +} | { + status: "success"; + devices: MicrophoneDevice[]; + selectedDevice: SelectedMicrophone; +}; +export interface MicrophoneSettingsEvents { + "query_devices": { + refresh_list: boolean; + }; + "query_help": {}; + "query_setting": { + setting: MicrophoneSetting; + }; + "action_help_click": {}; + "action_request_permissions": {}; + "action_set_selected_device": { + target: SelectedMicrophone; + }; + "action_set_selected_device_result": { + status: "success"; + } | { + status: "error"; + reason: string; + }; + "action_set_setting": { + setting: MicrophoneSetting; + value: any; + }; + notify_setting: { + setting: MicrophoneSetting; + value: any; + }; + notify_devices: MicrophoneDevices; + notify_device_selected: { + device: SelectedMicrophone; + }; + notify_device_level: { + level: { + [key: string]: { + deviceId: string; + status: "success" | "error"; + level?: number; + error?: string; + }; + }; + status: Exclude; + }; + notify_highlight: { + field: "hs-0" | "hs-1" | "hs-2" | undefined; + }; + notify_destroy: {}; +} +export declare function initialize_audio_microphone_controller(events: Registry): void; diff --git a/imports/shared-app/ui/modal/settings/MicrophoneRenderer.d.ts b/imports/shared-app/ui/modal/settings/MicrophoneRenderer.d.ts new file mode 100644 index 0000000..4fd3a5f --- /dev/null +++ b/imports/shared-app/ui/modal/settings/MicrophoneRenderer.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { MicrophoneSettingsEvents } from "tc-shared/ui/modal/settings/Microphone"; +export declare const MicrophoneSettings: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/modal/settings/Notifications.d.ts b/imports/shared-app/ui/modal/settings/Notifications.d.ts new file mode 100644 index 0000000..ecfc3e7 --- /dev/null +++ b/imports/shared-app/ui/modal/settings/Notifications.d.ts @@ -0,0 +1,2 @@ +/// +export declare const NotificationSettings: () => JSX.Element; diff --git a/imports/shared-app/ui/modal/transfer/FileBrowserControllerRemote.d.ts b/imports/shared-app/ui/modal/transfer/FileBrowserControllerRemote.d.ts new file mode 100644 index 0000000..6ef9896 --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileBrowserControllerRemote.d.ts @@ -0,0 +1,4 @@ +import { ConnectionHandler } from "../../../ConnectionHandler"; +import { Registry } from "../../../events"; +import { FileBrowserEvents } from "tc-shared/ui/modal/transfer/FileDefinitions"; +export declare function initializeRemoteFileBrowserController(connection: ConnectionHandler, events: Registry): void; diff --git a/imports/shared-app/ui/modal/transfer/FileBrowserRenderer.d.ts b/imports/shared-app/ui/modal/transfer/FileBrowserRenderer.d.ts new file mode 100644 index 0000000..0c473e8 --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileBrowserRenderer.d.ts @@ -0,0 +1,76 @@ +import { Registry } from "tc-shared/events"; +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import { FileBrowserEvents } from "tc-shared/ui/modal/transfer/FileDefinitions"; +import React = require("react"); +export interface FileBrowserRendererClasses { + navigation?: { + boxedInput?: string; + }; + fileTable?: { + table?: string; + header?: string; + body?: string; + }; + fileEntry?: { + entry?: string; + selected?: string; + dropHovered?: string; + }; +} +export declare const FileBrowserClassContext: React.Context; +interface NavigationBarProperties { + initialPath: string; + events: Registry; +} +interface NavigationBarState { + currentPath: string; + state: "editing" | "navigating" | "normal"; +} +export declare class NavigationBar extends ReactComponentBase { + private refRendered; + private refInput; + private ignoreBlur; + private lastSucceededPath; + protected defaultState(): NavigationBarState; + render(): JSX.Element; + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; + private onPathClicked; + private onRenderedPathClicked; + private onInputPathBluer; + private onPathEntered; + private onButtonRefreshClicked; + private handleNavigateBegin; + private handleCurrentPath; +} +interface FileListTableProperties { + initialPath: string; + events: Registry; +} +interface FileListTableState { + state: "querying" | "normal" | "error" | "query-timeout" | "no-permissions" | "invalid-password"; + errorMessage?: string; +} +export declare class FileBrowserRenderer extends ReactComponentBase { + private refTable; + private currentPath; + private fileList; + private selection; + protected defaultState(): FileListTableState; + render(): JSX.Element; + componentDidMount(): void; + private onDrop; + private onHeaderContextMenu; + private onBodyContextMenu; + private handleNavigationResult; + private handleQueryFiles; + private handleQueryFilesResult; + private handleActionDeleteResult; + private handleActionFileCreateBegin; + private handleActionFileCreateResult; + private handleActionSelectFiles; + private handleNotifyDragStarted; + private handleFileRenameResult; + private handleTransferStart; + private handleTransferStatus; +} +export {}; diff --git a/imports/shared-app/ui/modal/transfer/FileDefinitions.d.ts b/imports/shared-app/ui/modal/transfer/FileDefinitions.d.ts new file mode 100644 index 0000000..127d253 --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileDefinitions.d.ts @@ -0,0 +1,140 @@ +import { FileType } from "tc-shared/file/FileManager"; +import { ChannelEntry } from "tc-shared/tree/Channel"; +export declare const channelPathPrefix: string; +export declare const iconPathPrefix: string; +export declare const avatarsPathPrefix: string; +export declare const FileTransferUrlMediaType = "application/x-teaspeak-ft-urls"; +export declare type TransferStatus = "pending" | "transferring" | "finished" | "errored" | "none"; +export declare type FileMode = "password" | "empty" | "create" | "creating" | "normal" | "uploading"; +export declare type ListedFileInfo = { + path: string; + name: string; + type: FileType; + datetime: number; + size: number; + virtual: boolean; + mode: FileMode; + transfer?: { + id: number; + direction: "upload" | "download"; + status: TransferStatus; + percent: number; + } | undefined; +}; +export declare type PathInfo = { + channelId: number; + channel: ChannelEntry; + path: string; + type: "icon" | "avatar" | "channel" | "root"; +}; +export interface FileBrowserEvents { + action_navigate_to: { + path: string; + }; + action_delete_file: { + files: { + path: string; + name: string; + }[] | "selection"; + mode: "force" | "ask"; + }; + action_delete_file_result: { + results: { + path: string; + name: string; + status: "success" | "timeout" | "error"; + error?: string; + }[]; + }; + action_start_create_directory: { + defaultName: string; + }; + action_create_directory: { + path: string; + name: string; + }; + action_create_directory_result: { + path: string; + name: string; + status: "success" | "timeout" | "error"; + error?: string; + }; + action_rename_file: { + oldPath: string; + oldName: string; + newPath: string; + newName: string; + }; + action_rename_file_result: { + oldPath: string; + oldName: string; + status: "success" | "timeout" | "error" | "no-changes"; + newPath?: string; + newName?: string; + error?: string; + }; + action_start_rename: { + path: string; + name: string; + }; + action_select_files: { + files: { + name: string; + type: FileType; + }[]; + mode: "exclusive" | "toggle"; + }; + action_selection_context_menu: { + pageX: number; + pageY: number; + }; + action_start_download: { + files: { + path: string; + name: string; + }[]; + }; + action_start_upload: { + path: string; + mode: "files" | "browse"; + files?: File[]; + }; + query_files: { + path: string; + }; + query_files_result: { + path: string; + status: "success" | "timeout" | "error" | "no-permissions" | "invalid-password"; + error?: string; + files?: ListedFileInfo[]; + }; + query_current_path: {}; + notify_current_path: { + path: string; + status: "success" | "timeout" | "error"; + error?: string; + pathInfo?: PathInfo; + }; + notify_transfer_start: { + path: string; + name: string; + id: number; + mode: "upload" | "download"; + }; + notify_transfer_status: { + id: number; + status: TransferStatus; + fileSize?: number; + }; + notify_transfer_progress: { + id: number; + progress: number; + fileSize: number; + status: TransferStatus; + }; + notify_drag_ended: {}; + notify_drag_started: { + event: DragEvent; + }; + notify_destroy: {}; +} diff --git a/imports/shared-app/ui/modal/transfer/FileTransferInfo.d.ts b/imports/shared-app/ui/modal/transfer/FileTransferInfo.d.ts new file mode 100644 index 0000000..735f43a --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileTransferInfo.d.ts @@ -0,0 +1,6 @@ +/// +import { Registry } from "tc-shared/events"; +import { TransferInfoEvents } from "tc-shared/ui/modal/transfer/FileTransferInfoDefinitions"; +export declare const FileTransferInfo: (props: { + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/modal/transfer/FileTransferInfoController.d.ts b/imports/shared-app/ui/modal/transfer/FileTransferInfoController.d.ts new file mode 100644 index 0000000..5c0040e --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileTransferInfoController.d.ts @@ -0,0 +1,4 @@ +import { ConnectionHandler } from "../../../ConnectionHandler"; +import { Registry } from "../../../events"; +import { TransferInfoEvents } from "tc-shared/ui/modal/transfer/FileTransferInfoDefinitions"; +export declare const initializeTransferInfoController: (connection: ConnectionHandler, events: Registry) => void; diff --git a/imports/shared-app/ui/modal/transfer/FileTransferInfoDefinitions.d.ts b/imports/shared-app/ui/modal/transfer/FileTransferInfoDefinitions.d.ts new file mode 100644 index 0000000..0ff5497 --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/FileTransferInfoDefinitions.d.ts @@ -0,0 +1,45 @@ +import { TransferStatus } from "tc-shared/ui/modal/transfer/FileDefinitions"; +import { TransferProgress } from "tc-shared/file/Transfer"; +export interface TransferInfoEvents { + query_transfers: {}; + query_transfer_result: { + status: "success" | "error" | "timeout"; + error?: string; + transfers?: TransferInfoData[]; + showFinished?: boolean; + }; + action_toggle_expansion: { + visible: boolean; + }; + action_toggle_finished_transfers: { + visible: boolean; + }; + action_remove_finished: {}; + notify_transfer_registered: { + transfer: TransferInfoData; + }; + notify_transfer_status: { + id: number; + status: TransferStatus; + error?: string; + }; + notify_transfer_progress: { + id: number; + status: TransferStatus; + progress: TransferProgress; + }; + notify_destroy: {}; +} +export interface TransferInfoData { + id: number; + direction: "upload" | "download"; + status: TransferStatus; + name: string; + path: string; + progress: number; + error?: string; + timestampRegistered: number; + timestampBegin: number; + timestampEnd: number; + transferredBytes: number; +} diff --git a/imports/shared-app/ui/modal/transfer/ModalFileTransfer.d.ts b/imports/shared-app/ui/modal/transfer/ModalFileTransfer.d.ts new file mode 100644 index 0000000..2039aef --- /dev/null +++ b/imports/shared-app/ui/modal/transfer/ModalFileTransfer.d.ts @@ -0,0 +1 @@ +export declare function spawnFileTransferModal(channel: number): void; diff --git a/imports/shared-app/ui/modal/video-source/Controller.d.ts b/imports/shared-app/ui/modal/video-source/Controller.d.ts new file mode 100644 index 0000000..5443cd8 --- /dev/null +++ b/imports/shared-app/ui/modal/video-source/Controller.d.ts @@ -0,0 +1,24 @@ +import { VideoSource } from "tc-shared/video/VideoSource"; +import { VideoBroadcastConfig, VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +export declare type VideoSourceModalAction = { + mode: "select-quick"; + defaultDevice?: string; +} | { + mode: "select-default"; + defaultDevice?: string; +} | { + mode: "new"; +} | { + mode: "edit"; + source: VideoSource; + broadcastConstraints: VideoBroadcastConfig; +}; +export declare type VideoSourceSelectResult = { + source: VideoSource | undefined; + config: VideoBroadcastConfig | undefined; +}; +/** + * @param type The video type which should be prompted + * @param mode + */ +export declare function spawnVideoSourceSelectModal(type: VideoBroadcastType, mode: VideoSourceModalAction): Promise; diff --git a/imports/shared-app/ui/modal/video-source/Definitions.d.ts b/imports/shared-app/ui/modal/video-source/Definitions.d.ts new file mode 100644 index 0000000..263f861 --- /dev/null +++ b/imports/shared-app/ui/modal/video-source/Definitions.d.ts @@ -0,0 +1,127 @@ +import { ScreenCaptureDevice } from "tc-shared/video/VideoSource"; +export declare type DeviceListResult = { + status: "success"; + devices: { + id: string; + displayName: string; + }[]; + selectedDeviceId: string | undefined; + fallbackSelectedDeviceName: string | undefined; +} | { + status: "error"; + reason: "no-permissions" | "request-permissions" | "custom"; +}; +export declare type VideoPreviewStatus = { + status: "preview"; + stream: MediaStream; +} | { + status: "error"; + reason: "no-permissions" | "request-permissions" | "custom"; + message?: string; +} | { + status: "none"; +}; +export declare type VideoSourceState = { + type: "none"; +} | { + type: "selected"; + deviceId: string; + name: string; +} | { + type: "errored"; + error: string; +}; +export declare type ScreenCaptureDeviceList = { + status: "success"; + devices: ScreenCaptureDevice[]; +} | { + status: "error"; + reason: string; +} | { + status: "not-supported"; +} | { + status: "loading"; +}; +export declare type SettingFrameRate = { + min: number; + max: number; + original: number; + current: number; +}; +export declare type SettingBitrate = { + allowedBitrate: number | -1; + bitrate: number | 0; +}; +export interface ModalVideoSourceEvents { + action_cancel: {}; + action_start: {}; + action_request_permissions: {}; + action_select_source: { + id: string | undefined; + }; + action_setting_dimension: { + width: number; + height: number; + }; + action_setting_framerate: { + frameRate: number; + }; + action_setting_bitrate_max: { + bitrate: number | 0; + }; + action_setting_keyframe_sender: { + interval: number | 0; + }; + action_toggle_screen_capture_device_select: { + shown: boolean; + }; + action_preselect_screen_capture_device: { + deviceId: string; + }; + query_source: {}; + query_device_list: {}; + query_video_preview: {}; + query_start_button: {}; + query_setting_dimension: {}; + query_setting_framerate: {}; + query_setting_bitrate_max: {}; + query_setting_keyframe_sender: {}; + query_screen_capture_devices: {}; + notify_source: { + state: VideoSourceState; + }; + notify_device_list: { + status: DeviceListResult; + }; + notify_video_preview: { + status: VideoPreviewStatus; + }; + notify_start_button: { + enabled: boolean; + }; + notify_setting_dimension: { + setting: { + minWidth: number; + currentWidth: number; + originalWidth: number; + maxWidth: number; + minHeight: number; + currentHeight: number; + originalHeight: number; + maxHeight: number; + } | undefined; + }; + notify_settings_framerate: { + frameRate: SettingFrameRate | undefined; + }; + notify_screen_capture_devices: { + devices: ScreenCaptureDeviceList; + }; + notify_setting_bitrate_max: { + bitrate: SettingBitrate | undefined; + }; + notify_settings_keyframe_sender: { + interval: number | 0; + }; + notify_destroy: {}; +} diff --git a/imports/shared-app/ui/modal/video-source/Renderer.d.ts b/imports/shared-app/ui/modal/video-source/Renderer.d.ts new file mode 100644 index 0000000..0628a1e --- /dev/null +++ b/imports/shared-app/ui/modal/video-source/Renderer.d.ts @@ -0,0 +1,14 @@ +import { Registry } from "tc-shared/events"; +import * as React from "react"; +import { ModalVideoSourceEvents } from "tc-shared/ui/modal/video-source/Definitions"; +import { InternalModal } from "tc-shared/ui/react-elements/internal-modal/Controller"; +import { Translatable } from "tc-shared/ui/react-elements/i18n"; +import { VideoBroadcastType } from "tc-shared/connection/VideoConnection"; +export declare class ModalVideoSource extends InternalModal { + protected readonly events: Registry; + private readonly sourceType; + private readonly editMode; + constructor(events: Registry, type: VideoBroadcastType, editMode: boolean); + renderBody(): React.ReactElement; + renderTitle(): string | React.ReactElement; +} diff --git a/imports/shared-app/ui/modal/whats-new/Controller.d.ts b/imports/shared-app/ui/modal/whats-new/Controller.d.ts new file mode 100644 index 0000000..77031da --- /dev/null +++ b/imports/shared-app/ui/modal/whats-new/Controller.d.ts @@ -0,0 +1,5 @@ +import { ChangeLog } from "tc-shared/update/ChangeLog"; +export declare function spawnUpdatedModal(changes: { + changesUI?: ChangeLog; + changesClient?: ChangeLog; +}): void; diff --git a/imports/shared-app/ui/modal/whats-new/Renderer.d.ts b/imports/shared-app/ui/modal/whats-new/Renderer.d.ts new file mode 100644 index 0000000..57702c4 --- /dev/null +++ b/imports/shared-app/ui/modal/whats-new/Renderer.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +import { ChangeLog } from "tc-shared/update/ChangeLog"; +import { Translatable } from "tc-shared/ui/react-elements/i18n"; +export interface DisplayableChangeList extends ChangeLog { + title: React.ReactElement; + url: string; +} +export declare const WhatsNew: (props: { + changesUI?: ChangeLog; + changesClient?: ChangeLog; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/Avatar.d.ts b/imports/shared-app/ui/react-elements/Avatar.d.ts new file mode 100644 index 0000000..53a5fa9 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Avatar.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; +import { ClientAvatar } from "tc-shared/file/Avatars"; +export declare const AvatarRenderer: React.MemoExoticComponent<(props: { + avatar: "default" | "loading" | ClientAvatar; + className?: string; + alt?: string; +}) => JSX.Element>; diff --git a/imports/shared-app/ui/react-elements/Button.d.ts b/imports/shared-app/ui/react-elements/Button.d.ts new file mode 100644 index 0000000..abb9573 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Button.d.ts @@ -0,0 +1,19 @@ +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import * as React from "react"; +export interface ButtonProperties { + color?: "green" | "blue" | "red" | "purple" | "brown" | "yellow" | "default" | "none"; + type?: "normal" | "small" | "extra-small"; + className?: string; + onClick?: (event: React.MouseEvent) => void; + hidden?: boolean; + disabled?: boolean; + title?: string; + transparency?: boolean; +} +export interface ButtonState { + disabled?: boolean; +} +export declare class Button extends ReactComponentBase { + protected defaultState(): ButtonState; + render(): JSX.Element; +} diff --git a/imports/shared-app/ui/react-elements/ChatBox.d.ts b/imports/shared-app/ui/react-elements/ChatBox.d.ts new file mode 100644 index 0000000..a9e804f --- /dev/null +++ b/imports/shared-app/ui/react-elements/ChatBox.d.ts @@ -0,0 +1,36 @@ +import * as React from "react"; +import { Registry } from "tc-shared/events"; +import '!style-loader!css-loader!emoji-mart/css/emoji-mart.css'; +interface ChatBoxEvents { + action_set_enabled: { + enabled: boolean; + }; + action_request_focus: {}; + action_submit_message: { + message: string; + }; + action_insert_text: { + text: string; + focus?: boolean; + }; + notify_typing: {}; +} +export interface ChatBoxProperties { + className?: string; + onSubmit?: (text: string) => void; + onType?: () => void; +} +export interface ChatBoxState { + enabled: boolean; +} +export declare class ChatBox extends React.Component { + readonly events: Registry; + private callbackSubmit; + private callbackType; + constructor(props: any); + componentDidMount(): void; + componentWillUnmount(): void; + render(): JSX.Element; + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; +} +export {}; diff --git a/imports/shared-app/ui/react-elements/Checkbox.d.ts b/imports/shared-app/ui/react-elements/Checkbox.d.ts new file mode 100644 index 0000000..d480386 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Checkbox.d.ts @@ -0,0 +1,19 @@ +import * as React from "react"; +import { ReactElement } from "react"; +export interface CheckboxProperties { + label?: ReactElement | string; + disabled?: boolean; + onChange?: (value: boolean) => void; + value?: boolean; + initialValue?: boolean; + children?: never; +} +export interface CheckboxState { + checked?: boolean; + disabled?: boolean; +} +export declare class Checkbox extends React.Component { + constructor(props: any); + render(): JSX.Element; + private onStateChange; +} diff --git a/imports/shared-app/ui/react-elements/ContextDivider.d.ts b/imports/shared-app/ui/react-elements/ContextDivider.d.ts new file mode 100644 index 0000000..16dd886 --- /dev/null +++ b/imports/shared-app/ui/react-elements/ContextDivider.d.ts @@ -0,0 +1,25 @@ +import * as React from "react"; +export interface ContextDividerProperties { + id: string; + direction: "vertical" | "horizontal"; + defaultValue: number; + separatorClassName?: string; + separatorActiveClassName?: string; + children?: never; +} +export interface ContextDividerState { + active: boolean; +} +export declare class ContextDivider extends React.Component { + private readonly refSeparator; + private readonly listenerMove; + private readonly listenerUp; + private value; + constructor(props: any); + render(): JSX.Element; + componentDidMount(): void; + componentWillUnmount(): void; + private startMovement; + private stopMovement; + private applySeparator; +} diff --git a/imports/shared-app/ui/react-elements/Countdown.d.ts b/imports/shared-app/ui/react-elements/Countdown.d.ts new file mode 100644 index 0000000..6e37921 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Countdown.d.ts @@ -0,0 +1,6 @@ +import * as React from "react"; +export declare const Countdown: (props: { + timestamp: number; + finished?: React.ReactNode; + callbackFinished?: () => void; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/ErrorBoundary.d.ts b/imports/shared-app/ui/react-elements/ErrorBoundary.d.ts new file mode 100644 index 0000000..16761fe --- /dev/null +++ b/imports/shared-app/ui/react-elements/ErrorBoundary.d.ts @@ -0,0 +1,11 @@ +import * as React from "react"; +interface ErrorBoundaryState { + errorOccurred: boolean; +} +export declare class ErrorBoundary extends React.Component<{}, ErrorBoundaryState> { + constructor(props: any); + render(): {}; + componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void; + static getDerivedStateFromError(): Partial; +} +export {}; diff --git a/imports/shared-app/ui/react-elements/HTMLRenderer.d.ts b/imports/shared-app/ui/react-elements/HTMLRenderer.d.ts new file mode 100644 index 0000000..f23d37f --- /dev/null +++ b/imports/shared-app/ui/react-elements/HTMLRenderer.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +export declare class HTMLRenderer extends React.PureComponent<{ + purify: boolean; + children: string; +}, {}> { + private readonly reference; + private readonly newNodes; + private originalNode; + constructor(props: any); + render(): JSX.Element; + componentDidMount(): void; + componentWillUnmount(): void; +} diff --git a/imports/shared-app/ui/react-elements/Helper.d.ts b/imports/shared-app/ui/react-elements/Helper.d.ts new file mode 100644 index 0000000..b8dfcf0 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Helper.d.ts @@ -0,0 +1,7 @@ +import { Dispatch, SetStateAction } from "react"; +import { RegistryKey, RegistryValueType, ValuedRegistryKey } from "tc-shared/settings"; +export declare function useDependentState(factory: (prevState?: S) => S, inputs: ReadonlyArray): [S, Dispatch>]; +export declare function useTr(message: string): string; +export declare function joinClassList(...classes: any[]): string; +export declare function useGlobalSetting(key: RegistryKey, defaultValue: DV): V | DV; +export declare function useGlobalSetting(key: ValuedRegistryKey, defaultValue?: V): V; diff --git a/imports/shared-app/ui/react-elements/Icon.d.ts b/imports/shared-app/ui/react-elements/Icon.d.ts new file mode 100644 index 0000000..0fad052 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Icon.d.ts @@ -0,0 +1,12 @@ +/// +import { RemoteIcon } from "tc-shared/file/Icons"; +export declare const IconRenderer: (props: { + icon: string; + title?: string; + className?: string; +}) => JSX.Element; +export declare const RemoteIconRenderer: (props: { + icon: RemoteIcon; + className?: string; + title?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/Icons.d.ts b/imports/shared-app/ui/react-elements/Icons.d.ts new file mode 100644 index 0000000..259a13f --- /dev/null +++ b/imports/shared-app/ui/react-elements/Icons.d.ts @@ -0,0 +1,8 @@ +/// +import { ClientIcon } from "svg-sprites/client-icons"; +export declare const ClientIconRenderer: (props: { + icon: ClientIcon; + size?: string | number; + title?: string; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/InputField.d.ts b/imports/shared-app/ui/react-elements/InputField.d.ts new file mode 100644 index 0000000..31f4528 --- /dev/null +++ b/imports/shared-app/ui/react-elements/InputField.d.ts @@ -0,0 +1,169 @@ +import * as React from "react"; +import { ReactElement } from "react"; +export declare const ControlledBoxedInputField: (props: { + prefix?: string; + suffix?: string; + placeholder?: string; + disabled?: boolean; + editable?: boolean; + value?: string; + rightIcon?: () => React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>; + leftIcon?: () => React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>; + inputBox?: () => React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>; + isInvalid?: boolean; + className?: string; + maxLength?: number; + size?: "small" | "normal" | "large"; + type?: "number" | "password" | "text"; + onChange: (newValue?: string) => void; + onEnter?: () => void; + onFocus?: () => void; + onBlur?: () => void; + finishOnEnter?: boolean; +}) => JSX.Element; +export interface BoxedInputFieldProperties { + prefix?: string; + suffix?: string; + placeholder?: string; + disabled?: boolean; + editable?: boolean; + value?: string; + defaultValue?: string; + rightIcon?: () => ReactElement; + leftIcon?: () => ReactElement; + inputBox?: () => ReactElement; + isInvalid?: boolean; + className?: string; + maxLength?: number; + size?: "normal" | "large" | "small"; + type?: "text" | "password" | "number"; + onFocus?: (event: React.FocusEvent | React.MouseEvent) => void; + onBlur?: () => void; + onChange?: (newValue: string) => void; + onInput?: (newValue: string) => void; + finishOnEnter?: boolean; +} +export interface BoxedInputFieldState { + disabled?: boolean; + defaultValue?: string; + isInvalid?: boolean; + value?: string; +} +export declare class BoxedInputField extends React.Component { + private refInput; + private inputEdited; + constructor(props: any); + render(): JSX.Element; + focusInput(): void; + private onKeyDown; + private onInputBlur; +} +export declare const ControlledFlatInputField: (props: { + type?: "number" | "password" | "text"; + value: string; + placeholder?: string; + className?: string; + label?: React.ReactNode; + labelType?: "static" | "floating"; + labelClassName?: string; + labelFloatingClassName?: string; + help?: React.ReactNode; + helpClassName?: string; + invalid?: React.ReactNode; + invalidClassName?: string; + disabled?: boolean; + editable?: boolean; + onFocus?: () => void; + onBlur?: () => void; + onChange?: (newValue?: string) => void; + onInput?: (newValue?: string) => void; + onEnter?: () => void; + finishOnEnter?: boolean; +}) => JSX.Element; +export interface FlatInputFieldProperties { + defaultValue?: string; + value?: string; + placeholder?: string; + className?: string; + label?: string | React.ReactElement; + labelType?: "static" | "floating"; + labelClassName?: string; + labelFloatingClassName?: string; + type?: "text" | "password" | "number"; + help?: string | React.ReactElement; + helpClassName?: string; + invalidClassName?: string; + disabled?: boolean; + editable?: boolean; + onFocus?: () => void; + onBlur?: () => void; + onChange?: (newValue?: string) => void; + onInput?: (newValue?: string) => void; + onEnter?: () => void; + finishOnEnter?: boolean; +} +export interface FlatInputFieldState { + filled: boolean; + placeholder?: string; + disabled?: boolean; + editable?: boolean; + isInvalid: boolean; + invalidMessage: string | React.ReactElement; +} +export declare class FlatInputField extends React.Component { + private readonly refInput; + constructor(props: any); + render(): JSX.Element; + private onChange; + value(): string; + setValue(value: string | undefined): void; + inputElement(): HTMLInputElement | undefined; + focus(): void; +} +export declare const ControlledSelect: (props: { + type?: "flat" | "boxed"; + className?: string; + value: string; + placeHolder?: string; + label?: React.ReactNode; + labelClassName?: string; + help?: React.ReactNode; + helpClassName?: string; + invalid?: React.ReactNode; + invalidClassName?: string; + disabled?: boolean; + onFocus?: () => void; + onBlur?: () => void; + onChange?: (event?: React.ChangeEvent) => void; + children: React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>[]; +}) => JSX.Element; +export interface SelectProperties { + type?: "flat" | "boxed"; + refSelect?: React.RefObject; + defaultValue?: string; + value?: string; + className?: string; + label?: string | React.ReactElement; + labelClassName?: string; + help?: string | React.ReactElement; + helpClassName?: string; + invalidClassName?: string; + disabled?: boolean; + editable?: boolean; + title?: string; + onFocus?: () => void; + onBlur?: () => void; + onChange?: (event?: React.ChangeEvent) => void; +} +export interface SelectFieldState { + disabled?: boolean; + isInvalid: boolean; + invalidMessage: string | React.ReactElement; +} +export declare class Select extends React.Component { + private refSelect; + constructor(props: any); + render(): JSX.Element; + selectElement(): HTMLSelectElement | undefined; + focus(): void; +} diff --git a/imports/shared-app/ui/react-elements/LoadingDots.d.ts b/imports/shared-app/ui/react-elements/LoadingDots.d.ts new file mode 100644 index 0000000..41c1636 --- /dev/null +++ b/imports/shared-app/ui/react-elements/LoadingDots.d.ts @@ -0,0 +1,7 @@ +/// +export declare const LoadingDots: (props: { + maxDots?: number; + speed?: number; + textOnly?: boolean; + enabled?: boolean; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/ModalDefinitions.d.ts b/imports/shared-app/ui/react-elements/ModalDefinitions.d.ts new file mode 100644 index 0000000..d920bc1 --- /dev/null +++ b/imports/shared-app/ui/react-elements/ModalDefinitions.d.ts @@ -0,0 +1,2 @@ +import * as definitions from "./modal/Definitions"; +export = definitions; diff --git a/imports/shared-app/ui/react-elements/ProgressBar.d.ts b/imports/shared-app/ui/react-elements/ProgressBar.d.ts new file mode 100644 index 0000000..731f19b --- /dev/null +++ b/imports/shared-app/ui/react-elements/ProgressBar.d.ts @@ -0,0 +1,17 @@ +import * as React from "react"; +import { ReactElement } from "react"; +export interface ProgressBarState { + value?: number; + text?: ReactElement | string; + type?: "normal" | "error" | "success"; +} +export interface ProgressBarProperties { + value: number; + text?: ReactElement | string; + type: "normal" | "error" | "success"; + className?: string; +} +export declare class ProgressBar extends React.Component { + constructor(props: any); + render(): JSX.Element; +} diff --git a/imports/shared-app/ui/react-elements/RadioButton.d.ts b/imports/shared-app/ui/react-elements/RadioButton.d.ts new file mode 100644 index 0000000..3243bb9 --- /dev/null +++ b/imports/shared-app/ui/react-elements/RadioButton.d.ts @@ -0,0 +1,8 @@ +import * as React from "react"; +export declare const RadioButton: (props: { + children?: string | number | boolean | {} | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactNodeArray | React.ReactPortal | React.ReactNode[]; + name: string; + selected: boolean; + disabled?: boolean; + onChange: (checked: boolean) => void; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/ReactComponentBase.d.ts b/imports/shared-app/ui/react-elements/ReactComponentBase.d.ts new file mode 100644 index 0000000..7dc35ad --- /dev/null +++ b/imports/shared-app/ui/react-elements/ReactComponentBase.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +export declare enum BatchUpdateType { + UNSET = -1, + GENERAL = 0, + CHANNEL_TREE = 1 +} +export declare function BatchUpdateAssignment(type: BatchUpdateType): (constructor: Function) => void; +export declare abstract class ReactComponentBase extends React.Component { + private update_batch; + private batch_component_id; + private batch_component_force_id; + constructor(props: Properties); + protected initialize(): void; + protected defaultState(): State; + setState(state: ((prevState: Readonly, props: Readonly) => (Pick | State | null)) | (Pick | State | null), callback?: () => void): void; + forceUpdate(callback?: () => void): void; + protected classList(...classes: (string | undefined)[]): string; + protected hasChildren(): boolean; +} +export declare function batch_updates(type: BatchUpdateType): void; +export declare function flush_batched_updates(type: BatchUpdateType, force?: boolean): void; diff --git a/imports/shared-app/ui/react-elements/Slider.d.ts b/imports/shared-app/ui/react-elements/Slider.d.ts new file mode 100644 index 0000000..93e6cbd --- /dev/null +++ b/imports/shared-app/ui/react-elements/Slider.d.ts @@ -0,0 +1,39 @@ +import * as React from "react"; +import { ReactElement } from "react"; +import { Tooltip } from "tc-shared/ui/react-elements/Tooltip"; +export interface SliderProperties { + minValue: number; + maxValue: number; + stepSize: number; + value: number; + disabled?: boolean; + className?: string; + classNameFiller?: string; + inverseFiller?: boolean; + unit?: string; + tooltip?: (value: number) => ReactElement | string | null; + onInput?: (value: number) => void; + onChange?: (value: number) => void; + children?: never; +} +export interface SliderState { + value: number; + active: boolean; + disabled?: boolean; +} +export declare class Slider extends React.Component { + private documentListenersRegistered; + private lastValue; + private readonly mouseListener; + private readonly mouseUpListener; + protected readonly refTooltip: React.RefObject; + protected readonly refSlider: React.RefObject; + constructor(props: any); + private unregisterDocumentListener; + private registerDocumentListener; + componentWillUnmount(): void; + render(): JSX.Element; + protected enableSliderMode(event: React.MouseEvent | React.TouchEvent): void; + protected renderTooltip(): JSX.Element; + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; +} diff --git a/imports/shared-app/ui/react-elements/Switch.d.ts b/imports/shared-app/ui/react-elements/Switch.d.ts new file mode 100644 index 0000000..7b4b386 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Switch.d.ts @@ -0,0 +1,21 @@ +import * as React from "react"; +export interface SwitchProperties { + value?: boolean; + initialState?: boolean; + className?: string; + label?: string | React.ReactElement; + labelSide?: "right" | "left"; + disabled?: boolean; + onChange?: (value: boolean) => void; + onBlur?: () => void; +} +export interface SwitchState { + checked: boolean; + disabled?: boolean; +} +export declare class Switch extends React.Component { + private readonly ref; + constructor(props: any); + render(): JSX.Element; + focus(): void; +} diff --git a/imports/shared-app/ui/react-elements/Tab.d.ts b/imports/shared-app/ui/react-elements/Tab.d.ts new file mode 100644 index 0000000..9adbf0e --- /dev/null +++ b/imports/shared-app/ui/react-elements/Tab.d.ts @@ -0,0 +1,20 @@ +import * as React from "react"; +export declare class TabEntry extends React.Component<{ + children: [React.ReactNode, React.ReactNode]; + id: string; +}, {}> { + constructor(props: any); + render(): React.ReactNode; +} +export declare class Tab extends React.PureComponent<{ + children: React.ReactElement[]; + defaultTab: string; + selectedTab?: string; + permanentRender?: boolean; + className?: string; +}, { + selectedTab: string; +}> { + constructor(props: any); + render(): JSX.Element; +} diff --git a/imports/shared-app/ui/react-elements/Table.d.ts b/imports/shared-app/ui/react-elements/Table.d.ts new file mode 100644 index 0000000..fe5eca4 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Table.d.ts @@ -0,0 +1,56 @@ +import * as React from "react"; +import { ReactElement } from "react"; +export interface TableColumn { + name: string; + header: () => ReactElement | ReactElement[]; + width?: number; + fixedWidth?: string; + className?: string; +} +export interface TableRow { + columns: { + [key: string]: () => ReactElement | ReactElement[]; + }; + className?: string; + userData?: T; +} +export interface TableProperties { + columns: TableColumn[]; + rows: TableRow[]; + className?: string; + headerClassName?: string; + bodyClassName?: string; + bodyOverlayOnly?: boolean; + bodyOverlay?: () => ReactElement; + hiddenColumns?: string[]; + onHeaderContextMenu?: (event: React.MouseEvent) => void; + onBodyContextMenu?: (event: React.MouseEvent) => void; + onDrop?: (event: React.DragEvent) => void; + onDragOver?: (event: React.DragEvent) => void; + renderRow?: (row: TableRow, columns: TableColumn[], uniqueId: string) => React.ReactElement; +} +export interface TableState { + hiddenColumns: string[]; +} +export interface TableRowProperties { + columns: TableColumn[]; + rowData: TableRow; +} +export interface TableRowState { + hidden?: boolean; +} +export declare class TableRowElement extends React.Component, TableRowState> { + constructor(props: any); + render(): React.DetailedReactHTMLElement; +} +export declare class Table extends React.Component { + private rowIndex; + private refHeader; + private refHiddenHeader; + private refBody; + private lastHeaderHeight; + private lastScrollbarWidth; + constructor(props: any); + render(): JSX.Element; + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; +} diff --git a/imports/shared-app/ui/react-elements/TimestampRenderer.d.ts b/imports/shared-app/ui/react-elements/TimestampRenderer.d.ts new file mode 100644 index 0000000..37dfc4d --- /dev/null +++ b/imports/shared-app/ui/react-elements/TimestampRenderer.d.ts @@ -0,0 +1,4 @@ +/// +export declare const TimestampRenderer: (props: { + timestamp: number; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/Tooltip.d.ts b/imports/shared-app/ui/react-elements/Tooltip.d.ts new file mode 100644 index 0000000..f664467 --- /dev/null +++ b/imports/shared-app/ui/react-elements/Tooltip.d.ts @@ -0,0 +1,26 @@ +import * as React from "react"; +import { ReactElement } from "react"; +export interface TooltipState { + forceShow: boolean; + hovered: boolean; + pageX: number; + pageY: number; +} +export interface TooltipProperties { + tooltip: () => ReactElement | ReactElement[] | string; +} +export declare class Tooltip extends React.Component { + readonly tooltipId: string; + private refContainer; + private currentContainer; + constructor(props: any); + componentWillUnmount(): void; + render(): JSX.Element; + componentDidUpdate(prevProps: Readonly, prevState: Readonly, snapshot?: any): void; + private onMouseEnter; + updatePosition(): void; +} +export declare const IconTooltip: (props: { + children?: React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)>[]; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/react-elements/external-modal/Controller.d.ts b/imports/shared-app/ui/react-elements/external-modal/Controller.d.ts new file mode 100644 index 0000000..3f4fdc8 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/Controller.d.ts @@ -0,0 +1,26 @@ +import { ChannelMessage } from "../../../ipc/BrowserIPC"; +import { Registry } from "tc-events"; +import { EventControllerBase, Popout2ControllerMessages, PopoutIPCMessage } from "../../../ui/react-elements/external-modal/IPCMessage"; +import { ModalController, ModalEvents, ModalOptions, ModalState } from "../../../ui/react-elements/ModalDefinitions"; +export declare abstract class AbstractExternalModalController extends EventControllerBase<"controller"> implements ModalController { + readonly modalType: string; + readonly constructorArguments: any[]; + private readonly modalEvents; + private modalState; + private readonly documentUnloadListener; + private callbackWindowInitialized; + protected constructor(modalType: string, constructorArguments: any[]); + getOptions(): Readonly; + getEvents(): Registry; + getState(): ModalState; + protected abstract spawnWindow(): Promise; + protected abstract focusWindow(): void; + protected abstract destroyWindow(): void; + show(): Promise; + private doDestroyWindow; + hide(): Promise; + destroy(): void; + protected handleWindowClosed(): void; + protected handleIPCMessage(remoteId: string, broadcast: boolean, message: ChannelMessage): void; + protected handleTypedIPCMessage(remoteId: string, isBroadcast: boolean, type: T, payload: PopoutIPCMessage[T]): void; +} diff --git a/imports/shared-app/ui/react-elements/external-modal/IPCMessage.d.ts b/imports/shared-app/ui/react-elements/external-modal/IPCMessage.d.ts new file mode 100644 index 0000000..44ef4c1 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/IPCMessage.d.ts @@ -0,0 +1,35 @@ +import { IPCChannel } from "../../../ipc/BrowserIPC"; +export declare const kPopoutIPCChannelId = "popout-channel"; +export interface PopoutIPCMessage { + "hello-popout": { + version: string; + authenticationCode: string; + }; + "hello-controller": { + accepted: boolean; + message?: string; + constructorArguments?: any[]; + }; + "invoke-modal-action": { + action: "close" | "minimize"; + }; +} +export declare type Controller2PopoutMessages = "hello-controller"; +export declare type Popout2ControllerMessages = "hello-popout" | "invoke-modal-action"; +export interface SendIPCMessage { + "controller": Controller2PopoutMessages; + "popout": Popout2ControllerMessages; +} +export interface ReceivedIPCMessage { + "controller": Popout2ControllerMessages; + "popout": Controller2PopoutMessages; +} +export declare abstract class EventControllerBase { + protected readonly ipcAuthenticationCode: string; + protected ipcRemotePeerId: string; + protected ipcChannel: IPCChannel; + protected constructor(ipcAuthenticationCode: string); + protected sendIPCMessage(type: T, payload: PopoutIPCMessage[T]): void; + protected handleTypedIPCMessage(remoteId: string, isBroadcast: boolean, type: T, payload: PopoutIPCMessage[T]): void; + protected destroyIPC(): void; +} diff --git a/imports/shared-app/ui/react-elements/external-modal/PopoutController.d.ts b/imports/shared-app/ui/react-elements/external-modal/PopoutController.d.ts new file mode 100644 index 0000000..4f30f55 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/PopoutController.d.ts @@ -0,0 +1,13 @@ +import { Controller2PopoutMessages, EventControllerBase, PopoutIPCMessage } from "../../../ui/react-elements/external-modal/IPCMessage"; +export declare function getPopoutController(): PopoutController; +declare class PopoutController extends EventControllerBase<"popout"> { + private constructorArguments; + private callbackControllerHello; + constructor(); + getConstructorArguments(): any[]; + initialize(): Promise; + protected handleTypedIPCMessage(remoteId: string, isBroadcast: boolean, type: T, payload: PopoutIPCMessage[T]): void; + doClose(): void; + doMinimize(): void; +} +export {}; diff --git a/imports/shared-app/ui/react-elements/external-modal/PopoutEntrypoint.d.ts b/imports/shared-app/ui/react-elements/external-modal/PopoutEntrypoint.d.ts new file mode 100644 index 0000000..e3274b3 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/PopoutEntrypoint.d.ts @@ -0,0 +1,2 @@ +import "../../../file/RemoteAvatars"; +import "../../../file/RemoteIcons"; diff --git a/imports/shared-app/ui/react-elements/external-modal/PopoutRendererClient.d.ts b/imports/shared-app/ui/react-elements/external-modal/PopoutRendererClient.d.ts new file mode 100644 index 0000000..94a2947 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/PopoutRendererClient.d.ts @@ -0,0 +1,16 @@ +import { AbstractModal, ModalRenderer } from "tc-shared/ui/react-elements/ModalDefinitions"; +export interface ModalControlFunctions { + close(): any; + minimize(): any; +} +export declare class ClientModalRenderer implements ModalRenderer { + private readonly functionController; + private readonly titleElement; + private readonly container; + private readonly titleChangeObserver; + private titleContainer; + private currentModal; + constructor(functionController: ModalControlFunctions); + renderModal(modal: AbstractModal | undefined): void; + private updateTitle; +} diff --git a/imports/shared-app/ui/react-elements/external-modal/PopoutRendererWeb.d.ts b/imports/shared-app/ui/react-elements/external-modal/PopoutRendererWeb.d.ts new file mode 100644 index 0000000..4fbd805 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/PopoutRendererWeb.d.ts @@ -0,0 +1,8 @@ +import { AbstractModal, ModalRenderer } from "tc-shared/ui/react-elements/ModalDefinitions"; +export declare class WebModalRenderer implements ModalRenderer { + private readonly titleRenderer; + private readonly bodyRenderer; + private currentModal; + constructor(); + renderModal(modal: AbstractModal | undefined): void; +} diff --git a/imports/shared-app/ui/react-elements/external-modal/index.d.ts b/imports/shared-app/ui/react-elements/external-modal/index.d.ts new file mode 100644 index 0000000..72ddee3 --- /dev/null +++ b/imports/shared-app/ui/react-elements/external-modal/index.d.ts @@ -0,0 +1,7 @@ +import "./Controller"; +import { ModalController, ModalOptions } from "../ModalDefinitions"; +export declare type ControllerFactory = (modalType: string, constructorArguments?: any[], options?: ModalOptions) => ModalController; +export declare function setExternalModalControllerFactory(factory: ControllerFactory): void; +export declare function spawnExternalModal(modalType: string, constructorArguments?: any[], options?: ModalOptions): ModalController; diff --git a/imports/shared-app/ui/react-elements/i18n/index.d.ts b/imports/shared-app/ui/react-elements/i18n/index.d.ts new file mode 100644 index 0000000..d3adc50 --- /dev/null +++ b/imports/shared-app/ui/react-elements/i18n/index.d.ts @@ -0,0 +1,26 @@ +import * as React from "react"; +export declare class Translatable extends React.Component<{ + children: string | (string | React.ReactElement)[]; + __cacheKey?: string; + trIgnore?: boolean; + enforceTextOnly?: boolean; +}, { + translated: string; +}> { + protected renderElementIndex: number; + constructor(props: any); + render(): any[]; + componentDidMount(): void; + componentWillUnmount(): void; +} +export declare type VariadicTranslatableChild = React.ReactElement | string | number; +export declare const VariadicTranslatable: (props: { + text: string; + __cacheKey?: string; + children?: string | number | React.ReactElement React.ReactElement React.Component)>) | (new (props: any) => React.Component)> | VariadicTranslatableChild[]; +}) => JSX.Element; +declare global { + interface Window { + i18nInstances: Translatable[]; + } +} diff --git a/imports/shared-app/ui/react-elements/internal-modal/Controller.d.ts b/imports/shared-app/ui/react-elements/internal-modal/Controller.d.ts new file mode 100644 index 0000000..544dea8 --- /dev/null +++ b/imports/shared-app/ui/react-elements/internal-modal/Controller.d.ts @@ -0,0 +1,23 @@ +import { Registry } from "../../../events"; +import { AbstractModal, ModalController, ModalEvents, ModalOptions, ModalState } from "../../../ui/react-elements/ModalDefinitions"; +import { RegisteredModal } from "tc-shared/ui/react-elements/modal/Registry"; +export declare class InternalModalController implements ModalController { + readonly events: Registry; + private readonly modalType; + private readonly constructorArguments; + private modalInstance; + private initializedPromise; + private domElement; + private refModal; + private modalState_; + constructor(modalType: RegisteredModal, constructorArguments: any[]); + getOptions(): Readonly; + getEvents(): Registry; + getState(): ModalState; + private initialize; + show(): Promise; + hide(): Promise; + destroy(): void; +} +export declare abstract class InternalModal extends AbstractModal { +} diff --git a/imports/shared-app/ui/react-elements/internal-modal/Renderer.d.ts b/imports/shared-app/ui/react-elements/internal-modal/Renderer.d.ts new file mode 100644 index 0000000..7ba4ad4 --- /dev/null +++ b/imports/shared-app/ui/react-elements/internal-modal/Renderer.d.ts @@ -0,0 +1,23 @@ +import * as React from "react"; +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +export declare const InternalModalContentRenderer: React.MemoExoticComponent<(props: { + modal: AbstractModal; + onClose?: () => void; + onMinimize?: () => void; + containerClass?: string; + headerClass?: string; + headerTitleClass?: string; + bodyClass?: string; + refContent?: React.Ref; +}) => JSX.Element>; +export declare class InternalModalRenderer extends React.PureComponent<{ + modal: AbstractModal; + onClose: () => void; +}, { + show: boolean; +}> { + private readonly refModal; + constructor(props: any); + render(): JSX.Element; + private onBackdropClick; +} diff --git a/imports/shared-app/ui/react-elements/modal/Definitions.d.ts b/imports/shared-app/ui/react-elements/modal/Definitions.d.ts new file mode 100644 index 0000000..bb394b4 --- /dev/null +++ b/imports/shared-app/ui/react-elements/modal/Definitions.d.ts @@ -0,0 +1,98 @@ +import { IpcRegistryDescription, Registry } from "tc-shared/events"; +import { VideoViewerEvents } from "tc-shared/video-viewer/Definitions"; +import { ChannelEditEvents } from "tc-shared/ui/modal/channel-edit/Definitions"; +import { EchoTestEvents } from "tc-shared/ui/modal/echo-test/Definitions"; +import { ModalGlobalSettingsEditorEvents } from "tc-shared/ui/modal/global-settings-editor/Definitions"; +import { InviteUiEvents, InviteUiVariables } from "tc-shared/ui/modal/invite/Definitions"; +import { ReactElement } from "react"; +import * as React from "react"; +import { IpcVariableDescriptor } from "tc-shared/ui/utils/IpcVariable"; +export declare type ModalType = "error" | "warning" | "info" | "none"; +export declare type ModalRenderType = "page" | "dialog"; +export interface ModalOptions { + /** + * Unique modal id. + */ + uniqueId?: string; + /** + * Destroy the modal if it has been closed. + * If the value is `false` it *might* destroy the modal anyways. + * Default: `true`. + */ + destroyOnClose?: boolean; + /** + * Default size of the modal in pixel. + * This value might or might not be respected. + */ + defaultSize?: { + width: number; + height: number; + }; + /** + * Determines if the modal is resizeable or now. + * Some browsers might not support non resizeable modals. + * Default: `both` + */ + resizeable?: "none" | "vertical" | "horizontal" | "both"; + /** + * If the modal should be popoutable. + * Default: `false` + */ + popoutable?: boolean; + /** + * The default popout state. + * Default: `false` + */ + popedOut?: boolean; +} +export interface ModalFunctionController { + minimize(): any; + supportMinimize(): boolean; + maximize(): any; + supportMaximize(): boolean; + close(): any; +} +export interface ModalEvents { + "open": {}; + "close": {}; + "destroy": {}; +} +export declare enum ModalState { + SHOWN = 0, + HIDDEN = 1, + DESTROYED = 2 +} +export interface ModalController { + getOptions(): Readonly; + getEvents(): Registry; + getState(): ModalState; + show(): Promise; + hide(): Promise; + destroy(): any; +} +export declare abstract class AbstractModal { + protected constructor(); + abstract renderBody(): ReactElement; + abstract renderTitle(): string | React.ReactElement; + type(): ModalType; + color(): "none" | "blue"; + verticalAlignment(): "top" | "center" | "bottom"; + protected onInitialize(): void; + protected onDestroy(): void; + protected onClose(): void; + protected onOpen(): void; +} +export interface ModalRenderer { + renderModal(modal: AbstractModal | undefined): any; +} +export interface ModalConstructorArguments { + "video-viewer": [IpcRegistryDescription, string]; + "channel-edit": [IpcRegistryDescription, boolean]; + "echo-test": [IpcRegistryDescription]; + "global-settings-editor": [IpcRegistryDescription]; + "conversation": any; + "css-editor": any; + "channel-tree": any; + "modal-connect": any; + "modal-invite": [IpcRegistryDescription, IpcVariableDescriptor, string]; +} diff --git a/imports/shared-app/ui/react-elements/modal/Registry.d.ts b/imports/shared-app/ui/react-elements/modal/Registry.d.ts new file mode 100644 index 0000000..70b25ca --- /dev/null +++ b/imports/shared-app/ui/react-elements/modal/Registry.d.ts @@ -0,0 +1,8 @@ +import { AbstractModal } from "../../../ui/react-elements/ModalDefinitions"; +import { ModalConstructorArguments } from "tc-shared/ui/react-elements/modal/Definitions"; +export interface RegisteredModal { + modalId: T; + classLoader: () => Promise AbstractModal>; + popoutSupported: boolean; +} +export declare function findRegisteredModal(name: T): RegisteredModal | undefined; diff --git a/imports/shared-app/ui/react-elements/modal/index.d.ts b/imports/shared-app/ui/react-elements/modal/index.d.ts new file mode 100644 index 0000000..6b26f0c --- /dev/null +++ b/imports/shared-app/ui/react-elements/modal/index.d.ts @@ -0,0 +1,11 @@ +import { ModalConstructorArguments } from "tc-shared/ui/react-elements/modal/Definitions"; +import { ModalController, ModalOptions } from "tc-shared/ui/react-elements/ModalDefinitions"; +import { InternalModal, InternalModalController } from "tc-shared/ui/react-elements/internal-modal/Controller"; +export declare function spawnModal(modal: T, constructorArguments: ModalConstructorArguments[T], options?: ModalOptions): ModalController; +export declare function spawnReactModal(modalClass: new () => ModalClass): InternalModalController; +export declare function spawnReactModal(modalClass: new (..._: [A1]) => ModalClass, arg1: A1): InternalModalController; +export declare function spawnReactModal(modalClass: new (..._: [A1, A2]) => ModalClass, arg1: A1, arg2: A2): InternalModalController; +export declare function spawnReactModal(modalClass: new (..._: [A1, A2, A3]) => ModalClass, arg1: A1, arg2: A2, arg3: A3): InternalModalController; +export declare function spawnReactModal(modalClass: new (..._: [A1, A2, A3, A4]) => ModalClass, arg1: A1, arg2: A2, arg3: A3, arg4: A4): InternalModalController; +export declare function spawnReactModal(modalClass: new (..._: [A1, A2, A3, A4]) => ModalClass, arg1: A1, arg2: A2, arg3: A3, arg4: A4, arg5: A5): InternalModalController; +export declare function spawnInternalModal(modal: T, constructorArguments: ModalConstructorArguments[T], options?: ModalOptions): InternalModalController; diff --git a/imports/shared-app/ui/tree/Controller.d.ts b/imports/shared-app/ui/tree/Controller.d.ts new file mode 100644 index 0000000..d257e32 --- /dev/null +++ b/imports/shared-app/ui/tree/Controller.d.ts @@ -0,0 +1,8 @@ +import { ChannelTree } from "tc-shared/tree/ChannelTree"; +import { Registry } from "tc-shared/events"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +export interface ChannelTreeRendererOptions { + popoutButton: boolean; +} +export declare function initializeChannelTreeUiEvents(channelTree: ChannelTree, options: ChannelTreeRendererOptions): Registry; +export declare function initializeChannelTreeController(events: Registry, channelTree: ChannelTree, options: ChannelTreeRendererOptions): void; diff --git a/imports/shared-app/ui/tree/Definitions.d.ts b/imports/shared-app/ui/tree/Definitions.d.ts new file mode 100644 index 0000000..25a56be --- /dev/null +++ b/imports/shared-app/ui/tree/Definitions.d.ts @@ -0,0 +1,239 @@ +import { ClientIcon } from "svg-sprites/client-icons"; +import { RemoteIconInfo } from "tc-shared/file/Icons"; +export declare type CollapsedState = "collapsed" | "expended" | "unset"; +export declare type ChannelNameAlignment = "left" | "right" | "center" | "repetitive" | "normal"; +export declare type ChannelIcons = { + default: boolean; + passwordProtected: boolean; + musicQuality: boolean; + moderated: boolean; + codecUnsupported: boolean; + channelIcon: RemoteIconInfo; +}; +export declare type ChannelEntryInfo = { + name: string; + nameStyle: ChannelNameAlignment; + collapsedState: CollapsedState; +}; +export declare type ChannelTreeEntry = { + type: "channel" | "server" | "client" | "client-local"; + entryId: number; + depth: number; +}; +export declare type FullChannelTreeEntry = { + entryId: number; + depth: number; +} & ({ + fullInfo: true; + unread: boolean; +} & ({ + type: "channel"; + info: ChannelEntryInfo; + icon: ClientIcon; + icons: ChannelIcons; +} | { + type: "server"; + state: ServerState; +} | { + type: "client" | "client-local"; + name: ClientNameInfo; + status: ClientIcon; + icons: ClientIcons; + talkStatus?: ClientTalkIconState; + talkRequestMessage?: string; +}) | { + fullInfo: false; +} & { + type: "channel" | "server" | "client" | "client-local"; +}); +export declare type ClientNameInfo = { + name: string; + prefix: string[]; + suffix: string[]; + awayMessage: string; +}; +export declare type ClientTalkIconState = "unset" | "prohibited" | "requested" | "granted"; +export declare type ClientIcons = { + serverGroupIcons: (RemoteIconInfo & { + groupName: string; + groupId: number; + })[]; + channelGroupIcon: (RemoteIconInfo & { + groupName: string; + groupId: number; + }) | undefined; + clientIcon: RemoteIconInfo | undefined; +}; +export declare type ServerState = { + state: "disconnected"; +} | { + state: "connecting"; + targetAddress: string; +} | { + state: "connected"; + name: string; + icon: RemoteIconInfo; +}; +export interface ChannelTreeUIEvents { + action_toggle_popout: { + shown: boolean; + }; + action_show_context_menu: { + treeEntryIds: number[]; + pageX: number; + pageY: number; + }; + action_start_entry_move: { + start: { + x: number; + y: number; + }; + current: { + x: number; + y: number; + }; + }; + action_set_collapsed_state: { + treeEntryId: number; + state: "collapsed" | "expended"; + }; + action_select: { + treeEntryId: number | 0; + }; + action_channel_join: { + treeEntryId: number; + }; + action_channel_open_file_browser: { + treeEntryId: number; + }; + action_client_double_click: { + treeEntryId: number; + }; + action_client_name_submit: { + treeEntryId: number; + name: string; + }; + action_move_clients: { + targetTreeEntry: number; + entries: ChannelTreeDragEntry[]; + }; + action_move_channels: { + targetTreeEntry: number; + mode: "before" | "after" | "child"; + entries: ChannelTreeDragEntry[]; + }; + query_tree_entries: { + fullInfo: boolean; + }; + query_popout_state: {}; + query_selected_entry: {}; + query_unread_state: { + treeEntryId: number; + }; + query_channel_info: { + treeEntryId: number; + }; + query_channel_icon: { + treeEntryId: number; + }; + query_channel_icons: { + treeEntryId: number; + }; + query_client_status: { + treeEntryId: number; + }; + query_client_name: { + treeEntryId: number; + }; + query_client_icons: { + treeEntryId: number; + }; + query_client_talk_status: { + treeEntryId: number; + }; + query_server_state: { + treeEntryId: number; + }; + notify_tree_entries_full: { + entries: FullChannelTreeEntry[]; + }; + notify_popout_state: { + shown: boolean; + showButton: boolean; + }; + notify_selected_entry: { + treeEntryId: number | 0; + }; + notify_channel_info: { + treeEntryId: number; + info: ChannelEntryInfo; + }; + notify_channel_icon: { + treeEntryId: number; + icon: ClientIcon; + }; + notify_channel_icons: { + treeEntryId: number; + icons: ChannelIcons; + }; + notify_client_status: { + treeEntryId: number; + status: ClientIcon; + }; + notify_client_name: { + treeEntryId: number; + info: ClientNameInfo; + }; + notify_client_icons: { + treeEntryId: number; + icons: ClientIcons; + }; + notify_client_talk_status: { + treeEntryId: number; + status: ClientTalkIconState; + requestMessage?: string; + }; + notify_client_name_edit: { + treeEntryId: number; + initialValue: string | undefined; + }; + notify_client_name_edit_failed: { + treeEntryId: number; + reason: "scroll-to"; + }; + notify_server_state: { + treeEntryId: number; + state: ServerState; + }; + notify_unread_state: { + treeEntryId: number; + unread: boolean; + }; + notify_visibility_changed: { + visible: boolean; + }; + notify_destroy: {}; +} +export declare type ChannelTreeDragEntry = { + type: "channel"; + uniqueTreeId: number; +} | { + type: "channel"; + channelId: number; +} | { + type: "server"; +} | { + type: "client"; + uniqueTreeId: number; +} | { + type: "client"; + clientUniqueId: string; + clientId?: number; + clientDatabaseId?: number; +}; +export declare type ChannelTreeDragData = { + version: 1; + handlerId: string; + type: string; + entries: ChannelTreeDragEntry[]; +}; diff --git a/imports/shared-app/ui/tree/DragHelper.d.ts b/imports/shared-app/ui/tree/DragHelper.d.ts new file mode 100644 index 0000000..e43d8a7 --- /dev/null +++ b/imports/shared-app/ui/tree/DragHelper.d.ts @@ -0,0 +1,13 @@ +import { ClientIcon } from "svg-sprites/client-icons"; +import { ChannelTreeDragData, ChannelTreeDragEntry } from "tc-shared/ui/tree/Definitions"; +export declare type DragImageEntryType = { + icon: ClientIcon; + name: string; +}; +export declare function generateDragElement(entries: DragImageEntryType[]): HTMLElement; +export declare function setupDragData(transfer: DataTransfer, handlerId: string, entries: ChannelTreeDragEntry[], type: string): void; +export declare function parseDragData(transfer: DataTransfer): ChannelTreeDragData | undefined; +export declare function getDragInfo(transfer: DataTransfer): { + handlerId: string; + type: string; +} | undefined; diff --git a/imports/shared-app/ui/tree/EntryTags.d.ts b/imports/shared-app/ui/tree/EntryTags.d.ts new file mode 100644 index 0000000..1e51ae2 --- /dev/null +++ b/imports/shared-app/ui/tree/EntryTags.d.ts @@ -0,0 +1,15 @@ +/// +export declare const ClientTag: (props: { + clientName: string; + clientUniqueId: string; + handlerId: string; + clientId?: number; + clientDatabaseId?: number; + className?: string; +}) => JSX.Element; +export declare const ChannelTag: (props: { + channelName: string; + channelId: number; + handlerId: string; + className?: string; +}) => JSX.Element; diff --git a/imports/shared-app/ui/tree/Renderer.d.ts b/imports/shared-app/ui/tree/Renderer.d.ts new file mode 100644 index 0000000..169f30d --- /dev/null +++ b/imports/shared-app/ui/tree/Renderer.d.ts @@ -0,0 +1,7 @@ +/// +import { Registry } from "tc-shared/events"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +export declare const ChannelTreeRenderer: (props: { + handlerId: string; + events: Registry; +}) => JSX.Element; diff --git a/imports/shared-app/ui/tree/RendererChannel.d.ts b/imports/shared-app/ui/tree/RendererChannel.d.ts new file mode 100644 index 0000000..962e762 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererChannel.d.ts @@ -0,0 +1,22 @@ +import * as React from "react"; +import { RDPChannel } from "tc-shared/ui/tree/RendererDataProvider"; +export declare class ChannelIconClass extends React.Component<{ + channel: RDPChannel; +}, {}> { + render(): JSX.Element; +} +export declare class ChannelIconsRenderer extends React.Component<{ + channel: RDPChannel; +}, {}> { + render(): JSX.Element; +} +export declare class RendererChannel extends React.Component<{ + channel: RDPChannel; +}, {}> { + render(): JSX.Element; + componentDidUpdate(prevProps: Readonly<{ + channel: RDPChannel; + }>, prevState: Readonly<{}>, snapshot?: any): void; + componentDidMount(): void; + private fixCssVariables; +} diff --git a/imports/shared-app/ui/tree/RendererClient.d.ts b/imports/shared-app/ui/tree/RendererClient.d.ts new file mode 100644 index 0000000..b2752a0 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererClient.d.ts @@ -0,0 +1,32 @@ +import * as React from "react"; +import { RDPClient } from "tc-shared/ui/tree/RendererDataProvider"; +export declare class ClientStatus extends React.Component<{ + client: RDPClient; +}, {}> { + render(): JSX.Element; +} +export declare class ClientName extends React.Component<{ + client: RDPClient; +}, {}> { + render(): JSX.Element; +} +export declare class ClientTalkStatusIcon extends React.Component<{ + client: RDPClient; +}, {}> { + render(): JSX.Element; +} +export declare class ClientIconsRenderer extends React.Component<{ + client: RDPClient; +}, {}> { + render(): JSX.Element; +} +declare global { + interface HTMLElement { + createTextRange: any; + } +} +export declare class RendererClient extends React.Component<{ + client: RDPClient; +}, {}> { + render(): JSX.Element; +} diff --git a/imports/shared-app/ui/tree/RendererDataProvider.d.ts b/imports/shared-app/ui/tree/RendererDataProvider.d.ts new file mode 100644 index 0000000..d2804e8 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererDataProvider.d.ts @@ -0,0 +1,145 @@ +import { Registry } from "tc-shared/events"; +import { ChannelEntryInfo, ChannelIcons, ChannelTreeUIEvents, ClientIcons, ClientNameInfo, ClientTalkIconState, ServerState } from "tc-shared/ui/tree/Definitions"; +import { ChannelTreeView, PopoutButton } from "tc-shared/ui/tree/RendererView"; +import * as React from "react"; +import { ChannelIconClass, ChannelIconsRenderer, RendererChannel } from "tc-shared/ui/tree/RendererChannel"; +import { ClientIcon } from "svg-sprites/client-icons"; +import { UnreadMarkerRenderer } from "tc-shared/ui/tree/RendererTreeEntry"; +import { ClientIconsRenderer, ClientName, ClientStatus, ClientTalkStatusIcon, RendererClient } from "tc-shared/ui/tree/RendererClient"; +import { ServerRenderer } from "tc-shared/ui/tree/RendererServer"; +/** + * auto := Select/unselect/add/remove depending on the selected state & shift key state + * exclusive := Only selected these entries + * append := Append these entries to the current selection + * remove := Remove these entries from the current selection + */ +export declare type RDPTreeSelectType = "auto" | "auto-add" | "exclusive" | "append" | "remove"; +export declare class RDPTreeSelection { + readonly handle: RDPChannelTree; + selectedEntries: RDPEntry[]; + private readonly documentKeyListener; + private readonly documentBlurListener; + private shiftKeyPressed; + private controlKeyPressed; + private rangeStartEntry; + private rangeMode; + constructor(handle: RDPChannelTree); + reset(): void; + destroy(): void; + isMultiSelect(): boolean; + isAnythingSelected(): boolean; + clearSelection(): void; + select(entries: RDPEntry[], mode: RDPTreeSelectType, selectMainTree: boolean): void; + selectNext(selectClients: boolean, direction: "up" | "down"): void; + private doSelectNext; +} +export declare class RDPChannelTree { + readonly events: Registry; + readonly handlerId: string; + private registeredEventHandlers; + readonly refTree: React.RefObject; + readonly refPopoutButton: React.RefObject; + readonly selection: RDPTreeSelection; + popoutShown: boolean; + popoutButtonShown: boolean; + private readonly documentDragStopListener; + private treeRevision; + private orderedTree; + private treeEntries; + private dragOverChannelEntry; + constructor(events: Registry, handlerId: string); + initialize(): void; + destroy(): void; + getTreeEntries(): RDPEntry[]; + handleDragStart(event: DragEvent): void; + handleUiDragOver(event: DragEvent, target: RDPEntry): void; + handleUiDrop(event: DragEvent, target: RDPEntry): void; + private handleNotifyTreeEntries; + private handleNotifyPopoutState; +} +export declare abstract class RDPEntry { + readonly handle: RDPChannelTree; + readonly entryId: number; + readonly refUnread: React.RefObject; + stateQueried: boolean; + offsetTop: number; + offsetLeft: number; + selected: boolean; + unread: boolean; + private renderedInstance; + private destroyed; + protected constructor(handle: RDPChannelTree, entryId: number); + destroy(): void; + isDestroyed(): boolean; + getEvents(): Registry; + getHandlerId(): string; + queryState(): void; + handleUnreadUpdate(value: boolean): void; + setSelected(value: boolean): void; + handlePositionUpdate(offsetTop: number, offsetLeft: number): void; + render(): React.ReactElement; + select(mode: RDPTreeSelectType): void; + handleUiDoubleClicked(): void; + handleUiContextMenu(pageX: number, pageY: number): void; + handleUiDragStart(event: DragEvent): void; + handleUiDragOver(event: DragEvent): void; + handleUiDrop(event: DragEvent): void; + protected abstract doRender(): React.ReactElement; + protected abstract renderSelectStateUpdate(): any; + protected abstract renderPositionUpdate(): any; +} +export declare type RDPChannelDragHint = "none" | "top" | "bottom" | "contain"; +export declare class RDPChannel extends RDPEntry { + readonly refIcon: React.RefObject; + readonly refIcons: React.RefObject; + readonly refChannel: React.RefObject; + readonly refChannelContainer: React.RefObject; + info: ChannelEntryInfo; + icon: ClientIcon; + icons: ChannelIcons; + dragHint: "none" | "top" | "bottom" | "contain"; + constructor(handle: RDPChannelTree, entryId: number); + doRender(): React.ReactElement; + queryState(): void; + renderSelectStateUpdate(): void; + protected renderPositionUpdate(): void; + handleIconUpdate(newIcon: ClientIcon): void; + handleIconsUpdate(newIcons: ChannelIcons): void; + handleInfoUpdate(newInfo: ChannelEntryInfo): void; + setDragHint(hint: RDPChannelDragHint): void; +} +export declare class RDPClient extends RDPEntry { + readonly refClient: React.RefObject; + readonly refStatus: React.RefObject; + readonly refName: React.RefObject; + readonly refTalkStatus: React.RefObject; + readonly refIcons: React.RefObject; + readonly localClient: boolean; + name: ClientNameInfo; + status: ClientIcon; + icons: ClientIcons; + rename: boolean; + renameDefault: string; + talkStatus: ClientTalkIconState; + talkRequestMessage: string; + constructor(handle: RDPChannelTree, entryId: number, localClient: boolean); + doRender(): React.ReactElement; + queryState(): void; + protected renderPositionUpdate(): void; + protected renderSelectStateUpdate(): void; + handleStatusUpdate(newStatus: ClientIcon): void; + handleNameUpdate(newName: ClientNameInfo): void; + handleTalkStatusUpdate(newStatus: ClientTalkIconState, requestMessage: string): void; + handleIconsUpdate(newIcons: ClientIcons): void; + handleOpenRename(initialValue: string): void; +} +export declare class RDPServer extends RDPEntry { + readonly refServer: React.RefObject; + state: ServerState; + constructor(handle: RDPChannelTree, entryId: number); + queryState(): void; + protected doRender(): React.ReactElement; + protected renderPositionUpdate(): void; + protected renderSelectStateUpdate(): void; + handleStateUpdate(newState: ServerState): void; +} diff --git a/imports/shared-app/ui/tree/RendererServer.d.ts b/imports/shared-app/ui/tree/RendererServer.d.ts new file mode 100644 index 0000000..8d887a3 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererServer.d.ts @@ -0,0 +1,7 @@ +import * as React from "react"; +import { RDPServer } from "tc-shared/ui/tree/RendererDataProvider"; +export declare class ServerRenderer extends React.Component<{ + server: RDPServer; +}, {}> { + render(): JSX.Element; +} diff --git a/imports/shared-app/ui/tree/RendererTreeEntry.d.ts b/imports/shared-app/ui/tree/RendererTreeEntry.d.ts new file mode 100644 index 0000000..2b981b5 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererTreeEntry.d.ts @@ -0,0 +1,10 @@ +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import * as React from "react"; +import { RDPEntry } from "tc-shared/ui/tree/RendererDataProvider"; +export declare class UnreadMarkerRenderer extends React.Component<{ + entry: RDPEntry; +}, {}> { + render(): JSX.Element; +} +export declare class RendererTreeEntry extends ReactComponentBase { +} diff --git a/imports/shared-app/ui/tree/RendererView.d.ts b/imports/shared-app/ui/tree/RendererView.d.ts new file mode 100644 index 0000000..bf78f47 --- /dev/null +++ b/imports/shared-app/ui/tree/RendererView.d.ts @@ -0,0 +1,41 @@ +import { ReactComponentBase } from "tc-shared/ui/react-elements/ReactComponentBase"; +import { Registry } from "tc-shared/events"; +import * as React from "react"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +import { RDPChannelTree, RDPEntry } from "./RendererDataProvider"; +export declare class PopoutButton extends React.Component<{ + tree: RDPChannelTree; +}, {}> { + render(): JSX.Element; +} +export interface ChannelTreeViewProperties { + events: Registry; + dataProvider: RDPChannelTree; + moveThreshold?: number; +} +export interface ChannelTreeViewState { + elementScrollOffset?: number; + scrollOffset: number; + viewHeight: number; + fontSize: number; + treeVersion: number; + smoothScroll: boolean; + tree: RDPEntry[]; + treeRevision: number; +} +export declare class ChannelTreeView extends ReactComponentBase { + static readonly EntryHeightEm = 1.3; + private readonly refContainer; + private resizeObserver; + private scrollFixRequested; + private inViewCallbacks; + constructor(props: any); + componentDidMount(): void; + componentWillUnmount(): void; + private handleVisibilityChanged; + private visibleEntries; + render(): JSX.Element; + private onScroll; + scrollEntryInView(entryId: number, callback?: () => void): void; + getEntryFromPoint(pageX: number, pageY: number): number; +} diff --git a/imports/shared-app/ui/tree/popout/Controller.d.ts b/imports/shared-app/ui/tree/popout/Controller.d.ts new file mode 100644 index 0000000..0ff9507 --- /dev/null +++ b/imports/shared-app/ui/tree/popout/Controller.d.ts @@ -0,0 +1,15 @@ +import { ChannelTree } from "tc-shared/tree/ChannelTree"; +export declare class ChannelTreePopoutController { + readonly channelTree: ChannelTree; + private popoutInstance; + private uiEvents; + private treeEvents; + private controlBarEvents; + private generalEvents; + constructor(channelTree: ChannelTree); + destroy(): void; + hasBeenPopedOut(): boolean; + popout(): void; + popin(): void; + private sendTitle; +} diff --git a/imports/shared-app/ui/tree/popout/Definitions.d.ts b/imports/shared-app/ui/tree/popout/Definitions.d.ts new file mode 100644 index 0000000..8710a48 --- /dev/null +++ b/imports/shared-app/ui/tree/popout/Definitions.d.ts @@ -0,0 +1,15 @@ +import { IpcRegistryDescription } from "tc-shared/events"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +import { ControlBarEvents } from "tc-shared/ui/frames/control-bar/Definitions"; +export interface ChannelTreePopoutEvents { + query_title: {}; + notify_title: { + title: string; + }; +} +export declare type ChannelTreePopoutConstructorArguments = { + events: IpcRegistryDescription; + eventsTree: IpcRegistryDescription; + eventsControlBar: IpcRegistryDescription; + handlerId: string; +}; diff --git a/imports/shared-app/ui/tree/popout/RendererModal.d.ts b/imports/shared-app/ui/tree/popout/RendererModal.d.ts new file mode 100644 index 0000000..103253d --- /dev/null +++ b/imports/shared-app/ui/tree/popout/RendererModal.d.ts @@ -0,0 +1,17 @@ +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +import { Registry } from "tc-shared/events"; +import { ChannelTreeUIEvents } from "tc-shared/ui/tree/Definitions"; +import * as React from "react"; +import { ControlBarEvents } from "tc-shared/ui/frames/control-bar/Definitions"; +import { ChannelTreePopoutConstructorArguments, ChannelTreePopoutEvents } from "tc-shared/ui/tree/popout/Definitions"; +declare class ChannelTreeModal extends AbstractModal { + readonly eventsUI: Registry; + readonly eventsTree: Registry; + readonly eventsControlBar: Registry; + readonly handlerId: string; + constructor(info: ChannelTreePopoutConstructorArguments); + protected onDestroy(): void; + renderBody(): React.ReactElement; + renderTitle(): React.ReactElement; +} +export = ChannelTreeModal; diff --git a/imports/shared-app/ui/utils.d.ts b/imports/shared-app/ui/utils.d.ts new file mode 100644 index 0000000..5caee86 --- /dev/null +++ b/imports/shared-app/ui/utils.d.ts @@ -0,0 +1,5 @@ +/** + * Ensure that the module has been loaded within the main application and not + * within a popout. + */ +export declare function assertMainApplication(): void; diff --git a/imports/shared-app/ui/utils/IpcVariable.d.ts b/imports/shared-app/ui/utils/IpcVariable.d.ts new file mode 100644 index 0000000..f3bb19b --- /dev/null +++ b/imports/shared-app/ui/utils/IpcVariable.d.ts @@ -0,0 +1,26 @@ +import { UiVariableConsumer, UiVariableMap, UiVariableProvider } from "tc-shared/ui/utils/Variable"; +export declare class IpcUiVariableProvider extends UiVariableProvider { + readonly ipcChannelId: string; + private broadcastChannel; + constructor(); + destroy(): void; + protected doSendVariable(variable: string, customData: any, value: any): void; + private handleIpcMessage; + generateConsumerDescription(): IpcVariableDescriptor; +} +export declare type IpcVariableDescriptor = { + readonly ipcChannelId: string; +}; +declare class IpcUiVariableConsumer extends UiVariableConsumer { + readonly description: IpcVariableDescriptor; + private broadcastChannel; + private editListener; + constructor(description: IpcVariableDescriptor); + destroy(): void; + protected doEditVariable(variable: string, customData: any, newValue: any): Promise | void; + protected doRequestVariable(variable: string, customData: any): void; + private handleIpcMessage; +} +export declare function createIpcUiVariableProvider(): IpcUiVariableProvider; +export declare function createIpcUiVariableConsumer(description: IpcVariableDescriptor): IpcUiVariableConsumer; +export {}; diff --git a/imports/shared-app/ui/utils/LocalVariable.d.ts b/imports/shared-app/ui/utils/LocalVariable.d.ts new file mode 100644 index 0000000..a9bed15 --- /dev/null +++ b/imports/shared-app/ui/utils/LocalVariable.d.ts @@ -0,0 +1,2 @@ +import { UiVariableConsumer, UiVariableMap, UiVariableProvider } from "tc-shared/ui/utils/Variable"; +export declare function createLocalUiVariables(): [UiVariableProvider, UiVariableConsumer]; diff --git a/imports/shared-app/ui/utils/Variable.d.ts b/imports/shared-app/ui/utils/Variable.d.ts new file mode 100644 index 0000000..9a73ca1 --- /dev/null +++ b/imports/shared-app/ui/utils/Variable.d.ts @@ -0,0 +1,80 @@ +export declare type UiVariable = Transferable | undefined | null | number | string | object; +export declare type UiVariableMap = { + [key: string]: any; +}; +declare type IfEquals = (() => T extends X ? 1 : 2) extends (() => T extends Y ? 1 : 2) ? A : B; +declare type WritableKeys = { + [P in keyof T]-?: IfEquals<{ + [Q in P]: T[P]; + }, { + -readonly [Q in P]: T[P]; + }, P, never>; +}[keyof T]; +declare type ReadonlyKeys = { + [P in keyof T]: IfEquals<{ + [Q in P]: T[P]; + }, { + -readonly [Q in P]: T[P]; + }, never, P>; +}[keyof T]; +export declare type ReadonlyVariables = Pick>; +export declare type WriteableVariables = Pick>; +declare type UiVariableEditor = Variables[T] extends { + __readonly: any; +} ? never : (newValue: Variables[T], customData: any) => Variables[T] | void | boolean; +declare type UiVariableEditorPromise = Variables[T] extends { + __readonly: any; +} ? never : (newValue: Variables[T], customData: any) => Promise; +export declare abstract class UiVariableProvider { + private variableProvider; + private variableEditor; + protected constructor(); + destroy(): void; + setVariableProvider(variable: T, provider: (customData: any) => Variables[T] | Promise): void; + /** + * @param variable + * @param editor If the editor returns `false` or a new variable, such variable will be used + */ + setVariableEditor(variable: T, editor: UiVariableEditor): void; + setVariableEditorAsync(variable: T, editor: UiVariableEditorPromise): void; + /** + * Send/update a variable + * @param variable The target variable to send. + * @param customData + * @param forceSend If `true` the variable will be send event though it hasn't changed. + */ + sendVariable(variable: T, customData?: any, forceSend?: boolean): void | Promise; + getVariable(variable: T, customData?: any, ignoreCache?: boolean): Promise; + getVariableSync(variable: T, customData?: any, ignoreCache?: boolean): Variables[T]; + protected resolveVariable(variable: string, customData: any): Promise | any; + protected doEditVariable(variable: string, customData: any, newValue: any): Promise | void; + protected abstract doSendVariable(variable: string, customData: any, value: any): any; +} +export declare type UiVariableStatus = { + status: "loading"; + localValue: Variables[T] | undefined; + remoteValue: undefined; + setValue: (newValue: Variables[T], localOnly?: boolean) => void; +} | { + status: "loaded" | "applying"; + localValue: Variables[T]; + remoteValue: Variables[T]; + setValue: (newValue: Variables[T], localOnly?: boolean) => void; +}; +export declare type UiReadOnlyVariableStatus = { + status: "loading" | "loaded"; + value: Variables[T]; +}; +export declare abstract class UiVariableConsumer { + private variableCache; + destroy(): void; + private getOrCreateVariable; + private derefVariable; + useVariable>(variable: T, customData?: any, defaultValue?: Variables[T]): UiVariableStatus; + useReadOnly(variable: T, customData?: any, defaultValue?: never): UiReadOnlyVariableStatus; + useReadOnly(variable: T, customData: any | undefined, defaultValue: Variables[T]): Variables[T]; + protected notifyRemoteVariable(variable: string, customData: any | undefined, value: any): void; + protected abstract doRequestVariable(variable: string, customData: any | undefined): any; + protected abstract doEditVariable(variable: string, customData: any | undefined, value: any): Promise | void; +} +export {}; diff --git a/imports/shared-app/update/ChangeLog.d.ts b/imports/shared-app/update/ChangeLog.d.ts new file mode 100644 index 0000000..15b996b --- /dev/null +++ b/imports/shared-app/update/ChangeLog.d.ts @@ -0,0 +1,12 @@ +export declare type ChangeSetEntry = ChangeSet | string; +export interface ChangeSet { + title?: string; + changes: ChangeSetEntry[]; +} +export interface ChangeLogEntry extends ChangeSet { + timestamp: string; +} +export interface ChangeLog { + changes: ChangeLogEntry[]; + currentVersion: string; +} diff --git a/imports/shared-app/update/Updater.d.ts b/imports/shared-app/update/Updater.d.ts new file mode 100644 index 0000000..6f01372 --- /dev/null +++ b/imports/shared-app/update/Updater.d.ts @@ -0,0 +1,8 @@ +import { ChangeLog } from "../update/ChangeLog"; +export interface Updater { + getChangeLog(): ChangeLog; + getChangeList(oldVersion: string): ChangeLog; + getLastUsedVersion(): string; + getCurrentVersion(): string; + updateUsedVersion(): any; +} diff --git a/imports/shared-app/update/UpdaterWeb.d.ts b/imports/shared-app/update/UpdaterWeb.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/update/UpdaterWeb.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/update/index.d.ts b/imports/shared-app/update/index.d.ts new file mode 100644 index 0000000..1800a7b --- /dev/null +++ b/imports/shared-app/update/index.d.ts @@ -0,0 +1,4 @@ +import { Updater } from "./Updater"; +export declare function setUIUpdater(updater: Updater): void; +export declare function setNativeUpdater(updater: Updater): void; +export declare function checkForUpdatedApp(): void; diff --git a/imports/shared-app/utils/DateUtils.d.ts b/imports/shared-app/utils/DateUtils.d.ts new file mode 100644 index 0000000..e0942ff --- /dev/null +++ b/imports/shared-app/utils/DateUtils.d.ts @@ -0,0 +1,17 @@ +export declare enum ColloquialFormat { + YESTERDAY = 0, + TODAY = 1, + GENERAL = 2 +} +export declare function same_day(a: number | Date, b: number | Date): boolean; +export declare function date_format(date: Date, now: Date, ignore_settings?: boolean): ColloquialFormat; +export declare function formatDayTime(date: Date): string; +export declare function format_date_general(date: Date, hours?: boolean): string; +export declare function format_date_colloquial(date: Date, current_timestamp: Date): { + result: string; + format: ColloquialFormat; +}; +export declare function format_chat_time(date: Date): { + result: string; + next_update: number; +}; diff --git a/imports/shared-app/utils/LaterPromise.d.ts b/imports/shared-app/utils/LaterPromise.d.ts new file mode 100644 index 0000000..620209e --- /dev/null +++ b/imports/shared-app/utils/LaterPromise.d.ts @@ -0,0 +1,24 @@ +export declare class LaterPromise extends Promise { + private readonly _time; + private readonly _handle; + private _resolve; + private _reject; + constructor(); + resolved(object: T): void; + rejected(reason: any): void; + function_rejected(): (error: any) => void; + time(): number; + /** + * Attaches callbacks for the resolution and/or rejection of the Promise. + * @param onfulfilled The callback to execute when the Promise is resolved. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of which ever callback is executed. + */ + then(onfulfilled?: ((value: T) => TResult1 | PromiseLike) | undefined | null, onrejected?: ((reason: any) => TResult2 | PromiseLike) | undefined | null): Promise; + /** + * Attaches a callback for only the rejection of the Promise. + * @param onrejected The callback to execute when the Promise is rejected. + * @returns A Promise for the completion of the callback. + */ + catch(onrejected?: ((reason: any) => TResult | PromiseLike) | undefined | null): Promise; +} diff --git a/imports/shared-app/utils/TimeUtils.d.ts b/imports/shared-app/utils/TimeUtils.d.ts new file mode 100644 index 0000000..51ae6cc --- /dev/null +++ b/imports/shared-app/utils/TimeUtils.d.ts @@ -0,0 +1 @@ +export declare function format_online_time(secs: number): string; diff --git a/imports/shared-app/utils/buffers.d.ts b/imports/shared-app/utils/buffers.d.ts new file mode 100644 index 0000000..7671c1d --- /dev/null +++ b/imports/shared-app/utils/buffers.d.ts @@ -0,0 +1,3 @@ +export declare function str2ab8(str: any): ArrayBuffer; +export declare function arrayBufferBase64(base64: string): ArrayBuffer; +export declare function base64_encode_ab(source: ArrayBufferLike): string; diff --git a/imports/shared-app/utils/helpers.d.ts b/imports/shared-app/utils/helpers.d.ts new file mode 100644 index 0000000..3753d0b --- /dev/null +++ b/imports/shared-app/utils/helpers.d.ts @@ -0,0 +1,2 @@ +export declare function hashPassword(password: string): Promise; +export declare const copyToClipboard: (str: any) => void; diff --git a/imports/shared-app/video-viewer/Controller.d.ts b/imports/shared-app/video-viewer/Controller.d.ts new file mode 100644 index 0000000..cb0ff5c --- /dev/null +++ b/imports/shared-app/video-viewer/Controller.d.ts @@ -0,0 +1 @@ +export {}; diff --git a/imports/shared-app/video-viewer/Definitions.d.ts b/imports/shared-app/video-viewer/Definitions.d.ts new file mode 100644 index 0000000..f9fa2ae --- /dev/null +++ b/imports/shared-app/video-viewer/Definitions.d.ts @@ -0,0 +1,75 @@ +export interface PlayerStatusPlaying { + status: "playing"; + timestampPlay: number; + timestampBuffer: number; +} +export interface PlayerStatusBuffering { + status: "buffering"; +} +export interface PlayerStatusStopped { + status: "stopped"; +} +export interface PlayerStatusPaused { + status: "paused"; +} +export declare type PlayerStatus = PlayerStatusPlaying | PlayerStatusBuffering | PlayerStatusStopped | PlayerStatusPaused; +export interface VideoViewerEvents { + "action_toggle_side_bar": { + shown: boolean; + }; + "action_follow": { + watcherId: string | undefined; + }; + "query_watcher_info": { + watcherId: string; + }; + "query_watcher_status": { + watcherId: string; + }; + "query_followers": { + watcherId: string; + }; + "query_watchers": {}; + "query_video": {}; + "notify_show": {}; + "notify_destroy": {}; + "notify_watcher_list": { + watcherIds: string[]; + followingWatcher: string | undefined; + }; + "notify_watcher_status": { + watcherId: string; + status: PlayerStatus; + }; + "notify_watcher_info": { + watcherId: string; + clientId: number; + clientUniqueId: string; + clientName: string; + isOwnClient: boolean; + }; + "notify_follower_list": { + watcherId: string; + followerIds: string[]; + }; + "notify_follower_added": { + watcherId: string; + followerId: string; + }; + "notify_follower_removed": { + watcherId: string; + followerId: string; + }; + "notify_following": { + watcherId: string | undefined; + }; + "notify_following_status": { + status: PlayerStatus; + }; + "notify_local_status": { + status: PlayerStatus; + }; + "notify_video": { + url: string; + }; +} diff --git a/imports/shared-app/video-viewer/Renderer.d.ts b/imports/shared-app/video-viewer/Renderer.d.ts new file mode 100644 index 0000000..24500df --- /dev/null +++ b/imports/shared-app/video-viewer/Renderer.d.ts @@ -0,0 +1,13 @@ +import { Translatable } from "tc-shared/ui/react-elements/i18n"; +import * as React from "react"; +import { IpcRegistryDescription, Registry } from "tc-shared/events"; +import { VideoViewerEvents } from "./Definitions"; +import { AbstractModal } from "tc-shared/ui/react-elements/ModalDefinitions"; +declare class ModalVideoPopout extends AbstractModal { + readonly events: Registry; + readonly handlerId: string; + constructor(events: IpcRegistryDescription, handlerId: any); + renderTitle(): string | React.ReactElement; + renderBody(): React.ReactElement; +} +export = ModalVideoPopout; diff --git a/imports/shared-app/video-viewer/W2GPlugin.d.ts b/imports/shared-app/video-viewer/W2GPlugin.d.ts new file mode 100644 index 0000000..d1f199a --- /dev/null +++ b/imports/shared-app/video-viewer/W2GPlugin.d.ts @@ -0,0 +1,95 @@ +import { PluginCmdHandler, PluginCommandInvoker } from "../connection/PluginCmdHandler"; +import { Registry } from "../events"; +import { PlayerStatus } from "../video-viewer/Definitions"; +export interface W2GEvents { + notify_watcher_add: { + watcher: W2GWatcher; + }; + notify_watcher_remove: { + watcher: W2GWatcher; + }; + notify_following_changed: { + oldWatcher: W2GWatcher | undefined; + newWatcher: W2GWatcher | undefined; + }; + notify_following_watcher_status: { + newStatus: PlayerStatus; + }; + notify_following_url: { + newUrl: string; + }; +} +export interface W2GWatcherEvents { + notify_follower_added: { + follower: W2GWatcherFollower; + }; + notify_follower_removed: { + follower: W2GWatcherFollower; + }; + notify_follower_status_changed: { + follower: W2GWatcherFollower; + newStatus: PlayerStatus; + }; + notify_follower_nickname_changed: { + follower: W2GWatcherFollower; + newName: string; + }; + notify_watcher_status_changed: { + newStatus: PlayerStatus; + }; + notify_watcher_nickname_changed: { + newName: string; + }; + notify_watcher_url_changed: { + oldVideo: string; + newVideo: string; + }; + notify_destroyed: {}; +} +export interface W2GWatcherFollower { + clientId: number; + clientUniqueId: string; + clientNickname: string; + status: PlayerStatus; +} +export declare abstract class W2GWatcher { + readonly events: Registry; + readonly clientId: number; + readonly clientUniqueId: string; + protected constructor(clientId: any, clientUniqueId: any); + abstract getWatcherName(): string; + abstract getWatcherStatus(): PlayerStatus; + abstract getCurrentVideo(): string; + abstract getFollowers(): W2GWatcherFollower[]; +} +export declare class W2GPluginCmdHandler extends PluginCmdHandler { + static readonly kPluginChannel = "teaspeak-w2g"; + static readonly kStatusUpdateInterval = 5000; + static readonly kStatusUpdateTimeout = 10000; + readonly events: Registry; + private readonly callbackWatcherEvents; + private currentWatchers; + private localPlayerStatus; + private localVideoUrl; + private localFollowing; + private localStatusUpdateTimer; + constructor(); + handleHandlerRegistered(): void; + handleHandlerUnregistered(): void; + handlePluginCommand(data: string, invoker: PluginCommandInvoker): void; + private sendCommand; + getCurrentWatchers(): W2GWatcher[]; + private findWatcher; + private destroyWatcher; + private removeClientFromWatchers; + private removeClientFromFollowers; + private handlePlayerClosed; + private handleStatusUpdate; + private watcherStatusTimeout; + private notifyLocalStatus; + setLocalPlayerClosed(): void; + setLocalWatcherStatus(videoUrl: string, status: PlayerStatus): void; + setLocalFollowing(target: W2GWatcher | undefined, status?: PlayerStatus): void; + getLocalFollowingWatcher(): W2GWatcher | undefined; + private handleLocalWatcherEvent; +} diff --git a/imports/shared-app/video/VideoSource.d.ts b/imports/shared-app/video/VideoSource.d.ts new file mode 100644 index 0000000..c960b37 --- /dev/null +++ b/imports/shared-app/video/VideoSource.d.ts @@ -0,0 +1,75 @@ +import { Registry } from "tc-shared/events"; +export interface VideoSourceCapabilities { + minWidth: number; + maxWidth: number; + minHeight: number; + maxHeight: number; + minFrameRate: number; + maxFrameRate: number; +} +export interface VideoSourceInitialSettings { + width: number | 0; + height: number | 0; + frameRate: number; +} +export interface VideoSource { + getId(): string; + getName(): string; + getStream(): MediaStream; + getCapabilities(): VideoSourceCapabilities; + getInitialSettings(): VideoSourceInitialSettings; + /** Add a new reference to this stream */ + ref(): this; + /** Decrease the reference count. If it's zero, it will be automatically destroyed. */ + deref(): any; +} +export declare enum VideoPermissionStatus { + Granted = 0, + UserDenied = 1, + SystemDenied = 2 +} +export interface VideoDriverEvents { + notify_permissions_changed: { + oldStatus: VideoPermissionStatus; + newStatus: VideoPermissionStatus; + }; + notify_device_list_changed: { + devices: string[]; + }; +} +export declare type VideoDevice = { + id: string; + name: string; +}; +export declare type ScreenCaptureDevice = { + id: string; + name: string; + type: "full-screen" | "window"; + appIcon?: string; + appPreview?: string; +}; +export interface VideoDriver { + getEvents(): Registry; + getPermissionStatus(): VideoPermissionStatus; + /** + * Request permissions to access the video camara and device list. + * When requesting permissions, we're actually requesting a media stream. + * If the request succeeds, we're returning that media stream. + */ + requestPermissions(): Promise; + getDevices(): Promise; + /** + * @throws a string if an error occurs + * @returns A VideoSource on success with an initial ref count of one + * Will throw a string on error + */ + createVideoSource(id: string | undefined): Promise; + screenQueryAvailable(): boolean; + queryScreenCaptureDevices(): Promise; + /** + * Create a source from the screen + */ + createScreenSource(id: string | undefined, allowFocusLoss: boolean): Promise; +} +export declare function getVideoDriver(): VideoDriver; +export declare function setVideoDriver(driver: VideoDriver): void; diff --git a/imports/shared-app/voice/Filter.d.ts b/imports/shared-app/voice/Filter.d.ts new file mode 100644 index 0000000..ddb5d29 --- /dev/null +++ b/imports/shared-app/voice/Filter.d.ts @@ -0,0 +1,36 @@ +export declare enum FilterType { + THRESHOLD = 0, + VOICE_LEVEL = 1, + STATE = 2 +} +export interface FilterBase { + readonly priority: number; + setEnabled(flag: boolean): void; + isEnabled(): boolean; +} +export interface MarginedFilter { + getMarginFrames(): number; + setMarginFrames(value: number): any; +} +export interface ThresholdFilter extends FilterBase, MarginedFilter { + readonly type: FilterType.THRESHOLD; + getThreshold(): number; + setThreshold(value: number): any; + getAttackSmooth(): number; + getReleaseSmooth(): number; + setAttackSmooth(value: number): any; + setReleaseSmooth(value: number): any; + registerLevelCallback(callback: (value: number) => void): any; + removeLevelCallback(callback: (value: number) => void): any; +} +export interface VoiceLevelFilter extends FilterBase, MarginedFilter { + type: FilterType.VOICE_LEVEL; + getLevel(): number; +} +export interface StateFilter extends FilterBase { + type: FilterType.STATE; + setState(state: boolean): any; + isActive(): boolean; +} +export declare type FilterTypeClass = T extends FilterType.STATE ? StateFilter : T extends FilterType.VOICE_LEVEL ? VoiceLevelFilter : T extends FilterType.THRESHOLD ? ThresholdFilter : never; +export declare type Filter = ThresholdFilter | VoiceLevelFilter | StateFilter; diff --git a/imports/shared-app/voice/RecorderBase.d.ts b/imports/shared-app/voice/RecorderBase.d.ts new file mode 100644 index 0000000..9c28ba9 --- /dev/null +++ b/imports/shared-app/voice/RecorderBase.d.ts @@ -0,0 +1,97 @@ +import { IDevice } from "../audio/recorder"; +import { Registry } from "../events"; +import { Filter, FilterType, FilterTypeClass } from "../voice/Filter"; +export declare enum InputConsumerType { + CALLBACK = 0, + NODE = 1, + NATIVE = 2 +} +export interface CallbackInputConsumer { + type: InputConsumerType.CALLBACK; + callbackAudio?: (buffer: AudioBuffer) => any; + callbackBuffer?: (buffer: Float32Array, samples: number, channels: number) => any; +} +export interface NodeInputConsumer { + type: InputConsumerType.NODE; + callbackNode: (source_node: AudioNode) => any; + callbackDisconnect: (source_node: AudioNode) => any; +} +export interface NativeInputConsumer { + type: InputConsumerType.NATIVE; +} +export declare type InputConsumer = CallbackInputConsumer | NodeInputConsumer | NativeInputConsumer; +export declare enum InputState { + PAUSED = 0, + INITIALIZING = 1, + RECORDING = 2 +} +export declare enum InputStartError { + EUNKNOWN = "eunknown", + EDEVICEUNKNOWN = "edeviceunknown", + EBUSY = "ebusy", + ENOTALLOWED = "enotallowed", + ESYSTEMDENIED = "esystemdenied", + ENOTSUPPORTED = "enotsupported", + ESYSTEMUNINITIALIZED = "esystemuninitialized" +} +export interface InputEvents { + notify_state_changed: { + oldState: InputState; + newState: InputState; + }; + notify_voice_start: {}; + notify_voice_end: {}; + notify_filter_mode_changed: { + oldMode: FilterMode; + newMode: FilterMode; + }; + notify_device_changed: { + oldDeviceId: string; + newDeviceId: string; + }; +} +export declare enum FilterMode { + /** + * Apply all filters and act according to the output + */ + Filter = 0, + /** + * Bypass all filters and replay the audio + */ + Bypass = 1, + /** + * Block all communication + */ + Block = 2 +} +export interface AbstractInput { + readonly events: Registry; + currentState(): InputState; + destroy(): any; + start(): Promise; + stop(): Promise; + isFiltered(): boolean; + getFilterMode(): FilterMode; + setFilterMode(mode: FilterMode): any; + currentDeviceId(): string | undefined; + /** + * This method should not throw! + * If the target device is unknown, it should return `InputStartError.EDEVICEUNKNOWN` on start. + * If the device is different than the current device the recorder stops. + * + * When the device has been changed the event `notify_device_changed` will be fired. + */ + setDeviceId(device: string): Promise; + currentConsumer(): InputConsumer | undefined; + setConsumer(consumer: InputConsumer): Promise; + supportsFilter(type: FilterType): boolean; + createFilter(type: T, priority: number): FilterTypeClass; + removeFilter(filter: Filter): any; + getVolume(): number; + setVolume(volume: number): any; +} +export interface LevelMeter { + getDevice(): IDevice; + setObserver(callback: (value: number) => any): any; + destroy(): any; +} diff --git a/imports/shared-app/voice/RecorderProfile.d.ts b/imports/shared-app/voice/RecorderProfile.d.ts new file mode 100644 index 0000000..6877fa6 --- /dev/null +++ b/imports/shared-app/voice/RecorderProfile.d.ts @@ -0,0 +1,68 @@ +import { AbstractInput } from "../voice/RecorderBase"; +import { KeyDescriptor } from "../PPTListener"; +import { ConnectionHandler } from "../ConnectionHandler"; +import { IDevice } from "../audio/recorder"; +import { Registry } from "tc-shared/events"; +export declare type VadType = "threshold" | "push_to_talk" | "active"; +export interface RecorderProfileConfig { + version: number; + device_id: string | undefined; + volume: number; + 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; + }; +} +export interface DefaultRecorderEvents { + notify_default_recorder_changed: {}; +} +export declare let defaultRecorder: RecorderProfile; +export declare const defaultRecorderEvents: Registry; +export declare function setDefaultRecorder(recorder: RecorderProfile): void; +export interface RecorderProfileEvents { + notify_device_changed: {}; +} +export declare class RecorderProfile { + readonly events: Registry; + readonly name: any; + readonly volatile: any; + config: RecorderProfileConfig; + input: AbstractInput; + current_handler: ConnectionHandler; + callback_input_initialized: (input: AbstractInput) => void; + callback_start: () => any; + callback_stop: () => any; + callback_unmount: () => any; + private readonly pptHook; + private pptTimeout; + private pptHookRegistered; + private registeredFilter; + constructor(name: string, volatile?: boolean); + destroy(): void; + initialize(): Promise; + private initializeInput; + private save; + private reinitializePPTHook; + private reinitializeFilter; + unmount(): Promise; + getVadType(): VadType; + setVadType(type: VadType): boolean; + getThresholdThreshold(): number; + setThresholdThreshold(value: number): void; + getPushToTalkKey(): KeyDescriptor; + setPushToTalkKey(key: KeyDescriptor): void; + getPushToTalkDelay(): number; + setPushToTalkDelay(value: number): void; + getDeviceId(): string | typeof IDevice.DefaultDeviceId | typeof IDevice.NoDeviceId; + setDevice(device: IDevice | typeof IDevice.DefaultDeviceId | typeof IDevice.NoDeviceId): Promise; + getVolume(): number; + setVolume(volume: number): void; +} diff --git a/imports/shared-app/voice/VoiceClient.d.ts b/imports/shared-app/voice/VoiceClient.d.ts new file mode 100644 index 0000000..e8674f4 --- /dev/null +++ b/imports/shared-app/voice/VoiceClient.d.ts @@ -0,0 +1,4 @@ +import { VoicePlayer } from "../voice/VoicePlayer"; +export interface VoiceClient extends VoicePlayer { + getClientId(): number; +} diff --git a/imports/shared-app/voice/VoicePlayer.d.ts b/imports/shared-app/voice/VoicePlayer.d.ts new file mode 100644 index 0000000..074a75b --- /dev/null +++ b/imports/shared-app/voice/VoicePlayer.d.ts @@ -0,0 +1,57 @@ +import { Registry } from "../events"; +export declare enum VoicePlayerState { + INITIALIZING = 0, + PREBUFFERING = 1, + PLAYING = 2, + BUFFERING = 3, + STOPPING = 4, + STOPPED = 5 +} +export interface VoicePlayerEvents { + notify_state_changed: { + oldState: VoicePlayerState; + newState: VoicePlayerState; + }; +} +export interface VoicePlayerLatencySettings { + minBufferTime: number; + maxBufferTime: number; +} +export interface VoicePlayer { + readonly events: Registry; + /** + * @returns Returns the current voice player state. + * Subscribe to the "notify_state_changed" event to receive player changes. + */ + getState(): VoicePlayerState; + /** + * @returns The volume multiplier in a range from [0, 1] + */ + getVolume(): number; + /** + * @param volume The volume multiplier in a range from [0, 1] + */ + setVolume(volume: number): any; + /** + * Abort the replaying of the currently pending buffers. + * If new buffers are arriving a new replay will be started. + */ + abortReplay(): any; + /** + * Flush the current buffer. + * This will most likely set the player into the buffering mode. + */ + flushBuffer(): any; + /** + * Get the currently used latency settings + */ + getLatencySettings(): Readonly; + /** + * @param settings The new latency settings to be used + */ + setLatencySettings(settings: VoicePlayerLatencySettings): any; + /** + * Reset the latency settings to the default + */ + resetLatencySettings(): any; +} diff --git a/imports/shared-app/voice/VoiceWhisper.d.ts b/imports/shared-app/voice/VoiceWhisper.d.ts new file mode 100644 index 0000000..3d69c80 --- /dev/null +++ b/imports/shared-app/voice/VoiceWhisper.d.ts @@ -0,0 +1,51 @@ +import { Registry } from "../events"; +import { VoicePlayer } from "../voice/VoicePlayer"; +export interface WhisperTargetChannelClients { + target: "channel-clients"; + channels: number[]; + clients: number[]; +} +export interface WhisperTargetGroups { + target: "groups"; +} +export interface WhisperTargetEcho { + target: "echo"; +} +export declare type WhisperTarget = WhisperTargetGroups | WhisperTargetChannelClients | WhisperTargetEcho; +export interface WhisperSessionEvents { + notify_state_changed: { + oldState: WhisperSessionState; + newState: WhisperSessionState; + }; + notify_blocked_state_changed: { + oldState: boolean; + newState: boolean; + }; + notify_timed_out: {}; +} +export declare enum WhisperSessionState { + INITIALIZING = 0, + PAUSED = 1, + PLAYING = 2, + INITIALIZE_FAILED = 3 +} +export declare const kUnknownWhisperClientUniqueId = "unknown"; +export interface WhisperSession { + readonly events: Registry; + getClientId(): number; + getClientName(): string | undefined; + getClientUniqueId(): string | undefined; + getSessionState(): WhisperSessionState; + isBlocked(): boolean; + setBlocked(blocked: boolean): any; + getSessionTimeout(): number; + setSessionTimeout(timeout: number): any; + getLastWhisperTimestamp(): number; + /** + * This is only valid if the session has been initialized successfully, + * and it hasn't been blocked + * + * @returns Returns the voice player + */ + getVoicePlayer(): VoicePlayer | undefined; +} diff --git a/imports/vendor/TeaClientServices/src/Action.d.ts b/imports/vendor/TeaClientServices/src/Action.d.ts new file mode 100644 index 0000000..87a8bb2 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/Action.d.ts @@ -0,0 +1,13 @@ +import { MessageCommandErrorResult } from "./Messages"; +export declare type ActionResult = { + unwrap(): T; +} & ({ + status: "success"; + result: T; +} | { + status: "error"; + result: MessageCommandErrorResult; +}); +export declare function createErrorResult(result: MessageCommandErrorResult): ActionResult; +export declare function createResult(): ActionResult; +export declare function createResult(result: T): ActionResult; diff --git a/imports/vendor/TeaClientServices/src/ClientService.d.ts b/imports/vendor/TeaClientServices/src/ClientService.d.ts new file mode 100644 index 0000000..d12d617 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/ClientService.d.ts @@ -0,0 +1,50 @@ +import { ClientSessionType } from "./Messages"; +import { ClientServiceConnection } from "./Connection"; +import { Registry } from "tc-events"; +export declare type LocalAgent = { + clientVersion: string; + uiVersion: string; + architecture: string; + platform: string; + platformVersion: string; +}; +export interface ClientServiceConfig { + getServiceHost(): string; + getSelectedLocaleUrl(): string | null; + getSessionType(): ClientSessionType; + generateHostInfo(): LocalAgent; +} +export interface ClientServiceEvents { + /** Client service session has successfully be initialized */ + notify_session_initialized: {}; + /** The current active client service session has been closed */ + notify_session_closed: {}; +} +export declare class ClientServices { + readonly config: ClientServiceConfig; + readonly events: Registry; + private readonly connection; + private sessionInitialized; + private retryTimer; + private initializeAgentId; + private initializeLocaleId; + constructor(config: ClientServiceConfig); + start(): void; + awaitSession(): Promise; + isSessionInitialized(): boolean; + stop(): void; + getConnection(): ClientServiceConnection; + private scheduleRetry; + /** + * Returns as soon the result indicates that something else went wrong rather than transmitting. + * Note: This will not throw an exception! + * @param command + * @param retryInterval + */ + private executeCommandWithRetry; + /** + * @returns `true` if the session agent has been successfully initialized. + */ + private sendInitializeAgent; + private sendLocaleUpdate; +} diff --git a/imports/vendor/TeaClientServices/src/ClientServiceInvite.d.ts b/imports/vendor/TeaClientServices/src/ClientServiceInvite.d.ts new file mode 100644 index 0000000..a30cab5 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/ClientServiceInvite.d.ts @@ -0,0 +1,39 @@ +import { ClientServices } from "./ClientService"; +import { ActionResult } from "./Action"; +import { InviteAction } from "./Messages"; +export declare type InviteLinkInfo = { + linkId: string; + timestampCreated: number; + timestampDeleted: number; + timestampExpired: number; + amountViewed: number; + amountClicked: number; + propertiesConnect: { + [key: string]: string; + }; + propertiesInfo: { + [key: string]: string; + }; +}; +export declare class ClientServiceInvite { + private readonly handle; + constructor(handle: ClientServices); + createInviteLink(connectProperties: { + [key: string]: string; + }, infoProperties: { + [key: string]: string; + }, createNew: boolean, expire_timestamp: number): Promise>; + queryInviteLink(linkId: string, registerView: boolean): Promise>; + logAction["type"]>(linkId: string, action: A): Promise>; + logAction["type"]>(linkId: string, action: A, value: Extract["payload"]): Promise>; +} diff --git a/imports/vendor/TeaClientServices/src/Connection.d.ts b/imports/vendor/TeaClientServices/src/Connection.d.ts new file mode 100644 index 0000000..6fba7ff --- /dev/null +++ b/imports/vendor/TeaClientServices/src/Connection.d.ts @@ -0,0 +1,49 @@ +import { MessageCommand, MessageCommandResult, MessageNotify } from "./Messages"; +import { Registry } from "tc-events"; +export declare const kApiVersion = 1; +declare type ConnectionState = "disconnected" | "connecting" | "connected" | "reconnect-pending"; +interface ClientServiceConnectionEvents { + notify_state_changed: { + oldState: ConnectionState; + newState: ConnectionState; + }; +} +declare type NotifyPayloadType = Extract["payload"]; +declare type CommandPayloadType = Extract["payload"]; +export declare class ClientServiceConnection { + readonly events: Registry; + readonly reconnectInterval: number; + private readonly serviceHost; + private reconnectTimeout; + private connectionState; + private connection; + private pendingCommands; + private notifyHandler; + constructor(serviceHost: string, reconnectInterval: number); + destroy(): void; + getState(): ConnectionState; + private setState; + connect(): void; + disconnect(): void; + cancelReconnect(): void; + executeMessageCommand(command: MessageCommand): Promise; + executeCommand(command: K, payload: CommandPayloadType): Promise; + registerNotifyHandler(notify: K, callback: (notify: NotifyPayloadType) => void): () => void; + unregisterNotifyHandler(callback: (notify: NotifyPayloadType) => void): any; + unregisterNotifyHandler(notify: K, callback: (notify: NotifyPayloadType) => void): any; + catchNotify(notify: K, filter?: (value: NotifyPayloadType) => boolean): () => ({ + status: "success"; + value: NotifyPayloadType; + } | { + status: "fail"; + }); + private handleConnectFail; + private handleConnectionLost; + private executeReconnect; + private handleServerMessage; +} +export {}; diff --git a/imports/vendor/TeaClientServices/src/GeoLocation.d.ts b/imports/vendor/TeaClientServices/src/GeoLocation.d.ts new file mode 100644 index 0000000..e6cdb75 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/GeoLocation.d.ts @@ -0,0 +1,19 @@ +interface GeoLocationInfo { + country: string; + city?: string; + region?: string; + timezone?: string; +} +declare class GeoLocationProvider { + private readonly resolver; + private currentResolverIndex; + private cachedInfo; + private lookupPromise; + constructor(); + loadCache(): void; + private doLoadCache; + queryInfo(timeout: number): Promise; + private doQueryInfo; +} +export declare let geoLocationProvider: GeoLocationProvider; +export {}; diff --git a/imports/vendor/TeaClientServices/src/Logging.d.ts b/imports/vendor/TeaClientServices/src/Logging.d.ts new file mode 100644 index 0000000..4211591 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/Logging.d.ts @@ -0,0 +1,10 @@ +export interface ClientServiceLogger { + logTrace(message: string, ...args: any[]): any; + logDebug(message: string, ...args: any[]): any; + logInfo(message: string, ...args: any[]): any; + logWarn(message: string, ...args: any[]): any; + logError(message: string, ...args: any[]): any; + logCritical(message: string, ...args: any[]): any; +} +export declare let clientServiceLogger: ClientServiceLogger; +export declare function setClientServiceLogger(logger: ClientServiceLogger): void; diff --git a/imports/vendor/TeaClientServices/src/Messages.d.ts b/imports/vendor/TeaClientServices/src/Messages.d.ts new file mode 100644 index 0000000..fac2d43 --- /dev/null +++ b/imports/vendor/TeaClientServices/src/Messages.d.ts @@ -0,0 +1,178 @@ +export declare type Message = { + type: "Command"; + token: string; + command: MessageCommand; +} | { + type: "CommandResult"; + token: string | null; + result: MessageCommandResult; +} | { + type: "Notify"; + notify: MessageNotify; +}; +export declare type MessageCommand = { + type: "SessionInitialize"; + payload: CommandSessionInitialize; +} | { + type: "SessionInitializeAgent"; + payload: CommandSessionInitializeAgent; +} | { + type: "SessionUpdateLocale"; + payload: CommandSessionUpdateLocale; +} | { + type: "InviteQueryInfo"; + payload: CommandInviteQueryInfo; +} | { + type: "InviteLogAction"; + payload: CommandInviteLogAction; +} | { + type: "InviteCreate"; + payload: CommandInviteCreate; +}; +export declare type MessageCommandResult = { + type: "Success"; +} | { + type: "GenericError"; + error: string; +} | { + type: "ConnectionTimeout"; +} | { + type: "ConnectionClosed"; +} | { + type: "ClientSessionUninitialized"; +} | { + type: "ServerInternalError"; +} | { + type: "ParameterInvalid"; + parameter: string; +} | { + type: "CommandParseError"; + error: string; +} | { + type: "CommandEnqueueError"; + error: string; +} | { + type: "CommandNotFound"; +} | { + type: "CommandNotImplemented"; +} | { + type: "SessionAlreadyInitialized"; +} | { + type: "SessionAgentAlreadyInitialized"; +} | { + type: "SessionNotInitialized"; +} | { + type: "SessionAgentNotInitialized"; +} | { + type: "SessionInvalidType"; +} | { + type: "InviteSessionNotInitialized"; +} | { + type: "InviteSessionAlreadyInitialized"; +} | { + type: "InviteKeyInvalid"; + error: string; +} | { + type: "InviteKeyNotFound"; +} | { + type: "InviteKeyExpired"; +}; +export declare type MessageCommandErrorResult = Exclude; +export declare type MessageNotify = { + type: "NotifyClientsOnline"; + payload: NotifyClientsOnline; +} | { + type: "NotifyInviteCreated"; + payload: NotifyInviteCreated; +} | { + type: "NotifyInviteInfo"; + payload: NotifyInviteInfo; +}; +export declare type InviteAction = { + type: "OpenTeaClientProtocol"; +} | { + type: "RedirectWebClient"; +} | { + type: "ConnectAttempt"; +} | { + type: "ConnectSuccess"; +} | { + type: "ConnectFailure"; + payload: { + reason: string; + }; +} | { + type: "ConnectNoAction"; + payload: { + reason: string; + }; +}; +export declare enum ClientSessionType { + WebClient = 0, + TeaClient = 1, + InviteWebSite = 16 +} +export declare type CommandSessionInitialize = { + anonymize_ip: boolean; +}; +export declare type CommandSessionInitializeAgent = { + session_type: ClientSessionType; + platform: string | null; + platform_version: string | null; + architecture: string | null; + client_version: string | null; + ui_version: string | null; +}; +export declare type CommandSessionUpdateLocale = { + ip_country: string | null; + selected_locale: string | null; + local_timestamp: number; +}; +export declare type CommandInviteQueryInfo = { + link_id: string; + register_view: boolean; +}; +export declare type CommandInviteLogAction = { + link_id: string; + action: InviteAction; +}; +export declare type CommandInviteCreate = { + new_link: boolean; + properties_connect: { + [key: string]: string; + }; + properties_info: { + [key: string]: string; + }; + timestamp_expired: number; +}; +export declare type NotifyClientsOnline = { + users_online: { + [key: number]: number; + }; + unique_users_online: { + [key: number]: number; + }; + total_users_online: number; + total_unique_users_online: number; +}; +export declare type NotifyInviteCreated = { + link_id: string; + admin_token: string | null; +}; +export declare type NotifyInviteInfo = { + link_id: string; + timestamp_created: number; + timestamp_deleted: number; + timestamp_expired: number; + amount_viewed: number; + amount_clicked: number; + properties_connect: { + [key: string]: string; + }; + properties_info: { + [key: string]: string; + }; +}; diff --git a/imports/vendor/TeaClientServices/src/index.d.ts b/imports/vendor/TeaClientServices/src/index.d.ts new file mode 100644 index 0000000..c3c8dad --- /dev/null +++ b/imports/vendor/TeaClientServices/src/index.d.ts @@ -0,0 +1,7 @@ +export { ClientServiceLogger, setClientServiceLogger } from "./Logging"; +export { ActionResult } from "./Action"; +export { ClientServiceConnection } from "./Connection"; +export { ClientSessionType } from "./Messages"; +export * as Messages from "./Messages"; +export { ClientServiceInvite, InviteLinkInfo } from "./ClientServiceInvite"; +export { ClientServiceConfig, ClientServices, LocalAgent } from "./ClientService"; diff --git a/imports/vendor/TeaEventBus/src/Events.d.ts b/imports/vendor/TeaEventBus/src/Events.d.ts new file mode 100644 index 0000000..6ff31eb --- /dev/null +++ b/imports/vendor/TeaEventBus/src/Events.d.ts @@ -0,0 +1,38 @@ +export declare type EventPayloadObject = any; +export declare type EventMap

= { + [K in keyof P]: EventPayloadObject & { + type?: never; + }; +}; +export declare type Event

, T extends keyof P> = { + readonly type: T; + as(target: S): Event; + asUnchecked(target: S): Event; + asAnyUnchecked(target: S): Event; + /** + * Return an object containing only the event payload specific key value pairs. + */ + extractPayload(): P[T]; +} & P[T]; +export interface EventSender = EventMap> { + fire(event_type: T, data?: Events[T], overrideTypeKey?: boolean): any; + /** + * Fire an event later by using setTimeout(..) + * @param event_type The target event to be fired + * @param data The payload of the event + * @param callback The callback will be called after the event has been successfully dispatched + */ + fire_later(event_type: T, data?: Events[T], callback?: () => void): any; + /** + * Fire an event, which will be delayed until the next animation frame. + * This ensures that all react components have been successfully mounted/unmounted. + * @param event_type The target event to be fired + * @param data The payload of the event + * @param callback The callback will be called after the event has been successfully dispatched + */ + fire_react(event_type: T, data?: Events[T], callback?: () => void): any; +} +export declare type EventDispatchType = "sync" | "later" | "react"; +export interface EventConsumer { + handleEvent(mode: EventDispatchType, type: string, data: any): any; +} diff --git a/imports/vendor/TeaEventBus/src/Helper.d.ts b/imports/vendor/TeaEventBus/src/Helper.d.ts new file mode 100644 index 0000000..e741b17 --- /dev/null +++ b/imports/vendor/TeaEventBus/src/Helper.d.ts @@ -0,0 +1,8 @@ +import { EventMap, Event } from "./Events"; +export declare function guid(): string; +export declare function arrayRemove(array: any[], element: any): boolean; +/** + * Turn the payload object into a bus event object + * @param payload + */ +export declare function createEvent

, T extends keyof P>(type: T, payload?: P[T]): Event; diff --git a/imports/vendor/TeaEventBus/src/Hook.d.ts b/imports/vendor/TeaEventBus/src/Hook.d.ts new file mode 100644 index 0000000..2728a8e --- /dev/null +++ b/imports/vendor/TeaEventBus/src/Hook.d.ts @@ -0,0 +1,7 @@ +export interface EventRegistryHooks { + logTrace(message: string, ...args: any[]): any; + logAsyncInvokeError(error: any): any; + logReactInvokeError(error: any): any; +} +export declare let eventRegistryHooks: EventRegistryHooks; +export declare function setEventRegistryHooks(hooks: EventRegistryHooks): void; diff --git a/imports/vendor/TeaEventBus/src/Ipc.d.ts b/imports/vendor/TeaEventBus/src/Ipc.d.ts new file mode 100644 index 0000000..a2a6d1b --- /dev/null +++ b/imports/vendor/TeaEventBus/src/Ipc.d.ts @@ -0,0 +1,15 @@ +import { EventConsumer, EventDispatchType, EventMap } from "./Events"; +import { Registry } from "./Registry"; +export declare type IpcRegistryDescription = EventMap> = { + ipcChannelId: string; +}; +export declare class IpcEventBridge implements EventConsumer { + readonly registry: Registry; + readonly ipcChannelId: string; + private readonly ownBridgeId; + private broadcastChannel; + constructor(registry: Registry, ipcChannelId: string | undefined); + destroy(): void; + handleEvent(dispatchType: EventDispatchType, eventType: string, eventPayload: any): void; + private handleIpcMessage; +} diff --git a/imports/vendor/TeaEventBus/src/Registry.d.ts b/imports/vendor/TeaEventBus/src/Registry.d.ts new file mode 100644 index 0000000..2979abc --- /dev/null +++ b/imports/vendor/TeaEventBus/src/Registry.d.ts @@ -0,0 +1,54 @@ +import { Event, EventConsumer, EventMap, EventSender } from "./Events"; +import { IpcRegistryDescription } from "./Ipc"; +import * as React from "react"; +export declare class Registry = EventMap> implements EventSender { + protected readonly registryUniqueId: any; + protected persistentEventHandler: { + [key: string]: ((event: any) => void)[]; + }; + protected oneShotEventHandler: { + [key: string]: ((event: any) => void)[]; + }; + protected genericEventHandler: ((event: any) => void)[]; + protected consumer: EventConsumer[]; + private ipcConsumer; + private debugPrefix; + private warnUnhandledEvents; + private pendingAsyncCallbacks; + private pendingAsyncCallbacksTimeout; + private pendingReactCallbacks; + private pendingReactCallbacksFrame; + static fromIpcDescription = EventMap>(description: IpcRegistryDescription): Registry; + constructor(); + destroy(): void; + enableDebug(prefix: string): void; + disableDebug(): void; + enableWarnUnhandledEvents(): void; + disableWarnUnhandledEvents(): void; + fire(eventType: T, data?: Events[T], overrideTypeKey?: boolean): void; + fire_later(eventType: T, data?: Events[T], callback?: () => void): void; + fire_react(eventType: T, data?: Events[T], callback?: () => void): void; + on(event: T | T[], handler: (event: Event) => void): () => void; + one(event: T | T[], handler: (event: Event) => void): () => void; + off(handler: (event: Event) => void): any; + off(events: T | T[], handler: (event: Event) => void): any; + onAll(handler: (event: Event) => void): () => void; + offAll(handler: (event: Event) => void): void; + /** + * @param event + * @param handler + * @param condition If a boolean the event handler will only be registered if the condition is true + * @param reactEffectDependencies + */ + reactUse(event: T | T[], handler: (event: Event) => void, condition?: boolean, reactEffectDependencies?: any[]): any; + private doInvokeEvent; + private invokeAsyncCallbacks; + private invokeReactCallbacks; + registerHandler(handler: any, parentClasses?: boolean): void; + unregisterHandler(handler: any): void; + registerConsumer(consumer: EventConsumer): () => void; + unregisterConsumer(consumer: EventConsumer): void; + generateIpcDescription(): IpcRegistryDescription; +} +export declare function EventHandler(events: (keyof EventTypes) | (keyof EventTypes)[]): (target: any, propertyKey: string, _descriptor: PropertyDescriptor) => void; +export declare function ReactEventHandler, Events = any>(registry_callback: (object: ObjectClass) => Registry): (constructor: Function) => void; diff --git a/imports/vendor/TeaEventBus/src/index.d.ts b/imports/vendor/TeaEventBus/src/index.d.ts new file mode 100644 index 0000000..a139d44 --- /dev/null +++ b/imports/vendor/TeaEventBus/src/index.d.ts @@ -0,0 +1,4 @@ +export { setEventRegistryHooks, EventRegistryHooks } from "./Hook"; +export * from "./Events"; +export { Registry, EventHandler, ReactEventHandler } from "./Registry"; +export { IpcRegistryDescription } from "./Ipc"; diff --git a/imports/vendor/xbbcode/src/elements.d.ts b/imports/vendor/xbbcode/src/elements.d.ts new file mode 100644 index 0000000..b4c141a --- /dev/null +++ b/imports/vendor/xbbcode/src/elements.d.ts @@ -0,0 +1,27 @@ +import { Tag } from "./registry"; +export declare type TextPosition = { + start: number; + end: number; +}; +export interface Element { + textPosition: TextPosition; +} +export declare class TagElement implements Element { + tagType: Tag | undefined; + tag: string; + tagNormalized: string; + textPosition: TextPosition; + properlyClosed: boolean; + options: string; + content: Element[]; + constructor(tag: string, tagType: Tag | undefined, options?: string, content?: Element[]); + deductibleAsText(): boolean; + deductAsText(): string; +} +export declare class TextElement implements Element { + rawText: string; + escapeCharacters: number[]; + textPosition: TextPosition; + constructor(text: string, escapes: number[], positionOrBegin: number | TextPosition, end?: number); + text(): string; +} diff --git a/imports/vendor/xbbcode/src/parser.d.ts b/imports/vendor/xbbcode/src/parser.d.ts new file mode 100644 index 0000000..f51f57d --- /dev/null +++ b/imports/vendor/xbbcode/src/parser.d.ts @@ -0,0 +1,12 @@ +import { Element } from "./elements"; +import * as Registry from "./registry"; +export interface Options { + maxDepth?: number; + tagRegistry?: Registry.TagRegistry; + lazyCloseTag?: boolean; + tag_blacklist?: string[] | undefined; + tag_whitelist?: string[] | undefined; + enforce_back_whitelist?: boolean; + verbose?: boolean; +} +export declare function parse(text: string, options_: Options): Element[]; diff --git a/imports/vendor/xbbcode/src/react.d.ts b/imports/vendor/xbbcode/src/react.d.ts new file mode 100644 index 0000000..8a85831 --- /dev/null +++ b/imports/vendor/xbbcode/src/react.d.ts @@ -0,0 +1,14 @@ +import * as React from "react"; +import { Options } from "./parser"; +import ReactRenderer from "./renderer/react"; +export declare function XBBCodeRenderer(props: { + children: string; + options?: Options; + renderer?: ReactRenderer; +}): React.ReactElement; +export declare function XBBCodeRenderer(props: { + text: string; + children: never; + options?: Options; + renderer?: ReactRenderer; +}): React.ReactElement; diff --git a/imports/vendor/xbbcode/src/registry.d.ts b/imports/vendor/xbbcode/src/registry.d.ts new file mode 100644 index 0000000..5f47a2c --- /dev/null +++ b/imports/vendor/xbbcode/src/registry.d.ts @@ -0,0 +1,22 @@ +export interface ConditionalRule { + tag: string; + overriddenBy: string[]; +} +export interface Tag { + tag: string; + synonyms?: string[]; + ignore_black_whitelist?: boolean; + blacklistTags?: ConditionalRule[]; + whitelistTags?: string[]; + instantClose?: boolean; +} +export declare class TagRegistry { + readonly parent: TagRegistry | undefined; + private registeredTags; + private tagMap; + constructor(parent: TagRegistry | undefined); + findTag(tag: string, normalized?: boolean): Tag; + registerTag(tag: Tag): void; + tags(): Tag[]; +} +export declare const Default: TagRegistry; diff --git a/imports/vendor/xbbcode/src/renderer/base.d.ts b/imports/vendor/xbbcode/src/renderer/base.d.ts new file mode 100644 index 0000000..235ab49 --- /dev/null +++ b/imports/vendor/xbbcode/src/renderer/base.d.ts @@ -0,0 +1,22 @@ +import { Element, TagElement, TextElement } from "../elements"; +export declare abstract class Renderer { + private textRenderer; + private knownRenderer; + render(element: Element, skipCustomRenderers?: boolean): T; + renderContent(element: Element, skipCustomRenderers?: boolean): T[]; + protected abstract renderDefault(element: Element): T; + getTextRenderer(): ElementRenderer | undefined; + setTextRenderer(renderer: ElementRenderer | undefined): void; + registerCustomRenderer(renderer: ElementRenderer): void; + deleteCustomRenderer(tag: string): void; + listCustomRenderers(): string[]; + getCustomRenderer(key: string): ElementRenderer | undefined; +} +export declare abstract class ElementRenderer = Renderer> { + abstract tags(): string | string[]; + abstract render(element: E, renderer: R): T; +} +export declare abstract class StringRenderer extends Renderer { + protected renderDefault(element: Element): string; + protected abstract doRender(element: Element): (Element | string)[] | string; +} diff --git a/imports/vendor/xbbcode/src/renderer/html.d.ts b/imports/vendor/xbbcode/src/renderer/html.d.ts new file mode 100644 index 0000000..43592a9 --- /dev/null +++ b/imports/vendor/xbbcode/src/renderer/html.d.ts @@ -0,0 +1,8 @@ +import { Element } from "../elements"; +import { Renderer } from "./base"; +import ReactRenderer from "./react"; +export default class extends Renderer { + readonly reactRenderer: ReactRenderer | undefined; + constructor(reactRenderer?: ReactRenderer); + protected renderDefault(element: Element): string; +} diff --git a/imports/vendor/xbbcode/src/renderer/react.d.ts b/imports/vendor/xbbcode/src/renderer/react.d.ts new file mode 100644 index 0000000..68b0129 --- /dev/null +++ b/imports/vendor/xbbcode/src/renderer/react.d.ts @@ -0,0 +1,13 @@ +import * as React from "react"; +import { Renderer } from "./base"; +import { Element, TagElement } from "../elements"; +export default class ReactRenderer extends Renderer { + private readonly encapsulateText; + constructor(encapsulateText?: boolean); + protected renderDefault(element: Element): React.ReactNode; + private doRender; + private renderTag; + private renderText; + renderAsText(element: Element | string, stripLeadingAnTailingEmptyLines: boolean): React.ReactNode; + renderContentAsText(element: TagElement, stripLeadingAnTailingEmptyLines: boolean): React.ReactNode; +} diff --git a/imports/vendor/xbbcode/src/renderer/text.d.ts b/imports/vendor/xbbcode/src/renderer/text.d.ts new file mode 100644 index 0000000..e94ced5 --- /dev/null +++ b/imports/vendor/xbbcode/src/renderer/text.d.ts @@ -0,0 +1,5 @@ +import { Element } from "../elements"; +import { StringRenderer } from "./base"; +export default class extends StringRenderer { + protected doRender(element: Element): (Element | string)[] | string; +}