TeaSpeak-Client/imports/shared-app/connection/ServerFeatures.d.ts
2021-02-07 20:01:37 +01:00

36 lines
1.3 KiB
TypeScript

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<ServerFeatureEvents>;
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<boolean>;
listenSupportChange(feature: ServerFeature, listener: (support: boolean) => void, version?: number): () => void;
private disableAllFeatures;
private setFeatureSupport;
}