UNPKG

@persian-caesar/aparat.js

Version:

The aparat website services for npm package.

38 lines (37 loc) 1.61 kB
import { Profile, StreamProfile } from "../types/interfaces"; import { ApiService } from "../core/api"; export declare class UserService { private api; constructor(api: ApiService); /** * Retrieves the profile information of a user using two different API endpoints. * The first API call gets detailed profile attributes and the second provides additional link data. * * @param username - The username of the user. * @returns A Promise that resolves to a Profile object containing user details. * @throws APIError if the user is not found or an HTTP error occurs. */ getProfile(username: string): Promise<Profile>; /** * Checks if a user is currently live streaming. * * @param username - The username of the user. * @returns A Promise that resolves to a boolean indicating if the user is live. */ isStream(username: string): Promise<boolean>; /** * Retrieves the live stream profile details for a user if they are currently streaming. * * @param username - The username of the user. * @returns A Promise that resolves to a StreamProfile object if streaming; otherwise, null. */ getStreamProfile(username: string): Promise<StreamProfile | null>; } /** * @copyright * Code by Sobhan-SRZA (mr.sinre) | https://github.com/Sobhan-SRZA * Developed for Persian Caesar | https://github.com/Persian-Caesar | https://dsc.gg/persian-caesar * * If you encounter any issues or need assistance with this code, * please make sure to credit "Persian Caesar" in your documentation or communications. */