import { type ytdlpOptions, type sponsorblock, ytdlpDefaults, ytdlpExec, ytdlp } from './yt-dlp.js'; import { iReceiver, type iReceiverConfig, type iReceiverStatic, type ClientInterface, type Method } from './ireceiver.js'; import { DebugClientInterface } from './debug-interface.js'; export type YouTubeVideoID = string; export type { ytdlpOptions, sponsorblock }; export { ytdlpDefaults, ytdlpExec, ytdlp }; export type { iReceiverConfig, iReceiverStatic, ClientInterface, Method }; export { iReceiver }; export { DebugClientInterface }; /** * Encodes a payload to be sent over a socket * @param payload any valid payload * @param jwtSecret the JWT secret for signing * @returns string ready to be sent */ export declare function encodePayload(payload: Payload, jwtSecret: string): string; /** * parseint with wider range of accepted input types * @param v input to parse * @returns a number (or not a number) */ export declare function notStupidParseInt(v: string | number | undefined): number; /** * Get a boolean config value * @param envname environment variable to check * @param cfg object that might have $key * @param key key from the input object * @param fallback the default value * @returns computed boolean from the given sources */ export declare function getBoolean(envname: string, cfg: Partial | undefined, key: keyof T, fallback: boolean): boolean; /** * Throw an error inline * @param msg error message */ export declare function throwNewError(msg: string): T; /** * readdir but suppresses errors (if any) * @param downloadDir directory to read * @returns an array of files, or an empty array if an error was thrown */ export declare function getFilesNoError(downloadDir: string): Promise; export type Payload = RegistrationPayload | AckPayload | NowPlayingPayload | SkipPayload | QueuePayload | InsertPayload | DownloadPayload | PausePayload; export interface PayloadBase { type: string; body?: any; } export interface AckPayload extends PayloadBase { type: 'ack'; body?: never; } export interface RegistrationPayload extends PayloadBase { type: 'reg'; body: string; } export interface NowPlayingPayload extends PayloadBase { type: 'nowPlaying'; body: string | null; } export interface SkipPayload extends PayloadBase { type: 'skip'; body?: never; } export interface PausePayload extends PayloadBase { type: 'pause'; body: boolean; } export interface QueuePayload extends PayloadBase { type: 'queue'; body: string; } export interface InsertPayload extends PayloadBase { type: 'insert'; body: string; } export interface DownloadPayload extends PayloadBase { type: 'download'; body: YouTubeVideoID; }