import { AxiosRequestConfig } from 'axios'; import * as tikTokSchema from '../types/tiktok-schema'; import { MessageFns, ProtoMessageFetchResult, WebcastPushFrame } from '../types/tiktok-schema'; import { ClientOptions } from 'ws'; export type TikTokLiveConnectionBundledOptions = { useMobile: true; sessionId: string; ttTargetIdc: string; authenticateWs: true; } | { useMobile?: false; sessionId: string; ttTargetIdc: string; authenticateWs: boolean; } | { useMobile?: false; sessionId?: null; ttTargetIdc?: null; authenticateWs?: false; }; export type TikTokLiveConnectionOptions = TikTokLiveConnectionBundledOptions & { processInitialData: boolean; fetchRoomInfoOnConnect: boolean; enableExtendedGiftInfo: boolean; enableRequestPolling: boolean; requestPollingIntervalMs: number; signApiKey: string | null; connectWithUniqueId: boolean; disableEulerFallbacks: boolean; webClientParams: Record; webClientHeaders: Record; webClientOptions: AxiosRequestConfig; wsClientHeaders: Record; wsClientParams: Record; wsClientOptions: ClientOptions; signedWebSocketProvider?: (props: FetchSignedWebSocketParams) => Promise; }; export type TikTokLiveConstructorConnectionOptions = Partial & TikTokLiveConnectionBundledOptions; export type RoomInfo = Record & { data: { status: number; }; }; export type RoomGiftInfo = any; export type FetchSignedWebSocketParams = { roomId?: string; uniqueId?: string; ttTargetIdc?: string; sessionId?: string; useMobile?: boolean; }; export type WebcastHttpClientConfig = { customHeaders: Record; axiosOptions: AxiosRequestConfig; clientParams: Record; authenticateWs?: boolean; signApiKey?: string; }; export type DecodedWebcastPushFrame = WebcastPushFrame & { protoMessageFetchResult?: ProtoMessageFetchResult; }; export interface WebcastConfig { TIKTOK_HOST_WEB: string; TIKTOK_HOST_WEBCAST: string; TIKTOK_HTTP_ORIGIN: string; DEFAULT_HTTP_CLIENT_COOKIES: Record; DEFAULT_HTTP_CLIENT_PARAMS: Record; DEFAULT_HTTP_CLIENT_OPTIONS: AxiosRequestConfig; DEFAULT_WS_CLIENT_PARAMS_APPEND_PARAMETER: string; DEFAULT_HTTP_CLIENT_HEADERS: Record & { 'User-Agent': string; }; DEFAULT_WS_CLIENT_PARAMS: Record; DEFAULT_WS_CLIENT_HEADERS: Record & { 'User-Agent': string; }; } type ExtractMessageType = T extends MessageFns ? U : never; export type WebcastMessage = { [K in keyof typeof tikTokSchema as ExtractMessageType extends never ? never : K]: ExtractMessageType; }; type HasCommon = T extends { common: any; } ? T : never; export type WebcastEventMessage = { [K in keyof WebcastMessage as HasCommon extends never ? never : K]: WebcastMessage[K]; }; export interface IWebcastDeserializeConfig { skipMessageTypes: (keyof WebcastEventMessage)[]; showBase64OnDecodeError: boolean; } export interface IWebcastDeserializeConfig { skipMessageTypes: (keyof WebcastEventMessage)[]; } export type DecodedData = { [K in keyof WebcastEventMessage]: { type: K; data: WebcastEventMessage[K]; }; }[keyof WebcastEventMessage]; declare module '../types/tiktok-schema' { interface BaseProtoMessage { decodedData?: DecodedData; decodeError?: any; } interface WebcastGiftMessage { extendedGiftInfo?: any; } } export type WebcastHttpClientRequestParams = Omit, 'baseURL'> & { host: string; path: string; params?: Record; signRequest: boolean; }; export type WebSocketParams = { [key: string]: string; compress?: string; room_id: string; internal_ext: string; cursor: string; }; export {}; //# sourceMappingURL=client.d.ts.map