import { AxiosInstance } from 'axios'; import { ILyrics } from './contracts/ILyrics'; import { IClip } from './contracts/IClip'; import { Status } from './enums/Status'; import { IPayload as IGenerateClipPayload } from './contracts/generate/clip/IPayload'; import { IPayload as IGenerateClipExtendPayload } from './contracts/generate/clip/extend/IPayload'; import { IOptions as IGenerateOptions } from './contracts/generate/IOptions'; import { IPayload as IGenerateLyricsPayload } from './contracts/generate/lyrics/IPayload'; export declare const DEFAULT_AXIOS_TIMEOUT = 10000; export declare class Api { protected readonly clerkClient: AxiosInstance; protected readonly apiClient: AxiosInstance; private accessToken?; constructor(cookie: string); /** * Authenticates suno by cookie * * @param emulateDelay Emulates 1-2 seconds delay since it is a reverse enginiered version * * @returns void */ authenticate(emulateDelay?: boolean): Promise; /** * Waits the generation by checking callback result based on wait options * * @param callback Returns latest result * @param options IGenrationOptions The options included configuration for the wait logic * @param noWaitResult The result if no need to wait * @returns A promise that resolves the latest generated result. */ protected waitGeneration(callback: () => Promise, options: Pick, noWaitResult: T): Promise; /** * Generates songs/clips based on the provided parameters. * * @param IGenerateClipPayload The payload to generate songs/clips from. * @param IGenerateOptions The optins to generate songs/clips. * * @returns A promise that resolves to an array of AudioInfo objects representing the generated songs. */ generateClips(payload: IGenerateClipPayload, options?: IGenerateOptions): Promise; /** * Extends an existing audio clip by generating additional content based on the provided prompt. * * @param IGenerateClipExtendPayload The payload to generate songs/clips from. * @param IGenerateOptions The optins to generate songs/clips. * @returns A promise that resolves to an AudioInfo object representing the extended audio clip. */ extendClip(payload: IGenerateClipExtendPayload, options?: IGenerateOptions): Promise; /** * Calls the concatenate endpoint for a clip to generate the whole song. * @param clipId The ID of the audio clip to concatenate. * @returns A promise that resolves to an AudioInfo object representing the concatenated audio. * @throws Error if the response status is not 200. */ concatenate(clipId: string): Promise; /** * Generates lyrics based on a given prompt. * * @param payload IGenerateLyricsPayload The payload to generate lyrics. * @returnsThe generated lyrics object. */ generateLyrics(payload: IGenerateLyricsPayload, options?: IGenerateOptions): Promise; /** * Retrieves information for a specific lyrics. * @param id The ID of the audio lirycs to retrieve information for. * @returns A promise that resolves to an object containing the audio lyrics information. */ getLyrics(id: string): Promise; /** * Retrieves audio information for the given song IDs. * @param songIds An optional array of song IDs to retrieve information for. * @returns A promise that resolves to an array of AudioInfo objects. */ getFeed(params: { ids?: string; }): Promise; /** * Retrieves information for a specific audio clip. * @param clipId The ID of the audio clip to retrieve information for. * @returns A promise that resolves to an object containing the audio clip information. */ getClip(id: string): Promise; /** * Retrieves information about available credits and plans. * @returns A promise that resolves to an object containing the credits information. */ getBillingInfo(): Promise; }